.lang-dropdown {
  position: relative;
  flex-shrink: 0;
  z-index: 1001;
}

.lang-dropdown summary {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(60, 60, 67, 0.12);
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  cursor: pointer;
  list-style: none;
  user-select: none;
  white-space: nowrap;
  transition: background 0.15s ease, box-shadow 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.lang-dropdown summary::-webkit-details-marker {
  display: none;
}

.lang-dropdown summary::after {
  content: "";
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--muted);
  transition: transform 0.15s ease;
}

.lang-dropdown[open] summary {
  background: white;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.lang-dropdown[open] summary::after {
  transform: rotate(180deg);
}

.lang-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 88px;
  max-height: 70vh;
  overflow-y: auto;
  padding: 6px;
  border-radius: 14px;
  background: white;
  border: 0.5px solid rgba(60, 60, 67, 0.14);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 1002;
}

.lang-dropdown-menu a {
  display: block;
  padding: 9px 12px;
  border-radius: 10px;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  text-align: center;
}

.lang-dropdown-menu a:hover {
  background: var(--blue-soft);
  color: var(--blue);
}

.lang-dropdown-menu a.is-active {
  background: var(--blue-soft);
  color: var(--blue);
}

.nav-links .lang-dropdown {
  margin-left: auto;
}

@media (max-width: 900px) {
  .nav-links .lang-dropdown {
    margin-left: 0;
  }

  .nav-links {
    flex-wrap: nowrap;
    overflow: visible;
  }

  .lang-dropdown[open] .lang-dropdown-menu {
    position: fixed;
    top: auto;
    right: 16px;
    margin-top: 0;
  }
}
