/* ============================================
   UNITBASSE — LANGUAGE SWITCHER (DROPDOWN)
   v2 : drapeau + nom de langue, menu déroulant
   ============================================ */

.lang-switch {
    position: relative;
    list-style: none;
}

/* ===========================================
   01. BOUTON DECLENCHEUR
   =========================================== */
.lang-switch__trigger {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    height: 36px;
    padding: 0 var(--space-3) 0 var(--space-3);
    background: rgba(34, 34, 34, 0.6);
    border: 1px solid var(--gray-800);
    border-radius: var(--radius-full);
    color: var(--cream);
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    backdrop-filter: blur(var(--blur-sm));
    -webkit-backdrop-filter: blur(var(--blur-sm));
    transition: all var(--duration-fast) var(--ease-out);
    -webkit-tap-highlight-color: transparent;
}

.lang-switch__trigger:hover {
    border-color: var(--gold-dark);
    color: var(--cream);
    background: rgba(34, 34, 34, 0.8);
}

.lang-switch__trigger:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

.lang-switch__trigger[aria-expanded="true"] {
    border-color: var(--gold);
    background: rgba(34, 34, 34, 0.8);
}

.lang-switch__flag {
    width: 20px;
    height: 14px;
    flex-shrink: 0;
    border-radius: 2px;
    overflow: hidden;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
    display: inline-block;
    line-height: 0;
}

.lang-switch__flag svg {
    display: block;
    width: 100%;
    height: 100%;
}

.lang-switch__label {
    line-height: 1;
}

.lang-switch__caret {
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    color: var(--cream-muted);
    transition: transform var(--duration-fast) var(--ease-out);
}

.lang-switch__trigger[aria-expanded="true"] .lang-switch__caret {
    transform: rotate(180deg);
    color: var(--gold);
}

/* ===========================================
   02. MENU DEROULANT
   =========================================== */
.lang-switch__menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    padding: 6px;
    margin: 0;
    list-style: none;
    background: rgba(20, 20, 20, 0.95);
    border: 1px solid var(--gray-800);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    backdrop-filter: blur(var(--blur-lg));
    -webkit-backdrop-filter: blur(var(--blur-lg));
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity var(--duration-fast) var(--ease-out),
                transform var(--duration-fast) var(--ease-out),
                visibility var(--duration-fast);
    z-index: 100;
}

.lang-switch__menu.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-switch__option {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-md);
    color: var(--cream-muted);
    text-decoration: none;
    font-family: var(--font-sans);
    font-size: var(--text-sm);
    font-weight: 500;
    transition: all var(--duration-fast);
    cursor: pointer;
}

.lang-switch__option:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--cream);
}

.lang-switch__option:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: -2px;
}

.lang-switch__option--active {
    color: var(--gold);
    background: rgba(201, 162, 39, 0.08);
}

.lang-switch__option--active:hover {
    color: var(--gold);
    background: rgba(201, 162, 39, 0.12);
}

.lang-switch__option-name {
    flex: 1;
    line-height: 1;
}

.lang-switch__check {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    color: var(--gold);
    opacity: 0;
}

.lang-switch__option--active .lang-switch__check {
    opacity: 1;
}

/* ===========================================
   03. RESPONSIVE
   =========================================== */
@media (max-width: 768px) {
    /* Dans le menu mobile burger : on garde le dropdown
       compact, juste centré */
    .lang-switch {
        margin: var(--space-2) 0;
        align-self: center;
    }

    /* Le menu déroulant s'aligne à droite ou centré
       selon le contexte du burger */
    .lang-switch__menu {
        right: 50%;
        transform: translate(50%, -6px);
    }

    .lang-switch__menu.is-open {
        transform: translate(50%, 0);
    }
}
