/* Vos variables :root et styles génériques restent inchangés */
:root {
    --primary-color: #2563eb;
    --text-color: #333;
    --light-gray: #f5f5f5;
    --transition: all 0.3s ease;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --header-height: 100px; /* Define header height as a variable */
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Barlow Condensed', sans-serif;
}

header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: white;
    box-shadow: var(--shadow);
    z-index: 1000;
    padding: 15px 0;
    height: var(--header-height);
    display: flex;
    align-items: center;
}

.nav-container {
    display: flex;
    justify-content: space-between; /* Écarte le logo et la nav */
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

#logo-wrapper img {
    height: 70px;
    width: auto;
    transition: transform 0.3s;
}

#logo-wrapper img:hover {
    transform: scale(1.05);
}

/* NOUVEAU: Ajoutez ceci pour centrer la navigation */
nav {
    flex-grow: 1; /* Permet à la nav de prendre l'espace restant */
    display: flex; /* Active flexbox pour la nav elle-même */
    justify-content: center; /* Centre le menu à l'intérieur de la nav */
}

/* Menu desktop */
.main-menu {
    display: flex;
    /* justify-content: center; -- Supprimez cette ligne car le parent nav le gère maintenant */
    /* flex: 1; -- Supprimez cette ligne, car le parent nav gère l'espace */
    list-style: none;
    column-gap: 70px;
    margin: 0;
    padding: 0;
}

.main-menu li a {
    color: var(--text-color);
    text-decoration: none;
    font-weight: 500;
    padding: 14px 0;
    display: block;
    position: relative;
    transition: var(--transition);
}

.main-menu li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background: var(--primary-color);
    width: 0%;
    transition: width 0.3s ease;
}

.main-menu li a:hover::after {
    width: 100%;
}

.main-menu li a:hover {
    color: var(--primary-color);
}


.hamburger-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  z-index: 1001;
  position: relative;
}

.hamburger-line {
  display: block;
  width: 28px;
  height: 3px;
  background-color: var(--text-color);
  margin: 6px 0;
  transition: all 0.3s ease;
  border-radius: 2px;
}

.hamburger-btn[aria-expanded="true"] .hamburger-line:nth-child(1) {
  transform: translateY(9px) rotate(45deg);
  background-color: var(--primary-blue);
}

.hamburger-btn[aria-expanded="true"] .hamburger-line:nth-child(2) {
  opacity: 0;
}

.hamburger-btn[aria-expanded="true"] .hamburger-line:nth-child(3) {
  transform: translateY(-9px) rotate(-45deg);
  background-color: var(--primary-blue);
}
/* --- Mobile Menu Overlay --- */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Responsive */
@media (max-width: 768px) {
    /* Cache le menu desktop par défaut */
    .main-menu {
        display: none; /* Cache par défaut */
        flex-direction: column;
        position: fixed;
        top: var(--header-height);
        left: -100%; /* Cache hors écran */
        width: 65%;
        height: calc(100vh - var(--header-height));
        background: white;
        padding: 20px;
        box-shadow: 5px 0 15px rgba(0, 0, 0, 0.1);
        transition: left 0.3s ease;
        z-index: 1000;
        row-gap: 15px;
        align-items: flex-start;
        overflow-y: auto; /* Permettre le scroll pour le menu mobile */
        -webkit-overflow-scrolling: touch;
    }

    .main-menu.active {
        left: 0; /* Fait apparaître le menu */
        display: flex; /* Affiche le menu quand actif */
    }

    .main-menu li {
        width: 100%;
        padding: 12px 0;
        border-bottom: 1px solid var(--light-gray);
        text-align: left;
    }

    .main-menu li:last-child {
        border-bottom: none;
    }

    .main-menu li a {
        font-size: 1.2rem;
        padding: 8px 0;
    }

    /* Affiche le bouton hamburger sur mobile */
    .hamburger-btn {
        display: block;
    }

    /* Ajoute une marge au contenu principal pour éviter qu'il ne soit caché par le header fixe */
    main { /* Supposons que votre contenu principal est enveloppé dans <main> */
        margin-top: var(--header-height);
    }
    .hamburger-btn {
    display: block;
    order: 2;
    margin-left: auto;
  }
}

/* Ajuste la hauteur du header sur les écrans plus petits si nécessaire */
@media (max-width: 480px) {
    :root {
        --header-height: 80px;
    }
    #logo-wrapper img {
        height: 60px;
    }
}