/* Header */
header {
    background-color: #1176bc;
    color: #fff;
    padding: 10px 0;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

header .container {
    display: flex;
    align-items: center;
    justify-content: space-between; /* Garde le logo à gauche et la nav/burger à droite */
    max-width: 1250px;
    margin: 0 auto;
    padding: 0 20px;
}

header .logo img {
    width: 250px;
    max-width: 100%;
    height: auto; /* Bonne pratique */
}

/* === NAV DESKTOP (Slider JS) === */

nav {
    /* Le 'nav' est le conteneur principal */
}

nav ul {
    position: relative; /* Pour le slider */
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    /* PAS DE 'flex-wrap: wrap;' ! Cela casse le slider JS. */
}

/* Le slider (votre code) */
nav ul::before {
    content: '';
    position: absolute;
    width: var(--slider-width, 0);
    height: var(--slider-height, 0);
    top: var(--slider-top, 0);
    left: var(--slider-left, 0);
    background-color: #0c5a8e;
    border-radius: 5px;
    z-index: 1;
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

nav ul li {
    /* On ajoute une petite marge en haut/bas au cas où */
    margin: 5px 8px;
    position: relative;
    z-index: 2;
}

nav ul li a {
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    padding: 6px 10px;
    font-size: 14px;
    border: 2px solid #fff;
    border-radius: 5px;
    display: block;
    position: relative;
    transition: color 0.3s ease;
}

/* Style au survol (géré par le slider) */
nav ul li a.active,
nav ul li a:hover {
    background-color: transparent;
    border-color: #fff;
}

nav ul li a.active {
    color: #ffffff;
}

/* === BOUTON HAMBURGER === */
.menu-toggle {
    display: none; /* Caché sur desktop */
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 10px;
    padding-bottom: 110px;
    z-index: 1001; /* Doit être au-dessus de tout */
}

.menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: #fff;
    border-radius: 3px;
    margin: 5px 0;
    transition: all 0.3s ease-in-out;
}

/* === MEDIA QUERY POUR MOBILE (992px et moins) === */

@media (max-width: 992px) {

    /* 1. Afficher le bouton hamburger */
    .menu-toggle {
        display: block;
    }

    /* 2. Cacher la nav (elle devient un menu coulissant) */
    nav {
        position: fixed;
        top: 0;
        right: 0;
        width: 300px; /* Largeur du menu coulissant */
        max-width: 80%;
        height: 100vh; /* Toute la hauteur */
        background-color: #1176bc;
        padding-top: 80px; /* Espace en haut */
        z-index: 1000; /* Sous le bouton de fermeture, mais au-dessus du site */
        
        /* Caché par défaut */
        transform: translateX(100%);
        transition: transform 0.3s ease-in-out;
    }

    /* 3. Style "ouvert" (sera ajouté par JS) */
    nav.is-open {
        transform: translateX(0);
        box-shadow: -5px 0 15px rgba(0,0,0,0.2);
    }

    /* 4. Adapter la liste de liens pour le menu mobile */
    nav ul {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    nav ul li {
        margin: 0;
        width: 90%;
    }

    nav ul li a {
        text-align: center;
        width: 100%;
    }

    /* 5. Cacher le slider JS (inutile et cassé) */
    nav ul::before {
        display: none;
    }

    /* 6. Rétablir un style de survol/actif pour le mobile */
    nav ul li a.active,
    nav ul li a:hover {
        background-color: #0c5a8e;
    }

    /* 7. Animation du bouton "hamburger" en "croix" (X) */
    .menu-toggle.is-active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    .menu-toggle.is-active span:nth-child(2) {
        opacity: 0;
    }
    .menu-toggle.is-active span:nth-child(3) {
        transform: rotate(-45deg) translate(7px, -6px);
    }
}