/* ============================================================
   I18N — dil keçidi (AZ / EN) + axıcı crossfade.
   Switcher F·Spee referansı kimi: seqment pill, sürüşən vurğu,
   aktiv dildə rəngli nöqtə. JS (i18n.js) header-ə inject edir.
   ============================================================ */

/* Header element sırası — async inject olunsa belə vizual sıra sabit qalır:
   logo · menyu · axtarış · Giriş/Qeydiyyat · dil-switcher (ən sağda) */
.header > .logo { order: 0; }
/* nav-dan sonra boşluq → bütün action elementləri (axtarış, profil/giriş/qeydiyyat,
   dil-switcher) sağda bir qrup kimi toplaşır və stabil qalır. */
.header > .pill-nav { order: 1; margin-right: auto; }
.header > .search-trigger,
.header > .header-actions-group { order: 2; }
.header > .auth-zone { order: 3; }
.header > #lang-switch { order: 4; }
.header > .menu-toggle { order: 5; }

.lang-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0;
  background: rgba(26, 26, 77, 0.06);
  border-radius: var(--r-pill, 999px);
  padding: 4px;
  flex-shrink: 0;
}

.lang-switch .lang-opt {
  position: relative;
  z-index: 2;
  border: none;
  background: none;
  cursor: pointer;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--mute);
  padding: 6px 13px;
  border-radius: var(--r-pill, 999px);
  transition: color 260ms var(--ease, ease);
  -webkit-tap-highlight-color: transparent;
}
.lang-switch .lang-opt:hover { color: var(--ink); }
.lang-switch .lang-opt.is-active { color: var(--ink); }

/* Sürüşən ağ vurğu (indikator) */
.lang-switch .lang-indicator {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 0;
  width: 0;
  background: #fff;
  border-radius: var(--r-pill, 999px);
  box-shadow: 0 2px 8px rgba(26, 26, 77, 0.14);
  transition: transform 380ms cubic-bezier(0.34, 1.2, 0.5, 1), width 380ms cubic-bezier(0.34, 1.2, 0.5, 1);
  z-index: 1;
  pointer-events: none;
}

/* Aktiv dildə rəngli nöqtə (referansdakı qırmızı nöqtə) */
.lang-switch .lang-opt.is-active::after {
  content: '';
  position: absolute;
  top: 4px;
  right: 5px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent, #FF5C39);
  box-shadow: 0 0 0 2px #fff;
  animation: langDotIn 360ms cubic-bezier(0.34, 1.4, 0.5, 1);
}
@keyframes langDotIn {
  from { transform: scale(0); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* Axıcı keçid — dil dəyişəndə bütün məzmun yumşaq solub yenisi gəlir */
.shell {
  transition: opacity 240ms var(--ease, ease), filter 240ms var(--ease, ease);
}
.shell.lang-fading {
  opacity: 0.18;
  filter: blur(1px);
}

@media (prefers-reduced-motion: reduce) {
  .lang-switch .lang-indicator { transition: none; }
  .shell { transition: none; }
  .shell.lang-fading { opacity: 1; filter: none; }
}

@media (max-width: 700px) {
  .lang-switch .lang-opt { padding: 5px 10px; font-size: 11px; }
}
