.locale-switcher {
  position: relative;
  flex: none;
  font-family: inherit;
  font-size: 0.875rem;
}

body > .locale-switcher {
  display: inline-block;
  margin: 0.75rem 1rem;
}

.locale-switcher details {
  position: relative;
  width: max-content;
}

.locale-switcher summary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  padding-inline: 0.65rem;
  border: 1px solid color-mix(in srgb, currentColor 35%, transparent);
  border-radius: 999px;
  cursor: pointer;
  list-style: none;
  font-weight: 650;
  white-space: nowrap;
}

.locale-switcher summary::-webkit-details-marker { display: none; }

.locale-switcher summary::after {
  content: '';
  width: 0.38rem;
  height: 0.38rem;
  margin-block-start: -0.2rem;
  border-inline-end: 1.5px solid;
  border-block-end: 1.5px solid;
  transform: rotate(45deg);
}

.locale-switcher details[open] summary::after {
  margin-block-start: 0.2rem;
  transform: rotate(225deg);
}

.locale-switcher summary:hover,
.locale-switcher details[open] summary {
  background: color-mix(in srgb, currentColor 12%, transparent);
}

.locale-switcher-globe {
  position: relative;
  width: 1rem;
  height: 1rem;
  border: 1.5px solid;
  border-radius: 50%;
}

.locale-switcher-globe::before,
.locale-switcher-globe::after {
  content: '';
  position: absolute;
}

.locale-switcher-globe::before {
  inset: -1px 2.5px;
  border: 1px solid;
  border-radius: 50%;
}

.locale-switcher-globe::after {
  inset: 50% 0 auto;
  border-block-start: 1px solid;
}

.locale-switcher-code { display: none; }

.locale-switcher ul {
  position: absolute;
  z-index: 3;
  inset-block-start: calc(100% + 0.45rem);
  inset-inline-end: 0;
  min-width: 10rem;
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  color: var(--ink, #302239);
  background: var(--white, #fff);
  border: 1px solid color-mix(in srgb, currentColor 22%, transparent);
  border-radius: 12px;
  box-shadow: 0 8px 30px #25182d30;
}

[data-theme="dark"] .locale-switcher ul {
  color: #f3eaf9;
  background: #292231;
}

body > .locale-switcher ul { inset-inline: 0 auto; }

.locale-switcher a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  min-height: 44px;
  padding-inline: 0.75rem;
  border-radius: 7px;
  color: inherit;
  text-decoration: none;
}

.locale-switcher a:hover,
.locale-switcher [aria-current] {
  background: color-mix(in srgb, currentColor 10%, transparent);
}

.locale-switcher [aria-current] { font-weight: 700; }

.locale-switcher [aria-current]::after {
  content: '';
  width: 0.55rem;
  height: 0.32rem;
  margin-block-start: -0.16rem;
  border-inline-start: 2px solid;
  border-block-end: 2px solid;
  transform: rotate(-45deg);
}

.locale-switcher :is(summary, a):focus-visible {
  outline: 2px solid currentColor;
  outline-offset: -2px;
}

.site-header:is(.search-open, .menu-open) .locale-switcher-header { visibility: hidden; }

@media (max-width: 1023px) {
  .site-header .header-inner > .locale-switcher-header { margin-inline-start: auto; }
  .site-header .locale-switcher-header ~ :is(.theme-toggle, .menu-toggle) { margin-inline-start: 0; }
}

@media (max-width: 419px), (1024px <= width < 1240px) {
  .site-header .locale-switcher-name {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  .site-header .locale-switcher-code { display: inline; }
  .site-header .locale-switcher summary { gap: 0.32rem; padding-inline: 0.55rem; }
}

@media (max-width: 419px) {
  .site-header > .header-inner:has(> .locale-switcher-header) {
    gap: 6px;
    padding-inline: 12px;
  }

  .site-header .header-inner:has(> .locale-switcher-header) > .brand {
    flex: 0 1 132px;
    min-width: 0;
  }

  .site-header .header-inner:has(> .locale-switcher-header) > .brand img {
    width: 100%;
    transform: translateX(-12%);
  }
}

@media (1024px <= width < 1240px) {
  .site-header > .header-inner:has(> .locale-switcher-header) { gap: 8px; }

  .site-header .header-inner:has(> .locale-switcher-header) > .primary-nav {
    gap: clamp(8px, calc(8px + (100vw - 1024px) / 6), 32px);
  }

  .site-header .header-inner:has(> .locale-switcher-header) > .header-cta {
    flex: none;
    margin-inline-start: 0;
    padding-inline: 15px;
  }
}
