/* Lang-switcher — header control + overlay dropdown (above everything) */

.lang-switcher-toolbar {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  gap: 0.5rem;
  max-width: 100%;
  position: relative;
  z-index: 2147483000;
}

.lang-switcher-slot {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  flex-shrink: 0;
  width: max-content;
  max-width: 100%;
  margin: 0;
  position: relative;
  z-index: 2147483000;
  vertical-align: middle;
}

.lang-switcher {
  --ls-fg: currentColor;
  --ls-bg: color-mix(in srgb, currentColor 6%, transparent);
  --ls-border: color-mix(in srgb, currentColor 22%, transparent);
  --ls-menu-bg: #fff;
  --ls-menu-fg: #1a1a1a;
  --ls-accent: color-mix(in srgb, currentColor 12%, transparent);
  --ls-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);

  position: relative;
  z-index: 2147483000;
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
  flex: 0 0 auto;
  width: max-content;
  max-width: 100%;
  margin: 0;
  vertical-align: middle;
}

.lang-switcher__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  height: 2.25rem;
  min-width: 2.75rem;
  padding: 0 0.65rem;
  border: 1px solid var(--ls-border);
  border-radius: 0.375rem;
  background: var(--ls-bg);
  color: var(--ls-fg);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  box-sizing: border-box;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.lang-switcher__btn:hover,
.lang-switcher__btn[aria-expanded="true"] {
  background: var(--ls-accent);
}

/* Desktop (≥992px): full language name; tablet/mobile: short code */
.lang-switcher__current--full {
  display: inline;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 9rem;
  text-transform: none;
  letter-spacing: normal;
  font-size: 0.8125rem;
}

.lang-switcher__current--short {
  display: none;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 3rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.75rem;
}

@media (max-width: 991.98px) {
  .lang-switcher__current--full {
    display: none;
  }

  .lang-switcher__current--short {
    display: inline;
  }

  .lang-switcher__btn {
    height: 2rem;
    min-width: 2.5rem;
    padding: 0 0.45rem;
    font-size: 0.75rem;
  }
}

/* Legacy single-label (drawer copies / old builds) */
.lang-switcher__current:not(.lang-switcher__current--full):not(.lang-switcher__current--short) {
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 9rem;
}

.lang-switcher__chevron {
  flex-shrink: 0;
  width: 10px;
  height: 7px;
  transition: transform 0.2s ease;
}

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

/*
 * Dropdown: fixed by JS (escapes header stacking contexts / activity-bar).
 * Fallback absolute when JS hasn't positioned yet.
 */
.lang-switcher__list,
header .lang-switcher__list,
.lang-switcher-slot .lang-switcher__list,
.lang-switcher-toolbar .lang-switcher__list,
.header-activity-sticky .lang-switcher__list {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: auto;
  right: 0;
  z-index: 2147483646 !important;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.15rem;
  width: max-content;
  min-width: 10rem;
  max-width: min(16rem, calc(100vw - 1rem));
  max-height: min(70vh, 20rem);
  overflow-x: hidden;
  overflow-y: auto;
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 0.5rem;
  background: var(--ls-menu-bg);
  color: var(--ls-menu-fg);
  box-shadow: var(--ls-shadow);
  box-sizing: border-box;
  isolation: isolate;
  pointer-events: auto;
}

.lang-switcher__list.lang-switcher__list--fixed {
  position: fixed !important;
  top: auto;
  left: auto;
  right: auto;
  margin: 0;
}

.lang-switcher__list--align-left {
  left: 0;
  right: auto;
}

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

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

.lang-switcher__link,
header .lang-switcher__list a {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 0.5rem 0.65rem;
  border-radius: 0.375rem;
  color: var(--ls-menu-fg);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.3;
  text-decoration: none;
  text-align: left;
  text-transform: none;
  letter-spacing: normal;
  white-space: nowrap;
  transition: background-color 0.15s ease;
}

.lang-switcher__link:hover,
header .lang-switcher__list a:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--ls-menu-fg);
}

.lang-switcher__item--active,
header .lang-switcher__list a.lang-switcher__item--active {
  background: rgba(0, 0, 0, 0.1);
  color: var(--ls-menu-fg);
  font-weight: 600;
  pointer-events: none;
}

/* Full-name control inside mobile drawers / menus only */
.lang-switcher--mobile {
  display: block;
  margin: 0 0 0.75rem;
  width: 100%;
  max-width: none;
  z-index: auto;
}

.lang-switcher-mobile-item {
  display: block !important;
  list-style: none !important;
  width: 100%;
  margin: 0 0 0.75rem;
  padding: 0;
  position: relative;
  z-index: 1;
}

