/* =============================================
   HABS Mobile Menu Styles - Version 2.0 ULTRA SIMPLE
   Garantie de fonctionnement mobile
   ============================================= */

/* =============================================
   HAMBURGER BUTTON - TOUJOURS VISIBLE EN MODE FLEX
   ============================================= */
.nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 6px;
    
    /* Dimensions fixes pour zone de clic large */
    width: 50px;
    height: 50px;
    
    /* Style */
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 10px;
    
    /* Positionnement */
    position: relative;
    z-index: 99999;
    
    transition: none;
}

/* Les 3 barres du hamburger */
.nav-toggle span {
    display: block;
    width: 28px;
    height: 3px;
    background: #FFFFFF;
    border-radius: 2px;
    transition: all 0.3s ease;
}

/* Animation quand le menu est ouvert */
.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(9px, 9px);
}

.nav-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(-20px);
}

.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(9px, -9px);
}

/* =============================================
   DESKTOP: Cacher le bouton hamburger
   ============================================= */
@media screen and (min-width: 769px) {
    .nav-toggle {
        display: none !important;
    }
}

/* =============================================
   MOBILE: Afficher le bouton et le menu
   ============================================= */
@media screen and (max-width: 768px) {
    
    /* FORCER l'affichage du bouton */
    .nav-toggle {
        display: flex !important;
    }
    
    /* Menu de navigation mobile */
    .nav-menu {
        display: none !important;
        position: fixed;
        top: 70px;
        left: 0;
        right: 0;
        width: 100%;
        height: auto;
        max-height: calc(100vh - 70px);
        
        background: rgba(11, 14, 19, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        
        flex-direction: column;
        align-items: stretch;
        
        padding: 20px 0;
        margin: 0;
        
        overflow-y: auto;
        overflow-x: hidden;
        
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
        
        z-index: 9999;
        
        list-style: none;
    }
    
    /* Afficher le menu quand actif */
    .nav-menu.active {
        display: flex !important;
    }
    
    /* Items de menu */
    .nav-menu > li {
        width: 100%;
        margin: 0;
        padding: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }
    
    .nav-menu > li:last-child {
        border-bottom: none;
    }
    
    /* Liens de menu */
    .nav-menu > li > a {
        display: block;
        width: 100%;
        padding: 16px 24px;
        
        color: #FFFFFF;
        text-decoration: none;
        font-size: 16px;
        font-weight: 500;
        
        transition: all 0.3s ease;
    }
    
    .nav-menu > li > a:hover {
        background: rgba(74, 158, 255, 0.1);
        color: #4A9EFF;
    }
    
    .nav-menu > li > a.active {
        background: rgba(74, 158, 255, 0.15);
        color: #4A9EFF;
    }
    
    /* Supprimer les effets hover desktop */
    .nav-menu a::after,
    .nav-menu a::before {
        display: none !important;
    }
    
    /* =============================================
       DROPDOWNS MOBILES
       ============================================= */
    
    /* Container dropdown */
    .has-dropdown {
        position: relative;
    }
    
    /* Flèche dropdown */
    .dropdown-arrow {
        display: inline-block;
        width: 0;
        height: 0;
        margin-left: 8px;
        border-left: 5px solid transparent;
        border-right: 5px solid transparent;
        border-top: 5px solid currentColor;
        transition: transform 0.3s ease;
        vertical-align: middle;
    }
    
    .has-dropdown.active .dropdown-arrow {
        transform: rotate(180deg);
    }
    
    /* Menu dropdown */
    .dropdown-menu {
        display: none;
        position: static;
        width: 100%;
        
        background: rgba(20, 24, 33, 0.8);
        
        padding: 0;
        margin: 0;
        
        border: none;
        border-top: 1px solid rgba(255, 255, 255, 0.05);
        
        list-style: none;
        
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
    }
    
    /* Afficher dropdown quand parent actif */
    .has-dropdown.active .dropdown-menu {
        display: block !important;
    }
    
    /* Items dropdown */
    .dropdown-menu li {
        width: 100%;
        margin: 0;
        padding: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    }
    
    .dropdown-menu li:last-child {
        border-bottom: none;
    }
    
    /* Liens dropdown */
    .dropdown-menu a {
        display: block;
        width: 100%;
        padding: 14px 24px 14px 48px;
        
        color: #9BA3B4;
        text-decoration: none;
        font-size: 14px;
        
        transition: all 0.3s ease;
    }
    
    .dropdown-menu a:hover {
        background: rgba(74, 158, 255, 0.1);
        color: #FFFFFF;
        padding-left: 52px;
    }
    
    /* Indicateur dropdown */
    .dropdown-item-indicator {
        display: inline-block;
        width: 6px;
        height: 6px;
        margin-right: 12px;
        background: #4A9EFF;
        border-radius: 50%;
        vertical-align: middle;
    }
    
    /* Scrollbar personnalisée */
    .nav-menu::-webkit-scrollbar {
        width: 4px;
    }
    
    .nav-menu::-webkit-scrollbar-track {
        background: transparent;
    }
    
    .nav-menu::-webkit-scrollbar-thumb {
        background: rgba(74, 158, 255, 0.3);
        border-radius: 2px;
    }
    
    .nav-menu::-webkit-scrollbar-thumb:hover {
        background: rgba(74, 158, 255, 0.5);
    }
}

/* =============================================
   TABLET: Même comportement que mobile
   ============================================= */
@media screen and (min-width: 481px) and (max-width: 768px) {
    .nav-toggle {
        display: flex !important;
    }
}

/* =============================================
   PETIT MOBILE: Ajustements spécifiques
   ============================================= */
@media screen and (max-width: 480px) {
    .nav-toggle {
        width: 45px;
        height: 45px;
    }
    
    .nav-toggle span {
        width: 24px;
        height: 2.5px;
    }
    
    .nav-menu > li > a {
        padding: 14px 20px;
        font-size: 15px;
    }
    
    .dropdown-menu a {
        padding: 12px 20px 12px 40px;
        font-size: 13px;
    }
}
