.language-switcher {
    position: relative;
    display: inline-flex;
    align-items: center;
    z-index: 1002;
}

.language-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    height: auto;
    padding: 8px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #f1f5f9;
    font-size: 18px;
    cursor: pointer;
    transition: color .2s ease, transform .2s ease;
}

.language-trigger:hover,
.language-switcher.is-open .language-trigger {
    background: transparent;
    color: #aebdff;
    transform: translateY(-1px);
}

.language-trigger:focus-visible,
.language-dropdown button:focus-visible {
    outline: 2px solid #91aaff;
    outline-offset: 3px;
}

.language-dropdown {
    position: absolute;
    top: calc(100% + 12px);
    right: -150px;
    display: none;
    grid-template-columns: repeat(3, minmax(125px, 1fr));
    gap: 4px;
    width: min(520px, calc(100vw - 32px));
    max-height: min(440px, calc(100vh - 120px));
    padding: 12px;
    overflow-y: auto;
    border: 1px solid rgba(183, 193, 228, .2);
    border-radius: 16px;
    background: #111a32;
    box-shadow: 0 18px 48px rgba(0, 0, 0, .38);
}

.language-switcher.is-open .language-dropdown {
    display: grid;
}

.language-dropdown button {
    min-height: 42px;
    padding: 8px 10px;
    border: 1px solid transparent;
    border-radius: 9px;
    background: transparent;
    color: #f1f5f9;
    font: inherit;
    font-size: 14px;
    text-align: left;
    white-space: nowrap;
    cursor: pointer;
    transition: background .18s ease, border-color .18s ease, color .18s ease;
}

.language-dropdown button:hover,
.language-dropdown button[aria-pressed="true"] {
    border-color: rgba(120, 149, 255, .32);
    background: rgba(120, 149, 255, .12);
    color: #aebdff;
}

.mobile-login-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
}

.mobile-actions .language-dropdown {
    right: 50%;
    transform: translateX(50%);
    z-index: 1005;
}

@media (max-width: 992px) {
    .navbar-actions {
        gap: 20px;
    }

    .language-dropdown {
        right: -180px;
    }
}

@media (max-width: 768px) {
    .mobile-actions .language-dropdown {
        top: auto;
        bottom: calc(100% + 12px);
        right: 50%;
        grid-template-columns: repeat(2, minmax(110px, 1fr));
        width: min(340px, calc(85vw - 32px));
    }
}
