.lang-switcher,
.lang-switcher__current {
    color: var(--wp--preset--color--accent-1);
}

.lang-switcher__item a {
    color: var(--wp--preset--color--accent-2);
}

@media (min-width: 1024px) {
    .lang-switcher__selector:hover .lang-switcher__current {
        color: var(--wp--preset--color--accent-2);
    }
}

.lang-switcher {
    margin-left: 0;
    width: auto;
}

/* Drawer instance only — the header instance must stay vertically centered
   in its flex row (the WP layout reset gives it margin 0 there) */
.lang-switcher--drawer-only {
    margin-block-start: 20px !important;
}

.lang-switcher__current {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: start;
    height: 24px;
    line-height: 100%;
    text-transform: uppercase;
    vertical-align: middle;
    column-gap: 8px;
    position: relative;
    z-index: 1;
    font-weight: 700;
    font-size: 0.875rem;
    .arrow {
        transition: transform 0.3s ease;
    }
    .lang-flag {
        width: 24px;
        height: 24px;
        border-radius: 50%;
        object-fit: cover;
    }
    span {
        display: flex;
        height: 100%;
        align-items: center;
    }
}

.lang-switcher__dropdown {
    visibility: hidden;
    transition: all 0.3s ease;
    opacity: 0;
    display: none;
    position: absolute;
    top: 80%;
    left: 0;
    padding: 5px 10px 8px;
    width: 100%;
    text-align: center;
    text-transform: uppercase;
    transform: translateY(0px);
    list-style: none;
    margin: 0;
    z-index: 0;
    li {
       a {
            display: flex;
            align-items: center;
            column-gap: 8px;
            transition: color .25s ease-in;
            font-weight: 700;
            font-size: 0.875rem;
            &:hover {
                color: var(--wp--preset--color--base);
            }
            .lang-flag {
                width: 24px;
                height: 24px;
                border-radius: 50%;
                object-fit: cover;
            }
       }
    }
}

.lang-switcher__selector {
    padding: 5px 10px 5px 0px;
    position: relative;
    @media (min-width: 1024px) {
        &:hover {
            .lang-switcher__dropdown {
                visibility: visible;
                opacity: 1;
                display: block;
                padding: 5px 10px 5px 0px;
                display: flex;
                flex-direction: column;
                margin-top: 5px;
                row-gap: 5px;
            }
            .lang-switcher__current {
                .arrow {
                    transform: rotate(180deg);
                }
            }
        }
    }
}

/* Mobile + tablet: open via .is-open (script), not :hover — avoids sticky hover and allows tap trigger to close */
@media (max-width: 1023px) {
    .lang-switcher__selector.is-open .lang-switcher__dropdown {
        visibility: visible;
        opacity: 1;
        display: flex;
        flex-direction: column;
        padding: 5px 10px 5px 0px;
        margin-top: 5px;
        row-gap: 5px;
    }

    .lang-switcher__selector.is-open .lang-switcher__current {
        color: var(--wp--preset--color--accent-2);
    }

    .lang-switcher__selector.is-open .lang-switcher__current .arrow {
        transform: rotate(180deg);
    }
}
