/* Compact public language control. One button, then a list.
   Mobile: a sheet. Wider screens: a menu under the button. */

.lang-menu {
  position: relative;
  display: inline-block;
  max-width: 100%;
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  z-index: 30;
}

.lang-menu__button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  max-width: 100%;
  margin: 0;
  padding: 0 0.8rem;
  border: 1px solid rgba(28, 35, 64, 0.16);
  border-radius: 999px;
  background: #fff;
  color: #1c2340;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  list-style: none;
}

.lang-menu__button::-webkit-details-marker {
  display: none;
}

.lang-menu__button:focus {
  outline: none;
}

.lang-menu__button:focus-visible {
  outline: 2px solid #f5a623;
  outline-offset: 2px;
}

.lang-menu__globe {
  width: 18px;
  height: 18px;
  flex: none;
}

.lang-menu__current {
  overflow: hidden;
  text-overflow: ellipsis;
}

.lang-menu__caret {
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-0.1rem) rotate(45deg);
  flex: none;
}

.lang-menu[open] .lang-menu__caret {
  transform: translateY(0.1rem) rotate(225deg);
}

.lang-menu:not([open]) > .lang-menu__panel,
.lang-menu__panel[hidden] {
  display: none !important;
}

.lang-menu__panel {
  position: fixed;
  z-index: 80;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: min(70vh, 28rem);
  margin: 0;
  padding: 0.4rem 0.4rem calc(0.5rem + env(safe-area-inset-bottom));
  overflow: auto;
  background: #fff;
  border-radius: 1.25rem 1.25rem 0 0;
  box-shadow: 0 -12px 40px rgba(28, 35, 64, 0.18);
}

/* Moved to document.body so the header backdrop-filter cannot trap it. */
.lang-menu__panel--sheet {
  display: block !important;
  position: fixed !important;
  z-index: 10040;
  left: 0 !important;
  right: 0 !important;
  top: auto !important;
  bottom: 0 !important;
  width: auto !important;
  max-height: min(70vh, 28rem);
}

.lang-menu__backdrop {
  position: fixed;
  z-index: 10030;
  inset: 0;
  border: 0;
  padding: 0;
  background: rgba(28, 35, 64, 0.42);
}

.lang-menu[open]::before {
  content: "";
  position: fixed;
  z-index: 70;
  inset: 0;
  background: rgba(28, 35, 64, 0.42);
}

.lang-menu__link {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.9rem;
  border-radius: 0.75rem;
  color: #1c2340;
  font-size: 0.95rem;
  font-weight: 650;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
}

.lang-menu__link:hover,
.lang-menu__link:focus-visible {
  background: #fff6e4;
  outline: none;
}

.lang-menu__link[aria-current="page"] {
  background: #fff3d6;
}

.en-market-lang {
  display: flex;
  margin-left: auto;
}

.landing-nav__actions .lang-menu {
  flex: none;
}

@media (min-width: 768px) {
  .lang-menu[open]::before {
    display: none;
  }

  .lang-menu__panel {
    position: absolute;
    top: calc(100% + 0.35rem);
    right: 0;
    bottom: auto;
    left: auto;
    width: 16rem;
    max-height: 22rem;
    border-radius: 1rem;
    box-shadow: 0 16px 40px rgba(28, 35, 64, 0.16);
  }
}

@media (max-width: 767px) {
  .landing-nav__actions .lang-menu__current,
  .landing-nav__actions .lang-menu__caret {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .landing-nav__actions .lang-menu__button {
    width: 40px;
    min-width: 40px;
    height: 40px;
    min-height: 40px;
    padding: 0;
    justify-content: center;
    gap: 0;
  }
}
