theme-locale-picker {
  display: contents;
}

theme-locale-picker .theme-locale-picker__inner {
  display: inline-flex;
  gap: 28px;
  align-items: center;
}

.header-locale-toggle {
  display: none;
}

@media (min-width: 960px) {
  .header__container-top-wrap[data-fit-locale] .header__logo {
    min-width: 0;
  }

  .header__container-top-wrap[data-fit-locale] .header-nav__menu-item {
    margin-inline: var(--locale-nav-margin, 16px);
  }

  .header-action-bar.right > theme-locale-picker[data-compact] {
    position: relative;
    display: block;
  }

  theme-locale-picker[data-compact] > .header-locale-toggle {
    display: grid;
    place-items: center;
    width: 28px;
    height: 32px;
    padding: 0;
    border: 0;
    background: transparent;
    color: inherit;
    cursor: pointer;
  }

  .header-locale-toggle .icon {
    width: 21px;
    height: 21px;
  }

  theme-locale-picker[data-compact] > .header-locale-toggle[aria-expanded="false"] + form {
    display: none;
  }

  .header-action-bar.right > theme-locale-picker[data-compact] > form {
    position: absolute;
    inset-block-start: calc(100% + 8px);
    inset-inline-end: 0;
    width: 254px;
    max-height: min(65vh, 420px);
    margin: 0;
    padding: 12px;
    overflow-y: auto;
    overscroll-behavior: contain;
    color: rgb(var(--color-text));
    background: rgb(var(--color-background));
    border: 1px solid rgba(var(--color-text), .15);
    border-radius: 8px;
    box-shadow: 0 5px 20px rgb(0 0 0 / 12%);
  }

  theme-locale-picker[data-compact] .theme-locale-picker__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 6px;
  }

  theme-locale-picker[data-compact] theme-dropdown-menu {
    display: block;
  }

  theme-locale-picker[data-compact] .dropdown-menu__label {
    display: flex;
    justify-content: space-between;
    padding: 8px;
  }

  theme-locale-picker[data-compact] .dropdown-menu__label-text {
    color: inherit;
    white-space: normal;
    overflow-wrap: anywhere;
  }

  theme-locale-picker[data-compact] .dropdown-menu__list {
    position: static;
    width: 100%;
    max-height: 200px;
    box-shadow: none;
  }

  theme-locale-picker[data-compact] .dropdown-menu__list-item {
    white-space: normal;
    word-break: normal;
    overflow-wrap: anywhere;
  }

  theme-locale-picker[data-compact] .dropdown-menu__trigger {
    position: absolute;
    inset: 0 auto auto 0;
    width: 1px;
    height: 1px;
    clip-path: inset(50%);
    visibility: visible;
  }

  theme-locale-picker[data-compact] label:has(.dropdown-menu__trigger:focus-visible) {
    outline: 2px solid currentColor;
    outline-offset: -2px;
  }
}
