/* VilMarket — общие стили каталога и карточки товара.
   Сетка: узкая служебная полоса → шапка → контент 1240px; слева фильтры, справа товары.
   Палитра: лесной графит + светлый «опил» + фирменный оранжевый только для действий. */
:root {
  --bg: #F0F1ED;
  --surface: #FFFFFF;
  --surface-2: #E6E8E2;
  --ink: #1C2420;
  --muted: #5B655F;
  --line: #D6DAD2;
  --accent: #EA5501;        /* фирменный оранжевый из логотипа ВилМаркет: кнопки, акценты */
  --accent-ink: #FFFFFF;
  --accent-soft: #FBE7DC;
  --forest: #234536;        /* тёмная полоса, бейджи */
  --forest-ink: #E9EFEA;
  --ok: #2F7A4B;
  --wood: #DDBB82;          /* торец сосны на схемах */
  --wood-ring: #B48447;
  --larch: #D49A6A;         /* торец лиственницы */
  --larch-ring: #9C5F33;
  --aspen: #E8D7AE;         /* торец осины */
  --aspen-ring: #B9A26F;
  --dim: #3E4A44;           /* размерные линии */

  --f-display: "Unbounded", "Onest", system-ui, sans-serif;
  --f-body: "Onest", system-ui, -apple-system, "Segoe UI", sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --r: 10px;
  --wrap: 1240px;
  /* Сайт всегда светлый: тёмная тема системы/браузера его не перекрашивает */
  color-scheme: light;
}

* { box-sizing: border-box; }
body { background: var(--bg); color: var(--ink); font: 400 15px/1.55 var(--f-body); margin: 0; }
a { color: inherit; }
h1, h2, h3 { text-wrap: balance; margin: 0; line-height: 1.2; }
p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--f-mono); }

.wrap {
  max-width: var(--wrap); margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* ── служебная полоса ── */
.topbar { background: var(--forest); color: var(--forest-ink); font-size: 13px; }
.topbar .wrap { display: flex; gap: 8px 24px; align-items: center; flex-wrap: wrap; padding-block: 7px; }
.topbar span { opacity: .85; }
.topbar .push { margin-left: auto; display: flex; gap: 16px; }
.topbar a { text-decoration: none; opacity: .9; }
.topbar a:hover { opacity: 1; text-decoration: underline; }

/* ── шапка ── */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--surface); }
.header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 9; background: var(--surface); border-bottom: 1px solid var(--line); }
.header .wrap { display: flex; align-items: center; gap: 20px; padding-block: 12px; }
.logo { display: flex; align-items: center; gap: 10px; text-decoration: none; flex: none; }
.logo-img { display: block; height: 40px; width: auto; aspect-ratio: 181 / 49; max-width: 100%; color: var(--ink); }
.logo-sub { font-size: 11px; line-height: 1.3; color: var(--muted); border-left: 1px solid var(--line); padding-left: 10px; }
.footer .logo-img { color: var(--forest-ink); }
.btn-catalog { display: inline-flex; align-items: center; gap: 8px; background: var(--ink); color: var(--bg); border: 0; border-radius: 8px; padding: 10px 16px; font-weight: 600; cursor: pointer; text-decoration: none; }
.search { flex: 1; min-width: 0; display: flex; border: 1.5px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--bg); }
.search input { flex: 1; min-width: 0; border: 0; background: none; padding: 9px 12px; outline: none; }
.search button { border: 0; background: none; padding: 0 12px; color: var(--muted); cursor: pointer; }
.phone-block { text-align: right; flex: none; }
.phone-block a { font: 600 18px/1.1 var(--f-body); text-decoration: none; white-space: nowrap; }
.phone-block button { background: none; border: 0; padding: 0; color: var(--accent); font-size: 13px; cursor: pointer; border-bottom: 1px dashed currentColor; }
.icon-btn { position: relative; display: grid; place-items: center; width: 42px; height: 42px; border-radius: 8px; border: 1.5px solid var(--line); background: var(--surface); text-decoration: none; flex: none; }
.icon-btn svg { width: 20px; height: 20px; }
.badge { position: absolute; top: -6px; right: -6px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.badge[data-count="0"] { display: none; }
.messengers { display: flex; gap: 8px; flex: none; }

.catnav { border-bottom: 1px solid var(--line); background: var(--surface); }
.catnav .wrap { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; padding-block: 0; }
.catnav a { padding: 10px 12px; white-space: nowrap; text-decoration: none; font-size: 14px; color: var(--muted); border-bottom: 2px solid transparent; }
.catnav a:hover { color: var(--ink); }
.catnav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }

/* ── хлебные крошки и заголовок ── */
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 18px 0 12px; font-size: 13px; color: var(--muted); }
.crumbs li + li::before { content: "/"; margin-right: 6px; opacity: .5; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--accent); }
.h1 { font: 600 clamp(24px, 3.2vw, 36px)/1.15 var(--f-display); letter-spacing: -.02em; }
.lead { color: var(--muted); max-width: 70ch; margin-top: 10px; }
.lead b { color: var(--ink); font-weight: 600; }

