/* ==========================================
   XZIT — Mobile Menu Fix CSS
   Complète mobile-menu-fix.js
   ========================================== */

@media (max-width: 1199px) {

    /* ------------------------------------------
       FIX 1 — pointer-events
       Le CSS original met pointer-events:none sur
       tous les ul, bloquant les taps sur iOS
    ------------------------------------------ */
    .header .header-menu.is-menu-active .menu ul {
        pointer-events: auto !important;
    }

    .header .header-menu.is-menu-active .menu li {
        pointer-events: auto !important;
    }

    .header .header-menu.is-menu-active .menu a {
        pointer-events: auto !important;
    }

    /* ------------------------------------------
       FIX 2 — Subnavs actifs
       Affiche et positionne correctement le subnav
       quand .is-subnav-active est ajouté par JS
    ------------------------------------------ */
    .header .header-menu .menu .subnav.is-subnav-active,
    .header .header-menu .menu .mega-mobile.is-subnav-active {
        display: block !important;
        visibility: visible !important;
        pointer-events: auto !important;
        background-color: #fff;
        z-index: 10;
        overflow-y: auto !important;
    }

    /* Items du subnav — corrige translateY(100%) */
    .header .header-menu .menu .subnav.is-subnav-active a,
    .header .header-menu .menu .mega-mobile.is-subnav-active a {
        transform: translateY(0) !important;
        transition: transform 0.25s ease !important;
    }

    /* ------------------------------------------
       FIX 3 — li overflow:hidden coupe les subnavs
       On le retire quand le subnav est actif
    ------------------------------------------ */
    .header .header-menu .menu li:has(> .subnav.is-subnav-active),
    .header .header-menu .menu li:has(> .mega-mobile.is-subnav-active) {
        overflow: visible !important;
    }

    /* Fallback sans :has() pour navigateurs anciens */
    .header .header-menu .menu .subnav.is-subnav-active,
    .header .header-menu .menu .mega-mobile.is-subnav-active {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        padding-top: 40px;
        overflow-y: auto;
    }

    /* ------------------------------------------
       FIX 4 — Tap delay iOS
       touch-action: manipulation supprime le 300ms
    ------------------------------------------ */
    .header .header-menu .menu a,
    .js-mobile-menu-toggle,
    .header-menu .mobile-overlay,
    .subnav__backBtn a {
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
    }

    /* ------------------------------------------
       FIX 5 — Hamburger visible et tappable
    ------------------------------------------ */
    .header .js-mobile-menu-toggle {
        min-width: 44px;
        min-height: 44px;
        cursor: pointer;
        touch-action: manipulation;
        -webkit-tap-highlight-color: transparent;
        display: flex !important;
        align-items: center;
        justify-content: center;
    }

    /* ------------------------------------------
       FIX 6 — Overlay couvre bien tout l'écran
    ------------------------------------------ */
    .header .header-menu.is-menu-active .mobile-overlay {
        display: block !important;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(5, 16, 54, 0.5);
        z-index: -1;
        touch-action: manipulation;
    }
}