/* Comparix Pro — Language switcher (Milestone 14) */

.cx-lang-switcher {
    display: inline-flex;
    align-items: center;
    font-family: var(--cx-font, system-ui, sans-serif);
    font-size: 13px;
}

.cx-lang-switcher--header {
    margin-left: 8px;
}

.cx-lang-switcher--mobile {
    position: fixed;
    top: calc(12px + env(safe-area-inset-top, 0px));
    right: 12px;
    z-index: 9997;
    background: var(--cx-card, #fff);
    border: 1px solid var(--cx-border, #e2e8f0);
    border-radius: 999px;
    padding: 4px 8px;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.1);
}

.cx-lang-switcher--footer {
    position: fixed;
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    left: 16px;
    z-index: 9997;
    background: var(--cx-card, #fff);
    border: 1px solid var(--cx-border, #e2e8f0);
    border-radius: 8px;
    padding: 6px 10px;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.1);
}

.cx-lang-select {
    border: 1px solid var(--cx-border, #e2e8f0);
    border-radius: 6px;
    padding: 6px 28px 6px 10px;
    background: var(--cx-card, #fff);
    color: var(--cx-text, #0f172a);
    font: inherit;
    cursor: pointer;
    min-height: 36px;
}

.cx-lang-select:focus-visible {
    outline: 2px solid var(--cx-primary, #6366f1);
    outline-offset: 2px;
}

.cx-lang-list {
    display: flex;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.cx-lang-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border-radius: 6px;
    text-decoration: none;
    color: var(--cx-text, #0f172a);
    border: 1px solid transparent;
    min-height: 36px;
}

.cx-lang-link:hover,
.cx-lang-link:focus-visible {
    background: var(--cx-g100, #f1f5f9);
    outline: none;
}

.cx-lang-link.is-active {
    background: var(--cx-primary, #6366f1);
    color: #fff;
    border-color: var(--cx-primary, #6366f1);
}

.cx-lang-flag {
    font-size: 16px;
    line-height: 1;
}

@media (min-width: 769px) {
    .cx-lang-switcher--mobile {
        display: none;
    }
}

@media (max-width: 768px) {
    .cx-lang-switcher--header {
        display: none;
    }
}

[dir="rtl"] .cx-lang-switcher--header {
    margin-left: 0;
    margin-right: 8px;
}

[dir="rtl"] .cx-lang-switcher--mobile {
    right: auto;
    left: 12px;
}

[dir="rtl"] .cx-lang-switcher--footer {
    left: auto;
    right: 16px;
}