/* ── кнопки ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 8px; padding: 11px 18px; font-weight: 600; border: 1.5px solid transparent; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-wa { background: #25D366; color: #08331A; }
.btn-tg { background: #2AABEE; color: #04263A; }
.btn-sm { padding: 7px 12px; font-size: 13px; }
.btn-block { width: 100%; }
.btn.added { background: var(--ok); color: var(--surface); }

/* ── доверие ── */
.trust { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; margin-top: 18px; }
.trust div { background: var(--surface); padding: 12px 14px; display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--muted); }
.trust b { display: block; color: var(--ink); font-size: 14px; }
.trust svg { width: 22px; height: 22px; flex: none; color: var(--accent); margin-top: 1px; }

/* ── теги размеров ── */
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 0; padding: 0; list-style: none; }
.tags a { display: inline-block; padding: 6px 12px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); text-decoration: none; font-size: 14px; }
.tags a:hover, .tags a.on { border-color: var(--accent); color: var(--accent); }

/* ── каталог: сетка с фильтрами ── */
.layout { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 24px; margin-top: 24px; align-items: start; }
.filters { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; position: sticky; top: calc(env(safe-area-inset-top, 0px) + 80px); }
.filters fieldset { border: 0; padding: 0; margin: 0 0 18px; }
.filters legend { font-weight: 600; margin-bottom: 8px; font-size: 14px; }
.chk { display: flex; align-items: center; gap: 8px; padding: 4px 0; cursor: pointer; font-size: 14px; }
.chk input { accent-color: var(--accent); width: 16px; height: 16px; }
.chk .cnt { margin-left: auto; color: var(--muted); font-size: 12px; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: inline-block; padding: 5px 9px; border: 1px solid var(--line); border-radius: 6px; font: 500 13px var(--f-mono); }
.seg input:checked + span { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.filters .reset { background: none; border: 0; color: var(--muted); cursor: pointer; padding: 0; font-size: 13px; text-decoration: underline; }

.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar .found { color: var(--muted); font-size: 14px; }
.toolbar select { border: 1px solid var(--line); background: var(--surface); border-radius: 8px; padding: 7px 10px; }
.view-toggle { margin-left: auto; display: flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.view-toggle button { border: 0; background: var(--surface); padding: 7px 12px; cursor: pointer; font-size: 13px; color: var(--muted); }
.view-toggle button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.mob-filter { display: none; }

/* карточки */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); gap: 14px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); display: flex; flex-direction: column; overflow: hidden; transition: border-color .15s, box-shadow .15s; }
.card:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); box-shadow: 0 6px 20px -12px rgba(0,0,0,.25); }
.card.hl { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.card-media { position: relative; display: block; background: var(--surface-2); aspect-ratio: 4 / 3; max-width: 100%; }
.card-media .sec { position: absolute; inset: 0; display: grid; place-items: center; }
.card-media .sec svg { width: 78%; height: 78%; }
.card-media .pill { position: absolute; left: 10px; top: 10px; }
.pill { display: inline-block; padding: 3px 8px; border-radius: 5px; font-size: 12px; font-weight: 600; background: var(--forest); color: var(--forest-ink); }
.pill.larch { background: var(--larch-ring); color: #fff; }
.card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-title { font-weight: 600; font-size: 15px; line-height: 1.3; text-decoration: none; }
.card-title:hover { color: var(--accent); }
.specs { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 12.5px; color: var(--muted); margin: 0; padding: 0; list-style: none; }
.price { margin-top: auto; display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 2px 8px; padding-top: 6px; border-top: 1px dashed var(--line); }
.price .m3 { font: 600 20px/1.1 var(--f-display); letter-spacing: -.02em; white-space: nowrap; }
.price .m3 small { font: 400 13px var(--f-body); color: var(--muted); letter-spacing: 0; }
.price .pc { font-size: 13px; color: var(--muted); text-align: right; white-space: nowrap; }
.price .pc b { color: var(--ink); }
.price .vat { grid-column: 1 / -1; font-size: 12px; color: var(--muted); }
.buy { display: grid; grid-template-columns: auto 1fr; gap: 8px; }
.qty { display: inline-flex; border: 1.5px solid var(--line); border-radius: 8px; overflow: hidden; height: 40px; }
.qty button { width: 32px; border: 0; background: var(--surface-2); cursor: pointer; font-size: 17px; }
.qty input { width: 46px; border: 0; text-align: center; background: var(--surface); -moz-appearance: textfield; font-variant-numeric: tabular-nums; }
.qty input::-webkit-inner-spin-button { -webkit-appearance: none; }
.qty-unit { font-size: 12px; color: var(--muted); grid-column: 1 / -1; margin-top: -4px; }
.one-click { background: none; border: 0; color: var(--muted); font-size: 13px; cursor: pointer; text-decoration: underline; padding: 0; justify-self: start; }
.one-click:hover { color: var(--accent); }

/* вид «Список» */
.grid.list { grid-template-columns: minmax(0, 1fr); gap: 8px; }
.grid.list .card { flex-direction: row; align-items: stretch; }
.grid.list .card-media { width: 120px; flex: none; aspect-ratio: auto; }
.grid.list .card-media .pill { display: none; }
.grid.list .card-body { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 6px 18px; }
.grid.list .card-title { flex: 1 1 260px; }
.grid.list .specs { flex: 1 1 100%; order: 2; }
.grid.list .price { margin-top: 0; border-top: 0; padding-top: 0; flex: 0 0 auto; }
.grid.list .buy { flex: 0 0 auto; grid-template-columns: auto auto; }
.grid.list .qty-unit, .grid.list .one-click { display: none; }
@media (max-width: 640px) {
  .grid.list .card-media { width: 84px; }
  .grid.list .buy { grid-template-columns: 1fr; flex: 1 1 100%; }
}

/* таблица-прайс */
.tbl-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); }
table.price-tbl { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 640px; }
.price-tbl th, .price-tbl td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.price-tbl th { font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; background: var(--surface-2); }
.price-tbl td.r, .price-tbl th.r { text-align: right; font-variant-numeric: tabular-nums; }
.price-tbl tr:last-child td { border-bottom: 0; }
.price-tbl tbody tr:hover { background: var(--bg); }
.price-tbl a { font-weight: 600; text-decoration: none; }
.price-tbl a:hover { color: var(--accent); }
.price-tbl .size { font-family: var(--f-mono); font-weight: 600; }

