/* Шапка, футер, бургер, липкая покупка. Обе страницы: base → layout → своя. */

[hidden] { display: none !important; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Шапка. Эмблема — плашка, которая свисает ниже шапки; при прокрутке ужимается внутрь. */
.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  border-bottom: var(--line) solid var(--ink);
}
.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: var(--header-h);
}
.header__logo {
  position: relative;
  z-index: 2;
  align-self: flex-start;
  flex: none;
  width: 108px;
  height: var(--header-h);
  text-decoration: none;
}
.header__tab {
  position: absolute;
  left: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 108px;
  padding: 8px 9px 11px;
  background: var(--paper);
  border: var(--line) solid var(--ink);
  border-top: 0;
  border-radius: 0 0 18px 18px;
  box-shadow: var(--shadow-sm);
  transition: width .25s ease, padding .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.header__emblem {
  width: 100%;
  height: auto;
}
.header.is-compact .header__tab {
  width: 72px;
  padding: 7px 4px;
  border-color: transparent;
  box-shadow: none;
  background: transparent;
}
.header.is-compact .header__logo { width: 72px; }

.header__search {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  margin-left: auto;
  padding: 0;
  border: var(--line) solid var(--ink);
  border-radius: 12px;
  background: var(--white);
  box-shadow: var(--shadow-sm);
  transition: transform .12s, box-shadow .12s;
}
.header__search:hover { transform: translate(-2px, -2px); box-shadow: var(--shadow); }
.header__burger {
  min-height: 44px;
  padding: 0 16px;
  border: var(--line) solid var(--ink);
  border-radius: 12px;
  background: var(--honey);
  font: 800 15px/1 var(--f-text);
  box-shadow: var(--shadow-sm);
}
.header__panel { display: none; }
.header.is-open .header__panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 1;
  max-height: calc(100dvh - var(--header-h));
  overflow: auto;
  scrollbar-width: none;
  padding: 44px var(--gutter) 22px;
  background: var(--paper);
  border-bottom: var(--line) solid var(--ink);
}
.header.is-open.is-compact .header__panel { padding-top: 18px; }
.header__nav { display: flex; flex-direction: column; gap: 14px; }
.header__nav a {
  font: 400 34px/1 var(--f-head);
  text-transform: uppercase;
  text-decoration: none;
}
/* Язык: одна кнопка с текущим кодом, список по клику */
.lang { position: relative; align-self: flex-start; }
.lang__current {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 12px;
  border: var(--line) solid var(--ink);
  border-radius: 999px;
  background: var(--white);
  font: 800 14px/1 var(--f-text);
  box-shadow: var(--shadow-sm);
}
.lang__chev { transition: transform .15s ease; }
.lang.is-open .lang__chev { transform: rotate(180deg); }
.lang__menu {
  position: absolute;
  z-index: 60;
  left: 0;
  top: calc(100% + 8px);
  min-width: 168px;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--white);
  border: var(--line) solid var(--ink);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}
.lang__menu button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: none;
  font: 700 15px/1 var(--f-text);
  text-align: left;
}
.lang__menu button:hover,
.lang__menu button:focus-visible { background: var(--cream); outline: none; }
.lang__menu button[aria-selected="true"] { background: var(--honey); }
.lang__menu button[aria-selected="true"]::after { content: "✓"; font-weight: 900; }
@media (max-width: 1199px) {
  /* в бургер-меню список раскрывается в потоке, иначе его режет прокрутка панели */
  .lang__menu { position: static; margin-top: 8px; box-shadow: var(--shadow-sm); }
}
.lang__note { margin: 0; font-size: 14px; }
.header__wb { align-self: flex-start; min-height: 46px; padding: 0 18px; font-size: 15px; }

@media (min-width: 768px) {
  .header__logo { width: 170px; }
  .header__tab { width: 170px; padding: 12px 16px 16px; border-radius: 0 0 26px 26px; }
  .header.is-compact .header__logo,
  .header.is-compact .header__tab { width: 92px; }
  .header.is-compact .header__tab { padding: 6px 4px; }
}

@media (min-width: 1200px) {
  .header__burger { display: none; }
  .header__inner { gap: 14px; }
  .header__panel { display: contents; }
  .header__nav { order: 1; margin-left: auto; margin-right: 6px; }
  .header__search { order: 2; margin-left: 0; }
  .lang { order: 3; align-self: center; }
  .header__wb { order: 4; align-self: center; }
  .lang__menu { left: auto; right: 0; }
  .header.is-open .header__panel { display: contents; }
  .header__nav { flex-direction: row; gap: 18px; }
  .header__nav a { font: 700 15px/1 var(--f-text); text-transform: none; white-space: nowrap; padding: 15px 0; }
  .header__nav a:hover { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 6px; text-decoration-color: var(--honey); }
  .lang__note {
    position: absolute;
    right: var(--gutter);
    top: calc(100% + 6px);
  }
}

