/* =========================================================
   Language switcher (kk / ru / en)
   Origin-aware dropdown — scales from its trigger, ease-out.
   ========================================================= */

.lang-switch {
  position: relative;
}
.lang-switch > summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #4B5563;
  padding: 7px 11px;
  border: 1px solid #e2e8e4;
  border-radius: 10px;
  background: #fff;
  user-select: none;
  -webkit-user-select: none;
  transition: border-color 160ms ease, color 160ms ease, transform 160ms cubic-bezier(0.23, 1, 0.32, 1), box-shadow 160ms ease;
}
.lang-switch > summary::-webkit-details-marker { display: none; }
.lang-switch > summary::marker { content: ""; }
.lang-switch > summary .globe { color: #6b8a72; transition: color 160ms ease; }
.lang-switch > summary .lang-code { letter-spacing: 0.02em; }
.lang-switch > summary .chev { transition: transform 200ms cubic-bezier(0.23, 1, 0.32, 1); }
@media (hover: hover) and (pointer: fine) {
  .lang-switch > summary:hover { color: #1B5E20; border-color: #c7e0cd; box-shadow: 0 2px 8px -4px rgba(27, 94, 32, 0.25); }
  .lang-switch > summary:hover .globe { color: #1B5E20; }
}
.lang-switch > summary:active { transform: scale(0.97); }
.lang-switch[open] > summary { color: #1B5E20; border-color: #c7e0cd; }
.lang-switch[open] > summary .globe { color: #1B5E20; }
.lang-switch[open] > summary .chev { transform: rotate(180deg); }

.lang-switch .lang-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 168px;
  background: #fff;
  border: 1px solid #eef2ef;
  border-radius: 12px;
  box-shadow: 0 14px 32px -10px rgba(13, 31, 15, 0.20), 0 3px 8px rgba(13, 31, 15, 0.06);
  padding: 6px;
  z-index: 90;
  transform-origin: top right;
  transform: scale(0.97);
  opacity: 0;
  pointer-events: none;
  transition: transform 150ms cubic-bezier(0.23, 1, 0.32, 1), opacity 150ms ease-out;
}
.lang-switch[open] .lang-menu {
  transform: scale(1);
  opacity: 1;
  pointer-events: auto;
}
.lang-switch .lang-menu a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 500;
  color: #374151;
  transition: background-color 130ms ease, color 130ms ease;
}
.lang-switch .lang-menu a .check { color: #1B5E20; }
@media (hover: hover) and (pointer: fine) {
  .lang-switch .lang-menu a:hover { background: #f1f7f2; color: #1B5E20; }
}
.lang-switch .lang-menu a.active {
  background: #e8f5eb;
  color: #1B5E20;
  font-weight: 600;
}

/* Desktop only — mobile uses the in-drawer switcher */
@media (max-width: 1024px) {
  .lang-switch { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .lang-switch > summary,
  .lang-switch > summary .chev,
  .lang-switch .lang-menu { transition-duration: 0.01ms; }
}

/* =========================================================
   Drawer language pills (mobile)
   ========================================================= */
.mobile-drawer .drawer-lang {
  display: flex;
  gap: 8px;
  padding: 4px 0 16px;
  margin-bottom: 4px;
  border-bottom: 1px solid #eef2ef;
}
.mobile-drawer .drawer-lang a {
  flex: 1;
  text-align: center;
  padding: 9px 6px;
  border-radius: 10px;
  border: 1px solid #e2e8e4;
  font-size: 13px;
  font-weight: 600;
  color: #4B5563;
  transition: background-color 140ms ease, color 140ms ease, border-color 140ms ease, transform 140ms cubic-bezier(0.23, 1, 0.32, 1);
}
.mobile-drawer .drawer-lang a:active { transform: scale(0.97); }
.mobile-drawer .drawer-lang a.active {
  background: #e8f5eb;
  border-color: #c7e0cd;
  color: #1B5E20;
}
