/* FINAL MOBILE HEADER FIX
   Fixes top phone/email strip overlapping navigation and broken mobile footer/menu layout.
*/

:root {
    --mobile-header-z: 99990;
    --mobile-menu-z: 100000;
}

/* Header stacking */
.top-strip,
.site-header {
    position: relative;
    z-index: var(--mobile-header-z) !important;
}

.site-header {
    isolation: isolate;
}

.mobile-menu,
[data-mobile-menu] {
    z-index: var(--mobile-menu-z) !important;
}

/* Prevent hero/slider from covering header/menu */
.hero-slider,
.hero-slide,
.hero-section,
.hero-list,
.owl-carousel,
.owl-stage-outer,
.owl-stage,
.owl-item {
    position: relative;
    z-index: 1 !important;
}

/* Desktop/top strip cleanup */
.top-strip {
    background: #0f2f55;
    color: #ffffff;
}

.top-strip-inner,
.top-strip-with-duty {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 42px;
}

.top-contact {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.top-contact a {
    color: #ffffff;
    text-decoration: none;
    font-weight: 700;
    white-space: nowrap;
}

.top-divider {
    width: 1px;
    height: 16px;
    background: rgba(255,255,255,.35);
    flex: 0 0 auto;
}

.top-duty-phone,
.top-duty-phone a,
.duty-phone-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #ffffff;
    text-decoration: none;
    font-weight: 800;
    white-space: nowrap;
}

.top-duty-phone span:first-child {
    opacity: .82;
    font-weight: 700;
}

/* Main header */
.header-inner {
    min-height: 76px;
}

.brand-with-logo {
    min-width: 0;
}

.brand-text {
    min-width: 0;
}

.brand-text strong,
.brand-text small {
    display: block;
}

/* Mobile: top strip must not overlap navigation */
@media (max-width: 991px) {
    .top-strip {
        position: relative !important;
        z-index: calc(var(--mobile-header-z) + 1) !important;
    }

    .top-strip-inner,
    .top-strip-with-duty {
        min-height: auto !important;
        padding-top: 8px !important;
        padding-bottom: 8px !important;
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 6px !important;
        align-items: stretch !important;
    }

    .top-contact {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        gap: 6px 12px !important;
        font-size: 13px !important;
        line-height: 1.3 !important;
        width: 100% !important;
    }

    .top-contact a {
        white-space: normal !important;
        overflow-wrap: anywhere !important;
        max-width: 100% !important;
    }

    .top-divider {
        display: none !important;
    }

    .top-duty-phone,
    .top-duty-phone a,
    .duty-phone-link {
        width: 100% !important;
        justify-content: center !important;
        text-align: center !important;
        padding: 7px 10px !important;
        border-radius: 999px !important;
        background: rgba(255,255,255,.12) !important;
        font-size: 13px !important;
        line-height: 1.25 !important;
        white-space: normal !important;
    }

    .site-header {
        position: sticky !important;
        top: 0 !important;
        z-index: var(--mobile-header-z) !important;
        background: #ffffff !important;
        box-shadow: 0 10px 28px rgba(15, 23, 42, .08) !important;
    }

    .header-inner {
        min-height: 66px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 12px !important;
        padding-top: 8px !important;
        padding-bottom: 8px !important;
    }

    .brand-with-logo {
        flex: 1 1 auto !important;
        min-width: 0 !important;
        gap: 9px !important;
    }

    .brand-logo-wrap,
    .brand-logo-wrap img {
        width: 46px !important;
        height: 46px !important;
        flex: 0 0 46px !important;
    }

    .brand-text strong {
        font-size: 14px !important;
        line-height: 1.15 !important;
        white-space: normal !important;
    }

    .brand-text small {
        font-size: 11px !important;
        line-height: 1.2 !important;
        white-space: normal !important;
    }

    .desktop-nav {
        display: none !important;
    }

    .header-actions {
        flex: 0 0 auto !important;
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
    }

    .header-donate-btn {
        display: none !important;
    }

    .mobile-menu-toggle {
        position: relative !important;
        z-index: calc(var(--mobile-menu-z) + 1) !important;
        flex: 0 0 auto !important;
    }

    /* Mobile menu overlay */
    .mobile-menu,
    [data-mobile-menu] {
        position: fixed !important;
        inset: 0 !important;
        height: 100dvh !important;
        width: 100% !important;
        background: rgba(15, 23, 42, .58) !important;
        backdrop-filter: blur(6px) !important;
        overflow: hidden !important;
    }

    .mobile-menu-panel {
        position: fixed !important;
        top: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: min(88vw, 390px) !important;
        height: 100dvh !important;
        overflow-y: auto !important;
        background: #ffffff !important;
        box-shadow: -24px 0 60px rgba(15, 23, 42, .24) !important;
        padding-bottom: 24px !important;
    }

    .mobile-menu-head,
    .mobile-menu-head-logo {
        position: sticky !important;
        top: 0 !important;
        z-index: 3 !important;
        background: #ffffff !important;
        border-bottom: 1px solid rgba(15,23,42,.08) !important;
    }

    .mobile-nav {
        display: grid !important;
        gap: 8px !important;
        padding: 16px !important;
    }

    .mobile-nav a {
        display: flex !important;
        align-items: center !important;
        min-height: 46px !important;
        padding: 12px 14px !important;
        border-radius: 14px !important;
        background: #f8fbff !important;
        color: #1f2937 !important;
        text-decoration: none !important;
        font-weight: 800 !important;
    }

    .mobile-nav a.active {
        background: #eef5ff !important;
        color: #2f80ed !important;
    }

    .mobile-contact-card,
    .mobile-duty-card {
        margin: 12px 16px 0 !important;
        padding: 14px !important;
        border-radius: 16px !important;
        background: #f8fbff !important;
        border: 1px solid rgba(47,128,237,.10) !important;
    }

    .mobile-contact-card a,
    .mobile-duty-card a {
        overflow-wrap: anywhere !important;
    }
}

/* Very small phones */
@media (max-width: 480px) {
    .top-contact {
        font-size: 12px !important;
    }

    .top-duty-phone,
    .top-duty-phone a,
    .duty-phone-link {
        font-size: 12.5px !important;
        padding: 6px 9px !important;
    }

    .header-inner {
        min-height: 60px !important;
    }

    .brand-logo-wrap,
    .brand-logo-wrap img {
        width: 40px !important;
        height: 40px !important;
        flex-basis: 40px !important;
    }

    .brand-text strong {
        font-size: 13px !important;
    }

    .brand-text small {
        font-size: 10.5px !important;
    }

    .mobile-menu-panel {
        width: 92vw !important;
    }
}

/* Footer mobile breaks */
@media (max-width: 768px) {
    .footer-grid,
    .footer-grid-with-logo,
    .footer-bottom-inner,
    .donation-banner-wrap,
    .footer-donation-inner,
    .footer-donation-inner-visual {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 22px !important;
        text-align: left !important;
    }

    .footer-brand,
    .footer-brand-logo {
        align-items: center !important;
    }

    .footer-col,
    .footer-contact {
        min-width: 0 !important;
    }

    .footer-contact a,
    .footer-col a,
    .footer-bottom a {
        overflow-wrap: anywhere !important;
    }

    .footer-donation-visual,
    .footer-donation-image-card {
        width: 100% !important;
    }

    .footer-donation-image-card img {
        width: 100% !important;
        height: auto !important;
        object-fit: cover !important;
    }
}
