/* ================================================
   MOBILE-FIRST CSS FIX
   Loads LAST to override all conflicts
   ================================================ */

/* --- 1. GLOBAL RESET --- */
/* Force zero margins to eliminate white gap */
html,
body {
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden;
    width: 100%;
}

body {
    min-height: 100dvh;
}

/* Ensure page wrapper doesn't add spacing */
.page-wrapper {
    margin: 0 !important;
    padding: 0 !important;
}

/* --- 2. MOBILE HERO STRICT ENFORCEMENT --- */
@media (max-width: 992px) {

    /* Force exact viewport height */
    .premium-hero {
        height: 100dvh !important;
        min-height: 100dvh !important;
        max-height: 100dvh !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        padding: 0 !important;
        margin: 0 !important;
        position: relative;
    }

    /* Background grid fills entire height */
    .premium-hero__grid {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        display: block !important;
    }

    /* Visual layer (background slider) */
    .premium-hero__visual {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        z-index: 0 !important;
    }

    /* Content layer - perfect centering */
    .premium-hero__content {
        position: relative !important;
        z-index: 10 !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        text-align: center !important;
        padding: 80px 20px 40px !important;
        /* Top padding for fixed navbar */
        min-height: 100dvh !important;
        max-width: 100% !important;
    }

    /* --- 3. FLUID TYPOGRAPHY --- */
    .premium-hero__eyebrow {
        font-size: clamp(0.75rem, 2.5vw, 0.9rem) !important;
        margin-bottom: 1rem !important;
    }

    .premium-hero__title {
        font-size: clamp(2rem, 8vw, 3rem) !important;
        line-height: 1.2 !important;
        margin-bottom: 1.5rem !important;
    }

    .premium-hero__title .script-accent {
        font-size: clamp(1.75rem, 7vw, 2.5rem) !important;
        display: block !important;
        margin-top: 0.5rem !important;
    }

    .premium-hero__desc {
        font-size: clamp(0.9rem, 3.5vw, 1rem) !important;
        line-height: 1.6 !important;
        max-width: 90% !important;
        margin-bottom: 2rem !important;
    }

    /* --- 4. BUTTON OPTIMIZATIONS --- */
    .premium-hero__cta-group {
        display: flex !important;
        flex-direction: column !important;
        gap: 15px !important;
        width: 100% !important;
        max-width: 320px !important;
        align-items: stretch !important;
    }

    .btn-premium {
        width: 100% !important;
        min-height: 48px !important;
        padding: 14px 30px !important;
        font-size: clamp(14px, 3.5vw, 16px) !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        border-radius: 50px !important;
        font-weight: 600 !important;
        text-transform: uppercase !important;
        letter-spacing: 0.5px !important;
        transition: all 0.3s ease !important;
    }

    /* Impact Blue for primary button */
    .btn-premium--primary {
        background: #4A90E2 !important;
        color: #ffffff !important;
        border: 2px solid #4A90E2 !important;
        box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3) !important;
    }

    .btn-premium--primary:hover,
    .btn-premium--primary:active {
        background: #3a7bc8 !important;
        border-color: #3a7bc8 !important;
        transform: translateY(-2px) !important;
        box-shadow: 0 6px 20px rgba(74, 144, 226, 0.4) !important;
    }

    .btn-premium--glass {
        background: rgba(255, 255, 255, 0.1) !important;
        color: #ffffff !important;
        border: 2px solid rgba(255, 255, 255, 0.3) !important;
        backdrop-filter: blur(10px) !important;
        -webkit-backdrop-filter: blur(10px) !important;
    }

    .btn-premium--glass:hover,
    .btn-premium--glass:active {
        background: rgba(255, 255, 255, 0.2) !important;
        border-color: rgba(255, 255, 255, 0.5) !important;
    }

    /* --- 5. NAVBAR MOBILE FIX --- */
    .main-header {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        z-index: 9999 !important;
        background: rgba(5, 1, 74, 0.95) !important;
        backdrop-filter: blur(10px) !important;
        -webkit-backdrop-filter: blur(10px) !important;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2) !important;
    }

    .main-header .main-menu__wrapper {
        padding: 0 !important;
        background: transparent !important;
    }

    .main-header .main-menu__wrapper-inner {
        padding: 12px 15px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
    }

    .main-menu__logo {
        padding: 0 !important;
    }

    .main-menu__logo img {
        max-width: 80px !important;
        height: auto !important;
    }

    .mobile-nav__toggler {
        display: block !important;
        color: #ffffff !important;
        font-size: 24px !important;
        padding: 8px !important;
        cursor: pointer !important;
        background: rgba(255, 255, 255, 0.1) !important;
        border-radius: 8px !important;
        border: 1px solid rgba(255, 255, 255, 0.2) !important;
        transition: all 0.3s ease !important;
    }

    .mobile-nav__toggler:hover {
        background: rgba(255, 255, 255, 0.2) !important;
    }

    /* --- 6. MASK ADJUSTMENT --- */
    .hero-mask {
        background: linear-gradient(180deg,
                rgba(5, 1, 74, 0.4) 0%,
                rgba(5, 1, 74, 0.6) 50%,
                rgba(5, 1, 74, 0.7) 100%) !important;
    }

    .noise-overlay {
        opacity: 0.03 !important;
    }
}

/* --- 7. ENSURE NO OVERFLOW --- */
@media (max-width: 992px) {
    * {
        -webkit-overflow-scrolling: touch;
    }

    /* Prevent horizontal scroll */
    .premium-hero,
    .premium-hero__grid,
    .premium-hero__content {
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }

    /* --- 8. MOBILE MENU NAVIGATION LINKS --- */
    /* Override the hiding of .main-menu__list inside mobile menu */
    .mobile-nav__container .main-menu__list,
    .mobile-nav__content .main-menu__list {
        display: block !important;
        margin: 0 !important;
        padding: 0 !important;
        list-style: none !important;
    }

    .mobile-nav__container .main-menu__list li,
    .mobile-nav__content .main-menu__list li {
        display: block !important;
    }
}