.mf-language-switcher {
    position: relative;
}

.mf-language-switcher__button {
    display: flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    border: none;
    outline: none;
    cursor: pointer;
    padding: 0;
    font-size: 14px;
    line-height: 24px;
    color: #333333;
}

.mf-language-switcher__button:focus-visible {
    outline: 2px solid #3A307F;
    outline-offset: 4px;
    border-radius: 2px;
}

.mf-language-switcher__chevron {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

.mf-language-switcher--open .mf-language-switcher__chevron {
    transform: rotate(180deg);
}

.mf-language-switcher__panel {
    display: none !important;
    flex-direction: column;
    list-style: none;
    margin: 0;
    padding: 0;
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    min-width: 160px;
    background: #ffffff;
    border: 1px solid #E3E3E3;
    border-radius: 6px;
    box-shadow: 0 3px 6px 0 rgba(0, 0, 0, 0.05), 0 10px 10px 0 rgba(0, 0, 0, 0.05),
        0 23px 14px 0 rgba(0, 0, 0, 0.03);
    z-index: 10;
    overflow: hidden;
}

.mf-language-switcher--open .mf-language-switcher__panel {
    display: flex !important;
}

.mf-language-switcher__item {
    display: block;
    padding: 12px 16px;
    font-size: 14px;
    line-height: 20px;
    color: #333333;
    text-decoration: none;
    white-space: nowrap;
}

.mf-language-switcher__item:hover {
    background-color: #f7f7fc;
}

.mf-language-switcher__item--active {
    background-color: #EBE8F9;
    color: #3A307F;
    font-weight: 600;
    position: relative;
}

.mf-language-switcher__item--active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background-color: #3A307F;
}

body.rtl .mf-language-switcher__panel {
    right: auto;
    left: 0;
}

body.rtl .mf-language-switcher__item--active::before {
    left: auto;
    right: 0;
}

/* Footer instance opens upward, since it sits near the bottom of the page. */
.footer-language-switcher.mf-language-switcher .mf-language-switcher__panel {
    top: auto;
    bottom: calc(100% + 10px);
}

/* Mobile menu instance is laid out inline, full width, opening downward. */
.mobile-language-switcher .mf-language-switcher__panel {
    top: calc(100% + 10px);
    bottom: auto;
    left: 0;
    right: auto;
    min-width: 100%;
}
