/* ─────────────────────────────────────────────────────────
   Veynt Bots — Language Switcher
   Botão com ícone de tradução que abre dropdown com
   Português, Español e English. Injetado pelo js/i18n.js
   no .nav-right (desktop) e #mobile-nav (mobile).
   ───────────────────────────────────────────────────────── */

/* Wrapper do switcher (desktop) */
.lang-switcher {
  position: relative;
  display: inline-flex;
  align-items: center;
}

/* Botão atual — apenas ícone de tradução */
.lang-switcher__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  background: transparent;
  border: 1px solid var(--border-2);
  border-radius: var(--r-sm);
  color: var(--gray-1);
  cursor: pointer;
  transition: color 150ms ease, background 150ms ease, border-color 150ms ease;
}
.lang-switcher__btn:hover {
  color: var(--white);
  background: rgba(var(--on-surface-rgb), 0.04);
  border-color: var(--border-3);
}
.lang-switcher__btn:focus-visible {
  outline: 2px solid var(--accent-line, currentColor);
  outline-offset: 2px;
}
.lang-switcher.is-open .lang-switcher__btn {
  color: var(--white);
  background: rgba(var(--on-surface-rgb), 0.06);
  border-color: var(--border-3);
}

/* Ícone SVG de tradução dentro do botão */
.lang-switcher__icon {
  width: 20px;
  height: 20px;
  display: block;
}

/* Dropdown menu */
.lang-switcher__menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 80;
  min-width: 160px;
  margin: 0;
  padding: 4px;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--border-3);
  border-radius: var(--r-md);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.04) inset,
    0 12px 32px -8px rgba(0, 0, 0, 0.6),
    0 4px 12px -4px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  animation: veynt-lang-fadein 140ms ease-out;
}
.lang-switcher__menu[hidden] { display: none; }

@keyframes veynt-lang-fadein {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.lang-switcher__item {
  display: block;
  padding: 8px 12px;
  border-radius: var(--r-sm);
  cursor: pointer;
  font-size: 13px;
  color: var(--gray-1);
  transition: color 120ms ease, background 120ms ease;
}
.lang-switcher__item:hover {
  background: rgba(var(--on-surface-rgb), 0.06);
  color: var(--white);
}
.lang-switcher__item.is-active {
  background: var(--accent-dim);
  color: var(--white);
}

.lang-switcher__name {
  font-weight: 510;
}

/* ── Mobile (lista vertical dentro do menu) ─────────────── */
.lang-switcher--mobile {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  margin: 0 0 8px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--r-md);
}

.lang-switcher__mobile-header {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 4px 8px;
  color: var(--gray-3);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border-2);
  margin-bottom: 4px;
}
.lang-switcher__mobile-header .lang-switcher__icon {
  width: 16px;
  height: 16px;
}

.lang-switcher--mobile .lang-switcher__pill {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 12px;
  background: transparent;
  border: 0;
  border-radius: var(--r-sm);
  color: var(--gray-1);
  font-family: inherit;
  font-size: 13px;
  font-weight: 510;
  cursor: pointer;
  transition: color 120ms ease, background 120ms ease;
}
.lang-switcher--mobile .lang-switcher__pill:hover {
  background: rgba(var(--on-surface-rgb), 0.04);
  color: var(--white);
}
.lang-switcher--mobile .lang-switcher__pill.is-active {
  background: var(--accent-dim);
  color: var(--white);
  box-shadow: inset 0 0 0 1px var(--accent-line);
}

/* Mostra mobile switcher dentro do mobile-nav apenas em telas pequenas */
@media (min-width: 881px) {
  .lang-switcher--mobile { display: none; }
}

/* Em telas pequenas, esconde o switcher desktop (já está no mobile-nav) */
@media (max-width: 880px) {
  .nav-right .lang-switcher:not(.lang-switcher--mobile) { display: none; }
}

/* Compatibilidade: garante que o switcher fica visível mesmo se .nav-right
 * for escondido (ele é injetado dentro). Por isso forçamos display nele. */
@media (max-width: 880px) {
  .nav-right { display: none; }
}