.lang-switcher--mobile .lang-switcher__btn {
  width: 100%;
  justify-content: space-between;
  height: 2.5rem;
  font-size: 0.875rem;
  letter-spacing: normal;
  text-transform: none;
  min-width: 0;
}

.lang-switcher--mobile .lang-switcher__current {
  max-width: none;
  text-transform: none;
  letter-spacing: normal;
  display: inline;
}

.lang-switcher--mobile .lang-switcher__current--full,
.lang-switcher--mobile .lang-switcher__current--short {
  display: none;
}

.lang-switcher--mobile .lang-switcher__list {
  position: static !important;
  margin-top: 0.4rem;
  max-width: none;
  width: 100%;
  box-shadow: none;
  left: auto;
  right: auto;
  top: auto;
  z-index: auto !important;
}

.lang-switcher--mobile .lang-switcher__list.lang-switcher__list--fixed {
  position: static !important;
}

/* Keep toolbar children from wrapping onto a second header row */
.lang-switcher-toolbar > .hidden.md\:flex,
.lang-switcher-toolbar > [class*="hidden"][class*="md:flex"] {
  flex-shrink: 0;
}

/* ---------- Template layout safety: stay in one header row ---------- */

/* v1: menu__nav is width:100% below 992px — force nowrap so switcher stays on the right */
.header .flex-bl {
  flex-wrap: nowrap !important;
  align-items: center;
}

.header .menu__nav {
  width: auto !important;
  flex: 1 1 auto;
  min-width: 0;
  justify-content: flex-end;
}

.header .logo {
  flex: 0 0 auto;
}

.header .lang-switcher-slot,
.flex-bl > .lang-switcher-slot {
  flex: 0 0 auto;
  margin-left: 0.5rem;
  order: 3;
}

@media (min-width: 992px) {
  .header .lang-switcher-slot,
  .flex-bl > .lang-switcher-slot {
    margin-left: 1.25rem;
  }
}

/* Raise header above activity-bar while dropdown is open */
.header:has(.lang-switcher__btn[aria-expanded="true"]),
.header-activity-sticky:has(.lang-switcher__btn[aria-expanded="true"]) {
  z-index: 2147483000;
}

.header-activity-sticky:has(.lang-switcher__btn[aria-expanded="true"]) .activity-bar-outer {
  z-index: 1;
}

/* v5: overlay is display:contents on desktop, so slots share body-inner flex.
   Override .header .lang-switcher-slot { order: 3 } so Sign Up / burger stay rightmost. */
.header__overlay > .lang-switcher-slot,
.header__body-inner > .lang-switcher-slot {
  flex: 0 0 auto;
  align-self: center;
  order: 0;
  margin-right: 0.75rem;
}

/* Mobile bar slot: sit left of burger on the right side */
.header__body-inner > .lang-switcher-slot {
  margin-left: auto;
  margin-right: 0.5rem;
}

@media (width > 63.99875rem) {
  /* Desktop: nav centered between logo and [switcher|Sign Up] */
  .header .header__logo {
    flex: 0 0 auto;
  }

  .header .header__menu {
    flex: 1 1 auto;
    display: flex;
    justify-content: center;
    min-width: 0;
  }

  .header__body-inner > .lang-switcher-slot {
    display: none !important;
  }

  .header__overlay > .lang-switcher-slot {
    display: inline-flex !important;
    margin-left: 0;
  }

  .header .header__button {
    flex: 0 0 auto;
  }
}

@media (width <= 63.99875rem) {
  /* Tablet/mobile: slot left of burger; hide overlay slot inside the drawer */
  .header__overlay > .lang-switcher-slot {
    display: none !important;
  }

  .header__body-inner > .lang-switcher-slot {
    display: inline-flex !important;
  }
}

/* v7 */
.header__btns > .lang-switcher-slot {
  display: inline-flex;
  margin-right: 0.5rem;
  vertical-align: middle;
}

/* v14 desktop: keep switcher left of hamburger (unchanged) */
.header-col.justify-content-end > .lang-switcher-slot,
.header-col.d-flex > .lang-switcher-slot {
  margin-right: 0.75rem;
  flex: 0 0 auto;
  order: 1;
}

.header-col.justify-content-end > .header-hamburger,
.header-col.d-flex > .header-hamburger {
  order: 2;
}

