/*
 * MODA Footer Compact v1.0.1
 * More aggressive targeting for Leo / Elementor footer wrappers.
 */

:root {
    --mfc-top: 46px;
    --mfc-bottom: 28px;
    --mfc-mobile-bottom: 20px;
}

#footer,
footer#footer,
.footer-container,
#footer .footer-container,
#footer .container,
footer .footer-container,
footer .container,
.leo-footer-center,
.leo-footer-bottom,
.footer-center,
.footer-bottom,
#footer .mfc-compact-wrap,
footer#footer .mfc-compact-wrap {
    min-height: 0 !important;
    height: auto !important;
    max-height: none !important;
}

#footer,
footer#footer {
    padding-top: var(--mfc-top, 46px) !important;
    padding-bottom: var(--mfc-bottom, 28px) !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Common Leo / Ap PageBuilder / Elementor wrappers */
#footer .elementor-section,
#footer .elementor-container,
#footer .elementor-column,
#footer .elementor-widget-wrap,
#footer .elementor-widget,
#footer .ApRow,
#footer .ApColumn,
#footer .block,
#footer .block_content,
#footer .footer-container,
#footer .container,
footer#footer .elementor-section,
footer#footer .elementor-container,
footer#footer .ApRow,
footer#footer .ApColumn {
    min-height: 0 !important;
    height: auto !important;
}

/* Remove oversized section padding while preserving modest internal spacing */
#footer > .container,
#footer > .footer-container,
#footer .mfc-compact-wrap,
#footer .elementor-section.mfc-footer-section,
#footer .ApRow.mfc-footer-section,
footer#footer > .container,
footer#footer > .footer-container {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
}

/* Direct content rows should hug their content */
#footer .mfc-footer-row {
    min-height: 0 !important;
    height: auto !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    align-items: center !important;
}

/* Remove trailing blank space from nested page-builder sections */
#footer .elementor-section:last-child,
#footer .ApRow:last-child,
#footer .footer-container > :last-child,
#footer .container > :last-child,
footer#footer .elementor-section:last-child,
footer#footer .ApRow:last-child {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

#footer .row:last-child,
footer#footer .row:last-child,
.footer-container .row:last-child {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
}

#footer + *,
footer#footer + * {
    margin-top: 0 !important;
}

body,
#wrapper,
#page {
    padding-bottom: 0 !important;
}

/* Keep footer utility icons sensible, while allowing the main MODA logo to grow. */
#footer img,
footer#footer img {
    object-fit: contain;
}

@media (max-width: 767px) {
    #footer,
    footer#footer {
        padding-top: 28px !important;
        padding-bottom: var(--mfc-mobile-bottom, 20px) !important;
    }

    #footer .mfc-footer-row {
        align-items: flex-start !important;
    }
}


/* Enlarge the main MODA footer logo only.
   The JavaScript adds .mfc-main-footer-logo to the most likely brand image. */
#footer img.mfc-main-footer-logo,
footer#footer img.mfc-main-footer-logo {
    width: min(100%, 360px) !important;
    max-width: 360px !important;
    min-width: 240px !important;
    height: auto !important;
    max-height: none !important;
    display: block !important;
    margin: 0 auto !important;
    object-fit: contain !important;
}

/* Give the logo column enough breathing room without recreating the old huge gap. */
#footer .mfc-logo-column,
footer#footer .mfc-logo-column {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 220px !important;
    padding: 24px 20px !important;
}

@media (max-width: 991px) {
    #footer img.mfc-main-footer-logo,
    footer#footer img.mfc-main-footer-logo {
        max-width: 300px !important;
        min-width: 210px !important;
    }

    #footer .mfc-logo-column,
    footer#footer .mfc-logo-column {
        min-height: 180px !important;
    }
}

@media (max-width: 767px) {
    #footer img.mfc-main-footer-logo,
    footer#footer img.mfc-main-footer-logo {
        width: 220px !important;
        max-width: 78vw !important;
        min-width: 0 !important;
    }

    #footer .mfc-logo-column,
    footer#footer .mfc-logo-column {
        min-height: 130px !important;
        padding: 18px 10px 24px !important;
    }
}


/* v1.0.3 — hide accidental full-width content images rendered inside the
   mobile footer. Main MODA logo and recognised footer icons are excluded. */
@media (max-width: 767px) {
    #footer img.mfc-mobile-stray-image,
    footer#footer img.mfc-mobile-stray-image,
    #footer picture.mfc-mobile-stray-image,
    footer#footer picture.mfc-mobile-stray-image {
        display: none !important;
        width: 0 !important;
        height: 0 !important;
        min-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
    }
}


/* v1.0.4 — the rogue image can be rendered immediately after the footer
   rather than inside it. Hide only elements positively identified by JS. */
@media (max-width: 767px) {
    .mfc-mobile-orphan-media {
        display: none !important;
        width: 0 !important;
        height: 0 !important;
        min-height: 0 !important;
        max-height: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: hidden !important;
        visibility: hidden !important;
    }
}
