﻿/* assets/css/menu.css */


/* Structure du header pour aligner logo, menu et language switcher */
.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background-color: #4054b2;
    padding: 0;
    height: 70px;
    min-height: 70px;
    max-height: 70px;
    position: relative;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.site-header .menu-header-container {
    display: flex;
    align-items: center;
    gap: 0;
    flex-shrink: 0;
}

.site-header .main-nav {
    flex: 1;
    display: none;
    height: 100%;
    margin-left: 30px;
    margin-right: 20px;
}

.site-header .language-switcher {
    flex-shrink: 0;
    margin-left: auto;
    margin-right: 20px;
}

.logo a {
    display: block;
}

.logo img {
    height: 50px;
    width: auto;
    padding: 10px 0;
    transition: transform 0.3s ease;
}

.logo a:hover img {
    transform: scale(1.05);
}

/* --- DESKTOP NAVIGATION --- */
.main-nav {
    display: none; /* Hidden by default, shown on larger screens */
    flex: 1;
    height: 100%;
    align-items: center;
}

.main-nav ul {
    margin: 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    height: 100%;
}

.main-nav ul li {
    position: relative;
    display: flex;
    align-items: stretch;
    white-space: nowrap;
}

.main-nav ul li a {
    display: flex;
    align-items: center;
    padding: 0 18px;
    height: 70px;
    color: white;
    text-decoration: none;
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    font-size: 0.95em;
    position: relative;
    overflow: hidden; /* Pour l'effet shimmer */
    transition: color 0.3s ease, background-color 0.3s ease;
    white-space: nowrap;
}

/* Effet de survol simple */
.main-nav ul li:hover > a {
    background-color: #364692; /* Un bleu légèrement plus foncé */
    color: #fff;
}

/* Effet Shimmer au survol */
.main-nav ul li a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
    transition: left 0.5s ease;
}

.main-nav ul li a:hover::before {
    left: 100%;
}


/* Indicateur de sous-menu */
.main-nav ul > li.menu-item-has-children > a {
    padding-right: 30px; /* Espace pour la flèche */
}

.main-nav ul > li.menu-item-has-children > a::after {
    content: '▾'; /* Chevron vers le bas */
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
    transition: transform 0.3s ease;
}

/* Rotation de l'indicateur au survol */
.main-nav ul > li.menu-item-has-children:hover > a::after {
    transform: translateY(-50%) rotate(180deg);
}


/* --- DROPDOWN MENUS --- */
.main-nav ul ul {
    display: block !important; /* Toujours en 'block' pour animer l'opacité */
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #fff !important; /* Fond blanc pour le dropdown */
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    min-width: 240px; /* Largeur augmentée */
    width: auto;
    z-index: 1000;
    flex-direction: column;
    border-radius: 0 0 8px 8px; /* Coins arrondis en bas */
    border-top: 3px solid #364692;
    padding: 0;
    margin: 0;
    list-style: none;

    /* Animation */
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
}

.main-nav ul li:hover > ul {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.main-nav ul ul li {
    display: block;
    border-bottom: 1px solid #f0f0f0; /* Séparateur discret */
    background-color: #fff;
    width: 100%;
    white-space: normal;
}

.main-nav ul ul li:last-child {
    border-bottom: none;
}

.main-nav ul ul li a {
    display: block;
    color: #333;
    padding: 15px 20px;
    background-color: #fff;
    height: auto;
    transition: background-color 0.2s ease, color 0.2s ease;
    white-space: normal;
}

.main-nav ul ul li a:hover {
    background-color: #f5f5f5;
    color: #4054b2; /* Couleur primaire au survol */
}

/* Indicateur de sous-sous-menu */
.main-nav ul ul > li.menu-item-has-children > a {
    position: relative;
}
.main-nav ul ul > li.menu-item-has-children > a::after {
    content: '▸'; /* Chevron vers la droite */
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
}

/* --- SUB-SUB-MENUS --- */
.main-nav ul ul ul {
    top: -3px; /* Aligner avec le haut de l'élément parent */
    left: 100%;
    border-radius: 8px;
    border-top: none;
    background-color: #fff !important;
    min-width: 220px;
}


/* --- MOBILE MENU --- */
.mobile-menu-toggle {
    display: block;
    cursor: pointer;
    background: none;
    border: none;
    padding: 10px;
}

.mobile-menu-toggle .bar {
    display: block;
    width: 25px;
    height: 3px;
    background-color: white;
    margin: 5px 0;
    transition: 0.4s;
}

/* Animation de l'icône hamburger en croix */
.mobile-menu-toggle.active .bar:nth-child(1) {
    transform: rotate(-45deg) translate(-5px, 6px);
}
.mobile-menu-toggle.active .bar:nth-child(2) {
    opacity: 0;
}
.mobile-menu-toggle.active .bar:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -6px);
}


/* --- MOBILE NAV CONTAINER --- */
.mobile-nav {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(25, 28, 44, 0.98); /* Fond plus sombre et stylé */
    z-index: 2000;
    overflow-y: auto;

    /* Animation d'apparition */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s;
}

.mobile-nav.active {
    display: block; /* requis pour que l'animation fonctionne */
    opacity: 1;
    visibility: visible;
}

.mobile-nav-header {
    display: flex;
    justify-content: flex-end;
    padding: 20px;
}

#close-menu {
    background: none;
    border: none;
    color: white;
    font-size: 30px;
    cursor: pointer;
}

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

.mobile-nav ul li a {
    display: block;
    padding: 15px 20px;
    color: white;
    text-decoration: none;
    border-bottom: 1px solid #444;
    font-size: 18px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.mobile-nav ul ul {
    padding-left: 20px;
    background-color: rgba(255, 255, 255, 0.05);
}

.mobile-nav ul li a:hover {
    background-color: rgba(255, 255, 255, 0.05);
    color: #fff;
}

/* Responsive Media Queries */
@media (min-width: 992px) {
    .main-nav {
        display: flex !important;
        align-items: center;
    }
    .mobile-menu-toggle {
        display: none;
    }
}

@media (min-width: 1200px) {
    .main-nav ul li a {
        padding: 0 22px;
        font-size: 1em;
    }
}

/* Logo ALTA */
.site-branding {
    display: flex;
    align-items: center;
    gap: 15px;
}

.custom-logo-link {
    display: block;
    line-height: 0;
}

.custom-logo {
    height: 50px;
    width: auto;
    max-height: 50px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.custom-logo-link:hover .custom-logo {
    transform: scale(1.05);
}

.site-title-text {
    font-size: 1.2em;
    font-weight: 600;
    color: #fff;
}

/* Container du menu header - evite les conflits avec .bnt-container */
.menu-header-container {
    display: flex;
    align-items: center;
    gap: 0;
    flex-shrink: 0;
    padding: 0 20px;
}

/* Alignement du main-nav dans le header */
.site-header .main-nav {
    flex: 1;
    display: none;
    height: 100%;
    margin-left: 30px;
    margin-right: 20px;
    min-width: 0; /* Permet au flex de shrink si necessaire */
}

.site-header .language-switcher {
    flex-shrink: 0;
    margin-right: 20px;
}