/* v14 mobile / tablet: logo left (icon only), [lang][burger] on the right */
@media screen and (max-width: 991px) {
  .header .header-row {
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 0;
  }

  /* Logo column → left on the first row */
  .header .header-col:nth-child(2),
  .header .header-col.text-center {
    order: 0 !important;
    flex: 0 0 auto !important;
    flex-basis: auto !important;
    max-width: none !important;
    min-width: 0 !important;
    text-align: left !important;
    margin: 0 !important;
    padding-left: 0 !important;
  }

  .header .header-logo a {
    justify-content: flex-start !important;
  }

  .header .header-logo-name {
    display: none !important;
  }

  .header .header-logo-img {
    width: 40px !important;
    height: 40px !important;
    max-width: 40px !important;
  }

  /* Actions → right on the first row: switcher then burger */
  .header .header-col.d-flex.justify-content-end,
  .header .header-col:last-child {
    order: 0 !important;
    flex: 0 0 auto !important;
    flex-basis: auto !important;
    max-width: none !important;
    min-width: 0 !important;
    margin-left: auto !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 0.45rem;
    padding-right: 0 !important;
  }

  .header .header-col .lang-switcher-slot {
    order: 1 !important;
    margin-right: 0 !important;
    margin-left: 0 !important;
  }

  .header .header-hamburger {
    order: 2 !important;
    display: flex !important;
    flex-shrink: 0;
  }

  /* Nav dropdown under the bar (full width, second row / absolute) */
  .header .header-col:first-child {
    order: 1 !important;
    flex-basis: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    margin-top: 0 !important;
    padding: 0 !important;
  }
}

/* v15 */
.site-header__actions > .lang-switcher-slot,
.site-header__mobile-actions > .lang-switcher-slot {
  margin-right: 0.5rem;
  flex-shrink: 0;
}

/* v4 Webflow: keep switcher OUTSIDE collapsed .w-nav-menu, next to hamburger */
.header-navigation-container {
  display: flex !important;
  align-items: center;
  flex-wrap: nowrap;
  gap: 0.5rem;
}

.header-navigation-container > .lang-switcher-slot,
.header-navigation .lang-switcher-slot,
.w-nav > .lang-switcher-slot,
.navigation-wrapper .lang-switcher-slot {
  display: inline-flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  flex: 0 0 auto;
  align-self: center;
  margin: 0;
  position: relative;
  z-index: 2147483000;
  vertical-align: middle;
}

/* Never hide the header switcher with Webflow nav collapse rules */
.w-nav[data-collapse] .header-navigation-container > .lang-switcher-slot {
  display: inline-flex !important;
}

.header-navigation-box > .lang-switcher-slot,
.w-nav-menu > .lang-switcher-slot {
  /* leftover if an old build put it inside the menu — still show on desktop */
  display: inline-flex;
  vertical-align: middle;
  margin: 0 0.5rem;
}

/* v13 Elementor: Registration CTA column is display:none — slot lives in .header-flex */
.header-flex > .lang-switcher-slot,
.lang-switcher-slot--v13 {
  display: inline-flex !important;
  flex: 0 0 auto;
  align-self: center;
  margin-left: 0.75rem;
  margin-right: 0.25rem;
  width: auto !important;
  position: relative;
  z-index: 2147483000;
}

.header-flex .lang-switcher,
.lang-switcher-slot--v13 .lang-switcher,
.lang-switcher-slot--v13 .lang-switcher__btn {
  width: auto;
  max-width: max-content;
}

/* Readable on dark v13 header */
.elementor-location-header .lang-switcher-slot--v13 .lang-switcher,
.header-flex .lang-switcher-slot--v13 .lang-switcher {
  --ls-fg: #f5f5f5;
  --ls-bg: rgba(255, 255, 255, 0.08);
  --ls-border: rgba(255, 255, 255, 0.28);
  --ls-accent: rgba(255, 255, 255, 0.16);
}

@media (max-width: 767px) {
  .header-flex > .lang-switcher-slot,
  .lang-switcher-slot--v13 {
    margin-left: 0.5rem;
    order: 3;
  }
}

/* v11 / v12 ekit header — keep switcher compact beside Contact; do NOT
   override Elementor boxed .e-con-inner max-width (that stretches the bar). */
.ekit-template-content-header .lang-switcher-slot,
#main_header .lang-switcher-slot {
  display: inline-flex !important;
  flex: 0 0 auto;
  align-self: center;
  width: auto !important;
  max-width: max-content;
  margin: 0 0.5rem 0 0;
  vertical-align: middle;
  min-width: 0;
}

#main_header .lang-switcher,
#main_header .lang-switcher__btn {
  width: auto;
  max-width: max-content;
}

/* Keep [switcher][Contact] on one row — never stack above the CTA */
#main_header .elementor-widget-button .elementor-widget-container {
  display: inline-flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  justify-content: flex-end;
  gap: 0.5rem;
  width: auto !important;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

#main_header .elementor-button-wrapper {
  flex: 0 0 auto;
  margin: 0 !important;
  min-width: 0;
}

#main_header .elementor-button {
  white-space: nowrap;
}

