/* =========================================
   NAVIGATION MOBILE - À ajouter dans main.css
   OU créer un fichier mobile-nav.css séparé
   ========================================= */

/* BOUTON HAMBURGER (caché par défaut sur desktop) */
.burger-menu {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 2000;
    transition: 0.3s;
}

.burger-menu span {
    width: 100%;
    height: 3px;
    background: var(--jaune);
    border-radius: 10px;
    transition: all 0.3s ease;
}

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

.burger-menu.toggle span:nth-child(2) {
    opacity: 0;
}

.burger-menu.toggle span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}


/* =========================================
   CORRECTION DESKTOP : Z-INDEX DES DROPDOWNS
   ========================================= */
.dropdown-menu {
    z-index: 2001 !important; /* Force le menu au-dessus de tout */
    background: rgba(36, 36, 36, 0.98) !important; /* Force l'opacité */
    backdrop-filter: blur(10px); /* Effet de flou derrière */
}


/* =========================================
   RESPONSIVE : TABLETTE (jusqu'à 900px)
   ========================================= */
@media (max-width: 900px) {
    
    /* RÉDUCTION DE LA NAV */
    nav {
        padding: 0 30px;
        height: 80px;
    }
    
    .logo-container a {
        height: 70px;
    }
    
    /* AFFICHER LE BURGER */
    .burger-menu {
        display: flex;
    }
    
    /* CACHER LE BOUTON DEVIS SUR TABLETTE */
    .btn-devis {
        display: none;
    }
    
    /* MENU EN OVERLAY */
    .nav-links {
        position: fixed;
        right: -100%;
        top: 80px;
        flex-direction: column;
        background: rgba(36, 36, 36, 0.98);
        backdrop-filter: blur(20px);
        width: 100%;
        max-width: 400px;
        height: calc(100vh - 80px);
        padding: 40px 0;
        gap: 0;
        transition: right 0.4s ease;
        overflow-y: auto;
        box-shadow: -10px 0 30px rgba(0,0,0,0.5);
        z-index: 1999;
    }
    
    /* MENU OUVERT */
    .nav-links.nav-active {
        right: 0;
    }
    
    /* LIENS DU MENU */
    .nav-links li {
        width: 100%;
        opacity: 0;
        transform: translateX(50px);
        animation: navLinkFade 0.5s ease forwards;
    }
    
    .nav-links.nav-active li {
        opacity: 1;
        transform: translateX(0);
    }
    
    /* Animation progressive des liens */
    .nav-links.nav-active li:nth-child(1) { animation-delay: 0.1s; }
    .nav-links.nav-active li:nth-child(2) { animation-delay: 0.2s; }
    .nav-links.nav-active li:nth-child(3) { animation-delay: 0.3s; }
    .nav-links.nav-active li:nth-child(4) { animation-delay: 0.4s; }
    .nav-links.nav-active li:nth-child(5) { animation-delay: 0.5s; }
    
    @keyframes navLinkFade {
        from {
            opacity: 0;
            transform: translateX(50px);
        }
        to {
            opacity: 1;
            transform: translateX(0);
        }
    }
    
    .nav-links > li > a {
        padding: 20px 40px;
        font-size: 1rem;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    
    /* SOUS-MENUS SUR MOBILE - FOND OPAQUE */
    .dropdown-menu {
        position: static;
        display: none;
        background: rgba(20, 20, 20, 1) !important; /* 100% OPAQUE */
        backdrop-filter: none;
        padding: 0;
        box-shadow: inset 0 2px 10px rgba(0,0,0,0.5);
        border-top: none;
        border-left: 3px solid var(--jaune);
        margin: 0;
        z-index: 2002; /* Au-dessus de tout */
    }
    
    /* Afficher le sous-menu quand actif */
    .nav-item.submenu-active .dropdown-menu {
        display: block;
    }
    
    .dropdown-menu a {
        padding: 15px 50px;
        font-size: 0.9rem;
        border-left: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        background: rgba(20, 20, 20, 1); /* Fond opaque pour chaque lien */
        position: relative;
        z-index: 2003;
    }
    
    .dropdown-menu a:hover {
        padding-left: 55px;
        background: rgba(40, 40, 40, 1); /* Légèrement plus clair au survol */
    }
    
    /* Rotation de l'icône chevron */
    .nav-item.submenu-active .dropdown-icon {
        transform: rotate(180deg);
    }
    
    .dropdown-icon {
        transition: transform 0.3s ease;
    }
}


/* =========================================
   RESPONSIVE : MOBILE (jusqu'à 600px)
   ========================================= */
@media (max-width: 600px) {
    
    nav {
        padding: 0 20px;
        height: 70px;
    }
    
    .logo-container a {
        height: 60px;
    }
    
    .nav-links {
        top: 70px;
        height: calc(100vh - 70px);
        max-width: 100%;
        padding: 30px 0;
    }
    
    .nav-links > li > a {
        padding: 18px 25px;
        font-size: 0.95rem;
    }
    
    .dropdown-menu a {
        padding: 12px 40px;
    }
}


/* =========================================
   AMÉLIORATION : OVERLAY SOMBRE
   ========================================= */
@media (max-width: 900px) {
    /* Créer un overlay derrière le menu */
    body::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.7);
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.3s ease;
        z-index: 1998;
    }
    
    /* Afficher l'overlay quand le menu est ouvert */
    body.menu-open::before {
        opacity: 1;
        visibility: visible;
    }
}


/* =========================================
   CORRECTION : ÉLÉMENTS QUI DÉPASSENT
   ========================================= */
@media (max-width: 900px) {
    
    /* Hero ajusté */
    #hero h1 {
        font-size: 15vw;
    }
    
    .sub-hero {
        font-size: 4vw;
        letter-spacing: 3px;
    }
    
    .tagline {
        font-size: 1rem;
        letter-spacing: 2px;
    }
    
    /* Headers de pages */
    .page-header h1 {
        font-size: 3rem;
    }
    
    /* Sections */
    .preview-section {
        flex-direction: column;
        padding: 60px 30px;
    }
    
    .image-box {
        width: 100%;
        height: 300px;
        box-shadow: 10px 10px 0px #000 !important;
    }
    
    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

@media (max-width: 600px) {
    .page-header h1 {
        font-size: 2.2rem;
    }
    
    .section-main-title {
        font-size: 1.8rem;
    }
    
    .catalog-container,
    .contact-container {
        padding: 40px 20px;
    }
}