/* Оболочка сайта ХоумЛаб 3D: шрифты, токены, верхняя строка, шапка, меню каталога,
   поиск, подвал, плавающая кнопка Панды. Подключается первой строкой партиала
   partials/header.html — значит, на ВСЕХ страницах: и новых (вместе с ds.css),
   и старых (поверх index.css, этап 2 редизайна).

   Почему отдельный файл: старые страницы держат свой index.css с глобальными
   правилами, и полный ds.css их бы перекрасил. Поэтому здесь только то, что
   принадлежит шапке и подвалу, а база задана внутри них (:where(...) ниже).
   Токены объявлены на :root — их имена с index.css не пересекаются (проверено
   31.10.2026), --font-body/--font-display старого сайта здесь не трогаем.
   Описание — docs/DESIGN.md. */

/* Шрифты — со своего сервера, собирает scripts/build_onest_subset.py.
   Onest переменный (400–800) одним файлом; логотип — только буквы «ХоумЛаб 3D». */
@font-face {
  font-family: 'Onest';
  src: url('/fonts/onest/onest.woff2') format('woff2');
  font-weight: 400 800;
  font-display: swap;
}
@font-face {
  font-family: 'SF Pro Rounded Web';
  src: url('/fonts/sf-rounded-logo.woff2') format('woff2');
  font-weight: 700;
  font-display: swap;
}

:root {
  --bg: #ffffff;
  --bg-2: #f4f6f4;
  --bg-3: #e9eee9;
  --ink: #141a16;
  --muted: #5a635d;
  --line: #e3e8e4;
  --accent: #00b22d;
  --accent-strong: #00b22d; /* = --accent, цвет шапки: кнопки и акценты одним зелёным (решение владельца 01.11.2026) */
  --accent-soft: var(--bg-2); /* было светло-зелёное #e5f6e9 — владелец 01.11.2026: зелёная подложка удешевляет, только серая */
  --deep: #0e2416;
  --sale: #e4312b;
  /* Весь текст — Onest (решение владельца 30.10.2026). Округлый SF Pro Rounded —
     только в логотипе: это фирменный знак, а не шрифт страницы. */
  --display: 'Onest', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --text: 'Onest', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --brand: 'SF Pro Rounded Web', ui-rounded, 'SF Pro Rounded', system-ui, sans-serif;
  --r: 16px;
  --r-sm: 10px;
  --wrap: 1320px;
  --pad: clamp(16px, 2.4vw, 32px);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* База внутри оболочки: на старых страницах вокруг действует index.css */
:where(.notice, .util, .head, .foot, .fcontact) { font: 400 16px/1.5 var(--text); color: var(--ink); -webkit-font-smoothing: antialiased; }
:where(.notice, .util, .head, .foot, .fcontact) :where(*, *::before, *::after) { box-sizing: border-box; }
:where(.util, .head, .foot) :where(h1, h2, h3, p, ul, dl, dd) { margin: 0; }
:where(.util, .head, .foot) ul { padding: 0; list-style: none; }
:where(.util, .head, .foot, .fcontact) :where(button, input) { font: inherit; color: inherit; }
:where(.util, .head, .foot) img { display: block; max-width: 100%; }
:where(.util, .head, .foot) a { color: inherit; }
:where(.util, .head, .foot) a[href^="tel:"] { white-space: nowrap; }
:where(.util, .head, .foot) .wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--pad); }
:where(.util, .head, .foot) .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Высота липкой шапки — для старых страниц (index.css: sticky-блоки, якоря).
   Точное значение ставит shell.js; на телефоне шапка не липнет — 0. */
:root { --nav-height: 121px; }

