.hb-locale-switcher {
    position: relative;
    z-index: 80;
    justify-self: end;
    color: #0d2035;
    font-family: Inter, Arial, sans-serif;
}

.hb-locale-trigger {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 12px;
    border: 1px solid transparent;
    border-radius: 22px;
    color: #0d2035;
    background: transparent;
    cursor: pointer;
    white-space: nowrap;
    font: 700 12px/1 Inter, Arial, sans-serif;
    transition: background .18s ease, border-color .18s ease;
}

.hb-locale-trigger:hover,
.hb-locale-trigger[aria-expanded="true"] {
    border-color: #d8e1e8;
    background: #f4f7f9;
}

.hb-locale-trigger svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.hb-locale-trigger .hb-locale-chevron {
    width: 14px;
    transition: transform .18s ease;
}

.hb-locale-trigger[aria-expanded="true"] .hb-locale-chevron {
    transform: rotate(180deg);
}

.hb-locale-popover {
    position: absolute;
    top: calc(100% + 12px);
    right: 0;
    width: min(520px, calc(100vw - 28px));
    padding: 28px 20px 22px;
    border: 1px solid #e0e5ea;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 22px 60px rgba(15, 31, 47, .2);
}

.hb-locale-popover[hidden] {
    display: none !important;
}

.hb-locale-popover::before {
    content: '';
    position: absolute;
    top: -7px;
    right: 42px;
    width: 13px;
    height: 13px;
    border-top: 1px solid #e0e5ea;
    border-left: 1px solid #e0e5ea;
    background: #fff;
    transform: rotate(45deg);
}

.hb-locale-group + .hb-locale-group {
    margin-top: 18px;
}

.hb-locale-group h3 {
    margin: 0 0 12px;
    color: #232b34;
    font: 700 15px/1.2 Inter, Arial, sans-serif;
}

.hb-locale-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px 12px;
}

.hb-locale-option {
    min-width: 0;
    min-height: 34px;
    padding: 6px 8px;
    overflow: hidden;
    border: 1px solid #d5dce4;
    border-radius: 18px;
    color: #252c34;
    background: #f4f6f8;
    cursor: pointer;
    text-overflow: ellipsis;
    white-space: nowrap;
    font: 500 12px/1 Inter, Arial, sans-serif;
    transition: color .15s ease, background .15s ease, border-color .15s ease;
}

.hb-locale-option:hover {
    border-color: #8eb8f8;
}

.hb-locale-option.is-selected {
    border-color: #3d82ee;
    color: #fff;
    background: #3d82ee;
}

.hb-locale-confirm {
    min-width: 122px;
    min-height: 36px;
    display: block;
    margin: 28px auto 0;
    padding: 8px 24px;
    border: 0;
    border-radius: 20px;
    color: #fff;
    background: #3d82ee;
    cursor: pointer;
    font: 600 13px/1 Inter, Arial, sans-serif;
    transition: background .15s ease, transform .15s ease;
}

.hb-locale-confirm:hover {
    background: #216de1;
    transform: translateY(-1px);
}

.hb-locale-trigger:focus-visible,
.hb-locale-option:focus-visible,
.hb-locale-confirm:focus-visible {
    outline: 3px solid rgba(61, 130, 238, .35);
    outline-offset: 2px;
}

.header-right .hb-locale-switcher {
    flex: 0 0 auto;
}

.header-right .hb-locale-trigger {
    min-height: 40px;
}

@media (max-width: 860px) {
    .hb-locale-trigger {
        padding-inline: 9px;
    }

    .hb-locale-popover {
        right: -6px;
    }
}

@media (max-width: 560px) {
    .hb-locale-trigger {
        gap: 5px;
        padding-inline: 7px;
        font-size: 11px;
    }

    .hb-locale-trigger .hb-locale-globe {
        width: 18px;
    }

    .hb-locale-popover {
        position: fixed;
        top: 104px;
        right: 12px;
        left: 12px;
        width: auto;
        max-height: calc(100vh - 116px);
        overflow-y: auto;
        padding: 22px 16px 20px;
    }

    .hb-locale-popover::before {
        display: none;
    }

    .hb-locale-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 9px;
    }

    .hb-locale-option {
        font-size: 11px;
    }
}