/* ── секции ниже ── */
.section { margin-top: 48px; }
.section > h2, .h2 { font: 600 clamp(20px, 2.2vw, 26px)/1.2 var(--f-display); letter-spacing: -.015em; margin-bottom: 16px; }
.muted { color: var(--muted); }

/* калькулятор + лид-форма */
.calc { display: grid; grid-template-columns: 1.15fr 1fr; background: var(--forest); color: var(--forest-ink); border-radius: 14px; overflow: hidden; }
.calc-l, .calc-r { padding: 26px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.calc-r { background: color-mix(in srgb, var(--forest) 80%, #000); }
.calc h2 { font: 600 22px/1.2 var(--f-display); }
.calc .row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.calc label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; opacity: .9; min-width: 0; }
.calc select, .calc input { border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.08); color: var(--forest-ink); border-radius: 8px; padding: 9px 10px; width: 100%; }
.calc select option { color: #1C2420; }
.calc .out { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; border-top: 1px solid rgba(255,255,255,.15); padding-top: 14px; }
.calc .out div { font-size: 12px; opacity: .85; }
.calc .out b { display: block; font: 600 20px/1.2 var(--f-display); opacity: 1; margin-top: 2px; }
.calc .note { font-size: 12px; opacity: .7; }
.form { display: flex; flex-direction: column; gap: 10px; }
.form input::placeholder { color: rgba(233,239,234,.55); }
.form .agree { font-size: 12px; opacity: .7; }
.form .ok { background: rgba(93,187,130,.18); border: 1px solid rgba(93,187,130,.5); padding: 12px; border-radius: 8px; font-size: 14px; }

/* FAQ */
.faq { display: grid; gap: 8px; }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 0 16px; }
.faq summary { cursor: pointer; padding: 14px 0; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font: 400 20px/1 var(--f-mono); color: var(--accent); }
.faq details[open] summary::after { content: "−"; }
.faq details p { padding-bottom: 14px; color: var(--muted); max-width: 75ch; }

/* SEO-текст */
.prose { max-width: 75ch; display: grid; gap: 12px; }
.prose h2 { font: 600 22px/1.25 var(--f-display); margin-top: 8px; }
.prose h3 { font-size: 17px; margin-top: 6px; }
.prose ul { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.prose p, .prose li { color: var(--muted); }
.prose b { color: var(--ink); }

.links-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.links-grid a { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; text-decoration: none; display: flex; justify-content: space-between; gap: 8px; }
.links-grid a:hover { border-color: var(--accent); }
.links-grid span { color: var(--muted); font-size: 13px; white-space: nowrap; }

/* ── футер ── */
.footer { margin-top: 64px; background: var(--forest); color: var(--forest-ink); font-size: 14px; }
.footer .wrap { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1.3fr; gap: 24px; padding-block: 36px 28px; }
.footer h3 { font-size: 14px; margin-bottom: 10px; }
.footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.footer a { text-decoration: none; opacity: .85; }
.footer a:hover { opacity: 1; text-decoration: underline; }
.footer .legal { grid-column: 1 / -1; border-top: 1px solid rgba(255,255,255,.12); padding-top: 16px; font-size: 12px; opacity: .7; }
.footer .big { font: 600 20px var(--f-body); opacity: 1; }

/* ── мобильная панель действий ── */
.mbar { display: none; }

/* ── модалка «купить в 1 клик» ── */
.modal { border: 0; border-radius: 14px; padding: 0; width: min(420px, calc(100vw - 32px)); background: var(--surface); color: var(--ink); }
.modal::backdrop { background: rgba(10, 15, 12, .55); }
.modal form { padding: 22px; display: grid; gap: 12px; }
.modal h2 { font: 600 19px/1.25 var(--f-display); }
.modal input { border: 1.5px solid var(--line); border-radius: 8px; padding: 10px 12px; background: var(--bg); width: 100%; }
.modal .x { position: absolute; right: 10px; top: 8px; background: none; border: 0; font-size: 22px; cursor: pointer; color: var(--muted); }

/* ── товар ── */
.pdp { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 28px; margin-top: 18px; align-items: start; }
.gallery { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; display: grid; gap: 12px; }
.gallery .stage { aspect-ratio: 4 / 3; max-width: 100%; display: grid; place-items: center; background: var(--surface-2); border-radius: 10px; }
.gallery .stage svg { width: 86%; height: 86%; }
.gallery .cap { font-size: 13px; color: var(--muted); }
.thumbs { display: grid; grid-template-columns: repeat(3, minmax(0, 96px)); gap: 8px; }
.thumbs button { aspect-ratio: 1; max-width: 100%; border: 1.5px solid var(--line); border-radius: 8px; background: var(--surface-2); cursor: pointer; padding: 6px; display: grid; place-items: center; font-size: 11px; color: var(--muted); }
.thumbs button[aria-pressed="true"] { border-color: var(--accent); }
.thumbs svg { width: 80%; height: 80%; }

.buybox { display: grid; gap: 18px; }
.buybox .meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.stock { color: var(--ok); font-weight: 600; }
.opt-label { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.opts { display: flex; flex-wrap: wrap; gap: 6px; }
.opts a { padding: 7px 12px; border: 1.5px solid var(--line); border-radius: 8px; text-decoration: none; font-size: 14px; background: var(--surface); }
.opts a.mono { font-size: 13px; }
.opts a:hover { border-color: var(--ink); }
.opts a[aria-current="true"] { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.opts a small { display: block; font-size: 11px; color: var(--muted); }
.opts a[aria-current="true"] small { color: inherit; opacity: .75; }

.pricebox { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; display: grid; gap: 14px; }
.pb-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.pb-price { font: 600 32px/1 var(--f-display); letter-spacing: -.03em; }
.pb-price small { font: 400 15px var(--f-body); color: var(--muted); letter-spacing: 0; }
.pb-sub { font-size: 14px; color: var(--muted); margin-top: 6px; }
.pb-sub b { color: var(--ink); }
.vat-sw { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; font-size: 13px; }
.vat-sw button { border: 0; background: var(--surface); padding: 6px 10px; cursor: pointer; color: var(--muted); }
.vat-sw button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.pb-calc { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: center; background: var(--bg); border-radius: 10px; padding: 12px; }
.pb-calc .unit { display: inline-flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; margin-left: 8px; vertical-align: middle; }
.pb-calc .unit button { border: 0; background: var(--surface); padding: 5px 8px; font-size: 12px; cursor: pointer; color: var(--muted); }
.pb-calc .unit button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.pb-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.pb-total .pb-label { display: block; margin-bottom: 2px; }
.pb-total { text-align: right; font-size: 13px; color: var(--muted); }
.pb-total b { display: block; font: 600 22px/1.2 var(--f-display); color: var(--ink); }
.pb-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pb-actions .wide { grid-column: 1 / -1; }
.ship { display: grid; gap: 10px; font-size: 14px; }
.ship div { display: flex; gap: 10px; align-items: flex-start; }
.ship svg { width: 20px; height: 20px; flex: none; color: var(--muted); margin-top: 1px; }
.ship b { font-weight: 600; }

.dl { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); margin: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.dl div { display: contents; }
.dl dt, .dl dd { margin: 0; padding: 10px 14px; border-bottom: 1px solid var(--line); font-size: 14px; }
.dl dt { color: var(--muted); }
.dl dd { font-weight: 500; font-variant-numeric: tabular-nums; }
.dl div:last-child dt, .dl div:last-child dd { border-bottom: 0; }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.usage { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.usage div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px; font-size: 14px; }
.usage b { display: block; margin-bottom: 4px; }
.usage span { color: var(--muted); font-size: 13px; }
/* иконка-иллюстрация применения (рисует app.js) */
.usage .u-ico { display: grid; place-items: center; width: 56px; height: 56px; margin-bottom: 12px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); }
.usage .u-ico svg { width: 34px; height: 34px; }

.toc { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 36px; padding: 0; list-style: none; border-bottom: 1px solid var(--line); }
.toc a { display: inline-block; padding: 10px 12px; text-decoration: none; color: var(--muted); font-weight: 500; border-bottom: 2px solid transparent; }
.toc a:hover { color: var(--ink); border-bottom-color: var(--accent); }

/* ── главная ── */
.hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 32px; align-items: center; padding-block: 36px 8px; }
.hero .h1 { font-size: clamp(28px, 4.2vw, 50px); line-height: 1.08; }
.hero .h1 em { font-style: normal; color: var(--accent); }
.hero .lead { font-size: 17px; margin-top: 16px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.hero-cta .btn { padding: 13px 20px; font-size: 16px; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 8px 22px; margin-top: 22px; padding: 0; list-style: none; font-size: 14px; color: var(--muted); }
.hero-facts b { color: var(--ink); font: 600 18px/1.2 var(--f-display); display: block; }
.pile { position: relative; background: var(--surface-2); border-radius: 16px; padding: 14px; }
.pile svg { display: block; width: 100%; height: auto; }
.pile picture { display: block; }
.pile-photo { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 10px; }
.pile .tag { position: absolute; left: 18px; bottom: 18px; background: var(--surface); border-radius: 10px; padding: 10px 14px; box-shadow: 0 8px 24px -12px rgba(0,0,0,.35); font-size: 13px; color: var(--muted); }
.pile .tag b { display: block; font: 600 20px/1.15 var(--f-display); color: var(--ink); }

.cats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
/* плитка раздела: фото сверху, название и цена снизу */
.cat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); display: flex; flex-direction: column; overflow: hidden; text-decoration: none; transition: border-color .15s, box-shadow .15s; }
.cat:hover { border-color: var(--accent); box-shadow: 0 6px 20px -12px rgba(0,0,0,.25); }
.cat-photo { position: relative; display: block; aspect-ratio: 4 / 3; max-width: 100%; background: var(--surface-2); overflow: hidden; }
.cat-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.cat:hover .cat-photo img { transform: scale(1.04); }
.cat-photo .sec { position: absolute; inset: 0; display: grid; place-items: center; }
.cat-photo .sec svg { width: 70%; height: 70%; }
.cat-photo.has-photo .sec { display: none; }
.cat-text { display: block; padding: 12px 14px 14px; }
.cat b { display: block; font-size: 16px; line-height: 1.25; margin-bottom: 4px; }
.cat-text > span { font-size: 13px; color: var(--muted); }
.cat .from { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; }

.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; list-style: none; padding: 0; margin: 0; counter-reset: s; }
.steps li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; counter-increment: s; display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
.steps li::before { content: counter(s); font: 600 14px/1 var(--f-mono); color: var(--accent-ink); background: var(--accent); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; }
.steps b { color: var(--ink); font-size: 15px; }

