/* ==========================================================================
   Language Switcher
   ========================================================================== */

.language-switcher {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.language-switcher__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 9999px;
  background: rgba(26, 29, 34, 0.4);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  white-space: nowrap;
}
.language-switcher__btn:hover {
  border-color: rgba(9, 255, 140, 0.5);
  background: rgba(26, 29, 34, 0.7);
  box-shadow: 0 0 12px rgba(9, 255, 140, 0.18);
}

.language-switcher__label {
  line-height: 1;
  min-width: 22px;
  text-align: center;
}

.language-switcher__chev {
  opacity: 0.7;
  transition: transform 0.25s ease;
}
.language-switcher.is-open .language-switcher__chev {
  transform: rotate(180deg);
}

.language-switcher__menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: #121212;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 6px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.7);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  z-index: 100;
}
.language-switcher.is-open .language-switcher__menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.language-switcher__item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  background: none;
  border: none;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  transition: background 0.2s ease;
}
.language-switcher__item:hover {
  background: rgba(255, 255, 255, 0.06);
}
.language-switcher__item.is-active {
  background: rgba(9, 255, 140, 0.1);
  color: #09FF8C;
}

.language-switcher__flag {
  font-size: 18px;
  line-height: 1;
}

/* ---------- Mobile ---------- */
@media (max-width: 1023px) {
  .language-switcher--mobile .language-switcher__btn {
    padding: 8px 10px;
    font-size: 13px;
    gap: 4px;
  }
  .language-switcher--mobile .language-switcher__menu {
    right: 0;
    min-width: 180px;
  }
}

/* ---------- Mobile menu language row ---------- */
.mobile-menu .language-switcher {
  display: flex;
  justify-content: center;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.mobile-menu .language-switcher__menu {
  right: auto;
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
}
.mobile-menu .language-switcher.is-open .language-switcher__menu {
  transform: translateX(-50%) translateY(0);
}

/* ---------- Accounts page header compatibility ---------- */
.site-header .language-switcher {
  flex-shrink: 0;
}
.site-header .home-navigation + .language-switcher {
  margin-right: 4px;
}
@media (max-width: 1023px) {
  .site-header .mobile-header .language-switcher {
    margin-right: 4px;
  }
}