/* ═══════════════════════════════════════════════════════════════
   AÝOLA — каркас: шапка, строка шести разделов, поиск, мобильное меню,
   мини-корзина, подвал.
   ═══════════════════════════════════════════════════════════════ */

/* ── Масштаб витрины ─────────────────────────────────────────────
   Вся витрина на 10% крупнее (админка не затронута — у неё нет layout.css). */
:root { zoom: 1.1; --zoom: 1.1; }
/* При zoom единицы vw/vh тоже растут на 10% — там, где размер должен
   совпадать с экраном, делим на --zoom или берём проценты от окна. */

/* ── Шапка ─────────────────────────────────────────────────────── */
/* Липкая целиком, но промо-строка уезжает: top = −высота промо */
.site-header {
  --promo-h: 34px;
  position: sticky; top: calc(-1 * var(--promo-h)); z-index: 100;
  background: var(--bg);
}
.site-header.is-scrolled { box-shadow: 0 1px 0 var(--line), 0 6px 18px rgba(0, 0, 0, .06); }

/* Шапка — один графитовый блок (как у больших маркетплейсов):
   сверху служебная строка, ниже логотип, каталог, поиск и значки с подписями.
   Отдельной цветной полосы больше нет. */
.site-header .promo-strip,
.site-header .hbar { background: transparent; }
.site-header { background: linear-gradient(100deg, #1c1d21 0%, #25272d 55%, #1c1d21 100%); }
.site-header .hnav { background: var(--bg); }
html[data-theme="dark"] .site-header { background: linear-gradient(100deg, #161617 0%, #1f1f21 55%, #161617 100%); }

/* Служебная строка: доставка слева, ссылки по центру, язык и валюта справа */
.promo-strip {
  height: var(--promo-h);
  color: var(--ink-dim);
  font-family: var(--font); font-size: 12.5px; font-weight: 500;
}
.promo-strip__inner {
  height: 100%;
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 16px;
}
.promo-strip__main {
  margin: 0; display: flex; align-items: center; gap: 12px; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.promo-strip__main b { font-size: 11.5px; font-weight: 600; letter-spacing: .04em; padding: 1px 7px; color: var(--ink-text); border: 1px solid rgba(255, 255, 255, .45); border-radius: 4px; }
.promo-strip__sep { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .6; flex: none; }
/* Служебная строка нужна только под промокод — без него её нет */
.site-header:has(.promo-strip__main:empty) { --promo-h: 0px; }
.site-header:has(.promo-strip__main:empty) .promo-strip { display: none; }

/* Тёмная полоса: логотип, поиск, иконки */
.hbar { background: var(--ink); color: var(--ink-text); }
.hbar__inner {
  height: 76px;
  display: flex; align-items: center; gap: 16px;
}
/* Каталог рядом с логотипом */
.hbar__burger {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px; flex: none;
  height: 42px; padding: 0 12px;
  background: transparent; color: var(--ink-text);
  border: 1px solid rgba(255, 255, 255, .26); border-radius: 3px;
  font: 500 12px var(--font);
  cursor: pointer; transition: background .15s var(--ease), border-color .15s var(--ease);
}
.hbar__burger:hover { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .5); }
.hbar__burger svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; }

/* Louisbaton: a readable wordmark paired with the baguette LB emblem. */
.logo {
  display: inline-flex; align-items: center; gap: 10px;
  min-height: 44px;
  font-family: var(--font); font-size: 19px; font-weight: 500;
  font-kerning: normal; line-height: 1; letter-spacing: .12em;
  white-space: nowrap;
  color: var(--ink-text); flex: none;
}
.logo__name {
  text-transform: uppercase;
  /* Uppercase glyphs sit above the line-box centre; align their ink with the LB mark. */
  transform: translateY(.1em);
}
.logo__mark {
  display: block; width: 42px; height: 46px; flex: none;
  transform: translateY(-.15em);
  background: currentColor;
  -webkit-mask: url('/assets/brand/louisbaton-mark.png') center / contain no-repeat;
  mask: url('/assets/brand/louisbaton-mark.png') center / contain no-repeat;
}
.logo:hover { text-decoration: none; opacity: .85; }

.hsearch {
  position: relative; flex: 1; max-width: none; margin: 0 8px;
  display: flex; align-items: center;
}
.hsearch__input {
  width: 100%; height: 50px;
  padding: 0 52px 0 20px;
  font-size: 15px;
  color: #1c1d21; background: #fff;
  border: 0; border-radius: 14px;
}
.hsearch__input::placeholder { color: #767a82; }
.hsearch__input::-webkit-search-cancel-button { cursor: pointer; }
.hsearch__input:focus { outline: 2px solid var(--indigo); outline-offset: 2px; }
html[data-theme="dark"] .hsearch__input { background: #2c2c2e; color: var(--text); }
html[data-theme="dark"] .hsearch__input::placeholder { color: var(--text-dim); }
.hsearch__btn {
  position: absolute; right: 7px; top: 7px;
  width: 36px; height: 36px; border: 0; border-radius: 50%;
  background: none; color: #1c1d21;
  display: grid; place-items: center;
}
html[data-theme="dark"] .hsearch__btn { color: var(--text); }
.hsearch__btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }

.hbar__actions { display: flex; align-items: center; gap: 4px; flex: none; }
/* Значки с подписями: заказ, тема, избранное, корзина */
.hact {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  min-width: 58px; padding: 6px 4px;
  background: none; border: 0; border-radius: 12px;
  color: var(--ink-text); font-family: var(--font); font-size: 12px; font-weight: 500; line-height: 1.1;
  cursor: pointer; text-decoration: none;
  transition: background .15s var(--ease);
}
.hact:hover { background: rgba(255, 255, 255, .08); text-decoration: none; }
.hact__icon { position: relative; display: grid; place-items: center; width: 26px; height: 26px; }
.hact__icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.hact .count-dot { top: -6px; right: -10px; background: #ff2d55; color: #fff; }
.hact__label { opacity: .85; white-space: nowrap; }
.hbar__actions .icon-btn { color: var(--ink-text); }
.hbar__actions .icon-btn:hover { background: rgba(255, 255, 255, .1); text-decoration: none; }
.hbar__searchbtn { display: none; }

/* Фокус на полосах шапки: индиго-обводка на графите не видна —
   берём цвет текста полосы. Поле поиска обводится снаружи, по графиту, поэтому
   ему — светлый цвет шапки; в белой панели подсказок — обычная индиго-обводка. */
.promo-strip :focus-visible,
.hbar :focus-visible { outline-color: currentColor; }
.hbar .hsearch__input:focus { outline-color: var(--ink-text); }
.hbar .suggest :focus-visible { outline-color: var(--indigo); }

/* Подсказки поиска */
.suggest {
  position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 120;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  max-height: min(70vh, 560px); overflow-y: auto;
  padding: 6px 0;
}
.suggest__group + .suggest__group { border-top: 1px solid var(--line-soft); margin-top: 4px; padding-top: 4px; }
.suggest__title {
  margin: 6px 16px 4px; font-size: 11px; text-transform: uppercase;
  letter-spacing: .04em; color: var(--text-dim);
}
.suggest [role="option"] { display: flex; align-items: center; gap: 12px; padding: 8px 16px; text-decoration: none; }
.suggest [role="option"]:hover, .suggest [aria-selected="true"] { background: var(--bg-soft); }
.suggest__link svg { width: 16px; height: 16px; fill: none; stroke: var(--text-dim); stroke-width: 1.8; flex: none; }
.suggest__link em, .suggest__name em {
  display: block; font-style: normal; font-size: 12px; color: var(--text-dim);
}
.suggest__img { width: 40px; height: 53px; flex: none; background: var(--bg-plate); overflow: hidden; }
.suggest__img img { width: 100%; height: 100%; object-fit: cover; }
.suggest__name { flex: 1; min-width: 0; font-size: 14px; }
.suggest__name em { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.suggest__price { font-size: 13px; text-align: right; }
.suggest__price .price-line { display: flex; flex-direction: column; align-items: flex-end; }
.suggest__all {
  border-top: 1px solid var(--line-soft); margin-top: 4px;
  font-size: 13px; font-weight: 600; color: var(--indigo);
}

/* Светлая полоса разделов */
.hnav { background: var(--bg); border-bottom: 1px solid var(--line); position: relative; }
.hnav__inner {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: stretch; gap: 16px;
}
.hnav__nav { grid-column: 2; min-width: 0; }
.hnav .hpicks { grid-column: 3; justify-self: end; align-self: center; margin-right: 0; }
.hnav .hpick__btn { color: var(--text); background: var(--bg-soft); height: 32px; }
.hnav .hpick__btn:hover, .hnav .hpick.is-open .hpick__btn { background: var(--line-soft); }
.hnav .hpick__btn:focus-visible { outline-color: var(--text); }
.hnav .hpick__list { top: calc(100% + 8px); }
.hnav__list {
  display: flex; align-items: stretch; gap: 2px;
  justify-content: safe center;          /* разделы по центру; если не влезут — прокрутка без обрезки слева */
  list-style: none; height: 46px;
  overflow-x: auto; scrollbar-width: none;
}
.hnav__list::-webkit-scrollbar { display: none; }
.hnav__item { display: flex; }
.hnav__link {
  display: flex; align-items: center;
  padding: 0 14px;
  font-family: var(--font);
  font-size: 14px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  white-space: nowrap;
  border-bottom: 3px solid transparent; border-top: 3px solid transparent;
  transition: border-color .15s var(--ease), background .15s var(--ease);
}
.hnav__link:hover { text-decoration: none; border-bottom-color: var(--text); }
.hnav__link[aria-current="page"] { border-bottom-color: var(--indigo); }

/* Мобильное меню (шторка слева) */
.mnav-dialog .dialog__body { padding: 0; }
.mnav__top, .mnav__service { list-style: none; }
.mnav__top a {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 22px;
  border-bottom: 1px solid var(--line-soft);
  font-family: var(--font);
  font-size: 16px; font-weight: 600; letter-spacing: -.01em; text-transform: none;
  cursor: pointer; list-style: none;
}
.mnav__top a:hover { text-decoration: none; background: var(--bg-soft); }
.mnav__top small { font-family: var(--font); font-weight: 400; font-size: 13px; color: var(--text-dim); letter-spacing: 0; }
.mnav__service { padding: 14px 0 30px; background: var(--bg-soft); }
.mnav__service a { display: flex; align-items: center; gap: 12px; padding: 11px 22px; font-size: 15px; }
.mnav__service svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; }

/* ── Мини-корзина ──────────────────────────────────────────────── */
.minibag .dialog__body { padding: 0 22px 18px; }
.mini__added {
  display: flex; align-items: center; gap: 8px;
  margin: 0 -22px 4px; padding: 12px 22px;
  background: var(--indigo-soft); color: var(--text);
  font-size: 14px; font-weight: 600;
}
.mini__added svg { width: 18px; height: 18px; fill: none; stroke: var(--moss); stroke-width: 2.2; }
.mini__list { list-style: none; }
.mini__line {
  display: grid; grid-template-columns: 72px 1fr auto; gap: 14px; align-items: start;
  padding: 14px 0; border-bottom: 1px solid var(--line-soft);
}
.mini__img { display: block; aspect-ratio: 3 / 4; background: var(--bg-plate); overflow: hidden; }
.mini__img img { width: 100%; height: 100%; object-fit: cover; }
.mini__name { font-size: 14px; font-weight: 600; display: block; }
.mini__meta { font-size: 13px; color: var(--text-dim); margin: 3px 0 6px; }
.mini__price { font-size: 14px; font-weight: 700; margin: 0; }
.mini__remove { width: 34px; height: 34px; margin: -6px -8px 0 0; }
.mini__remove svg { width: 16px; height: 16px; }
.minibag .dialog__foot { display: block; }
.mini__sum { display: flex; justify-content: space-between; align-items: baseline; margin: 0 0 12px; font-size: 14px; }
.mini__sum b { font-size: 18px; }
/* Две кнопки в ряд, а если не помещаются (узкий телефон) — друг под другом */
.mini__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.mini__actions .btn { flex: 1 1 auto; }

/* Шкала «до бесплатной доставки» — используется и в корзине */
.ship-meter { margin: 16px 0 0; font-size: 13px; }
.ship-meter p { margin: 0 0 8px; }
.ship-meter__bar { height: 4px; background: var(--line-soft); overflow: hidden; }
.ship-meter__bar i { display: block; height: 100%; background: var(--moss); transition: width .5s var(--pop); }

/* ── Подвал: тёмная полоса, по центру копирайт и ссылки ─────────── */
.site-footer {
  margin-top: 64px;
  padding-top: 76px;
  background: #1c1d21; color: #8b8d93;
  font-family: var(--font); font-size: 13px;
}
body:has(#main .plp:last-child) .site-footer,
body:has(#main .home > .plp:last-child) .site-footer { margin-top: 0; }   /* серый фон каталога сразу переходит в подвал */
html[data-theme="dark"] .site-footer { background: #161617; }
.site-footer__bottom {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 30px;
  min-height: 54px; padding: 12px var(--gutter);
  border-top: 1px solid rgba(255, 255, 255, .08);
}
.site-footer__copy { margin: 0; }
.site-footer__links { display: flex; flex-wrap: wrap; justify-content: center; margin: 0; padding: 0; list-style: none; }
.site-footer__links li + li { border-left: 1px solid rgba(255, 255, 255, .18); }
.site-footer__links a { padding: 0 11px; color: #8b8d93; text-decoration: none; transition: color .15s var(--ease); }
.site-footer__links li:first-child a { padding-left: 0; }
.site-footer__links a:hover { color: #fff; }
.site-footer__links a:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
@media (max-width: 760px) {
  .site-footer { padding-top: 40px; margin-top: 40px; }
  .site-footer__bottom { flex-direction: column; gap: 10px; padding-top: 16px; padding-bottom: 18px; text-align: center; }
  .site-footer__links { gap: 6px 18px; }
  .site-footer__links li + li { border-left: 0; }
  .site-footer__links a { padding: 0; }
}

/* ── Язык и валюта в шапке ─────────────────────────────────────── */
.hpicks { display: flex; align-items: center; gap: 2px; margin-right: 2px; }
.hpick { position: relative; }
.hpick__btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 8px 0 10px;
  background: transparent; color: var(--ink-text);
  border: 1px solid transparent; border-radius: 18px;
  font-family: var(--font); font-size: 13px; font-weight: 600; letter-spacing: .02em;
  cursor: pointer;
  transition: background .15s var(--ease), border-color .15s var(--ease);
}
.hpick__btn:hover, .hpick.is-open .hpick__btn { background: rgba(255, 255, 255, .1); }
.hpick__btn:focus-visible { outline: 2px solid var(--ink-text); outline-offset: 1px; }
.hpick__btn > svg:first-child { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.hpick__btn > svg:last-child { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.2; opacity: .7; transition: transform .2s var(--ease); }
.hpick.is-open .hpick__btn > svg:last-child { transform: rotate(180deg); }
.hpick__sign { font-size: 15px; font-weight: 600; min-width: 1ch; text-align: center; }
.hpick__list {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 120;
  min-width: 190px; margin: 0; padding: 6px; list-style: none;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: 12px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, .14), 0 2px 6px rgba(0, 0, 0, .05);
  animation: svDd .16s var(--ease);
}
.hpick__list--cur { min-width: 290px; }
.hpick__opt > span { white-space: nowrap; }
.hpick__opt {
  width: 100%; min-height: 40px;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px;
  background: none; border: 0; border-radius: 8px;
  color: var(--text); font-family: var(--font); font-size: 14px; text-align: left;
  cursor: pointer;
}
.hpick__opt > span { flex: 1; display: flex; align-items: center; gap: 10px; }
.hpick__opt .hpick__sign { width: 18px; }
.hpick__opt small { color: var(--text-dim); font-size: 12px; white-space: nowrap; }
.hpick__opt svg { width: 15px; height: 15px; flex: none; fill: none; stroke: var(--text); stroke-width: 2.2; opacity: 0; }
.hpick__opt:hover, .hpick__opt:focus-visible { background: var(--bg-soft); outline: 0; }
.hpick__opt[aria-selected="true"] { font-weight: 600; }
.hpick__opt[aria-selected="true"] svg { opacity: 1; }
.hpick__note { margin: 4px 0 0; padding: 8px 10px 4px; border-top: 1px solid var(--line-soft); font-size: 11.5px; line-height: 1.45; color: var(--text-dim); }

/* Меню на телефоне: язык и валюта кнопками */
.mnav__prefs { padding: 18px 22px 24px; border-top: 1px solid var(--line-soft); }
.mnav__prefs-title { margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--text-dim); }
.mnav__prefs-title + .mnav__seg + .mnav__prefs-title { margin-top: 16px; }
.mnav__seg { display: flex; flex-wrap: wrap; gap: 6px; }
.mnav__seg button {
  min-height: 38px; padding: 0 14px;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--line); border-radius: 19px;
  font-family: var(--font); font-size: 14px; font-weight: 500; cursor: pointer;
}
.mnav__seg button[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.mnav__prefs-note { margin: 12px 0 0; font-size: 12px; line-height: 1.45; color: var(--text-dim); }
@media (max-width: 900px) { .hpicks { display: none; } }

/* ── Нижняя панель вкладок (телефон и планшет) ─────────────────── */
:root { --tabbar-h: 0px; }
.tabbar { display: none; }
@media (max-width: 900px) {
  /* Safe area belongs inside the dock, with its background reaching the edge. */
  :root {
    --tabbar-safe-bottom: calc(env(safe-area-inset-bottom, 0px) / var(--zoom, 1));
    --tabbar-h: calc(60px + var(--tabbar-safe-bottom));
  }
  body { padding-bottom: var(--tabbar-h); }
  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 95;
    display: grid; grid-template-columns: repeat(5, 1fr);
    height: var(--tabbar-h);
    padding: 6px max(6px, calc(env(safe-area-inset-right, 0px) / var(--zoom, 1)))
      calc(5px + var(--tabbar-safe-bottom)) max(6px, calc(env(safe-area-inset-left, 0px) / var(--zoom, 1)));
    background: var(--bg);
    border: 0; border-top: 1px solid var(--line);
    border-radius: 0;
  }
  .tabbar__item {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
    min-width: 0; padding: 0; background: none; border: 0;
    color: var(--text-dim); font-family: var(--font); font-size: 10px; font-weight: 500; line-height: 1.1;
    text-decoration: none; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .tabbar__item:hover { text-decoration: none; color: var(--text); }
  .tabbar__icon {
    position: relative; display: grid; place-items: center;
    width: 40px; height: 26px; border-radius: 13px;
    transition: background .2s var(--ease), transform .15s var(--ease);
  }
  .tabbar__icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
  .tabbar__item:active .tabbar__icon { transform: scale(.92); }
  .tabbar__item[aria-current="page"] { color: var(--text); font-weight: 600; }
  .tabbar__item[aria-current="page"] .tabbar__icon { background: var(--bg-soft); }
  .tabbar__item[aria-current="page"] .tabbar__icon svg { stroke-width: 2.1; }
  .tabbar__item[data-tab="saved"][aria-current="page"] .tabbar__icon svg { fill: #ff2d55; stroke: #ff2d55; }
  .tabbar__label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tabbar__badge { position: absolute; top: -5px; right: -2px; min-width: 16px; height: 16px; padding: 0 4px; font-size: 10px; line-height: 16px; background: #ff2d55; color: #fff; box-shadow: 0 0 0 2px var(--bg); }
  .tabbar__item:focus-visible { outline: 2px solid var(--text); outline-offset: -4px; border-radius: 10px; }
}

/* ── Приложение ────────────────────────────────────────────────── */
#main:focus { outline: 0; }
.app { min-height: 60vh; }
.app-boot { display: grid; place-items: center; min-height: 60vh; }

#snow { position: fixed; inset: 0; z-index: 5; pointer-events: none; }

/* ── Адаптив ───────────────────────────────────────────────────── */
@media (max-width: 1100px) {
  .hnav__link { padding: 0 10px; font-size: 13px; }
}

@media (max-width: 900px) {
  .site-header:not(:has(.promo-strip__main:empty)) { --promo-h: 30px; }
  .promo-strip { font-size: 12px; }
  .promo-strip__inner { display: flex; justify-content: center; }
  .promo-strip__main { justify-content: center; width: 100%; }
  .promo-strip__main > span:nth-child(n+2) { display: none; }

  /* Шапка как в приложении: логотип, поиск всегда на виду, тема.
     Избранное, корзина и меню — в нижней панели вкладок. */
  .hbar__inner { height: 58px; gap: 10px; }
  .logo { gap: 6px; font-size: 12px; letter-spacing: .07em; }
  .logo__mark { width: 28px; height: 36px; }
  .hbar__burger, .hbar__searchbtn, .hbar__track, #savedLink, #bagLink { display: none; }
  .hsearch { max-width: none; margin: 0; min-width: 0; }
  .hsearch__input { height: 38px; padding-left: 40px; padding-right: 12px; font-size: 14px; }
  .hsearch__btn { left: 4px; right: auto; top: 3px; pointer-events: none; }
  .hsearch__btn svg { width: 18px; height: 18px; }
  .suggest { position: fixed; left: 8px; right: 8px; top: calc(var(--promo-h) + 58px + 4px); max-height: calc(100vh / var(--zoom) - 200px); overflow-y: auto; }
  .hsearch__input { border-radius: 12px; }
  .hact { min-width: 0; padding: 6px; }
  .hact__label { display: none; }
  .hact__icon svg { width: 22px; height: 22px; }

  .hnav { display: none; }

}

@media (max-width: 360px) {
  .logo { gap: 4px; font-size: 10px; letter-spacing: .045em; }
  .logo__mark { width: 24px; height: 32px; }
  .hbar__inner { gap: 6px; }
}
