/* Bagoes Labs Language Switcher V4 */

.header-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
}

.language-switcher {
    position: relative;
    display: inline-flex;
    flex: 0 0 auto;
}

.language-button {
    width: auto;
    min-width: 78px;
    height: 42px;

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;

    padding: 0 12px;

    border: 1px solid var(--border);
    border-radius: 12px;

    color: var(--navy);
    background: var(--surface);

    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;

    appearance: none;
    cursor: pointer;
}

.language-button:hover,
.language-button:focus-visible,
.language-button[aria-expanded="true"] {
    border-color: var(--blue);
    background: var(--blue-soft);
    outline: none;
}

.language-caret {
    display: inline-block;
    color: var(--muted);
    font-size: 9px;
    transition: transform 160ms ease;
}

.language-button[aria-expanded="true"] .language-caret {
    transform: rotate(180deg);
}

.language-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 2000;

    width: 224px;
    min-width: 224px;

    display: flex;
    flex-direction: column;
    gap: 4px;

    padding: 8px;

    border: 1px solid var(--border);
    border-radius: 14px;

    background: var(--surface);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.22);
}

.language-menu[hidden] {
    display: none !important;
}

.language-option {
    width: 100%;
    min-height: 44px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;

    margin: 0;
    padding: 10px 12px;

    border: 0;
    border-radius: 9px;

    color: var(--text);
    background: transparent;

    font-size: 13px;
    font-weight: 700;
    text-align: left;
    white-space: nowrap;

    appearance: none;
    cursor: pointer;
}

.language-option:hover,
.language-option:focus-visible {
    color: var(--blue);
    background: var(--blue-soft);
    outline: none;
}

.language-option[aria-current="true"] {
    color: var(--blue);
    background: var(--blue-soft);
}

.language-option[aria-current="true"]::before {
    content: "✓";
    color: var(--blue);
    font-weight: 900;
}

.language-option-code {
    margin-left: auto;
    color: var(--muted);
    font-size: 10px;
    font-weight: 850;
    letter-spacing: 0.08em;
}

@media (max-width: 720px) {
    .header-actions {
        gap: 7px;
    }

    .language-button {
        min-width: 68px;
        padding: 0 9px;
    }

    .language-menu {
        right: -48px;
        width: min(224px, calc(100vw - 28px));
        min-width: 0;
    }
}
