.lang-switcher {
  position: relative;
  display: inline-block;
  font-family: inherit;
}

.lang-switcher-btn {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #f4f4f8;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: background 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}
.lang-switcher-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.35);
}
.lang-switcher-btn .flag {
  font-size: 1rem;
  line-height: 1;
}
.lang-switcher-caret {
  font-size: 0.6rem;
  opacity: 0.6;
  margin-inline-start: 0.1rem;
}

.lang-switcher-menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  margin: 0;
  padding: 0.4rem;
  list-style: none;
  min-width: 11.5rem;
  max-height: 22rem;
  overflow-y: auto;
  background: rgba(8, 9, 16, 0.97);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 0.85rem;
  box-shadow: 0 20px 45px -15px rgba(0, 0, 0, 0.75);
  z-index: 100;
}
.lang-switcher[data-align="left"] .lang-switcher-menu {
  right: auto;
  left: 0;
}
.lang-switcher-menu[hidden] {
  display: none;
}
.lang-switcher-menu li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.55rem 0.65rem;
  border-radius: 0.55rem;
  cursor: pointer;
  font-size: 0.85rem;
  color: rgba(244, 244, 248, 0.85);
}
.lang-switcher-menu li .flag {
  font-size: 1.15rem;
  line-height: 1;
}
.lang-switcher-menu li:hover {
  background: rgba(255, 255, 255, 0.08);
}
.lang-switcher-menu li.active {
  background: rgba(124, 92, 255, 0.18);
  color: #fff;
}

#lang-switcher-root {
  line-height: 1;
}

@media (max-width: 640px) {
  #lang-switcher-root {
    position: static !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    display: flex !important;
    justify-content: center !important;
    width: 100%;
    margin: 0 auto 1.25rem !important;
  }
}

html[dir="rtl"] .lang-switcher-caret {
  transform: scaleX(-1);
}
