/* Language selector — custom dropdown (v6) */
.header-lang {
    display: flex !important;
    align-items: center;
    position: relative;
    z-index: 250;
    min-height: 38px;
    flex-shrink: 0;
}

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

/* ── Trigger button ─────────────────────────────────────────── */
.lang-switcher__btn {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    background: linear-gradient(180deg, #fffdf9 0%, #fff3e0 100%);
    border: 1.5px solid rgba(255, 224, 130, .9);
    border-radius: 999px;
    padding: .42rem .8rem .42rem .7rem;
    min-height: 38px;
    font-family: var(--menu-font, inherit);
    font-size: .82rem;
    font-weight: 700;
    color: #6d3b00;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(93, 40, 0, .18);
    transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
}

.lang-switcher__btn:hover,
.lang-switcher.is-open .lang-switcher__btn {
    border-color: #ffca28;
    box-shadow: 0 4px 14px rgba(93, 40, 0, .26);
    transform: translateY(-1px);
}

.lang-switcher__btn:focus-visible {
    outline: 2px solid #ff9800;
    outline-offset: 2px;
}

.lang-switcher__globe {
    display: inline-flex;
    color: #e65100;
}

.lang-switcher__current {
    line-height: 1.1;
    white-space: nowrap;
    max-width: 9rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lang-switcher__chevron {
    display: inline-flex;
    color: #b26500;
    transition: transform .2s ease;
}

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

/* ── Dropdown panel ─────────────────────────────────────────── */
.lang-switcher__panel {
    position: absolute;
    top: calc(100% + .55rem);
    inset-inline-end: 0;
    width: 15.5rem;
    background: #fffdf9;
    border: 1px solid rgba(230, 81, 0, .14);
    border-radius: 14px;
    box-shadow:
        0 18px 40px rgba(70, 30, 0, .22),
        0 4px 12px rgba(70, 30, 0, .12);
    overflow: hidden;
    animation: lang-pop .16s ease;
    z-index: 300;
}

@keyframes lang-pop {
    from { opacity: 0; transform: translateY(-6px) scale(.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.lang-switcher__panel-title {
    padding: .65rem 1rem .5rem;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: #b26500;
    background: linear-gradient(180deg, #fff3e0, #fffdf9);
    border-bottom: 1px solid rgba(230, 81, 0, .1);
}

.lang-switcher__list {
    list-style: none;
    margin: 0;
    padding: .35rem;
    max-height: min(21rem, 60vh);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #ffcc80 transparent;
}

.lang-switcher__list::-webkit-scrollbar { width: 6px; }
.lang-switcher__list::-webkit-scrollbar-thumb {
    background: #ffcc80;
    border-radius: 999px;
}

/* ── Option rows ────────────────────────────────────────────── */
.lang-switcher__item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .6rem;
    padding: .45rem .65rem;
    border-radius: 9px;
    text-decoration: none;
    transition: background .13s ease;
}

.lang-switcher__item:hover {
    background: #fff3e0;
}

.lang-switcher__names {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
    min-width: 0;
}

.lang-switcher__native {
    font-size: .92rem;
    font-weight: 700;
    color: #4e2a00;
}

.lang-switcher__english {
    font-size: .68rem;
    font-weight: 600;
    letter-spacing: .04em;
    color: #a1745a;
    text-transform: uppercase;
}

.lang-switcher__check {
    display: none;
    color: #e65100;
    flex-shrink: 0;
}

.lang-switcher__item.is-active {
    background: linear-gradient(90deg, #fff3e0, #ffe9cc);
    box-shadow: inset 3px 0 0 #ff9800;
}

.lang-switcher__item.is-active .lang-switcher__native {
    color: #c1440e;
}

.lang-switcher__item.is-active .lang-switcher__check {
    display: inline-flex;
}

/* RTL-safe active bar */
[dir="rtl"] .lang-switcher__item.is-active {
    box-shadow: inset -3px 0 0 #ff9800;
}

/* ── Utilities / responsive ─────────────────────────────────── */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 960px) {
    .lang-switcher__btn {
        padding: .38rem .65rem .38rem .6rem;
        font-size: .78rem;
    }

    .lang-switcher__current {
        max-width: 6.5rem;
    }

    .lang-switcher__panel {
        width: 14rem;
    }
}
