/*
 * ===== launge — скрытие служебной плашки Google Translate =====
 * Перевод идёт через прокси-домен Google (*.translate.goog), а не через
 * встроенный TranslateElement-виджет — поэтому #google_translate_element и
 * .goog-te-combo здесь больше не создаются и специфичный для них CSS не
 * нужен. Но сам прокси-домен всё равно добавляет свою баннер-плашку
 * "Translated by Google" сверху зеркалируемой страницы — эти селекторы её
 * скрывают, чтобы не портить вёрстку хедера.
 */
.goog-te-banner-frame,
.goog-te-banner-frame.skiptranslate,
iframe.goog-te-banner-frame,
body > iframe.skiptranslate,
html > iframe.skiptranslate,
.VIpgJd-ZVi9od-ORHb-OEVmcd,
.VIpgJd-ZVi9od-aZ2wEe-wOHMyf,
.VIpgJd-ZVi9od-aZ2wEe {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    max-height: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important
}

html,
html.translated-ltr,
html.translated-rtl,
body {
    top: 0 !important;
    margin-top: 0 !important;
    position: static !important;
    min-height: 100vh !important
}

.goog-tooltip,
.goog-tooltip:hover,
#goog-gt-tt,
.goog-te-balloon-frame,
.goog-te-spinner-pos,
.goog-te-spinner-animation {
    display: none !important
}

.goog-text-highlight {
    background-color: transparent !important;
    box-shadow: none !important;
    -webkit-box-shadow: none !important;
    border: none !important
}

font[style*="background-color"] {
    background-color: transparent !important
}

/* ===== launge — публичный виджет смены языка ===== */
.launge-widget {
    position: relative;
    display: inline-block;
    font-family: inherit;
    color: #fff;
    -webkit-user-select: none;
    user-select: none
}

.launge-widget * {
    box-sizing: border-box
}

/* Кнопка-триггер */
.launge-widget__toggle {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .06);
    padding: 7px 12px 7px 9px;
    cursor: pointer;
    color: inherit;
    border-radius: 999px;
    transition: background .18s ease, border-color .18s ease, transform .18s ease, box-shadow .18s ease;
    box-shadow: 0 1px 0 rgba(255, 255, 255, .03) inset;
}

.launge-widget__toggle:hover {
    background: rgba(255, 255, 255, .08);
    border-color: rgba(255, 255, 255, .12);
    transform: translateY(-1px);
}

.launge-widget.is-open .launge-widget__toggle {
    background: rgba(255, 255, 255, .1);
    border-color: rgba(255, 255, 255, .14);
}

.launge-widget.is-loading .launge-widget__toggle {
    pointer-events: none;
    opacity: .7;
}

.launge-widget.is-loading .launge-widget__toggle::after {
    content: '';
    width: 12px;
    height: 12px;
    border: 2px solid rgba(255, 255, 255, .2);
    border-top-color: #fff;
    border-radius: 50%;
    animation: laungeSpin .7s linear infinite;
    margin-left: 4px;
}

@keyframes laungeSpin {
    to {
        transform: rotate(360deg)
    }
}

/* Текущий флаг в кнопке */
.launge-widget__flag {
    width: 22px;
    height: 16px;
    border-radius: 3px;
    object-fit: cover;
    display: block;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .1), 0 1px 2px rgba(0, 0, 0, .25);
}

.launge-widget__flag--text {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 16px;
    background: linear-gradient(180deg, #3a3f4f, #2b3042);
    border-radius: 3px;
    font-size: 9px;
    font-weight: 800;
    color: #cbd5e1;
    letter-spacing: .5px;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .08);
}

.launge-widget__current-name {
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: .2px;
}

.launge-widget__chev {
    width: 10px;
    height: 7px;
    color: currentColor;
    opacity: .6;
    transition: transform .25s ease, opacity .15s ease;
}

.launge-widget__toggle:hover .launge-widget__chev {
    opacity: .95
}

.launge-widget.is-open .launge-widget__chev {
    transform: rotate(180deg);
    opacity: 1
}

/* Меню */
.launge-widget__menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 250px;
    background: linear-gradient(165deg, #30313f 0%, #21222d 100%);
    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: 18px;
    box-shadow:
        0 28px 56px -16px rgba(0, 0, 0, .65),
        0 0 0 1px rgba(255, 255, 255, .03),
        0 1px 0 rgba(255, 255, 255, .05) inset;
    padding: 8px;
    display: none;
    z-index: 1000;
    overflow: hidden;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* Закреплённый сверху язык по умолчанию */
.launge-widget__pinned {
    padding: 2px 2px 0;
}

.launge-widget__item--pinned {
    background: rgba(99, 102, 241, .08);
    border: 1px solid rgba(99, 102, 241, .18);
}

.launge-widget__item--pinned:hover {
    background: rgba(99, 102, 241, .14);
    transform: none;
}

.launge-widget__item--pinned .launge-widget__item-name::after {
    content: 'по умолчанию';
    display: block;
    margin-top: 1px;
    font-size: 10px;
    font-weight: 500;
    color: #9599ad;
    letter-spacing: .02em;
}

.launge-widget__divider {
    height: 1px;
    margin: 8px 4px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .1) 20%, rgba(255, 255, 255, .1) 80%, transparent);
}

.launge-widget__list {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.launge-widget__menu::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 18px;
    width: 12px;
    height: 12px;
    background: linear-gradient(135deg, #2b2c39, #2b2c39);
    border-left: 1px solid rgba(255, 255, 255, .08);
    border-top: 1px solid rgba(255, 255, 255, .08);
    transform: rotate(45deg);
    border-radius: 2px;
    pointer-events: none;
}

.launge-widget.is-open .launge-widget__menu {
    display: block;
    animation: laungeFade .18s cubic-bezier(.21, 1.02, .73, 1) both;
}

@keyframes laungeFade {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(.98)
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1)
    }
}

/* Элемент списка */
.launge-widget__item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    border-radius: 11px;
    text-decoration: none;
    color: #d8dce8;
    font-size: 14px;
    line-height: 1.2;
    cursor: pointer;
    transition: background .15s ease, color .15s ease, transform .15s ease;
    position: relative;
}

.launge-widget__item:hover {
    background: rgba(255, 255, 255, .07);
    color: #fff;
    text-decoration: none;
    transform: translateX(2px);
}

.launge-widget__item.is-active {
    background: linear-gradient(90deg, rgba(99, 102, 241, .22), rgba(99, 102, 241, .08));
    color: #fff;
    font-weight: 600;
}

.launge-widget__item.is-active::after {
    content: '✓';
    margin-left: auto;
    color: #a5b4fc;
    font-size: 13px;
    font-weight: 700;
}

.launge-widget__item-flag {
    width: 24px;
    height: 17px;
    border-radius: 3px;
    object-fit: cover;
    flex-shrink: 0;
    display: block;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, .1), 0 1px 2px rgba(0, 0, 0, .25);
}

.launge-widget__item-name {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* На мобильных виджет смены языка скрываем полностью */
@media (max-width: 767px) {
    .launge-widget,
    .launge-nav-item {
        display: none !important;
    }
}