@media (min-width: 1280px) {
  .header__nav { gap: 24px; }
}

/* Бургер на планшете: плашка-эмблема свисает на 53px — не накрывать первый пункт */
@media (min-width: 768px) and (max-width: 1199px) {
  .header.is-open:not(.is-compact) .header__panel { padding-top: 72px; }
}

/* Футер: фирменный зелёный эмблемы, шрифты и контуры — как везде */
.footer {
  background: var(--green-dark);
  color: #efe6cf;
  padding: 56px 0 28px;
  border-top: var(--line) solid var(--ink);
  font-size: 15px;
}
.footer a { color: inherit; text-decoration: none; }
.footer a:hover { color: var(--honey); }
.footer__top {
  display: grid;
  gap: 26px;
  padding-bottom: 34px;
  border-bottom: 2px solid rgb(255 255 255 / 16%);
}
.footer__brand { display: flex; gap: 18px; align-items: center; }
.footer__emblem { width: 124px; height: auto; flex: none; }
.footer__claim {
  margin: 0;
  max-width: 22ch;
  font: 400 clamp(30px, 3.4vw, 44px)/0.95 var(--f-head);
  text-transform: uppercase;
  color: var(--paper);
}
.footer__buy p { margin: 0 0 10px; font-weight: 800; color: var(--paper); }
.footer__cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px 20px;
  padding: 34px 0;
}
.footer__title {
  margin: 0 0 12px;
  font: 400 24px/1 var(--f-head);
  text-transform: uppercase;
  color: var(--honey);
}
.footer__list { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; font-weight: 500; }
.footer__list small { display: block; margin-top: 2px; color: #b9c9a8; font-size: 13px; font-weight: 500; }
.footer__phone { font: 800 20px/1.1 var(--f-text); color: var(--paper); white-space: nowrap; }
.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  align-items: center;
  padding-top: 22px;
  border-top: 2px solid rgb(255 255 255 / 16%);
  color: #b9c9a8;
  font-size: 13px;
}
.footer__bottom p { margin: 0; }

