/* Responsive language picker: globe-only trigger and flag + language menu */
.language-picker {
    display: block;
    position: relative;
    flex: 0 0 auto;
    margin: 0;
    z-index: 30;
}
.language-picker-trigger {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    list-style: none;
    border: 1px solid transparent;
    border-radius: 9px;
    color: var(--ink, #282a30);
    background: transparent;
    cursor: pointer;
    transition: color .14s ease, background-color .14s ease, border-color .14s ease;
}
.language-picker-trigger::-webkit-details-marker { display: none; }
.language-picker-trigger::marker { content: ""; }
.language-picker-trigger:hover,
.language-picker[open] > .language-picker-trigger {
    color: var(--brand, #f51e26);
    background: var(--warm-light, #fff5f0);
    border-color: var(--line, #e3e5e9);
}
.language-picker-trigger:focus-visible,
.language-picker-menu .language-picker-option:focus-visible {
    outline: 2px solid var(--brand, #f51e26);
    outline-offset: 2px;
}
.language-picker-trigger svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.language-picker-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 500;
    width: min(328px, calc(100vw - 20px));
    padding: 12px;
    border: 1px solid var(--line, #e3e5e9);
    border-radius: 12px;
    background: var(--white, #fff);
    box-shadow: 0 12px 32px rgba(28, 33, 42, .16);
}
.language-picker-heading {
    margin: 0 0 8px;
    padding-inline: 4px;
    color: var(--muted, #6c7078);
    font-size: 12px;
    font-weight: 700;
}
.language-picker-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px;
    margin: 0;
}
.language-picker-form { min-width: 0; margin: 0; }
.language-picker-menu .language-picker-option {
    width: 100%;
    min-width: 0;
    min-height: 40px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 9px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--ink, #282a30);
    background: transparent;
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.25;
    text-align: left;
    text-decoration: none;
    cursor: pointer;
}
.language-picker-menu .language-picker-option:hover,
.language-picker-menu .language-picker-option[aria-current="true"] {
    border-color: rgba(245, 30, 38, .2);
    color: var(--brand, #f51e26);
    background: rgba(245, 30, 38, .06);
}
.language-picker-flag {
    width: 22px;
    flex: 0 0 22px;
    display: inline-grid;
    place-items: center;
}
.language-picker-flag svg {
    display: block;
    width: 20px;
    height: 14px;
    border: 1px solid rgba(32, 34, 40, .12);
    border-radius: 2px;
    box-shadow: 0 1px 2px rgba(32, 34, 40, .1);
}
.language-picker-option-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
@media (max-width: 640px) {
    .language-picker-trigger { width: 38px; height: 38px; }
    .language-picker-menu { width: min(320px, calc(100vw - 16px)); padding: 10px; }
    .language-picker-options { gap: 3px; }
    .language-picker-menu .language-picker-option { min-height: 38px; gap: 6px; padding-inline: 7px; }
}
@media (prefers-reduced-motion: reduce) {
    .language-picker-trigger { transition: none; }
}

/* Keep language choices above header scrims and open menus. */
.language-picker[open] { z-index: 90; }


/* Keep the full locale list visible on small screens without header clipping. */
@media (max-width:760px) {
    .language-picker[open] { position:static; z-index:10000; }
    .language-picker-menu { position:fixed; top:68px; right:8px; left:auto; width:min(340px,calc(100vw - 16px)); max-height:calc(100dvh - 80px); overflow-y:auto; overscroll-behavior:contain; z-index:10001; }
}
@media (max-width:380px) {
    .language-picker-menu { top:66px; right:8px; width:min(320px,calc(100vw - 16px)); }
}


/* On desktop, open the locale panel beside the globe instead of over the search field. */
@media (min-width: 1201px) {
    .language-picker-menu {
        top: calc(100% + 6px);
        right: auto;
        left: calc(100% + 8px);
    }
}
@media (min-width: 761px) and (max-width: 1200px) {
    .language-picker-menu {
        position: fixed;
        top: 80px;
        right: 12px;
        left: auto;
    }
}


/* Keep the desktop locale menu directly below its globe trigger. */
@media (min-width:1201px) {
    .language-picker-menu {
        left: 0;
        right: auto;
    }
}