.why { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.why div { background: var(--surface); padding: 18px; font-size: 14px; color: var(--muted); }
.why b { display: block; color: var(--ink); font-size: 16px; margin-bottom: 4px; }

.articles { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.articles a { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; text-decoration: none; display: grid; gap: 8px; align-content: start; }
.articles a:hover { border-color: var(--accent); }
.articles small { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.articles b { font-size: 15px; line-height: 1.35; }
/* производство: видео + текст, ниже галерея */
.eyebrow { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); margin-bottom: 8px; }
#production > h2 { font: 600 clamp(20px, 2.2vw, 26px)/1.2 var(--f-display); letter-spacing: -.015em; margin-bottom: 18px; }
.prod { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 28px; align-items: center; }
.prod-video { margin: 0; display: grid; gap: 8px; }
.prod-video figcaption { font-size: 13px; color: var(--muted); }
.video-box { position: relative; aspect-ratio: 16 / 9; max-width: 100%; border-radius: 14px; overflow: hidden; background: var(--forest); }
.video-box video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: transparent; }
.video-box video.on { background: #000; }
.video-ph { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; color: var(--forest-ink); font-weight: 600; text-align: center; padding: 16px; }
.video-ph .play { width: 58px; height: 58px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; font-size: 20px; padding-left: 4px; }
.prod-text { display: grid; gap: 16px; }
.prod-points { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 14px 18px; }
.prod-points li { font-size: 14px; color: var(--muted); border-top: 2px solid var(--accent); padding-top: 10px; }
.prod-points b { display: block; color: var(--ink); font-size: 15px; margin-bottom: 2px; }
.prod-gallery { list-style: none; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.prod-gallery li { position: relative; aspect-ratio: 4 / 3; max-width: 100%; border-radius: 10px; overflow: hidden; background: var(--surface-2); display: grid; align-items: end; }
.prod-gallery img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.prod-gallery span { position: relative; margin: 8px; justify-self: start; background: var(--surface); color: var(--ink); font-size: 12px; font-weight: 600; padding: 4px 8px; border-radius: 6px; }
@media (max-width: 860px) {
  .prod { grid-template-columns: minmax(0, 1fr); }
  .prod-gallery { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 62%; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 6px; }
  .prod-gallery li { scroll-snap-align: start; }
}
@media (max-width: 480px) { .prod-points { grid-template-columns: minmax(0, 1fr); } }

/* значок рейтинга Яндекс Карт (каталог, карточка товара) */
.ymap-badge { display: inline-flex; flex-wrap: wrap; max-width: 100%; align-items: center; gap: 4px 8px; padding: 6px 12px 6px 8px; border: 1px solid var(--line); border-radius: 20px; background: var(--surface); text-decoration: none; font-size: 13px; color: var(--muted); transition: border-color .15s; }
.ymap-badge:hover { border-color: #F5B301; }
.ymap-badge .pin { width: 20px; height: 20px; border-radius: 50%; background: #FC3F1D; color: #fff; display: grid; place-items: center; font: 700 12px/1 var(--f-body); flex: none; }
.ymap-badge b { color: var(--ink); font-size: 14px; font-variant-numeric: tabular-nums; }
.ymap-badge .stars { font-size: 13px; letter-spacing: 1px; }
.reviews { display: grid; grid-template-columns: minmax(0, 300px) minmax(0, 1fr); gap: 16px; align-items: start; }
.rv-sum { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 20px; display: grid; gap: 12px; }
.rv-score { display: flex; align-items: baseline; gap: 12px; }
.rv-score b { font: 600 44px/1 var(--f-display); letter-spacing: -.03em; }
.stars { color: #F5B301; font-size: 20px; letter-spacing: 2px; }
.rv-sum p { font-size: 14px; }
.rv-widget { height: 560px; max-width: 100%; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--surface); display: grid; place-items: center; }
.rv-widget iframe { width: 100%; height: 100%; border: 0; display: block; }
.rv-ph { padding: 24px; text-align: center; max-width: 46ch; }
@media (max-width: 860px) { .reviews { grid-template-columns: minmax(0, 1fr); } .rv-widget { height: 520px; } }
.reviews-link { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; }
.reviews-link p { color: var(--muted); max-width: 60ch; }
.form textarea { border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.08); color: var(--forest-ink); border-radius: 8px; padding: 9px 10px; width: 100%; min-height: 88px; resize: vertical; font: inherit; }
.form textarea::placeholder { color: rgba(233,239,234,.55); }

/* ── разделы: фото товара поверх схемы, пустой результат фильтра ── */
.card-media { overflow: hidden; }
.card-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* есть фото — схему сечения не показываем; если фото не загрузится, app.js снимет класс и схема вернётся */
.card-media.has-photo .sec { display: none; }
.pill.aspen { background: var(--aspen-ring); color: #fff; }
.grid-empty { background: var(--surface); border: 1px dashed var(--line); border-radius: var(--r); padding: 24px; display: grid; gap: 10px; justify-items: start; color: var(--muted); }
.gallery .stage { overflow: hidden; }
.gallery .stage img { width: 100%; height: 100%; object-fit: cover; }
.thumbs button { overflow: hidden; }
.thumbs img { width: 100%; height: 100%; object-fit: cover; border-radius: 4px; }
.calc label select { width: 100%; }
.calc #c-add { margin-top: 2px; }

/* ── контакты, о компании, статьи ── */
.contact-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 20px; }
.contact-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; display: grid; gap: 10px; align-content: start; justify-items: start; }
.contact-card .eyebrow { margin: 0; }
.contact-big { font: 600 24px/1.15 var(--f-display); text-decoration: none; letter-spacing: -.02em; }
.contact-addr { font-weight: 600; font-size: 16px; }
.map-box { margin-top: 16px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); height: 420px; max-width: 100%; }
.map-box iframe { width: 100%; height: 100%; border: 0; display: block; }
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; margin-top: 20px; }
.facts div { background: var(--surface); padding: 16px; display: grid; gap: 2px; }
.facts b { font: 600 22px/1.15 var(--f-display); }
.facts span { color: var(--muted); font-size: 13px; }
.article { max-width: 78ch; margin-top: 8px; }
.article .h1 { margin-bottom: 4px; }
.article .prose { margin-top: 20px; }
.articles-list { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.articles-list a span { font-size: 14px; line-height: 1.5; }
.policy h2 { font-size: 19px; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: minmax(0, 1fr); } .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } .map-box { height: 320px; } }