/* ===== Объявление (часы работы и т. п.) ===== */
.notice { background: #fff4d6; color: var(--ink); text-align: center; padding: 9px 16px; font-size: 14px; font-weight: 500; }

/* ===== Верхняя строка ===== */
.util { background: var(--bg-2); font-size: 14px; }
.util__in { display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 38px; }
.util__where a { text-decoration: none; font-weight: 500; }
.util__where span { color: var(--muted); margin-left: 12px; }
#openNow.is-open { color: var(--accent-strong); font-weight: 500; }
#openNow.is-open::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-right: 6px; vertical-align: 1px; }
.util__nav { display: flex; gap: 22px; }
.util__tel { display: none; font-weight: 600; text-decoration: none; white-space: nowrap; }
.util__nav a { text-decoration: none; color: var(--muted); }
@media (hover: hover) { .util__nav a:hover, .util__where a:hover { color: var(--accent-strong); } }

/* ===== Шапка ===== */
.head { position: sticky; top: 0; z-index: 50; background: var(--bg); box-shadow: 0 1px 0 var(--line); }
.head__in { display: flex; align-items: center; gap: 18px; height: 76px; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; flex: none; }
.logo img { width: 44px; height: 44px; }
.logo span { font: 700 22px/1 var(--brand); letter-spacing: -0.02em; white-space: nowrap; }
.logo em { font-style: normal; color: var(--accent); }
.catbtn {
  flex: none; display: inline-flex; align-items: center; gap: 10px; height: 48px; padding: 0 20px; border: 0; border-radius: 12px;
  background: var(--accent); color: #fff; font-weight: 600; cursor: pointer; transition: background-color 160ms ease;
}
.catbtn[aria-expanded="true"] { background: var(--deep); }
@media (hover: hover) { .catbtn:hover { background: var(--accent-strong); } }
.search { position: relative; flex: 1; min-width: 0; }
.search input {
  width: 100%; height: 48px; padding: 0 56px 0 18px; border: 2px solid var(--accent); border-radius: 12px; background: var(--bg);
  font: 400 16px var(--text); color: var(--ink); -webkit-appearance: none; appearance: none;
}
.search input::placeholder { color: var(--muted); }
.search input:focus { outline: none; border-color: var(--accent-strong); }
.search__go { position: absolute; right: 4px; top: 4px; width: 40px; height: 40px; border: 0; border-radius: 9px; background: var(--accent); color: #fff; display: grid; place-items: center; cursor: pointer; }
.search__list {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 60; background: var(--bg); border-radius: var(--r);
  box-shadow: 0 18px 50px rgba(14, 36, 22, 0.18); padding: 8px; max-height: 70vh; overflow: auto;
}
.search__list a { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: center; padding: 8px 10px; border-radius: 10px; text-decoration: none; }
.search__list img { width: 44px; height: 44px; object-fit: contain; background: var(--bg-2); border-radius: 8px; }
.search__list b { font-weight: 500; }
.search__list small { display: block; color: var(--muted); font-size: 13px; }
.search__list .price { font-weight: 600; white-space: nowrap; }
.search__list li.is-active a, .search__list a:hover { background: var(--bg-2); }
.search__none { padding: 12px; color: var(--muted); }
.head__phone { position: relative; flex: none; }
.head__phonebtn { display: flex; flex-direction: column; align-items: flex-start; border: 0; background: none; padding: 0; cursor: pointer; line-height: 1.2; text-align: left; }
.head__phonebtn b { font-weight: 600; white-space: nowrap; }
.head__phonebtn span { color: var(--muted); font-size: 13px; }
@media (hover: hover) { .head__phonebtn:hover b { color: var(--accent-strong); } }
.phonemenu { position: absolute; right: 0; top: calc(100% + 10px); z-index: 60; width: 300px; padding: 8px; background: var(--bg); border-radius: var(--r); box-shadow: 0 18px 50px rgba(14, 36, 22, 0.18); }
.phonemenu a { display: flex; flex-direction: column; padding: 10px 12px; border-radius: 10px; text-decoration: none; }
.phonemenu a span { color: var(--muted); font-size: 13px; }
.phonemenu a:hover { background: var(--bg-2); }
.head__icon { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; text-decoration: none; font-size: 13px; color: var(--ink); flex: none; min-width: 56px; }
.head__icon svg { color: var(--ink); }
@media (hover: hover) { .head__icon:hover, .head__icon:hover svg { color: var(--accent-strong); } }
.badge { position: absolute; top: -6px; left: calc(50% + 6px); min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--bg-3); color: var(--ink); font: 600 12px/20px var(--text); font-style: normal; text-align: center; }
.badge.active { background: var(--accent); color: #fff; }
.head__cart.is-bump svg { animation: bump 420ms var(--ease); }
@keyframes bump { 40% { transform: scale(1.2) rotate(-6deg); } }
.topnav { display: flex; gap: 26px; height: 44px; align-items: center; overflow-x: auto; scrollbar-width: none; }
/* Метка «новинка» у пункта меню (лазерный станок R1) */
.topnav__new { display: inline-block; margin-left: 4px; padding: 2px 6px; border-radius: 6px; background: var(--ink); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: 0.02em; vertical-align: 2px; }
.topnav::-webkit-scrollbar { display: none; }
.topnav a { text-decoration: none; font-weight: 600; white-space: nowrap; }
.topnav__hot { color: var(--sale); }
@media (hover: hover) { .topnav a:hover { color: var(--accent-strong); } }
/* Раскрывающиеся разделы «Пластик» и «Лабжурнал» (02.11.2026). Панель — на всю ширину шапки: опора —
   .head (sticky), а не .topnav, поэтому прокрутка .topnav по горизонтали панель не обрезает. Открывается
   наведением и фокусом (Tab), на касание — классом .is-open из shell.js; закрывается с задержкой 120 мс,
   чтобы мышь успела перейти на панель. */
.topnav__dd { display: flex; align-self: stretch; }
.topnav__dl { display: flex; align-items: center; gap: 5px; padding: 0; border: 0; background: none; color: inherit; font: inherit; font-weight: 600; white-space: nowrap; text-decoration: none; cursor: pointer; }
.topnav__dl::after { content: ''; width: 7px; height: 7px; margin-top: -3px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); opacity: 0.5; transition: transform 160ms var(--ease); }
.tdd { position: absolute; left: 0; right: 0; top: 100%; z-index: 5; background: var(--bg); box-shadow: 0 24px 40px rgba(14, 36, 22, 0.14); border-top: 1px solid var(--line); visibility: hidden; opacity: 0; transform: translateY(-4px); transition: opacity 140ms ease 120ms, transform 140ms ease 120ms, visibility 0s linear 260ms; }
.topnav__dd:hover .tdd, .topnav__dd:focus-within .tdd, .topnav__dd.is-open .tdd { visibility: visible; opacity: 1; transform: none; transition-delay: 60ms, 60ms, 0s; }
.topnav__dd:hover .topnav__dl, .topnav__dd.is-open .topnav__dl { color: var(--accent-strong); }
.topnav__dd:hover .topnav__dl::after, .topnav__dd.is-open .topnav__dl::after { transform: rotate(225deg); margin-top: 3px; }
.tdd a { white-space: normal; }
.tdd__in { display: grid; gap: 28px; padding-top: 24px; padding-bottom: 28px; }
.tdd__in--lab { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
/* «Полезное» — разделы карточками: иконка, заголовок-ссылка, пункты с подписью (05.11.2026) */
.tdl { display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: 16px; background: #fff; box-shadow: inset 0 0 0 1px var(--line); min-width: 0; }
.tdd .tdl__h { display: flex; align-items: center; gap: 10px; padding: 0 4px 6px; color: var(--ink); font: 700 16px/1.25 var(--display); }
.tdl__ic { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--bg-2); color: var(--ink); }
.tdl__links { display: flex; flex-direction: column; gap: 2px; }
.tdd .tdl__links a { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 10px; color: var(--ink); transition: background-color 120ms ease; }
.tdl__links img { flex: none; width: 36px; height: 36px; border-radius: 9px; object-fit: cover; }
.tdl__links img.tdl__app { box-shadow: 0 0 0 1px var(--line); }
.tdl__links span { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.tdl__links b { font-weight: 600; font-size: 14px; line-height: 1.25; }
.tdl__links small { color: var(--muted); font-size: 12.5px; line-height: 1.3; }
@media (hover: hover) { .tdd .tdl__links a:hover { background: var(--bg-2); } .tdd .tdl__links a:hover small { color: var(--muted); } }
.tdd__in--lab .tdd__card--help { display: grid; grid-template-columns: 120px 1fr; grid-template-rows: auto auto; align-content: center; column-gap: 8px; margin: 0; padding: 16px 18px 16px 8px; }
.tdd__in--lab .tdd__card--help img { grid-row: 1 / span 2; width: 120px; height: 120px; margin: 0; }
.tdd__in--lab .tdd__card--help b { align-self: end; padding: 0; font-size: 18px; }
.tdd__in--lab .tdd__card--help span { align-self: start; padding: 4px 0 0; font-size: 14px; }
.tdl__links i { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; background: var(--bg-2); color: var(--ink); }
.tdd__col { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tdd .tdd__h { margin-bottom: 6px; color: var(--ink); font: 700 16px/1.25 var(--display); white-space: normal; }
.tdd__col a:not(.tdd__h) { display: flex; align-items: center; gap: 8px; padding: 4px 0; color: var(--muted); font-weight: 500; font-size: 14px; line-height: 1.3; white-space: normal; }
.tdd__col img { flex: none; width: 28px; height: 28px; border-radius: 6px; background: var(--bg-2); object-fit: cover; }
.tdd__card { display: flex; flex-direction: column; gap: 2px; margin-bottom: 6px; padding-bottom: 12px; border-radius: var(--r); background: var(--bg-2); overflow: hidden; color: var(--ink); white-space: normal; }
.tdd__card img { width: 100%; height: 130px; margin-bottom: 8px; object-fit: cover; }
.tdd__card b, .tdd__card span { padding: 0 14px; }
.tdd__card b { font: 700 16px/1.25 var(--display); }
.tdd__card span { color: var(--muted); font-size: 13px; font-weight: 500; line-height: 1.35; }
.tdd__card--help { align-self: start; padding-top: 12px; }
.tdd__card--help img { width: 96px; height: 96px; margin: 0 0 4px 8px; object-fit: contain; }
@media (hover: hover) { .tdd a:hover, .tdd a:hover b { color: var(--accent-strong); } .tdd__card:hover img { opacity: 0.92; } }
/* «Пластик»: слева типы (наведение переключает панель — shell.js), справа плитки по назначению */
.tdd { max-height: calc(100vh - 160px); overflow-y: auto; overscroll-behavior: contain; }
.tdd__in--fil { grid-template-columns: 230px minmax(0, 1fr); gap: 32px; align-items: start; }
.tdd__rail { display: flex; flex-direction: column; gap: 2px; padding-right: 20px; box-shadow: 1px 0 0 var(--line); }
.tdd .tdd__tab { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 10px; color: var(--ink); font-weight: 600; font-size: 15px; }
.tdd__tab::after { content: ''; width: 7px; height: 7px; border-top: 2px solid currentColor; border-right: 2px solid currentColor; transform: rotate(45deg); opacity: 0.45; }
.tdd .tdd__tab[aria-current="true"] { background: var(--bg-2); }
/* полезные ссылки под типами — плашками со стрелкой, в одну строку каждая (стрелка не переносится) */
.tdd__more { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; padding-top: 14px; box-shadow: 0 -1px 0 var(--line); }
.tdd .tdd__more a { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 12px; border-radius: 10px; background: var(--bg-2); color: var(--ink); font-size: 13.5px; font-weight: 600; line-height: 1.25; }
.tdd__more a::after { content: ''; flex: none; width: 6px; height: 6px; border-top: 2px solid currentColor; border-right: 2px solid currentColor; transform: rotate(45deg); opacity: 0.45; }
@media (hover: hover) { .tdd .tdd__more a:hover { color: var(--accent-strong); } }
.tdd__in--prn { grid-template-columns: 230px minmax(0, 1fr); gap: 32px; align-items: start; }
/* «3D-принтеры» — как в магазине Bambu Lab: слева серии, справа карточки модели (фото сверху, имя, подпись, цена) */
.tdp__lead { margin: 2px 0 14px; color: var(--muted); font-size: 14px; }
.tdp__cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.tdd .tdp__card { position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 20px 16px 20px; border-radius: 16px; background: #fff; box-shadow: 0 1px 2px rgba(14, 36, 22, 0.06), 0 4px 16px rgba(14, 36, 22, 0.06); color: var(--ink); text-align: center; transition: box-shadow 160ms ease; }
.tdp__card::after { content: ''; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px var(--line); pointer-events: none; transition: box-shadow 160ms ease; }
.tdp__img { display: block; width: 100%; height: 170px; margin-bottom: 14px; }
.tdp__img img { display: block; width: 100%; height: 100%; object-fit: contain; transition: transform 260ms var(--ease); }
.tdp__card b { font: 500 18px/1.25 var(--display); }
.tdp__card small { color: var(--muted); font-size: 14px; line-height: 1.4; }
.tdp__card em { margin-top: 6px; font-size: 14px; font-style: normal; }
.tdp__card em:has(s) { color: var(--accent-strong); } /* цена со скидкой — зелёная (04.11.2026) */
.tdp__card em s { color: var(--muted); }
.tdp__card em.tdp__pre { display: inline-flex; align-items: center; margin-top: 10px; padding: 7px 16px; border-radius: 999px; background: var(--accent, #00b22d); color: #fff; font-weight: 600; font-size: 13.5px; }
.tdp__card:hover em.tdp__pre { filter: brightness(1.06); }
.tdp__card s { margin-left: 4px; color: var(--muted); }
.tdp__off, .tdp__tag { position: absolute; top: 12px; z-index: 1; padding: 4px 8px; border-radius: 8px; font: 600 12px/1 var(--text); font-style: normal; }
.tdp__off { left: 12px; background: var(--sale); color: #fff; }
.tdp__tag { right: 12px; background: var(--bg); color: var(--ink); box-shadow: inset 0 0 0 1px #d6dcd7; }
.tdp__tag--new { background: var(--ink); color: #fff; box-shadow: none; }
@media (hover: hover) { .tdd .tdp__card:hover::after { box-shadow: inset 0 0 0 1.5px var(--accent-strong); } .tdp__card:hover .tdp__img img { transform: translateY(-4px) scale(1.03); } }
@media (max-width: 1200px) { .tdp__cards { grid-template-columns: repeat(3, minmax(0, 1fr)); } .tdp__img { height: 140px; } .tdd__in--prn { grid-template-columns: 200px minmax(0, 1fr); gap: 24px; } }
.tdd__grp + .tdd__grp { margin-top: 18px; padding-top: 18px; box-shadow: 0 -1px 0 var(--line); }
.tdd__gh { margin: 0 0 10px; color: var(--ink); font: 700 15px/1.2 var(--display); }
.tdd__tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.tdd .tdd__tile { position: relative; display: flex; align-items: center; gap: 12px; min-height: 68px; padding-right: 12px; border-radius: 12px; background: #fff; box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); font-weight: 600; font-size: 15px; line-height: 1.25; overflow: hidden; }
.tdd__tile img { flex: none; width: 68px; height: 68px; background: var(--bg-2); }
.tdd__tag { position: absolute; z-index: 1; top: 0; right: 0; padding: 4px 8px; border-radius: 0 12px 0 10px; background: var(--sale); color: #fff; font: 700 11px/1 var(--text); font-style: normal; }
.tdd__tag--new { background: var(--accent-strong); }
/* рамка — отдельным слоем поверх картинки: inset-тень у самой плитки фото перекрывало */
.tdd .tdd__tile { box-shadow: none; }
.tdd__tile::after { content: ''; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px var(--line); pointer-events: none; }
@media (hover: hover) { .tdd .tdd__tile:hover::after { box-shadow: inset 0 0 0 1.5px var(--accent-strong); } .tdd .tdd__tile:hover { color: var(--ink); } .tdd .tdd__tab:hover { background: var(--bg-2); color: var(--ink); } }
@media (max-width: 1200px) { .tdd__tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } .tdd__in--fil { grid-template-columns: 200px minmax(0, 1fr); gap: 24px; } }
@media (prefers-reduced-motion: reduce) { .tdd { transition: none; } }

/* ===== Меню (кнопка «Меню», partials/header.html → .mm) ===== */
.catbtn svg path { fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; transform-origin: 12px 12px; transition: transform 220ms var(--ease), opacity 160ms ease; }
.catbtn[aria-expanded="true"] .catbtn__l1 { transform: translateY(6px) rotate(45deg); }
.catbtn[aria-expanded="true"] .catbtn__l2 { opacity: 0; }
.catbtn[aria-expanded="true"] .catbtn__l3 { transform: translateY(-6px) rotate(-45deg); }
.catmenu { position: absolute; left: 0; right: 0; top: 100%; z-index: 60; max-height: calc(100vh - 140px); overflow: auto; overscroll-behavior: contain; background: var(--bg); box-shadow: 0 24px 48px rgba(14, 36, 22, 0.14); border-top: 1px solid var(--line); }
.mm__top { display: none; }
.mm__in { display: flex; flex-direction: column; gap: 28px; padding-top: 24px; padding-bottom: 28px; }
.mm__tiles { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.mm__tile { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px 12px 16px; border-radius: 16px; background: #fff; box-shadow: 0 1px 2px rgba(14, 36, 22, 0.05), 0 6px 18px rgba(14, 36, 22, 0.06); color: var(--ink); text-align: center; text-decoration: none; }
.mm__tile img { width: 100%; height: 96px; margin-bottom: 8px; object-fit: contain; transition: transform 300ms var(--ease); }
.mm__tile b { font: 500 16px/1.25 var(--display); }
.mm__tile small { color: var(--muted); font-size: 13px; line-height: 1.3; }
.mm__tile::after { content: ''; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow 160ms ease; pointer-events: none; }
@media (hover: hover) { .mm__tile:hover::after { box-shadow: inset 0 0 0 1.5px var(--accent-strong); } .mm__tile:hover img { transform: scale(1.05); } }
/* ссылки — отдельной серой панелью со своей подписью: колонки не должны читаться как продолжение плиток над ними */
.mm__more { padding: 20px 28px 24px; border-radius: 20px; background: var(--bg-2); }
.mm__cap { margin: 0 0 16px; color: var(--muted); font-size: 13px; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; }
.mm__grps { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 20px 28px; }
.mm__grp { display: flex; flex-direction: column; min-width: 0; }
.mm__h { display: none; }
.mm__all { margin-bottom: 8px; color: var(--ink); font: 600 15px/1.3 var(--text); text-decoration: none; }
.mm__links { display: flex; flex-direction: column; gap: 7px; }
.mm__links a { color: var(--muted); font-size: 14px; line-height: 1.35; text-decoration: none; }
@media (hover: hover) { .mm__all:hover, .mm__links a:hover { color: var(--accent-strong); } }
.mm__foot { display: flex; flex-wrap: wrap; gap: 10px; }
.mm__foot a { display: flex; flex-direction: column; gap: 2px; padding: 10px 16px; border-radius: 12px; background: #fff; box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); text-decoration: none; }
.mm__foot b { font-size: 14px; font-weight: 600; }
.mm__foot span { color: var(--muted); font-size: 13px; }
@media (hover: hover) { .mm__foot a:hover { color: var(--accent-strong); } }
@media (max-width: 1180px) { .mm__tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } .mm__grps { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

/* ===== Подвал ===== */
.foot { margin-top: clamp(64px, 8vw, 104px); background: var(--deep); color: #c9d8cd; padding: 48px 0 24px; }
.foot a { color: #fff; text-decoration: none; }
@media (hover: hover) { .foot a:hover { color: #7fe39a; } }
.foot__cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
.logo--light span { color: #fff; }
.foot__brand { display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.foot__phone { font: 700 22px/1 var(--text); }
.foot__social { display: flex; gap: 10px; }
.foot__social img { width: 28px; height: 28px; }
.foot__col { display: flex; flex-direction: column; gap: 8px; }
.foot__col b { color: #fff; margin-bottom: 6px; }
.foot__legal { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 24px; margin-top: 40px; padding-top: 20px; border-top: 1px solid rgba(255, 255, 255, 0.12); font-size: 13px; }
.foot__pay { display: flex; gap: 12px; }
.foot__pay img { height: 20px; width: auto; background: #fff; border-radius: 4px; padding: 2px 6px; }

/* ===== Плавающая кнопка: AI-Панда и Telegram (assistant.js держит на ней приветствие) ===== */
.fcontact { position: fixed; right: 24px; bottom: 24px; z-index: 70; display: flex; flex-direction: column; align-items: flex-end; }
.fcontact__btn { display: flex; align-items: center; gap: 8px; height: 48px; padding: 0 18px 0 8px; border: 0; border-radius: 999px; background: var(--accent-strong); color: #fff; font-weight: 600; font-size: 15px; cursor: pointer; box-shadow: 0 6px 20px rgba(0, 178, 45, 0.35); transition: transform 160ms var(--ease), background-color 160ms ease; }
.fcontact__btn img { width: 34px; height: 34px; border-radius: 50%; background: #fff; object-fit: cover; }
@media (hover: hover) { .fcontact__btn:hover { background: #009626; transform: translateY(-2px); } }
.fcontact__menu { position: absolute; right: 0; bottom: calc(100% + 10px); min-width: 190px; padding: 8px; background: var(--bg); border-radius: var(--r); box-shadow: 0 18px 50px rgba(14, 36, 22, 0.18); }
.fcontact__menu a, .fcontact__menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 0; border-radius: 10px; background: none; text-align: left; text-decoration: none; font-weight: 600; cursor: pointer; }
.fcontact__menu img, .fcontact__menu svg { width: 22px; height: 22px; border-radius: 50%; }
@media (hover: hover) { .fcontact__menu a:hover, .fcontact__menu button:hover { background: var(--bg-2); } }
body.has-cookie-banner .fcontact { bottom: 96px; }
/* Кнопка Панды не закрывает кнопки покупки (аудит 01.11.2026): после первого экрана — круг без подписи,
   на телефоне прячется, пока листают вниз; на корзине, оформлении и в кабинете скрыта (shell.js) */
.fcontact { transition: transform 220ms var(--ease), opacity 220ms ease; }
.fcontact.is-compact .fcontact__btn { padding: 0 7px; }
.fcontact.is-compact .fcontact__btn span { display: none; }
.fcontact.is-away { transform: translateY(calc(100% + 32px)); opacity: 0; pointer-events: none; }
.fcontact.is-off .fcontact__btn { display: none; } /* меню чата остаётся: его открывает нижнее меню */

/* ===== Планшет ===== */
@media (max-width: 1180px) {
  .head__phonebtn span { display: none; }
  .util__nav a:nth-child(n+4) { display: none; }
}
/* ===== Телефон ===== */
@media (max-width: 900px) {
  .head__in { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; grid-template-areas: "logo logo lk cart" "cat search search search"; height: auto; padding-top: 10px; padding-bottom: 12px; gap: 10px 12px; }
  .logo { grid-area: logo; }
  .catbtn { grid-area: cat; height: 48px; padding: 0 14px; }
  .search { grid-area: search; }
  /* выпадающий список поиска — на ширину экрана (left/right ставит shell.js → fitList), строки компактнее */
  .search__list { padding: 6px; max-height: min(70vh, calc(100dvh - 190px)); }
  .search__list a { grid-template-columns: 40px minmax(0, 1fr) auto; gap: 10px; padding: 8px; }
  .search__list img { width: 40px; height: 40px; }
  .search__list b { font-size: 15px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .search__list small { font-size: 12.5px; margin-top: 2px; }
  .search__list .price { font-size: 14.5px; }
  #lkHeaderBtn { grid-area: lk; }
  .head__cart { grid-area: cart; }
  .head__phone { display: none; }
  .logo span { font-size: 19px; }
  .topnav { display: none; }
  .head { position: relative; } /* не липнет, но остаётся опорой и слоем для меню каталога (static прятал его под баннер) */
  html { scroll-padding-top: 16px; }
  /* меню — шторка на весь экран, поверх нижнего меню */
  .catmenu { position: fixed; inset: 0; z-index: 95; display: flex; flex-direction: column; max-height: none; border-top: 0; box-shadow: none; }
  .catmenu[hidden] { display: none; }
  html.mm-open { overflow: hidden; }
  html.mm-open .tabbar { display: none; }  /* меню лежит в слое шапки — нижнее меню иначе оказывается поверх него */
  .mm__top { display: flex; align-items: center; justify-content: space-between; flex: none; padding: 10px 12px 10px 20px; border-bottom: 1px solid var(--line); }
  .mm__top b { font: 600 20px/1.2 var(--display); }
  .mm__x { width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--bg-2); font-size: 26px; line-height: 1; cursor: pointer; }
  .mm__in { flex: 1; overflow: auto; overscroll-behavior: contain; gap: 20px; padding-top: 16px; padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
  .mm__tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .mm__tile { flex-direction: row; align-items: center; gap: 10px; padding: 10px; text-align: left; }
  .mm__tile img { flex: none; width: 52px; height: 52px; margin: 0; }
  .mm__tile b { font-size: 15px; white-space: nowrap; }
  .mm__tile small { display: none; }
  .mm__more { padding: 0; border-radius: 0; background: none; }
  .mm__cap { margin: 4px 4px 4px; }
  .mm__grps { display: flex; flex-direction: column; gap: 0; }
  .mm__grp { border-bottom: 1px solid var(--line); }
  .mm__h { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 54px; padding: 0 4px; border: 0; background: none; color: var(--ink); font: 500 17px/1.3 var(--text); text-align: left; cursor: pointer; }
  .mm__h::after { content: ''; width: 9px; height: 9px; margin-right: 6px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: translateY(-3px) rotate(45deg); transition: transform 200ms var(--ease); }
  .mm__h[aria-expanded="true"]::after { transform: translateY(2px) rotate(-135deg); }
  .mm__all, .mm__links { display: none; }
  .mm__grp.is-open .mm__links { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; padding: 0 4px 10px; }
  .mm__grp.is-open .mm__links a { display: flex; align-items: center; min-height: 40px; color: var(--ink); font-size: 15px; }
  .mm__grp.is-open .mm__all { display: flex; align-items: center; order: 3; min-height: 40px; margin: 0 4px 12px; color: var(--accent-strong); font-size: 15px; font-weight: 500; }
  .mm__grp.is-open .mm__all::before { content: 'Смотреть раздел: '; color: var(--muted); font-weight: 400; margin-right: 4px; }
  .mm__foot { flex-direction: column; padding-top: 4px; border-top: 0; }
  .util__nav { display: none; }
  .util__tel { display: inline; }
  .foot__cols { grid-template-columns: 1fr 1fr; }
  .foot__brand { grid-column: 1 / -1; }
  :root { --nav-height: 0px; }
}
@media (max-width: 560px) {
  .util__where span { display: none; }
  .head__icon span:not(.badge) { display: none; }
  .head__icon { min-width: 40px; }
  .foot__cols { grid-template-columns: 1fr; }
  .fcontact { right: 16px; bottom: 16px; }
  .fcontact__btn { padding: 0 8px; }
  .fcontact__btn span { display: none; }
}

/* ===== Выпадающий список в стиле сайта (shell.js → HLSelect) ===== */
.hsel { position: relative; display: block; min-width: 0; }
.hsel__native { position: absolute !important; inset: 0; width: 100% !important; height: 100% !important; opacity: 0 !important; pointer-events: none !important; }
.hsel__btn { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 46px; padding: 10px 14px; border: 0; border-radius: 12px; background: var(--bg-2); color: var(--ink); font: 600 15px/1.25 var(--text, inherit); text-align: left; cursor: pointer; box-shadow: none; -webkit-appearance: none; appearance: none; transition: box-shadow 160ms ease, background-color 160ms ease; }
.hsel__btn img { width: 28px; height: 28px; flex: none; border-radius: 6px; object-fit: contain; background: #fff; }
.hsel__val { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hsel__btn svg { flex: none; color: var(--muted); transition: transform 200ms ease; }
.hsel.is-open .hsel__btn { box-shadow: inset 0 0 0 2px var(--ink); }
.hsel.is-open .hsel__btn svg { transform: rotate(180deg); }
.hsel__btn:focus-visible { outline: 3px solid var(--accent-strong, #00961f); outline-offset: 2px; }
.hsel__btn:disabled { opacity: 0.5; cursor: default; }
@media (hover: hover) { .hsel__btn:not(:disabled):hover { background: #eaedeb; } }
.hsel__list { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 70; max-height: 320px; overflow-y: auto; margin: 0; padding: 6px; list-style: none; border-radius: 14px; background: #fff; box-shadow: 0 12px 32px rgba(20, 26, 22, 0.16), 0 0 0 1px rgba(20, 26, 22, 0.06); overscroll-behavior: contain; }
.hsel.is-up .hsel__list { top: auto; bottom: calc(100% + 6px); }
.hsel__list[hidden] { display: none; }
.hsel__list [role=option] { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; color: var(--ink); font-size: 15px; line-height: 1.3; cursor: pointer; }
.hsel__list [role=option] img { width: 36px; height: 36px; flex: none; border-radius: 8px; object-fit: contain; background: var(--bg-2); }
.hsel__list [role=option].is-active { background: var(--bg-2); }
.hsel__list [role=option][aria-selected="true"] { font-weight: 700; }
.hsel__list [role=option][aria-selected="true"]::after { content: ''; width: 6px; height: 11px; margin-left: auto; border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink); transform: rotate(45deg) translate(-2px, -2px); flex: none; }
.hsel__list [aria-disabled="true"] { opacity: 0.4; cursor: default; }
.hsel__group { padding: 10px 12px 4px; color: var(--muted); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }

/* ===== Нижнее меню на телефоне (partials/footer.html, shell.js) =====
   --tb — его высота; всё, что прижато к низу экрана, поднимается на неё. */
:root { --tb: 0px; }
.tabbar { display: none; }
@media (max-width: 900px) {
  :root { --tb: calc(60px + env(safe-area-inset-bottom)); }
  html.no-tabbar { --tb: 0px; }
  html.no-tabbar .tabbar { display: none; }
  body { padding-bottom: var(--tb); }
  .tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 75; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); height: var(--tb); padding-bottom: env(safe-area-inset-bottom); background: rgba(255, 255, 255, 0.98); box-shadow: 0 -1px 0 var(--line); font: 400 12px/1.2 var(--text); }
  .tabbar a, .tabbar button { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-width: 0; padding: 0; border: 0; background: none; color: var(--muted); font: inherit; text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
  .tabbar svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .tabbar img { width: 26px; height: 26px; border-radius: 50%; box-shadow: 0 0 0 1.5px var(--accent-strong); }
  .tabbar [aria-current="page"], .tabbar [aria-expanded="true"] { color: var(--ink); }
  .tabbar [aria-current="page"] svg { stroke: var(--accent-strong); }
  .tabbar .badge { position: absolute; top: 6px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent-strong); color: #fff; font-size: 11px; font-weight: 600; line-height: 18px; text-align: center; }
  .tabbar .badge[hidden] { display: none; }
  /* кнопка чата живёт в меню — плавающую прячем, её меню открывается над нижним меню */
  .fcontact, body.has-pp-sticky .fcontact { right: 12px; bottom: calc(var(--tb) + 8px); }
  .fcontact__btn { display: none; }
  .pp-sticky, .evp-mobile { bottom: var(--tb); }
  .cookie-banner, body.has-pp-sticky .cookie-banner { bottom: calc(var(--tb) + 10px) !important; }
  body.has-pp-sticky .cookie-banner { bottom: calc(var(--tb) + 76px) !important; }
  .toast { bottom: calc(var(--tb) + 16px); }
  .spx-bar { bottom: calc(var(--tb) + 12px); }
  .panda-teaser { bottom: calc(var(--tb) + 12px); }
  .head__icon { min-height: 44px; }
  .util__tel { display: inline-flex; align-items: center; min-height: 32px; }
}
@media (max-width: 560px) {
  /* подвал короче: ссылки в две колонки вместо одной */
  .foot__cols { grid-template-columns: 1fr 1fr; gap: 24px 16px; }
  .foot__brand { grid-column: 1 / -1; }
  .foot__col a { font-size: 14px; }
}

