.lang-switcher {
  position: relative;
}

.lang-switcher.lang-switcher-floating {
  position: fixed;
  inset: 18px 18px auto auto;
  z-index: 400;
  direction: ltr;
}

.lang-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 86px;
  border: 1px solid rgba(255,255,255,.24);
  border-radius: 20px;
  padding: 7px 10px;
  color: #fff;
  background: rgba(12,20,80,.88);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background .2s, border-color .2s;
}

.lang-btn:hover,
.lang-btn:focus-visible {
  background: rgba(12,20,80,1);
  border-color: rgba(255,255,255,.46);
}

.lang-dropdown {
  position: absolute;
  z-index: 300;
  top: calc(100% + 8px);
  right: 0;
  min-width: 156px;
  padding: 6px 0;
  border: 1px solid rgba(255,255,255,.12);
  border-top: 2px solid #f4c400;
  border-radius: 0 0 10px 10px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
  background: rgba(0,0,0,.97);
  box-shadow: 0 16px 38px rgba(0,0,0,.24);
  transition: opacity .2s, transform .2s;
}

.lang-switcher.open .lang-dropdown {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 0;
  padding: 9px 16px;
  color: rgba(255,255,255,.72);
  background: transparent;
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
}

.lang-option:hover,
.lang-option:focus-visible {
  color: #fff;
  background: rgba(255,255,255,.08);
}

.lang-option.active {
  color: #f4c400;
}

[dir="rtl"] .lang-dropdown {
  right: auto;
  left: 0;
}

[dir="rtl"] .lang-switcher.lang-switcher-floating {
  inset: 18px 18px auto auto;
}

[dir="rtl"] .lang-switcher.lang-switcher-floating .lang-dropdown {
  right: 0;
  left: auto;
}

[dir="rtl"] .lang-option {
  text-align: right;
}

@media (max-width: 640px) {
  .lang-switcher {
    margin-left: auto;
  }

  [dir="rtl"] .lang-switcher {
    margin-right: auto;
    margin-left: 0;
  }

  .lang-btn {
    min-width: 80px;
    padding: 6px 9px;
    font-size: 11px;
  }

  .lang-switcher.lang-switcher-floating {
    inset: 12px 12px auto auto;
    margin: 0;
  }

  [dir="rtl"] .lang-switcher.lang-switcher-floating {
    inset: 12px 12px auto auto;
    margin: 0;
  }
}