/* ── корзина ── */
.hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; opacity: 0; }
.send-err { font-size: 14px; line-height: 1.45; padding: 10px 12px; border-radius: 8px; background: var(--accent-soft); color: var(--ink); }
.send-err a { color: var(--accent); font-weight: 600; }
.cart-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; align-items: start; margin-top: 20px; }
/* список товаров закреплён слева, пока покупатель заполняет длинную форму справа;
   если товаров много, список прокручивается внутри себя */
.cart-list { display: flex; flex-direction: column; gap: 10px; min-width: 0; position: sticky; top: calc(env(safe-area-inset-top, 0px) + 84px); max-height: calc(100vh - env(safe-area-inset-top, 0px) - 100px); }
#cart-items { display: grid; gap: 10px; align-content: start; overflow-y: auto; min-height: 0; overscroll-behavior: contain; padding-right: 2px; }
.ci { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto 120px 32px; gap: 14px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; }
.ci-img { width: 76px; height: 60px; background: var(--surface-2); border-radius: 8px; display: grid; place-items: center; }
.ci-img svg { width: 86%; height: 86%; }
.ci-name { font-weight: 600; text-decoration: none; line-height: 1.3; }
.ci-name:hover { color: var(--accent); }
.ci-meta { font-size: 13px; color: var(--muted); margin-top: 4px; }
.ci-qty { display: grid; justify-items: center; gap: 4px; }
.ci-vol { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ci-sum { font: 600 17px/1.2 var(--f-display); text-align: right; white-space: nowrap; }
.ci-del { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: 20px; line-height: 1; cursor: pointer; }
.ci-del:hover { color: var(--accent); border-color: var(--accent); }
.cart-more { font-size: 14px; }
.cart-more a { color: var(--muted); }
.cart-more a:hover { color: var(--accent); }
.cart-side { display: grid; gap: 14px; }
.cart-sum { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; display: grid; gap: 12px; }
.cart-sum dl { margin: 0; display: grid; gap: 6px; }
.cart-sum dl div { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.cart-sum dt { color: var(--muted); }
.cart-sum dd { margin: 0; font-weight: 500; font-variant-numeric: tabular-nums; }
.cart-sum .sep { border-top: 1px dashed var(--line); padding-top: 8px; margin-top: 4px; }
.cart-sum .total dt { color: var(--ink); font-weight: 600; align-self: end; }
.cart-sum .total dd { font: 600 24px/1.1 var(--f-display); letter-spacing: -.02em; }
.cart-note { font-size: 13px; color: var(--muted); }
.order { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 18px; display: grid; gap: 12px; position: relative; }
.order h2 { font: 600 19px/1.25 var(--f-display); }
.fld { display: grid; gap: 5px; font-size: 13px; color: var(--muted); }
.fld input, .fld textarea { border: 1.5px solid var(--line); border-radius: 8px; padding: 10px 12px; background: var(--bg); color: var(--ink); width: 100%; font: inherit; font-size: 15px; resize: vertical; }
.fld input:focus, .fld textarea:focus { border-color: var(--ink); outline: none; }
.fld-row { display: grid; grid-template-columns: 1.4fr 1fr; gap: 10px; }
.seg2 { display: grid; grid-template-columns: 1fr 1fr; border: 1.5px solid var(--line); border-radius: 8px; overflow: hidden; }
.seg2 label { cursor: pointer; }
.seg2 input { position: absolute; opacity: 0; pointer-events: none; }
.seg2 span { display: block; text-align: center; padding: 9px 6px; font-size: 14px; color: var(--muted); }
.seg2 input:checked + span { background: var(--ink); color: var(--bg); font-weight: 600; }
.seg2 input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -2px; }
.order .agree { font-size: 12px; color: var(--muted); }
.cart-empty, .cart-done { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 28px; margin-top: 20px; display: grid; gap: 12px; justify-items: start; }
.cart-empty h2, .cart-done h2 { font: 600 22px/1.25 var(--f-display); }
.cart-empty .tags { margin-top: 6px; }
@media (max-width: 960px) {
  .cart-layout { grid-template-columns: minmax(0, 1fr); }
  .cart-list { position: static; max-height: none; }
  #cart-items { overflow: visible; }
}
@media (max-width: 640px) {
  .ci { grid-template-columns: 64px minmax(0, 1fr) auto; grid-template-areas: "img main del" "qty qty sum"; row-gap: 10px; }
  .ci-img { grid-area: img; width: 64px; height: 52px; }
  .ci-main { grid-area: main; }
  .ci-del { grid-area: del; align-self: start; }
  .ci-qty { grid-area: qty; grid-auto-flow: column; justify-content: start; align-items: center; gap: 10px; }
  .ci-sum { grid-area: sum; align-self: center; }
  .cart-empty, .cart-done { padding: 20px; }
}

/* ── адаптив ── */
@media (max-width: 1060px) {
  .messengers, .header .phone-block button { display: none; }
  .trust { grid-template-columns: repeat(2, 1fr); }
  .footer .wrap { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .filters { position: fixed; inset: 0 auto 0 0; width: min(320px, 88vw); z-index: 30; border-radius: 0; overflow-y: auto; transform: translateX(-102%); transition: transform .2s; padding-top: calc(16px + env(safe-area-inset-top, 0px)); padding-left: max(16px, env(safe-area-inset-left, 0px)); }
  .filters.open { transform: none; box-shadow: 0 0 0 100vmax rgba(0,0,0,.4); }
  .mob-filter { display: inline-flex; }
  .pdp, .two, .calc, .hero { grid-template-columns: minmax(0, 1fr); }
  .cats, .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .why { grid-template-columns: minmax(0, 1fr); }
  .search { display: none; }
}
@media (max-width: 640px) {
  body { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
  .topbar .hide-m, .phone-block, .btn-catalog span, .header .logo-sub { display: none; }
  .header .logo-img { height: 34px; }
  .header .wrap { gap: 10px; }
  .header .spacer { flex: 1; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card-body { padding: 10px; }
  .price { grid-template-columns: 1fr; }
  .price .pc { text-align: left; }
  .price .m3 { font-size: 17px; }
  .buy { grid-template-columns: 1fr; }
  .qty { width: 100%; }
  .qty input { flex: 1; }
  .specs li:nth-child(n+3) { display: none; }
  .calc .row, .calc .out { grid-template-columns: 1fr 1fr; }
  .trust div { padding: 10px; }
  .footer .wrap { grid-template-columns: 1fr; }
  .dl { grid-template-columns: 1fr 1fr; }
  .pb-price { font-size: 27px; }
  .steps { grid-template-columns: minmax(0, 1fr); }
  .cats { gap: 8px; }
  .cat-text { padding: 10px; }
  .cat b { font-size: 14px; }
  .hero { padding-top: 20px; }
  .hero-cta .btn { flex: 1 1 100%; }
  .mbar { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--surface); border-top: 1px solid var(--line); padding: 8px max(12px, env(safe-area-inset-right, 0px)) calc(8px + env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px)); }
  .mbar .btn { padding: 10px 6px; font-size: 14px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; scroll-behavior: auto !important; } }

/* Mobile catalogue: optional compact list and two-column grid. */
@media (max-width: 640px) {
  .view-toggle { display: flex; }
  #grid.list { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  #grid.list .card { display: grid; grid-template-columns: 96px minmax(0, 1fr); column-gap: 12px; row-gap: 4px; padding: 10px; align-items: start; }
  #grid.list .card-body { display: contents; }
  #grid.list .card-media { grid-column: 1; grid-row: 1 / span 3; width: 96px; height: 96px; aspect-ratio: auto; border-radius: 10px; overflow: hidden; }
  #grid.list .card-media .pill { display: none; }
  #grid.list .card-media .sec svg { width: 86%; height: 86%; }
  #grid.list .card-title { grid-column: 2; font-size: 15px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  #grid.list .specs { grid-column: 2; font-size: 12px; gap: 2px 8px; }
  #grid.list .specs li:nth-child(n+3) { display: none; }
  #grid.list .price { grid-column: 2; margin: 0; padding: 0; border: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 10px; }
  #grid.list .price .m3 { font-size: 18px; }
  #grid.list .price .pc { text-align: left; font-size: 13px; }
  #grid.list .price .vat { display: none; }
  #grid.list .buy { grid-column: 1 / -1; display: grid; grid-template-columns: 116px minmax(0, 1fr); gap: 8px; margin-top: 6px; }
  #grid.list .qty { width: auto; height: 44px; }
  #grid.list .qty button { width: 36px; }
  #grid.list .qty input { width: 44px; flex: none; }
  #grid.list .buy .btn { height: 44px; padding: 0 10px; font-size: 15px; }
  #grid.list .qty-unit, #grid.list .one-click { display: none; }
}
@media (max-width: 640px) {
  #grid:not(.list) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  #grid:not(.list) .card { min-width: 0; }
  #grid:not(.list) .card-body { padding: 10px; gap: 8px; min-width: 0; }
  #grid:not(.list) .card-title { font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; }
  #grid:not(.list) .specs { font-size: 12px; gap: 3px 8px; }
  #grid:not(.list) .price .m3 { font-size: 17px; white-space: normal; }
  #grid:not(.list) .price .pc, #grid:not(.list) .price .vat { font-size: 12px; }
  #grid:not(.list) .buy { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  #grid:not(.list) .qty { width: 100%; height: 44px; }
  #grid:not(.list) .qty button { width: 34px; flex: 0 0 34px; }
  #grid:not(.list) .qty input { width: 0; min-width: 0; flex: 1 1 0; }
  #grid:not(.list) .buy .btn { min-width: 0; min-height: 44px; padding: 8px 4px; font-size: 14px; }
  #grid:not(.list) .one-click { font-size: 12px; }
  .view-toggle button { min-height: 44px; }
}
/* Product photographs: preserve complete timber profiles. */
.cat-photo:has(img[src*="product-20261108-"]), .card-media:has(img[src*="product-20261108-"]), .gallery .stage:has(img[src*="product-20261108-"]) { background: #fff; }
.cat-photo img[src*="product-20261108-"], .card-media img[src*="product-20261108-"], .gallery .stage img[src*="product-20261108-"] { object-fit: contain; }

/* Global catalog search */
.search-product-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:18px;margin:24px 0}
.search-product{display:flex;flex-direction:column;overflow:hidden;background:var(--surface);border:1px solid var(--line);border-radius:12px;text-decoration:none;color:var(--text)}
.search-product:hover,.search-product:focus-visible{border-color:var(--accent,#9b6032);box-shadow:0 4px 16px #0001}
.search-product img{display:block;width:100%;height:190px;object-fit:cover;background:var(--bg)}
.search-product h2{font-size:17px;line-height:1.4;margin:16px 16px 10px}
.search-product-price{font-size:22px;font-weight:700;margin:auto 16px 10px}
.search-product>span{margin:0 16px 16px;font-size:14px}
.search-results>p{overflow-wrap:anywhere}
@media(max-width:1060px){.search-product-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:860px){.header .wrap{flex-wrap:wrap}.header .search{display:flex;order:10;flex:1 0 100%;width:100%}.search input{font-size:16px;min-height:44px}.search-product-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.search-product img{height:150px}.search-product h2{font-size:14px;margin:12px}.search-product-price{font-size:18px;margin-left:12px}.search-product>span{margin-left:12px}}

/* Mobile product quantity and unit controls */
@media (max-width: 640px) {
  .pb-calc { grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: start; }
  .pb-calc > div:first-child { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; min-width: 0; }
  .pb-calc .unit { display: flex; margin: 0; flex-shrink: 0; }
  .pb-calc .unit button { min-width: 52px; min-height: 44px; padding: 10px 14px; font-size: 14px; }
  .pb-calc .pb-total { padding-top: 4px; }
}
