header {
    position: relative;
    z-index: 50;
    overflow: visible !important;
}

header:before,
header:hover:before {
    display: none !important;
    content: none !important;
}

header .flex-c .flex-b.header-lang-switcher {
    flex-grow: 0;
    text-align: right;
    position: relative;
    z-index: 100;
}

[dir="rtl"] header .flex-c .flex-b.header-lang-switcher {
    text-align: left;
}

.lang-switcher {
    position: relative;
    display: inline-block;
    font-size: 13px;
    text-align: left;
}

[dir="rtl"] .lang-switcher {
    text-align: right;
}

.lang-switcher__toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    border: 1px solid rgba(0, 107, 239, 0.25);
    border-radius: 999px;
    background: linear-gradient(180deg, #ffffff 0%, #f3f8fb 100%);
    color: #1d5187;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(29, 81, 135, 0.08);
    transition: border-color .2s, box-shadow .2s;
    font: inherit;
    line-height: 1.2;
}

.lang-switcher__toggle:hover,
.lang-switcher.is-open .lang-switcher__toggle {
    border-color: #006bef;
    box-shadow: 0 4px 14px rgba(0, 107, 239, 0.18);
}

.lang-switcher__badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 22px;
    padding: 0 6px;
    border-radius: 6px;
    background: #006bef;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .04em;
}

.lang-switcher__current {
    font-weight: 600;
    max-width: 120px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lang-switcher__caret {
    font-size: 11px;
    opacity: .7;
    transition: transform .2s;
}

.lang-switcher.is-open .lang-switcher__caret {
    transform: rotate(180deg);
}

.lang-switcher__menu {
    position: fixed;
    z-index: 10000;
    min-width: 190px;
    margin: 0;
    padding: 6px;
    list-style: none;
    border: 1px solid #dbe7f2;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 12px 32px rgba(29, 81, 135, 0.22);
}

.lang-switcher__menu li {
    margin: 0;
    padding: 0;
}

.lang-switcher__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 8px;
    color: #234;
    text-decoration: none !important;
    transition: background .15s, color .15s;
}

.lang-switcher__item:hover {
    background: #eef5ff;
    color: #006bef;
}

.lang-switcher__item.is-active {
    background: #e8f2ff;
    color: #006bef;
    font-weight: 600;
}

.lang-switcher__label {
    flex: 1;
}

.lang-switcher__check {
    color: #006bef;
    font-size: 12px;
}

@media screen and (max-width: 768px) {
    .lang-switcher__current {
        max-width: 88px;
    }
}

/* style.css скрывает header .flex-b + .flex-b на экранах ≤600px */
@media screen and (max-width: 600px) {
    header .flex-c {
        flex-wrap: wrap;
        justify-content: center;
    }

    header .flex-c .flex-b.header-lang-switcher {
        display: block !important;
        flex-basis: 100%;
        flex-grow: 0;
        text-align: center;
        margin: 0 0 8px;
        order: 2;
    }

    [dir="rtl"] header .flex-c .flex-b.header-lang-switcher {
        text-align: center;
    }

    .lang-switcher__toggle {
        margin: 0 auto;
    }
}
