/* Переключатель языка RU / KZ / EN в шапке. Вставляется сборкой tools/build-locales.mjs.
   Две копии: кнопки рядом с меню (телефоны, планшеты) и выпадающий список в блоке действий (десктоп). */
.lang-switch { flex: 0 0 auto; align-self: center; }
.lang-switch a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.15rem;
  min-height: 2.1rem;
  padding: 0 .45rem;
  border-radius: 999px;
  color: rgba(255, 255, 255, .78);
  font-size: .72rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: .05em;
  text-decoration: none;
  transition: background-color .2s ease, color .2s ease;
}
.lang-switch a:hover:not([aria-current]) { color: #e8c56d; background: rgba(232, 197, 109, .1); }
.lang-switch a[aria-current] { background: linear-gradient(135deg, #e8c56d, #c9972d); color: #080908; }
.lang-switch a:focus-visible,
.lang-switch summary:focus-visible { outline: 2px solid #e8c56d; outline-offset: 2px; }

.lang-switch--bar {
  display: inline-flex;
  gap: 2px;
  margin-left: auto;
  padding: 3px;
  border: 1px solid rgba(232, 197, 109, .32);
  border-radius: 999px;
}

.lang-switch--menu { position: relative; }
.lang-switch__details { position: relative; }
.lang-switch__current {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  min-height: 2.8rem;
  padding: 0 .8rem;
  border: 1px solid rgba(232, 197, 109, .32);
  border-radius: 999px;
  color: #fff;
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .05em;
  list-style: none;
  cursor: pointer;
}
.lang-switch__current::-webkit-details-marker { display: none; }
.lang-switch__current::after {
  content: "";
  width: .38rem;
  height: .38rem;
  margin-top: -.2rem;
  border-right: 1.5px solid #e8c56d;
  border-bottom: 1.5px solid #e8c56d;
  transform: rotate(45deg);
  transition: transform .2s ease;
}
.lang-switch__details[open] .lang-switch__current::after { margin-top: .2rem; transform: rotate(-135deg); }
.lang-switch__list {
  position: absolute;
  top: calc(100% + .4rem);
  right: 0;
  z-index: 20010;
  display: grid;
  gap: 2px;
  min-width: 4.5rem;
  padding: 4px;
  border: 1px solid rgba(232, 197, 109, .32);
  border-radius: 1rem;
  background: rgba(5, 6, 5, .97);
  box-shadow: 0 .8rem 2rem rgba(0, 0, 0, .35);
}
.lang-switch__list a { min-height: 2.3rem; }

@media (min-width: 64rem) {
  .lang-switch--bar { display: none; }
}
@media (max-width: 63.99rem) {
  .lang-switch--menu { display: none; }
  .lang-switch--bar a { min-width: 2rem; min-height: 2rem; padding: 0 .35rem; font-size: .68rem; }
}

/* Подписи, которые шаблоны выводят через CSS content: переводим по языку страницы. */
html[lang="kk"] .catalog-categories::before { content: "КАТАЛОГ"; }
html[lang="en"] .catalog-categories::before { content: "CATALOG"; }
@media (max-width: 63.99rem) {
  html[lang="kk"] .page-home-main .home-nav::before,
  html[lang="kk"] .page-lucerne-b2b .home-nav::before { content: "Мәзір"; }
  html[lang="en"] .page-home-main .home-nav::before,
  html[lang="en"] .page-lucerne-b2b .home-nav::before { content: "Menu"; }
}
html[lang="en"] .page-home-main .home-media-placeholder::before { content: "BAS Agros"; }
html[lang="kk"] .page-lucerne-v3 .product-hero-copy::before { content: "ЖОҢЫШҚА"; }
html[lang="en"] .page-lucerne-v3 .product-hero-copy::before { content: "ALFALFA"; }
html[lang="kk"] .page-home-main .home-audience-row > p::before { content: "Міндет"; }
html[lang="en"] .page-home-main .home-audience-row > p::before { content: "Task"; }

/* На карточках товаров шапка шире главной: на ноутбуках сжимаем кнопки, чтобы меню
   с переключателем языка помещалось в одну строку. */
@media (min-width: 64rem) and (max-width: 89.99rem) {
  .page-product .home-nav-actions { gap: .5rem; }
  .page-product .home-nav-actions > a {
    min-height: 2.75rem;
    padding-inline: .95rem;
    font-size: .8rem;
    white-space: nowrap;
  }
  .page-product .home-nav-actions .lang-switch__current { min-height: 2.75rem; }
  .page-product .home-nav > ul { column-gap: 0; }
  .page-product .home-nav > ul a { padding-inline: .4rem; font-size: .78rem; white-space: nowrap; }
}