@media (max-width: 380px) {
  .footer__brand { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 359px) {
  .footer .mp__btn { min-width: 0; flex: 1 1 0; padding: 0 6px; font-size: 14px; }
}
@media (max-width: 599px) {
  .footer__cols { grid-template-columns: 1fr; gap: 26px; }
}

@media (min-width: 768px) {
  .footer { padding-top: 72px; }
  .footer__top { grid-template-columns: 1fr auto; align-items: end; }
  .footer__buy { width: 340px; }
  .footer__emblem { width: 168px; }
}
@media (min-width: 768px) and (max-width: 1023px) {
  .footer__top { grid-template-columns: 1fr; align-items: start; }
  .footer__buy { width: auto; max-width: 420px; }
}
@media (min-width: 1100px) {
  .footer__cols { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* Нижняя панель главной — только мобилка, после hero */
.dock { display: none; }
body.has-dock { padding-bottom: 0; }

@media (max-width: 767px) {
  .dock.is-on {
    position: fixed;
    z-index: 80;
    left: 0;
    right: 0;
    bottom: 0;
    display: grid;
    grid-template-columns: auto repeat(3, minmax(0, 1fr));
    gap: 8px;
    align-items: center;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    background: var(--paper);
    border-top: var(--line) solid var(--ink);
  }
  .dock__label { font: 800 12px/1 var(--f-text); }
  .dock .mp__btn {
    min-width: 0;
    min-height: 44px;
    padding: 0 4px;
    font-size: 14px;
    box-shadow: none;
  }
  body.has-dock { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
}

/* Поиск по каталогу */
html.is-locked { overflow: hidden; }
.search {
  width: min(560px, calc(100vw - 24px));
  max-height: min(640px, calc(100dvh - 48px));
  margin: max(10vh, 24px) auto auto;
  padding: 16px;
  border: var(--line) solid var(--ink);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 8px 8px 0 var(--ink);
  overflow: hidden;
}
.search[open] { display: flex; flex-direction: column; }
@media (min-width: 768px) {
  .search { margin-top: max(148px, 12vh); max-height: min(640px, calc(100dvh - 172px)); }
}
.search::backdrop { background: rgb(58 35 24 / 50%); }
.search__box {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.search__icon { flex: none; }
.search__input {
  flex: 1;
  min-width: 0;
  min-height: 52px;
  padding: 0 14px;
  border: var(--line) solid var(--ink);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--ink);
  font: 600 17px/1.2 var(--f-text);
}
.search__input:focus { outline: 3px solid var(--honey); outline-offset: 0; }
.search__input::-webkit-search-cancel-button { display: none; }
.search__close {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: var(--line) solid var(--ink);
  border-radius: 12px;
  background: var(--honey);
  box-shadow: var(--shadow-sm);
}
.search__count { flex: none; margin: -2px 2px 12px; font-size: 14px; color: var(--ink-soft); }
.search__hint {
  padding: 2px 8px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--white);
  font: 700 13px/1.4 var(--f-text);
}
.search__list { display: grid; align-content: start; gap: 10px; margin: 0; padding: 2px 2px 8px; list-style: none; }
.search .sbox { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.search .sbox > .search__list { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding-right: 22px; }
.search__item {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 8px 12px 8px 8px;
  border: var(--line) solid var(--ink);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: inherit;
  text-decoration: none;
  transition: transform .12s, box-shadow .12s, background-color .12s;
}
.search__item img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: 10px;
  background: var(--cream);
  mix-blend-mode: multiply;
}
.search__item:hover,
.search__item.is-active { background: #fff3d1; transform: translate(-2px, -2px); box-shadow: var(--shadow-sm); }
.search__text { display: grid; gap: 4px; min-width: 0; }
.search__name { font: 400 22px/1 var(--f-head); text-transform: uppercase; }
.search__sub { font-size: 14px; color: var(--ink-soft); }
.search mark { background: var(--honey); color: inherit; border-radius: 3px; padding: 0 1px; }

/* Свой скроллбар (js/layout.js → initScrollbars): родная полоса скрыта везде, где [data-scroll] */
[data-scroll] { scrollbar-width: none; -ms-overflow-style: none; }
[data-scroll]::-webkit-scrollbar { display: none; }
.header__panel::-webkit-scrollbar { display: none; }
.sbox { position: relative; min-width: 0; }
.sbar {
  position: relative;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--cream);
  touch-action: none;
  cursor: pointer;
}
.sbar[hidden] { display: none; }
.sbar--x { height: 14px; margin-top: 10px; }
.sbar--y { position: absolute; top: 2px; right: 0; bottom: 8px; width: 14px; }
.sbar__thumb {
  position: absolute;
  top: 1px;
  left: 1px;
  border-radius: 999px;
  background: var(--honey);
  box-shadow: inset 0 0 0 2px var(--ink);
  cursor: grab;
}
.sbar--x .sbar__thumb { height: 8px; min-width: 32px; }
.sbar--y .sbar__thumb { width: 8px; min-height: 32px; }
.sbar.is-drag .sbar__thumb { background: var(--amber); cursor: grabbing; }

/* Поиск на телефоне: на весь экран, компактные строки */
@media (max-width: 767px) {
  .search {
    width: 100%;
    max-width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .search__box {
    position: relative;
    gap: 8px;
    margin: 0;
    padding: 10px var(--gutter);
    border-bottom: var(--line) solid var(--ink);
    background: var(--paper);
  }
  .search__icon {
    position: absolute;
    left: calc(var(--gutter) + 14px);
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
  }
  .search__input { min-height: 48px; padding-left: 44px; font-size: 16px; }
  .search__close { width: 48px; height: 48px; box-shadow: none; }
  .search__count { margin: 12px var(--gutter) 0; }
  .search .sbox { margin: 12px 0 0; }
  .search .sbox > .search__list {
    gap: 8px;
    padding: 0 calc(var(--gutter) + 12px) calc(16px + env(safe-area-inset-bottom)) var(--gutter);
  }
  .search .sbar--y { right: 4px; top: 0; bottom: 16px; width: 8px; border-width: 1.5px; }
  .search .sbar--y .sbar__thumb { width: 3px; left: 1px; box-shadow: none; background: var(--ink); }
  .search__item {
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 12px;
    padding: 6px 10px 6px 6px;
  }
  .search__item img { width: 52px; height: 52px; border-radius: 8px; }
  .search__item:hover,
  .search__item.is-active { transform: none; box-shadow: none; }
  .search__name {
    font-size: 19px;
    line-height: 1.2;
    padding-top: 2px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  .search__sub {
    font-size: 13px;
    line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
}
