.langswitch { position: relative; flex-shrink: 0; }

.langswitch__btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 13px;
  font-family: var(--font-body);
  font-size: .86rem;
  font-weight: 600;
  color: var(--body);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.langswitch__btn:hover { border-color: var(--blue); background: var(--blue-050); }
.langswitch__btn::after {
  content: "";
  width: 6px; height: 6px;
  margin-left: 2px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform .2s ease;
}
.langswitch__btn[aria-expanded="true"]::after { transform: translateY(1px) rotate(-135deg); }

.langswitch__menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 120;
  min-width: 218px;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  display: none;
}
.langswitch__menu.is-open { display: block; }

.langswitch__menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 9px;
  font-size: .9rem;
  font-weight: 500;
  color: var(--body);
  text-decoration: none;
  transition: background .12s ease;
}
.langswitch__menu a:hover { background: var(--blue-050); color: var(--blue); text-decoration: none; }
.langswitch__menu a.is-active { background: var(--blue-050); color: var(--blue); font-weight: 700; }
.langswitch__code {
  display: inline-grid;
  place-items: center;
  min-width: 38px;
  padding: 3px 6px;
  border-radius: 5px;
  background: var(--blue-100);
  color: var(--blue-ink);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .04em;
  flex-shrink: 0;
}
.langswitch__menu a.is-active .langswitch__code { background: var(--blue); color: #fff; }
.langswitch__btn svg { width: 16px; height: 16px; flex-shrink: 0; }

@media (max-width: 900px) {
  .langswitch { margin-left: auto; order: -1; }
  .langswitch__btn { padding: 8px 11px; font-size: .82rem; }
  .langswitch__menu { right: 0; min-width: 200px; }
}

@media (max-width: 420px) {
  .langswitch__btn span:not([aria-hidden]) { display: none; }
}
