/* Seletor de idioma — componente único (gerado por tools/lib/lang-switch.mjs).
   Compacto e sem caixa: bandeira SVG + sigla; lista só ao abrir. Funciona sem JS (<details>).
   Cor herdada do cabeçalho (claro/escuro); foco no padrão do sistema: 2px, offset 3px. */
.sv-header-end { display: flex; align-items: center; gap: 14px; margin-left: auto; }
/* na home o .header-cta some em ≤900px (display:none do index-v2.css); só vira flex acima disso */
@media (min-width: 901px) { .header-cta:has(> .lang-switch) { display: flex; align-items: center; gap: 14px; } }

.lang-switch { position: relative; font-size: 12px; line-height: 1; letter-spacing: .02em; }
.lang-switch svg { flex: none; border-radius: 2px; box-shadow: 0 0 0 1px rgba(128,128,128,.28); }
.lang-switch__code { font-weight: 500; letter-spacing: .06em; }

/* menu (cabeçalho desktop) */
.lang-switch--menu > summary {
  list-style: none; display: inline-flex; align-items: center; gap: 7px;
  height: 36px; padding: 0 6px; border-radius: 8px;
  color: var(--lang-switch-color, #f5f5f7); opacity: 1; cursor: pointer; user-select: none;
  transition: opacity .25s var(--ease, ease);
}
.lang-switch--menu > summary::-webkit-details-marker { display: none; }
.lang-switch--menu > summary:hover, .lang-switch--menu[open] > summary { opacity: .8; }
.lang-switch--menu > summary:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; opacity: 1; }
.lang-switch__chev { transition: transform .25s var(--ease, ease); opacity: .7; box-shadow: none !important; border-radius: 0 !important; }
.lang-switch--menu[open] .lang-switch__chev { transform: rotate(180deg); }

.lang-switch--menu > .lang-switch__list {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 700; min-width: 184px; width: max-content; margin: 0; padding: 6px;
  list-style: none; border-radius: 14px; color: #f5f5f7;
  background: rgba(24, 24, 27, .94); -webkit-backdrop-filter: saturate(160%) blur(18px); backdrop-filter: saturate(160%) blur(18px);
  box-shadow: 0 0 0 1px rgba(255,255,255,.1), 0 18px 40px rgba(0,0,0,.35);
  animation: lang-switch-in .22s var(--ease-out, ease-out);
}
.lang-switch--menu .lang-switch__link {
  display: flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 10px; border-radius: 9px; white-space: nowrap;
  color: rgba(245,245,247,.78); font-size: 13px; transition: color .2s, background-color .2s;
}
.lang-switch--menu .lang-switch__link:hover { color: #fff; background: rgba(255,255,255,.08); }
.lang-switch--menu .lang-switch__link:focus-visible { outline: 2px solid #f5f5f7; outline-offset: -2px; color: #fff; }
.lang-switch--menu .lang-switch__link[aria-current] { color: #fff; }
.lang-switch--menu .lang-switch__link[aria-current] .lang-switch__name::after { content: ""; display: inline-block; width: 5px; height: 5px; margin-left: 8px; border-radius: 50%; background: currentColor; vertical-align: middle; }
.lang-switch__name { margin-left: auto; padding-left: 14px; text-align: right; white-space: nowrap; }
.lang-switch--menu .lang-switch__code { width: 22px; }

/* linha (folha do menu mobile) */
.lang-switch--inline { margin: 28px 0 0; }
.lang-switch--inline .lang-switch__list { display: flex; gap: 8px; margin: 0; padding: 0; list-style: none; }
.lang-switch--inline .lang-switch__link {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 999px;
  color: var(--c-on-dark-soft, rgba(245,245,247,.64)); font-size: 15px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.14);
  transition: color .25s var(--ease, ease), box-shadow .25s var(--ease, ease);
}
.lang-switch--inline .lang-switch__link[aria-current] { color: var(--c-on-dark, #f5f5f7); box-shadow: inset 0 0 0 1px rgba(255,255,255,.55); }
.lang-switch--inline .lang-switch__link:focus-visible { outline: 2px solid var(--c-on-dark, #f5f5f7); outline-offset: 3px; }
.lang-switch--inline .lang-switch__name { display: none; }

@keyframes lang-switch-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .lang-switch--menu > .lang-switch__list { animation: none; } }

/* ≤900px: o cabeçalho passa a ter só logo + botão de menu; o seletor vai para a folha */
@media (max-width: 900px) { .lang-switch--menu { display: none; } }
@media (min-width: 901px) { .lang-switch--inline { display: none; } }
