/* Menu principal */
.main-menu {
    display: flex;
    align-items: center; /* Aligne les éléments verticalement */
    justify-content: space-between; /* Logo à gauche, menu centré */
    background-color: var(--primary-blue);
    padding: 10px 20px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: fixed; /* Fixe le menu en haut */
    top: 0; /* Place le menu au sommet de la page */
    width: 100%; /* S'étend sur toute la largeur */
    z-index: 1000; /* S'assure que le menu reste au-dessus des autres éléments */
}

/* Logo dans le menu */
.main-menu .logo {
    flex-shrink: 0; /* Empêche le logo de rétrécir */
    margin-right: auto; /* Pousse les éléments suivants vers la droite */
}

.main-menu .logo img {
    height: 70px; /* Augmente la taille de l'image de 1.5x */
    width: auto;
    display: block;
}

/* Liste des liens de navigation */
.main-menu ul {
    display: flex;
    justify-content: center; /* Centre les liens du menu */
    padding: 0;
    margin: 0;
    list-style: none;
    margin-right: 40px;
}

.main-menu li {
    position: relative;
    margin: 0 15px;
}

/* Liens du menu principal */
.main-menu a {
    display: block;
    padding: 15px 20px;
    color: var(--text-light);
    font-weight: bold;
    transition: background-color 0.3s, color 0.3s;
    text-align: center;
}

.main-menu a:hover {
    background-color: var(--accent-orange);
    border-radius: 5px;
}

/* Sous-menu déroulant */
.dropdown .submenu {
    display: none;
    position: absolute;
    top: 100%; /* Place le sous-menu juste en dessous du lien parent */
    left: 0;
    background-color: var(--primary-green);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-radius: 5px;
    z-index: 1000;
    padding: 5px 0; /* Espacement autour des items du sous-menu */
}

.dropdown:hover .submenu {
    display: block;
}

.submenu li {
    margin: 0;
}

.submenu a {
    padding: 10px 20px;
    white-space: nowrap; /* Empêche les textes de se couper sur plusieurs lignes */
    color: var(--text-light);
}

.submenu a:hover {
    background-color: var(--hover-blue);
}
/* Lien actif dans le menu */
.main-menu a.active {
    border: 2px solid var(--primary-green); /* Contour vert */
    border-radius: 5px; /* Coins arrondis */
    padding: 13px 18px; /* Ajuste l'espacement pour tenir compte du contour */
    background-color: #f9f9f9; /* Ajoute un fond clair pour contraste */
    color: var(--primary-green); /* Change la couleur du texte */
    font-weight: bold;
    transition: all 0.3s ease;
}

/* Effet au survol (si actif) */
.main-menu a.active:hover {
    background-color: var(--primary-green);
    color: var(--text-light);
}

/* Responsive pour les écrans plus petits */
@media (max-width: 768px) {
    .main-menu {
        flex-wrap: wrap; /* Permet au menu de passer à la ligne si nécessaire */
    }

    .main-menu ul {
        justify-content: flex-start; /* Aligne les liens à gauche */
    }
}


/* Mobile Menu */
.mobile-menu {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background-color: #00A676;
}

.mobile-menu .logo img {
    height: 50px;
}

.mobile-menu .hamburger {
    font-size: 24px;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
}

#mobile-nav {
    display: none;
    flex-direction: column;
    background-color: #fff;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
    padding: 10px;
}

#mobile-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

#mobile-nav ul li {
    margin: 10px 0;
}

#mobile-nav ul li a {
    text-decoration: none;
    color: #333;
    font-size: 16px;
}

#mobile-nav ul li a.active {
    color: #00A676;
    font-weight: bold;
}

/* Show menu when toggled */
#mobile-nav.hidden {
    display: none;
}

#mobile-nav:not(.hidden) {
    display: flex;
}