.lang-switcher {
  position: relative;
  z-index: 1000;
  flex-shrink: 0;
}

button.lang-switcher__btn {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  box-sizing: border-box;
  height: 2.5rem;
  padding: 0 0.9rem;
  border: 1px solid #94a3b8 !important;
  border-radius: 9999px;
  background: #fff !important;
  background-image: none !important;
  color: #0f172a !important;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

button.lang-switcher__btn:hover,
button.lang-switcher__btn[aria-expanded="true"] {
  background: #f1f5f9 !important;
  border-color: #64748b !important;
  color: #0f172a !important;
  opacity: 1;
}

.lang-switcher__current {
  color: #0f172a !important;
  font-weight: 600;
}

.lang-switcher__chevron {
  flex-shrink: 0;
  color: #0f172a !important;
  stroke: currentColor;
  transition: transform 0.2s ease;
}

.lang-switcher__btn[aria-expanded="true"] .lang-switcher__chevron {
  transform: rotate(180deg);
}

.lang-switcher__list {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  left: auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.15rem;
  width: max-content;
  min-width: 11.5rem;
  max-width: min(16rem, calc(100vw - 1.5rem));
  max-height: min(70vh, 22rem);
  overflow-x: hidden;
  overflow-y: auto;
  margin: 0;
  padding: 0.4rem;
  list-style: none;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 0.75rem;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
  z-index: 1100;
}

.lang-switcher__list[hidden] {
  display: none !important;
}

.lang-switcher__list li {
  display: block;
  width: 100%;
  margin: 0;
  padding: 0;
  line-height: normal;
  list-style: none;
}

.lang-switcher__link {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 0.55rem 0.75rem;
  border-radius: 0.5rem;
  color: #0f172a;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.3;
  text-decoration: none;
  text-align: left;
  white-space: nowrap;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.lang-switcher__link:hover {
  background: rgba(37, 99, 235, 0.1);
  color: #1e3a8a;
}

.lang-switcher__item--active {
  background: rgba(37, 99, 235, 0.16);
  color: #1e3a8a;
  font-weight: 600;
  pointer-events: none;
}

.site-header__actions .lang-switcher {
  margin-right: 0;
}

.site-header__mobile-actions .lang-switcher {
  margin-right: 0;
  flex-shrink: 0;
}

.lang-switcher--mobile {
  margin: 0 0 1rem;
  display: none;
}

.lang-switcher-mobile-item {
  display: none !important;
  list-style: none !important;
  width: 100%;
  margin: 0;
  padding: 0;
}

.lang-switcher--mobile .lang-switcher__btn {
  width: 100%;
  justify-content: space-between;
}

.lang-switcher--mobile .lang-switcher__list {
  position: static;
  margin-top: 0.5rem;
  max-width: none;
  width: 100%;
  box-shadow: none;
}

@media (max-width: 1023px) {
  .site-header {
    overflow: visible;
  }

  .site-header__bar {
    gap: 0.4rem !important;
    padding-left: 0.5rem !important;
    padding-right: 0.5rem !important;
  }

  .site-header__logo {
    min-width: 0;
    flex: 0 1 auto;
  }

  .site-header__logo .header-logo {
    height: 1.35rem;
  }

  .site-header__mobile-actions {
    display: flex !important;
    flex: 1 1 auto;
    min-width: 0;
    justify-content: flex-end;
    align-items: center;
    gap: 0.3rem;
  }

  .site-header__mobile-actions button.lang-switcher__btn {
    height: 2rem;
    min-width: 2.75rem;
    padding: 0 0.45rem;
    gap: 0.2rem;
  }

  .site-header__mobile-actions .lang-switcher__current {
    font-size: 0 !important;
    line-height: 0;
  }

  .site-header__mobile-actions .lang-switcher__current::after {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #0f172a !important;
  }

  html[lang="es"] .site-header__mobile-actions .lang-switcher__current::after { content: "ES"; }
  html[lang="nl"] .site-header__mobile-actions .lang-switcher__current::after { content: "NL"; }
  html[lang="da"] .site-header__mobile-actions .lang-switcher__current::after { content: "DA"; }
  html[lang="it"] .site-header__mobile-actions .lang-switcher__current::after { content: "IT"; }
  html[lang="nb"] .site-header__mobile-actions .lang-switcher__current::after { content: "NO"; }
  html[lang="pt"] .site-header__mobile-actions .lang-switcher__current::after { content: "PT"; }
  html[lang^="en"] .site-header__mobile-actions .lang-switcher__current::after { content: "EN"; }

  .site-header__mobile-actions .header-btn {
    height: 2rem;
    max-height: 2rem;
    max-width: 7.25rem;
    padding: 0 0.55rem !important;
    font-size: 0.75rem !important;
    flex: 0 1 auto;
  }

  .site-header__menu-toggle {
    flex-shrink: 0;
    padding: 0.3rem;
  }

  .lang-switcher--mobile {
    display: block;
  }

  .lang-switcher-mobile-item {
    display: block !important;
    margin: 0 0 0.75rem;
  }
}

@media (max-width: 379px) {
  .site-header__mobile-actions .header-btn {
    max-width: 6.25rem;
    padding: 0 0.4rem !important;
    font-size: 0.6875rem !important;
  }

  .site-header__logo .header-logo {
    height: 1.2rem;
  }
}
