/* Mobile header override - MUST be loaded last */

@media (max-width: 1024px) {
    /* Fix body/wrapper to prevent horizontal scrolling */
    body,
    #wrapper {
        overflow-x: clip !important;
        width: 100% !important;
        max-width: 100vw !important;
    }

    /* Hide scroll to top elements on mobile */
    .float-text,
    .scrollbar-v {
        display: none !important;
    }

    /* Remove any content margin/padding that was added by theme */
    #content {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }

    /* Hero section fixes */
    section.jarallax,
    section.section-dark,
    #content > section:first-child {
        padding-top: 160px !important;
        margin-top: 0 !important;
    }

    /* Smaller h1 on mobile */
    h1 {
        font-size: 32px !important;
        line-height: 1.2 !important;
        margin-bottom: 20px !important;
    }

    /* Center hero subtitle on mobile */
    h3.hero-subtitle {
        text-align: center !important;
    }

    /* Smaller lead text */
    .lead {
        font-size: 16px !important;
        line-height: 1.5 !important;
    }

    /* Remove extra spacers on mobile */
    .spacer-double.sm-hide {
        display: none !important;
    }

    /* Nuclear option - force header to stay in place */
    header,
    header.smaller,
    header.header-mobile,
    header.scroll-down,
    header.scroll-up,
    header.transparent,
    header.clone {
        position: fixed !important;
        top: 0px !important;
        left: 0px !important;
        right: 0px !important;
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 8px 0 !important;
        height: auto !important;
        min-height: 52px !important;
        transform: none !important;
        z-index: 1001 !important;
        overflow: visible !important;
        transition: background-color 0.5s ease, backdrop-filter 0.5s ease !important;
    }

    /* Transparent background by default - only when NOT scrolled */
    header.transparent:not(.smaller):not(.menu-open) {
        background: transparent !important;
    }

    /* Dark background when scrolled - NUCLEAR option with all possible selectors */
    header.smaller,
    header[class*="smaller"],
    header.transparent.smaller,
    header.header-mobile.smaller,
    header.has-topbar.smaller,
    header.transparent.has-topbar.smaller {
        background-color: #1a1a1a !important;
        background-image: none !important;
        backdrop-filter: blur(10px) !important;
    }

    /* Also add background when menu is open */
    header.menu-open {
        background: rgba(26, 26, 26, 0.98) !important;
        backdrop-filter: blur(10px) !important;
    }

    /* Override JS-set height when menu is open */
    header.menu-open {
        height: auto !important;
        min-height: 52px !important;
        max-height: none !important;
    }

    /* Hide mobile menu by default */
    header.header-mobile #mainmenu {
        display: none !important;
        position: fixed !important;
        top: 52px !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        width: 100% !important;
        height: calc(100vh - 52px) !important;
        overflow-y: auto !important;
        background: rgba(26, 26, 26, 0.98) !important;
        backdrop-filter: blur(10px) !important;
        padding: 20px !important;
        z-index: 999 !important;
    }

    /* Show menu when open class is added */
    header.header-mobile.menu-open #mainmenu {
        display: block !important;
    }

    /* Menu item styles */
    header.header-mobile #mainmenu li {
        border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    }

    header.header-mobile #mainmenu a.menu-item {
        color: #fff !important;
        display: block !important;
        padding: 15px 10px !important;
        font-size: 16px !important;
    }

    /* Force container to full width */
    header .container,
    header .container-fluid,
    header .de-flex,
    header .header-row {
        max-width: 100% !important;
        width: 100% !important;
        margin: 0 !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
    }

    /* Kill all transitions */
    header,
    header * {
        transition: none !important;
        animation: none !important;
    }

    /* Fix burger menu position */
    #menu-btn {
        position: absolute !important;
        right: 15px !important;
        top: 50% !important;
        transform: translateY(-50%) !important;
        width: 30px !important;
        height: 30px !important;
        z-index: 1002 !important;
    }

    /* Smaller logo */
    header .logo-mobile img {
        max-width: 35px !important;
        height: auto !important;
    }

    header .logo-text {
        font-size: 18px !important;
    }

    /* Hide phone in header */
    header .de-flex-col.header-col-mid a.tel {
        display: none !important;
    }
}
