/* -------------------------------------------------------------------------
 * Language switcher (flag dropdown)
 * ---------------------------------------------------------------------- */

.lang-switcher {
    position: relative;
    display: inline-flex;
}

.lang-switcher-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 8px;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    color: inherit;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.lang-switcher-toggle:hover {
    border-color: rgba(0, 0, 0, 0.28);
}

.lang-flag {
    display: block;
    width: 20px;
    height: 14px;
    border-radius: 2px;
    object-fit: cover;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.lang-code {
    letter-spacing: 0.02em;
}

.lang-chevron {
    font-size: 18px;
    transition: transform 0.15s ease;
}

.lang-switcher.is-open .lang-chevron {
    transform: rotate(180deg);
}

.lang-switcher-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 1000;
    min-width: 160px;
    margin: 0;
    padding: 6px;
    list-style: none;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
}

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

.lang-switcher-menu li {
    margin: 0;
}

.lang-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 10px;
    border-radius: 7px;
    font-size: 14px;
    font-weight: 500;
    color: #1a1a1a;
    text-decoration: none;
    transition: background-color 0.12s ease;
}

.lang-option:hover {
    background: rgba(0, 0, 0, 0.05);
}

.lang-option.is-current {
    font-weight: 700;
    background: rgba(0, 0, 0, 0.04);
}

/* Inside the mobile menu panel, render the switcher full width. */
.mobile-menu-inner .lang-switcher {
    display: flex;
    width: 100%;
    margin-top: 16px;
}

.mobile-menu-inner .lang-switcher-toggle {
    width: 100%;
    justify-content: space-between;
}

.mobile-menu-inner .lang-switcher-menu {
    left: 0;
    right: 0;
}

/* -------------------------------------------------------------------------
 * Native variant (mobile) — label + control backed by a real <select>.
 * Tapping the control opens the OS language picker. Text colour matches the
 * surrounding menu items (light on the dark mobile panel).
 * ---------------------------------------------------------------------- */
.lang-switcher--native {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--color-text-on-dark, #f3f3f7);
}

.lang-native-label {
    font-weight: 600;
    font-size: 16px;
    color: inherit;
}

.lang-native-control {
    position: relative;
    margin-left: auto;
    display: inline-flex;
}

.lang-native-display {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    border-radius: 8px;
    font-weight: 600;
    color: inherit;
    pointer-events: none;
}

.lang-native-display .lang-code {
    letter-spacing: 0.02em;
}

.lang-native-display .lang-chevron {
    font-size: 18px;
    opacity: 0.85;
}

/* The real <select> sits on top, invisible, and captures the tap so the OS
   shows its native picker. Keeps custom appearance, native behaviour. */
.lang-native-select {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    opacity: 0;
    cursor: pointer;
    font-size: 16px; /* >=16px avoids iOS zoom-on-focus */
    -webkit-appearance: none;
    appearance: none;
}
