/* ---------- Selector de idioma (ES | PT | EN) ---------- */
.tb-links { align-items: center; }
.lang-switch { display: inline-flex; align-items: center; gap: 2px; padding: 2px; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; background: rgba(255,255,255,.04); line-height: 1; }
.topbar .lang-switch a { display: inline-block; min-width: 30px; padding: 5px 8px; border-radius: 999px; font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-align: center; color: #cfe3f2; transition: background-color .2s, color .2s; }
.topbar .lang-switch a:hover { color: #fff; background: rgba(255,255,255,.08); }
.topbar .lang-switch a.is-active { color: var(--ink); background: var(--leaf); }
.topbar .lang-switch a:focus-visible { outline: 2px solid var(--leaf); outline-offset: 2px; }
.lang-sep { color: rgba(255,255,255,.28); font-size: .7rem; user-select: none; }
.lang-switch a.is-active + .lang-sep, .lang-sep:has(+ a.is-active) { visibility: hidden; }

/* Cambio de idioma suave, sin recarga */
main, .topbar-inner, .main-nav, .site-footer { transition: opacity .16s ease; }
.lang-fading main, .lang-fading .topbar-inner, .lang-fading .main-nav, .lang-fading .site-footer { opacity: .2; }
/* Evita ver el español un instante cuando el visitante prefiere otro idioma */
.i18n-pending body { opacity: 0; }
body { transition: opacity .2s ease; }

@media (max-width: 600px) {
  .topbar-inner { justify-content: flex-end; }
  .tb-links { gap: 8px; justify-content: flex-end; width: 100%; flex-wrap: nowrap; }
  .topbar .lang-switch a { min-width: 26px; padding: 5px 6px; }
  .tb-links .tb-web { display: none; }
  .tb-links .tb-item { margin-right: auto; }
}
@media (prefers-reduced-motion: reduce) {
  main, .topbar-inner, .main-nav, .site-footer, body { transition: none; }
}
