.block-langswitcher {
    margin-inline-start: 15px;
}
.block-langswitcher > a.lang-switcher-current {
    display: flex;
    align-items: center;
    gap: 6px;
}
/*
 * `.lang-flag` doubles up with class "icon" (for the mobile header's
 * generic `.control a .icon` font-size/line-height treatment), which also
 * hands it an unwanted `padding: 0 5px` there - it shrinks the visible
 * circle's content box and pushes the image off-center. Reset it here
 * unconditionally so the flag owns its full 24x24 box everywhere.
 */
.block-langswitcher .lang-flag {
    display: inline-block;
    padding: 0 !important;
    line-height: 0;
    border-radius: 50%;
    overflow: hidden;
    width: 24px;
    height: 24px;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}
/*
 * A theme-wide reset (`img{max-width:100%;height:auto}`) fights a percentage
 * width/height here in a way that leaves the image shrunk and off-center
 * inside its circle - pixel values sidestep that entirely.
 */
.block-langswitcher .lang-flag img {
    display: block;
    width: 24px !important;
    height: 24px !important;
    max-width: none !important;
    object-fit: cover;
}
.block-langswitcher .lang-switcher-menu .lang-flag img {
    width: 16px !important;
    height: 16px !important;
}
.block-langswitcher > a.lang-switcher-current .text {
    font-size: 11px;
    letter-spacing: 0.5px;
}
.block-langswitcher .lang-switcher-menu {
    min-width: 150px;
}
.block-langswitcher .lang-switcher-menu .menu-item > a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 20px;
}
.block-langswitcher .lang-switcher-menu .menu-item.current-lang > a {
    color: var(--main-color-2, #c99947);
    font-weight: 600;
}
.block-langswitcher .lang-switcher-menu .lang-flag {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
}

/*
 * Below 1200px .header-right only reserves width for two icons (search +
 * account) - see header-style-01.css. The switcher is a 3rd icon added
 * later, so without this it doesn't fit and float-wraps onto its own row,
 * appearing detached from the header. Reserve room for it and drop its
 * text label (same treatment the account icon already gets) so it fits
 * back on one line.
 */
@media (max-width: 1199px) {
    .header.style-01 .header-top .header-right:has(.block-langswitcher) .block-search {
        max-width: calc(100% - 80px);
    }
    .block-langswitcher {
        margin-inline-start: 0;
        width: 40px;
        text-align: right;
    }
    .block-langswitcher > a.lang-switcher-current {
        display: inline-flex;
        justify-content: flex-end;
    }
    .block-langswitcher > a.lang-switcher-current .text {
        display: none;
    }
}

/*
 * The real mobile header (templates/mobile/mobile-style-01.php, used when
 * Mobile_Detect sees an actual mobile/tablet user agent - not just a narrow
 * viewport) reuses the "woo-user-link" icon class, but the switcher's own
 * wrapper still carries "block-userlink", which inherits a global
 * `padding: 13px 0` meant for the desktop header (see style.css). That
 * inflates it to 50px against the other .control icons' 30px, pushing the
 * flag visibly out of vertical alignment with them.
 */
.header-mobile .block-langswitcher > a.lang-switcher-current {
    padding: 3px 0;
}

/*
 * `.header-mobile .control a > *:not(.icon)` (style-mobile.css) hides any
 * non-icon child of a `.control` link - meant to strip text labels off the
 * cart/account icons. It also matches inside the switcher's open dropdown,
 * since that markup lives inside `.control` too, blanking out the flag and
 * language name for every item in the list. Force them back.
 */
.header-mobile .lang-switcher-menu a .lang-flag {
    display: inline-block !important;
}
.header-mobile .lang-switcher-menu a .lang-name {
    display: inline !important;
}
