/* ========================================
   MENU MOBILE - VERSION COMPLÈTE CORRIGÉE
   ======================================== */

@media (max-width: 968px) {
    
    /* ===== CONTRÔLES MOBILES ===== */
    .nav-actions-mobile {
        display: flex !important;
        gap: 1rem;
        align-items: center;
    }
    
    .search-btn {
        display: block !important;
        width: 40px;
        height: 40px;
        border: none;
        background: #f9fafb;
        border-radius: 8px;
        font-size: 1.2rem;
        cursor: pointer;
    }
    
    .hamburger-btn {
        display: flex !important;
        flex-direction: column;
        justify-content: space-between;
        width: 28px;
        height: 22px;
        background: none;
        border: none;
        cursor: pointer;
        padding: 0;
        z-index: 10005;
        position: relative;
    }
    
    .hamburger-btn span {
        width: 100%;
        height: 3px;
        background: #1f2937;
        border-radius: 3px;
        transition: all 0.3s ease;
        display: block;
    }
    
    /* Animation hamburger → X */
    .hamburger-btn.active span:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px);
    }
    
    .hamburger-btn.active span:nth-child(2) {
        opacity: 0;
    }
    
    .hamburger-btn.active span:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
    }
    
    /* ===== OVERLAY ===== */
    .menu-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.6);
        z-index: 10000;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s;
        pointer-events: none;
    }
    
    .menu-overlay.active {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }
    
    /* ===== MENU PANEL ===== */
    .nav-menu-desktop {
        position: fixed !important;
        top: 0 !important;
        right: -100% !important;
        width: 85% !important;
        max-width: 350px !important;
        height: 100vh !important;
        background: #ffffff !important;
        box-shadow: -5px 0 30px rgba(0,0,0,0.3) !important;
        transition: right 0.3s ease-in-out !important;
        z-index: 10001 !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        padding: 0 !important;
        margin: 0 !important;
        display: block !important;
        list-style: none !important;
    }
    
    .nav-menu-desktop.open {
        right: 0 !important;
    }
    
    /* ===== HEADER DU MENU (ne bloque pas les clics) ===== */
    .nav-menu-desktop::before {
        content: '☰ Menu';
        display: block !important;
        padding: 1.5rem;
        background: #00853F;
        color: white;
        font-size: 1.3rem;
        font-weight: 800;
        text-align: center;
        border-bottom: 4px solid #FCD116;
        pointer-events: none !important;
    }
    
    /* ===== ITEMS DU MENU ===== */
    .nav-menu-desktop > li {
        display: block !important;
        width: 100% !important;
        border-bottom: 1px solid #e5e7eb !important;
        position: relative !important;
        list-style: none !important;
        margin: 0 !important;
        padding: 0 !important;
        pointer-events: auto !important;
    }
    
    .nav-menu-desktop > li > a {
        display: block !important;
        padding: 1.2rem 1.5rem !important;
        color: #1f2937 !important;
        text-decoration: none !important;
        font-weight: 600 !important;
        font-size: 1.05rem !important;
        transition: all 0.2s ease !important;
        background: white !important;
        cursor: pointer !important;
        pointer-events: auto !important;
        position: relative !important;
        z-index: 10 !important;
    }
    
    .nav-menu-desktop > li > a:hover,
    .nav-menu-desktop > li > a:active {
        background: #f0fdf4 !important;
        color: #00853F !important;
    }
    
    /* ===== INDICATEUR FLÈCHE ===== */
    .nav-menu-desktop > li.has-submenu > a::after {
        content: '▶' !important;
        float: right !important;
        font-size: 0.8rem !important;
        color: #94a3b8 !important;
        transition: transform 0.3s ease !important;
        pointer-events: none !important;
    }
    
    .nav-menu-desktop > li.has-submenu.submenu-open > a::after {
        transform: rotate(90deg) !important;
        color: #00853F !important;
    }
    
    /* ===== SOUS-MENU ===== */
    .nav-menu-desktop .submenu {
        position: static !important;
        display: block !important;
        max-height: 0 !important;
        overflow: hidden !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        background: #f8fafc !important;
        padding: 0 !important;
        margin: 0 !important;
        transition: max-height 0.3s ease-out !important;
        list-style: none !important;
        min-width: auto !important;
        width: 100% !important;
        pointer-events: auto !important;
    }
    
    /* Sous-menu ouvert */
    .nav-menu-desktop > li.submenu-open > .submenu {
        max-height: 500px !important;
        border-top: 1px solid #e5e7eb !important;
    }
    
    .nav-menu-desktop .submenu li {
        display: block !important;
        margin: 0 !important;
        padding: 0 !important;
        list-style: none !important;
        border-bottom: 1px solid #e5e7eb !important;
        pointer-events: auto !important;
    }
    
    .nav-menu-desktop .submenu li:last-child {
        border-bottom: none !important;
    }
    
    .nav-menu-desktop .submenu a {
        display: block !important;
        padding: 1rem 1.5rem 1rem 2.5rem !important;
        color: #475569 !important;
        font-weight: 500 !important;
        font-size: 0.95rem !important;
        text-decoration: none !important;
        transition: all 0.2s ease !important;
        background: #f8fafc !important;
        cursor: pointer !important;
        pointer-events: auto !important;
    }
    
    .nav-menu-desktop .submenu a:hover,
    .nav-menu-desktop .submenu a:active {
        background: white !important;
        color: #00853F !important;
        padding-left: 3rem !important;
    }
    
    /* ===== BODY LOCK ===== */
    body.menu-open {
        overflow: hidden !important;
    }
}

/* ===== PETIT MOBILE ===== */
@media (max-width: 640px) {
    .nav-menu-desktop {
        width: 90% !important;
        max-width: none !important;
    }
    
    .nav-menu-desktop > li > a {
        font-size: 1rem !important;
        padding: 1rem 1.2rem !important;
    }
    
    .nav-menu-desktop .submenu a {
        font-size: 0.9rem !important;
        padding: 0.9rem 1.2rem 0.9rem 2rem !important;
    }
}

/* ===== OVERLAY VIA CSS (pas HTML) ===== */
@media (max-width: 968px) {
    
    /* Supprimer tout overlay sur body */
    body::before,
    body::after,
    body.menu-open::before,
    body.menu-open::after {
        display: none !important;
        content: none !important;
    }
    
    /* Overlay derrière le menu via le menu lui-même */
    .nav-menu-desktop.open::after {
        content: '';
        position: fixed;
        top: 0;
        left: -100vw;
        width: 100vw;
        height: 100vh;
        background: rgba(0,0,0,0.5);
        z-index: -1;
        pointer-events: none;
    }
}