/* =========================================================
   LANGUAGE SWITCHER
   ========================================================= */

.lang-switcher {
  position: relative;

  display: inline-flex;
  align-items: center;

  font-family: var(--font-family);
}

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


/* =========================================================
   CURRENT LANGUAGE BUTTON
   ========================================================= */

.lang-current {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  gap: 7px;

  min-height: 38px;
  padding: 8px 11px;

  background-color: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 8px;

  color: var(--text-color-primary);

  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 500;
  line-height: 1;

  cursor: pointer;

  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    opacity 0.2s ease;
}

.lang-current:hover {
  background-color: #f5f5f5;
  border-color: rgba(0, 0, 0, 0.22);
}

.lang-current:active {
  opacity: 0.75;
}

.lang-current:focus-visible {
  outline: 3px solid rgba(215, 25, 63, 0.22);
  outline-offset: 2px;
}

.lang-current-label {
  white-space: nowrap;
}

.lang-current-arrow {
  display: inline-block;

  font-size: 11px;
  line-height: 1;

  transition:
    transform 0.2s ease;
}

.lang-switcher.open .lang-current-arrow {
  transform: rotate(180deg);
}


/* =========================================================
   DROPDOWN MENU
   ========================================================= */

.lang-menu {
  position: absolute;
  z-index: 1100;

  top: calc(100% + 7px);
  right: 0;

  min-width: 140px;
  margin: 0;
  padding: 5px;

  display: none;

  list-style: none;

  background-color: #ffffff;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 9px;

  box-shadow:
    0 10px 28px rgba(16, 24, 40, 0.12),
    0 2px 6px rgba(16, 24, 40, 0.06);
}

.lang-switcher.open .lang-menu {
  display: block;
}

.lang-menu li {
  margin: 0;
  padding: 0;
}

.lang-menu a {
  display: block;

  width: 100%;
  margin: 0;
  padding: 10px 12px;

  border-radius: 6px;

  color: var(--text-color-primary);

  font-family: var(--font-family);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;

  text-decoration: none;
  white-space: nowrap;

  transition:
    background-color 0.15s ease;
}

.lang-menu a:hover,
.lang-menu a:focus {
  background-color: #f5f5f5;
  text-decoration: none;
}

.lang-menu a:focus-visible {
  outline: 2px solid rgba(215, 25, 63, 0.3);
  outline-offset: -2px;
}


/* =========================================================
   DESKTOP HEADER PLACEMENT
   ========================================================= */

.header-left > .lang-switcher {
  margin-left: 12px;
}


/* =========================================================
   MOBILE MENU PLACEMENT
   ========================================================= */

.mobile-menu > .lang-switcher {
  width: 100%;
  max-width: none;

  margin-top: auto;
  padding: 4px 20px 10px;

  box-sizing: border-box;
}

.mobile-menu > .lang-switcher .lang-current {
  width: 100%;

  justify-content: space-between;

  min-height: 46px;
  padding: 12px 14px;
}

.mobile-menu > .lang-switcher .lang-menu {
  position: static;

  top: auto;
  right: auto;

  width: 100%;
  min-width: 0;

  margin: 7px 0 0;
  padding: 5px;

  box-sizing: border-box;

  box-shadow: none;
}

.mobile-menu > .lang-switcher .lang-menu a {
  padding: 12px 14px;
}


/* Keep the eligibility button directly below the switcher */
.mobile-menu > .mobile-menu-cta {
  margin-top: 0;
  padding-top: 0;
}


/* =========================================================
   RESPONSIVE VISIBILITY
   ========================================================= */

@media (max-width: 767px) {
  .header-left > .lang-switcher {
    display: none;
  }

  .mobile-menu > .lang-switcher {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  .mobile-menu > .lang-switcher .lang-current {
    flex-shrink: 0;
  }

  .mobile-menu > .lang-switcher .lang-menu {
    align-self: stretch;
  }
}

@media (min-width: 768px) {
  .mobile-menu > .lang-switcher {
    display: none;
  }
}


/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
  .lang-current,
  .lang-current-arrow,
  .lang-menu a {
    transition: none;
  }
}