/* ========== STYLES DU MENU OPTIMISÉS ========== */

.main-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(44, 62, 80, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0,0,0,0.1);
    z-index: 1000;
    transition: transform 0.3s ease; /* Optimisé: ne transitionne que transform */
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo a {
    display: flex;
    align-items: center;
    gap: 1rem;
    text-decoration: none;
}

/* OPTIMISATION: Logo SVG intégré (pas de requête externe) */
.logo svg {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    transition: transform 0.3s ease;
}

.logo svg:hover {
    transform: rotate(10deg);
}

.logo span {
    font-size: 1.5rem;
    font-weight: bold;
    color: #fff;
    letter-spacing: 1px;
}

/* Menu navigation */
.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin: 0;
    padding: 0;
}

.nav-menu li a {
    color: #fff;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
    padding: 0.5rem 1rem;
    transition: color 0.3s ease; /* Optimisé: transition uniquement sur color */
    position: relative;
}

.nav-menu li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: #3498db;
    transition: width 0.3s ease; /* Optimisé */
    transform: translateX(-50%);
}

.nav-menu li a:hover::after,
.nav-menu li a.active::after {
    width: 80%;
}

.nav-menu li a:hover {
    color: #3498db;
}

/* Bouton menu mobile */
.mobile-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    z-index: 1001; /* OPTIMISATION: s'assure que le bouton reste au-dessus */
}

.mobile-menu-btn span {
    width: 25px;
    height: 3px;
    background: #fff;
    transition: all 0.3s ease;
    border-radius: 2px; /* OPTIMISATION: coins arrondis */
}

/* OPTIMISATION: Animation du bouton burger en X */
.mobile-menu-btn.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-btn.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-btn.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* Media query mobile */
@media (max-width: 768px) {
    .mobile-menu-btn {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        top: 80px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 80px);
        background: rgba(44, 62, 80, 0.98);
        backdrop-filter: blur(10px); /* OPTIMISATION: ajout blur sur menu mobile */
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2rem;
        transition: left 0.3s ease-in-out; /* OPTIMISATION: easing plus fluide */
    }
    
    .nav-menu.active {
        left: 0;
    }
    
    .nav-container {
        padding: 1rem;
    }
    
    .logo span {
        font-size: 1.2rem;
    }
}

/* OPTIMISATION: Évite les débordements sur très petits écrans */
@media (max-width: 480px) {
    .logo span {
        font-size: 1rem;
    }
    
    .logo svg {
        width: 40px;
        height: 40px;
    }
    
    .nav-menu li a {
        font-size: 1rem;
    }
}