/* Never show a drawer copy inside the always-visible ekit navbar */
.elementskit-navbar-nav > .lang-switcher-mobile-item,
.ekit-nav-menu-one-page-no > .lang-switcher-mobile-item,
#menu-menu-header > .lang-switcher-mobile-item {
  display: none !important;
}

/* Mobile/tablet only — contain overflow without breaking desktop boxed width */
@media (max-width: 1024px) {
  #main_header {
    overflow-x: clip;
    box-sizing: border-box;
  }

  #main_header .elementor-element-4cfa6aa5,
  #main_header .elementor-element-5c46959c {
    min-width: 0;
    box-sizing: border-box;
  }

  /* Only shrink the actions cluster — keep logo column able to go full-width */
  #main_header .elementor-element-4cfa6aa5.e-con,
  #main_header .elementor-element-5c46959c.e-con {
    --flex-shrink: 1;
  }

  /* Cap the 126% logo widget without killing centering */
  #main_header .elementor-element-2721c2aa {
    max-width: 100% !important;
  }

  #main_header .elementor-element-5c46959c {
    --gap: 0.5rem 0.5rem;
    --row-gap: 0.5rem;
    --column-gap: 0.5rem;
  }

  #main_header .elementor-widget-ekit-nav-menu,
  #main_header .elementor-widget-button {
    flex: 0 1 auto !important;
    min-width: 0;
  }

  #main_header .lang-switcher-slot {
    margin-right: 0.35rem;
  }

  #main_header .elementor-widget-button .elementor-widget-container {
    gap: 0.35rem;
  }

  #main_header .elementor-button.elementor-size-sm {
    padding-left: 0.65rem;
    padding-right: 0.65rem;
    font-size: 0.75rem;
    line-height: 1.2;
  }

  #main_header .lang-switcher__btn {
    height: 2rem;
    min-width: 2.25rem;
    padding: 0 0.35rem;
  }
}

@media (max-width: 767px) {
  /* Logo row full width → platform name centered (original Elementor behavior) */
  #main_header .elementor-element-4cfa6aa5 {
    flex-wrap: wrap !important;
    --flex-wrap: wrap;
  }

  #main_header .elementor-element-12b6f268 {
    width: 100% !important;
    max-width: 100% !important;
    --width: 100%;
    --justify-content: center;
    --align-items: center;
    justify-content: center !important;
    align-items: center !important;
    --flex-shrink: 0;
  }

  #main_header .elementor-element-1d50e6c7 {
    justify-content: center !important;
    align-items: center !important;
    width: 100%;
  }

  #main_header .elementor-element-2721c2aa {
    max-width: 100% !important;
    width: auto !important;
    text-align: center !important;
    align-self: center !important;
    --align-self: center;
  }

  #main_header .elementor-element-2721c2aa .elementor-heading-title,
  #main_header .elementor-element-2721c2aa .elementor-heading-title a {
    text-align: center !important;
  }

  /* Actions row under the title: hamburger | [switcher][Contact] */
  #main_header .elementor-element-5c46959c {
    width: 100% !important;
    max-width: 100% !important;
    flex-wrap: nowrap !important;
    justify-content: space-between !important;
    align-items: center !important;
  }
}

/* Random skins (*-random-*): always-visible beside burger, all breakpoints */
.lang-switcher-slot--random {
  display: inline-flex !important;
  flex: 0 0 auto;
  align-self: center;
  align-items: center;
  width: auto !important;
  max-width: max-content;
  min-width: 0;
  margin: 0 0.5rem 0 0;
  vertical-align: middle;
  position: relative;
  z-index: 2147483000;
}

.lang-switcher-slot--random .lang-switcher,
.lang-switcher-slot--random .lang-switcher__btn {
  width: auto;
  max-width: max-content;
}

@media (max-width: 991.98px) {
  .lang-switcher-slot--random {
    margin-right: 0.35rem;
  }

  .lang-switcher-slot--random .lang-switcher__btn {
    height: 2rem;
    min-width: 2.35rem;
    padding: 0 0.4rem;
  }
}

/* v10 legal / auth: centered between breadcrumbs and logo/title */
.lang-switcher-slot--centered {
  display: flex !important;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 100%;
  margin: 0.85rem auto 1.15rem;
  position: relative;
  z-index: 2147483000;
}

.lang-switcher-slot--centered .lang-switcher {
  /* Readable on dark hero backgrounds */
  --ls-fg: #f8fafc;
  --ls-bg: rgba(255, 255, 255, 0.12);
  --ls-border: rgba(255, 255, 255, 0.35);
  --ls-accent: rgba(255, 255, 255, 0.2);
}

.lang-switcher-slot--centered .lang-switcher__btn {
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
