/* ==========================================================================
   HEADER — Résidence MG
   ========================================================================== */

header {
    background-color: #1a5276;
    color: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0.5rem 0;
}

header .container {
    width: 95%;
    max-width: 1200px;
    margin: 0 auto;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ---------- LOGO ---------- */
.logo-container { flex-shrink: 0; }

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
    gap: 10px;
}
.logo-link:hover { opacity: 0.9; }

.logo {
    width: 50px;
    height: 50px;
    background-color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}
.logo img {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.logo-text h1 { font-size: 1.2rem; margin: 0; line-height: 1.2; }
.logo-text p  { font-size: 0.7rem; opacity: 0.9; margin: 0; }

/* ---------- NAVIGATION DESKTOP ---------- */
.desktop-nav {
    flex: 1;
    display: flex;
    justify-content: center;
}
.desktop-nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0.25rem;
    flex-wrap: wrap;
    justify-content: center;
}
.desktop-nav ul li { margin: 0; }

.nav-link {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 4px;
    transition: all 0.3s;
    font-size: 0.9rem;
    white-space: nowrap;
    display: block;
}
.nav-link:hover { background: rgba(255, 255, 255, 0.15); color: #aed6f1; }
.nav-link.active {
    background: rgba(39, 174, 96, 0.3);
    color: #27ae60;
    font-weight: 600;
}

/* ---------- ACTIONS DROITE ---------- */
.header-actions-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

/* Téléphone */
.header-phone { display: none; }
.phone-link {
    color: #fff;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    white-space: nowrap;
}
.phone-link:hover { color: #aed6f1; }

/* Langue Desktop */
.language-switcher-desktop { position: relative; }

.lang-btn-desktop {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px 14px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s;
    white-space: nowrap;
}
.lang-btn-desktop:hover { background: rgba(255, 255, 255, 0.2); }
.lang-arrow { font-size: 0.6rem; transition: transform 0.3s; }
.lang-btn-desktop.open .lang-arrow { transform: rotate(180deg); }

.lang-dropdown-desktop {
    position: absolute;
    top: 100%;
    right: 0;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
    min-width: 150px;
    z-index: 1050;
    display: none;
    margin-top: 8px;
    overflow: hidden;
}
.lang-dropdown-desktop.show { display: block; }

.lang-option-item {
    display: block;
    padding: 12px 16px;
    color: #333;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.2s;
    border-bottom: 1px solid #f0f0f0;
}
.lang-option-item:last-child { border-bottom: none; }
.lang-option-item:hover { background: #f5f8ff; color: #1a5276; }
.lang-option-item.active { background: #e8f5e9; color: #27ae60; font-weight: 600; }

/* Espace client Desktop */
.client-access-desktop {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.client-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(39, 174, 96, 0.8);
    color: #fff;
    padding: 8px 16px;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.85rem;
    transition: all 0.3s;
    white-space: nowrap;
}
.client-btn:hover {
    background: #27ae60;
    transform: translateY(-1px);
    color: #fff;
}
.logout-btn-icon {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    transition: all 0.3s;
}
.logout-btn-icon:hover {
    background: rgba(231, 76, 60, 0.8);
    border-color: #e74c3c;
}

/* Hamburger mobile */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    z-index: 1100;
}
.mobile-menu-toggle span {
    display: block;
    width: 25px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: all 0.3s;
}
.mobile-menu-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.mobile-menu-toggle.active span:nth-child(2) { opacity: 0; }
.mobile-menu-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ---------- MENU MOBILE ---------- */
.mobile-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: none;
}
.mobile-menu-overlay.active { display: block; }

.mobile-menu-panel {
    position: fixed;
    top: 0;
    right: -320px;
    width: 85%;
    max-width: 320px;
    height: 100vh;
    height: 100dvh;
    background: #1a5276;
    z-index: 2100;
    transition: right 0.3s ease;
    overflow-y: auto;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.3);
}
.mobile-menu-panel.active { right: 0; }

.mobile-menu-header {
    display: flex;
    justify-content: flex-end;
    padding: 15px 20px;
}
.mobile-menu-close {
    background: rgba(255, 255, 255, 0.15);
    border: none;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}
.mobile-menu-close:hover { background: rgba(255, 255, 255, 0.3); }

.mobile-menu-list {
    list-style: none;
    margin: 0;
    padding: 0 20px 40px;
}
.mobile-menu-list li { margin-bottom: 2px; }

.mobile-link {
    display: block;
    padding: 14px 15px;
    color: #fff;
    text-decoration: none;
    font-size: 1.1rem;
    border-radius: 8px;
    transition: background 0.3s;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    cursor: pointer;
}
.mobile-link:hover { background: rgba(255, 255, 255, 0.15); }

.mobile-divider {
    border-top: 2px solid rgba(39, 174, 96, 0.6);
    margin: 20px 0 15px !important;
    padding-top: 5px;
}

.mobile-lang-section { padding: 10px 15px; }
.mobile-lang-title {
    display: block;
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
}
.mobile-lang-link {
    display: block;
    padding: 12px 15px;
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-size: 1.1rem;
    transition: background 0.3s;
    margin-bottom: 2px;
}
.mobile-lang-link:hover { background: rgba(255, 255, 255, 0.15); }
.mobile-lang-link.active {
    background: rgba(39, 174, 96, 0.3);
    border-left: 3px solid #27ae60;
}

.mobile-logout-form { margin: 0; }
.mobile-logout-btn {
    color: #ff6b6b !important;
}
.mobile-logout-btn:hover { background: rgba(255, 107, 107, 0.2) !important; }

/* ---------- RESPONSIVE ---------- */
@media (min-width: 769px) {
    .header-phone { display: flex; }
    .phone-number { display: inline; }
}

@media (max-width: 900px) {
    .desktop-nav ul { gap: 0; }
    .nav-link { padding: 8px 10px; font-size: 0.8rem; }
    .client-btn-text { display: none; }
    .client-btn { padding: 8px 12px; }
}

@media (max-width: 768px) {
    .desktop-nav,
    .header-phone,
    .language-switcher-desktop,
    .client-access-desktop {
        display: none !important;
    }
    .mobile-menu-toggle { display: flex; }
}

@media (max-width: 480px) {
    .logo-text h1 { font-size: 1rem; }
    .logo { width: 40px; height: 40px; }
    .logo img { width: 32px; height: 32px; }
}