.lang-switcher {
    position: relative;
    width: fit-content;
    flex: 0 0 auto;
    z-index: 30;
}

.lang-switcher__menu[hidden] {
    display: none;
}

.lang-switcher.is-open .lang-switcher__menu {
    display: block;
}

header nav {
    display: flex;
    align-items: center;
    gap: 10px;
}

.lang-switcher__toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: 'Albert Sans', sans-serif;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
}

.lang-switcher__flag {
    display: block;
    width: 24px;
    height: 16px;
    flex: 0 0 24px;
    object-fit: cover;
    border-radius: 2px;
}

.lang-switcher__caret {
    border: 4px solid transparent;
    border-top-color: currentColor;
    margin-top: 3px;
}

.lang-switcher__menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 150px;
    margin: 0;
    padding: 4px 0;
    list-style: none;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    text-align: left;
    max-height: min(70vh, 360px);
    overflow-y: auto;
}

.lang-switcher__item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 14px;
    font-family: 'Albert Sans', sans-serif;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

@media (min-width: 769px) {
    header nav {
        gap: 16px;
        min-width: 0;
    }

    .desktop-nav-list {
        flex-wrap: wrap;
        justify-content: flex-end;
        row-gap: 8px;
        min-width: 0;
    }

    .desktop-nav-list a {
        line-height: 1.2;
        overflow-wrap: anywhere;
    }

    .lang-switcher__toggle {
        font-size: 14px;
        color: #222;
        background: #fff;
        border: 1px solid #d8d8d8;
    }

    .lang-switcher__menu {
        background: #fff;
        border: 1px solid #e5e5e5;
    }

    .lang-switcher__item {
        color: #222;
    }

    .lang-switcher__item:hover,
    .lang-switcher__item.is-active {
        background: #00188f;
        color: #fff;
    }
}

@media (min-width: 769px) and (max-width: 1120px) {
    .desktop-nav-list {
        gap: 10px;
    }

    .desktop-nav-list a {
        font-size: 13px;
    }
}

@media (max-width: 768px) {
    header nav {
        gap: 8px;
    }

    .lang-switcher__toggle {
        font-size: 12px;
        color: #222;
        background: transparent;
        border: 1px solid #222;
        padding: 5px 8px;
    }

    .lang-switcher__menu {
        background: #010045;
        border: 1px solid rgba(255, 255, 255, 0.12);
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
    }

    .lang-switcher__item {
        color: #fff;
    }

    .lang-switcher__item:hover,
    .lang-switcher__item.is-active {
        background: rgba(255, 204, 0, 0.15);
        color: #ffcc00;
    }
}
