/* Navigation */
.site-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    background: var(--navbarBg);
}

.site-header-top {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.75rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
}

.site-brand {
    flex: 1;
    min-width: 0;
}

.site-brand a {
    color: var(--textColor);
    text-decoration: none;
    font-size: 1.4rem;
    font-weight: 700;
    font-family: var(--titleFont);
    letter-spacing: -0.5px;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    max-width: 100%;
}

.site-brand-link-combo {
    gap: 0.75rem;
}

.site-brand-link-combo .site-brand-name {
    line-height: 1.1;
    white-space: normal;
}

.site-brand img {
    height: auto;
    max-width: 100%;
}

.site-header-tools {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.main-nav {
    background: transparent;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem 0.85rem;
}

/* Burger Button */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    position: relative;
    z-index: 1100;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--primaryColor);
    margin: 5px 0;
    transition: all 0.3s ease;
    border-radius: 2px;
}

/* Burger Animation to X */
.nav-toggle.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.active span:nth-child(2) { opacity: 0; }
.nav-toggle.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.nav-menu {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-links a {
    color: var(--textColor);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    padding: 0.5rem 0;
    position: relative;
    white-space: nowrap;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; width: 0; height: 2px;
    background: var(--primaryColor);
    transition: width 0.3s ease;
}

.nav-links a:hover, .nav-links a.active { color: var(--primaryColor); }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }

.nav-lang {
    display: flex;
    gap: 0.4rem;
    background: #f3f4f6;
    padding: 0.25rem;
    border-radius: calc(var(--borderRadius) / 2);
}

.lang-btn {
    padding: 0.4rem 0.7rem;
    color: #6b7280;
    text-decoration: none;
    border-radius: calc(var(--borderRadius) / 3);
    font-size: 0.8rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.lang-btn.active {
    background: white;
    color: var(--primaryColor);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.nav-lang-flags {
    background: none;
    padding: 0;
    gap: 0.5rem;
}

.lang-btn-flags {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    min-height: 2.25rem;
    padding: 0.2rem;
    background: none;
    color: inherit;
    border-radius: 999px;
    box-shadow: none;
}

.lang-btn-flags:hover {
    background: none;
    box-shadow: none;
}

.lang-btn-flags.active {
    background: none;
    box-shadow: none;
}

.lang-flag {
    display: inline-flex;
    width: 1.75rem;
    height: 1.75rem;
    line-height: 0;
}

.lang-flag img {
    width: 100%;
    height: 100%;
    display: block;
}

.lang-btn-flags .lang-label {
    display: none;
}

/* --- MOBILE MODE STYLES (Activated exclusively by .mobile-mode) --- */

.site-header.mobile-mode .nav-toggle {
    display: block;
}

.site-header.mobile-mode .nav-container {
    padding: 0;
}

.site-header.mobile-mode .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 80%;
    max-width: 300px;
    height: 100vh;
    background: white;
    flex-direction: column;
    justify-content: flex-start;
    padding: 5rem 1rem 2rem;
    transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: -10px 0 30px rgba(0,0,0,0.1);
    gap: 3rem;
    z-index: 1050;
    display: flex; /* Toujours flex car masqué par right:-100% */
}

.site-header.mobile-mode .nav-close {
    position: absolute;
    top: 0.9rem;
    right: 0.9rem;
    width: 2.4rem;
    height: 2.4rem;
    border: none;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.06);
    color: var(--textColor);
    font-size: 1.7rem;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    z-index: 3301;
}

.site-header.mobile-mode .nav-close:hover {
    background: rgba(0, 0, 0, 0.12);
}

.site-header:not(.mobile-mode) .nav-close {
    display: none;
}

.nav-toggle:focus,
.nav-close:focus {
    outline: none;
    box-shadow: none;
}

.site-header.mobile-mode .nav-menu.active {
    right: 0;
}

.site-header.mobile-mode .nav-links {
    flex-direction: column;
    width: 100%;
    gap: 1.5rem;
}

.site-header.mobile-mode .nav-links a {
    font-size: 1.2rem;
    padding: 0.5rem 0;
}

@media (max-width: 768px) {
    .site-header-top {
        padding: 0.75rem 1rem;
        gap: 0.75rem;
    }

    .site-brand a {
        font-size: 1.1rem;
    }

    .nav-container {
        padding: 0 1rem 0.75rem;
    }
}
