.lft-language-switcher {
    display: inline-block;
    font: inherit;
    line-height: 1.35;
}

.lft-language-switcher__details {
    position: relative;
}

.lft-language-switcher__current {
    display: inline-flex;
    min-height: 38px;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border: 1px solid #d8dde5;
    border-radius: 5px;
    color: #242a32;
    background: #fff;
    cursor: pointer;
    list-style: none;
}

.lft-language-switcher__current::-webkit-details-marker {
    display: none;
}

.lft-language-switcher__current::after {
    width: 6px;
    height: 6px;
    margin: -3px 2px 0 4px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    content: '';
    transform: rotate(45deg);
}

.lft-language-switcher__details[open] .lft-language-switcher__current::after {
    margin-top: 3px;
    transform: rotate(225deg);
}

.lft-language-switcher__current:focus-visible,
.lft-language-switcher .trp-language-switcher__item:focus-visible {
    outline: 2px solid #2856c7;
    outline-offset: 2px;
}

.lft-language-switcher__options {
    position: absolute;
    z-index: 1000;
    top: calc(100% + 4px);
    right: 0;
    width: max-content;
    min-width: 190px;
    max-width: min(300px, 90vw);
    max-height: min(400px, 60vh);
    overflow-y: auto;
    padding: 4px;
    border: 1px solid #d8dde5;
    border-radius: 5px;
    background: #fff;
    box-shadow: 0 8px 24px rgb(26 36 52 / 14%);
}

.lft-language-switcher .trp-language-switcher__item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px;
    border-radius: 3px;
    color: #242a32;
    font: inherit;
    text-decoration: none;
    white-space: nowrap;
}

.lft-language-switcher .trp-language-switcher__item:hover,
.lft-language-switcher .trp-language-switcher__item.is-current {
    background: #eef3fd;
    color: #204ab4;
}

.lft-language-switcher__flag {
    display: block;
    width: 22px;
    height: 17px;
    flex: none;
    border: 1px solid #d8dde5;
    border-radius: 2px;
    object-fit: cover;
}

@media (max-width: 768px) {
    /* Keep the current language accessible while showing only its flag. */
    .lft-language-switcher__current > .lft-language-switcher__flag + span {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        clip-path: inset(50%);
        white-space: nowrap;
        border: 0;
    }
}
