/* Оптовый калькулятор: холодная страница, тёплая сумма. */
@font-face { font-family: 'Golos Text'; font-style: normal; font-display: swap; font-weight: 400 900;
  src: url(fonts/golos-text-cyrillic-wght-normal.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Golos Text'; font-style: normal; font-display: swap; font-weight: 400 900;
  src: url(fonts/golos-text-latin-wght-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Golos Text'; font-style: normal; font-display: swap; font-weight: 400 900;
  src: url(fonts/golos-text-latin-ext-wght-normal.woff2) format('woff2');
  unicode-range: U+20BD; }
@font-face { font-family: 'Unbounded'; font-style: normal; font-display: swap; font-weight: 200 900;
  src: url(fonts/unbounded-cyrillic-wght-normal.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: 'Unbounded'; font-style: normal; font-display: swap; font-weight: 200 900;
  src: url(fonts/unbounded-latin-wght-normal.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --frost: #e6edf1;
  --snow: #fbfcfd;
  --line: #d2dce2;
  --ink: #16242e;
  --ink-2: #4c5d69;
  --ember: #c2410c;
  --ember-hi: #f26a1b;
  --tint: #fff2e6;
  --stove: #24110a;
  --stove-2: #3d180a;
  --cream: #ffe4c4;
  --display: 'Unbounded', 'Golos Text', system-ui, sans-serif;
  --text: 'Golos Text', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--frost);
  color: var(--ink);
  font: 400 16px/1.5 var(--text);
  font-variant-numeric: tabular-nums;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--ember-hi); outline-offset: 2px; }

.page {
  max-width: 940px;
  margin: 0 auto;
  padding: 28px 16px calc(32px + env(safe-area-inset-bottom));
}

/* Шапка */
.hero { margin-bottom: 22px; }
.hero h1 {
  margin: 0;
  font: 700 clamp(36px, 10vw, 64px)/1 var(--display);
  letter-spacing: -0.03em;
}
.lead { margin: 14px 0 0; max-width: 34em; color: var(--ink-2); font-size: 17px; }
.facts { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 16px 0 0; padding: 0; list-style: none; font-size: 14px; color: var(--ink-2); }
.facts li { display: flex; align-items: center; gap: 7px; }
.facts svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }

/* Выбор товара */
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
.pick { margin-bottom: 18px; }
.pick-h { margin: 0 0 10px; font: 600 17px/1.3 var(--text); }
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 96px;
  padding: 16px 40px 14px 16px;
  border: 1.5px solid var(--line);
  border-radius: 18px;
  background: var(--snow);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.tile:hover { border-color: var(--ink-2); }
.tile.on { border-color: var(--ember); background: var(--tint); }
.tile:has(input:focus-visible) { outline: 3px solid var(--ember-hi); outline-offset: 2px; }
.tile-img { display: block; width: calc(100% + 24px); height: auto; margin: -2px -12px 8px -2px; border-radius: 12px; }
.tile-name { font: 600 17px/1.2 var(--display); letter-spacing: -0.01em; overflow-wrap: anywhere; }
.tile-note { font-size: 13.5px; line-height: 1.35; color: var(--ink-2); }
.nw { white-space: nowrap; }
.tile-dot {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 20px;
  height: 20px;
  border: 1.5px solid var(--line);
  border-radius: 50%;
  background: #fff;
}
.tile.on .tile-dot { border: 6px solid var(--ember); }
.variants {
  display: flex;
  gap: 4px;
  margin-top: 10px;
  padding: 4px;
  border-radius: 14px;
  background: #d8e2e8;
}
.variant {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 6px 10px;
  border-radius: 10px;
  text-align: center;
  font-size: 14.5px;
  line-height: 1.25;
  color: var(--ink-2);
  cursor: pointer;
}
.variant.on { background: var(--snow); color: var(--ink); font-weight: 600; box-shadow: 0 1px 2px rgba(22, 36, 46, 0.12); }
.variant:has(input:focus-visible) { outline: 3px solid var(--ember-hi); outline-offset: 1px; }

/* Цены ещё не заданы */
.product.pending { grid-template-areas: 'head' 'msg'; }
.pending-msg {
  grid-area: msg;
  padding: 18px 20px;
  border-radius: 16px;
  border: 1.5px dashed #e7b48d;
  background: var(--tint);
}
.pending-msg p { margin: 0; color: var(--ink-2); }
.pending-msg .pending-title { margin-bottom: 4px; font: 600 17px/1.3 var(--display); color: var(--ember); }

/* Карточка товара */
.products { display: grid; gap: 18px; }
.product {
  display: grid;
  grid-template-columns: minmax(0, 1fr); /* лента миниатюр не должна раздвигать карточку шире экрана */
  grid-template-areas: 'head' 'input' 'stove' 'ladder';
  gap: 20px;
  padding: 20px;
  background: var(--snow);
  border: 1px solid var(--line);
  border-radius: 22px;
}
.p-head { grid-area: head; }
.p-input { grid-area: input; }
.stove { grid-area: stove; }
.p-ladder { grid-area: ladder; }

.p-img { display: block; width: 100%; max-width: 280px; height: auto; border-radius: 14px; margin-bottom: 14px; }
.p-head h2 { margin: 0; font: 600 21px/1.25 var(--display); letter-spacing: -0.01em; }
.p-about { margin: 8px 0 0; color: var(--ink-2); max-width: 36em; }
.p-sizes { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 12px; font-size: 14px; color: var(--ink-2); }
.p-sizes > span:first-child { margin-right: 4px; }
.size { padding: 3px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink); background: #fff; }

/* Ввод количества */
.q-label { display: block; margin-bottom: 8px; font-weight: 600; }
.stepper {
  display: grid;
  grid-template-columns: 58px 1fr 58px;
  height: 62px;
  border: 1.5px solid var(--line);
  border-radius: 16px;
  background: #fff;
  overflow: hidden;
}
.stepper:focus-within { border-color: var(--ember-hi); box-shadow: 0 0 0 3px rgba(242, 106, 27, 0.18); }
.st-btn {
  border: 0;
  background: transparent;
  font: 500 28px/1 var(--text);
  color: var(--ink-2);
  touch-action: manipulation;
}
.st-btn:hover { background: var(--frost); color: var(--ink); }
.st-btn:active { background: var(--line); }
.q {
  width: 100%;
  min-width: 0;
  border: 0;
  border-inline: 1px solid var(--line);
  text-align: center;
  font: 600 26px/1 var(--display);
  letter-spacing: -0.01em;
  background: transparent;
}
.q:focus { outline: none; }
.q::placeholder { color: #a9b6be; }
.quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.qk {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  font-size: 15px;
  touch-action: manipulation;
}
.qk:hover { border-color: var(--ink-2); }
.qk.sel { border-color: var(--ember); background: var(--tint); color: var(--ember); font-weight: 600; }
.rule { margin: 12px 0 0; font-size: 14px; color: var(--ink-2); }
.adjust {
  margin: 10px 0 0;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--tint);
  color: var(--ember);
  font-size: 14px;
}

/* Печка: сумма */
.stove {
  position: relative;
  align-self: start;
  padding: 22px 22px 20px;
  border-radius: 18px;
  color: var(--cream);
  background:
    radial-gradient(120% 85% at 50% 125%, rgba(255, 122, 28, 0.62), rgba(255, 122, 28, 0) 62%),
    linear-gradient(165deg, var(--stove-2), var(--stove) 70%);
  box-shadow: inset 0 0 0 1px rgba(255, 196, 140, 0.16);
  container-type: inline-size;
}
.stove p { margin: 0; }
.stove-formula { font-size: 15px; color: rgba(255, 228, 196, 0.82); }
.stove-total {
  margin-top: 6px !important;
  font: 700 40px/1.05 var(--display);
  font-size: min(54px, 14cqi);
  white-space: nowrap;
  letter-spacing: -0.03em;
  color: #ffe6c8;
  text-shadow: 0 0 28px rgba(255, 140, 40, 0.5);
}
.stove-next { margin-top: 12px !important; font-size: 14px; color: rgba(255, 220, 186, 0.86); }
.stove.empty { background: radial-gradient(120% 85% at 50% 125%, rgba(255, 122, 28, 0.22), rgba(255, 122, 28, 0) 62%), linear-gradient(165deg, var(--stove-2), var(--stove) 70%); }
.stove.deal .stove-total { font-size: min(40px, 10cqi); }
.stove.empty .stove-total { color: rgba(255, 230, 200, 0.4); text-shadow: none; }
.stove.warmup { animation: warmup 0.9s ease-out; }
@keyframes warmup {
  0% { box-shadow: inset 0 0 0 1px rgba(255, 196, 140, 0.16), 0 0 0 0 rgba(255, 122, 28, 0); }
  35% { box-shadow: inset 0 0 0 1px rgba(255, 196, 140, 0.4), 0 0 38px 6px rgba(255, 122, 28, 0.45); }
  100% { box-shadow: inset 0 0 0 1px rgba(255, 196, 140, 0.16), 0 0 0 0 rgba(255, 122, 28, 0); }
}

/* Лестница цен — термометр: сверху холодно и дорого, внизу горячо и дёшево */
.ladder { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 15px; }
.ladder th { padding: 0 12px 8px 0; text-align: left; font-weight: 500; font-size: 13px; color: var(--ink-2); }
.ladder th:first-child { padding-left: 30px; }
.ladder th:last-child, .ladder td:last-child { text-align: right; padding-right: 12px; }
.ladder td { position: relative; height: 46px; padding: 0 12px 0 0; border-top: 1px solid var(--line); color: var(--ink-2); }
.ladder td:first-child { padding-left: 30px; }
.ladder tbody tr:last-child td { border-bottom: 1px solid var(--line); }
.ladder td:last-child { font-weight: 600; color: var(--ink); white-space: nowrap; }
.therm { position: absolute; left: 9px; top: -1px; bottom: 0; width: 8px; background: #b9c9d3; } /* цвет ступени задаёт calc.js */
.ladder tbody tr:first-child .therm { border-radius: 4px 4px 0 0; }
.ladder tbody tr:last-child .therm { border-radius: 0 0 4px 4px; }
.ladder tr.on td { background: var(--tint); color: var(--ink); font-weight: 600; }
.ladder tr.on td:first-child { border-radius: 10px 0 0 10px; }
.ladder tr.on td:last-child { border-radius: 0 10px 10px 0; color: var(--ember); }
.ladder tr.on .therm::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--ember-hi);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 3px var(--tint), 0 0 14px 2px rgba(242, 106, 27, 0.7);
}

/* Итог и копирование */
.summary {
  margin-top: 18px;
  padding: 20px;
  background: var(--snow);
  border: 1px solid var(--line);
  border-radius: 22px;
}
.summary h2 { margin: 0 0 10px; font: 600 19px/1.25 var(--display); }
.sum-lines { margin: 0; padding: 0; list-style: none; }
.sum-lines li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.sum-lines li span:first-child { grid-column: 1 / -1; font-weight: 500; }
.sum-lines li span:nth-child(2) { color: var(--ink-2); font-size: 15px; }
.sum-lines li strong { font-weight: 700; white-space: nowrap; }
.sum-total { display: flex; justify-content: space-between; align-items: baseline; margin: 12px 0 0; font-size: 18px; }
.sum-total strong { font: 700 22px/1.2 var(--display); }
.share-box { margin-top: 18px; }
.share { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.btn-main, .btn-share {
  min-height: 52px;
  padding: 0 22px;
  border-radius: 14px;
  font-weight: 600;
  font-size: 16px;
  touch-action: manipulation;
}
.btn-main { width: 100%; border: 0; background: var(--ember); color: #fff; }
.btn-main:hover { background: #a8380a; }
.btn-main:disabled { opacity: 0.7; cursor: progress; }
.btn-share { flex: 1 1 auto; min-height: 46px; border: 1.5px solid var(--line); background: #fff; }
.btn-share:hover { border-color: var(--ink-2); }

/* Заявка: контакт в Telegram */
.lead { display: grid; gap: 12px; }
.lead-h { margin: 0; font-weight: 600; font-size: 17px; line-height: 1.3; }
.lead-f { display: block; }
.lead-f span { display: block; margin-bottom: 5px; font-size: 13.5px; color: var(--ink-2); }
.lead-f input {
  width: 100%;
  height: 50px;
  padding: 0 14px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font-size: 16px; /* меньше 16px — iPhone увеличивает страницу при вводе */
}
.lead-f input:focus { outline: none; border-color: var(--ember-hi); box-shadow: 0 0 0 3px rgba(242, 106, 27, 0.18); }
.lead-f input::placeholder { color: #9aa8b1; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.lead-err { margin: 0; padding: 8px 12px; border-radius: 10px; background: #fdecea; color: #b42318; font-size: 14px; }
.lead-note { margin: 0; font-size: 13px; color: var(--ink-2); }
.lead-done { padding: 16px 18px; border-radius: 14px; background: #e8f5ee; border: 1px solid #b9dfc9; }
.lead-done p { margin: 0; }
.lead-done-h { margin-bottom: 4px !important; font: 600 17px/1.3 var(--display); color: #1d6b45; }
.link-btn { margin-top: 10px; padding: 0; border: 0; background: none; color: var(--ember); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.load-err { padding: 16px; border-radius: 14px; background: #fdecea; color: #b42318; }
.share-hint { margin: 10px 0 0; font-size: 14px; color: var(--ink-2); }

.foot { margin-top: 26px; font-size: 13px; color: var(--ink-2); }
.foot p { margin: 2px 0; }
.offscreen { position: fixed; left: -9999px; top: 0; }
.noscript { margin: 16px; padding: 12px; background: var(--tint); border-radius: 10px; }

@media (min-width: 860px) {
  .page { padding-top: 56px; }
  .hero { margin-bottom: 30px; }
  .product {
    grid-template-columns: minmax(0, 1fr) 360px;
    grid-template-areas: 'head stove' 'input stove' 'ladder stove';
    grid-template-rows: auto auto 1fr;
    gap: 22px 36px;
    padding: 30px;
  }
  .stove { position: sticky; top: 20px; min-height: 230px; display: flex; flex-direction: column; }
  .product.pending { grid-template-columns: minmax(0, 1fr) 360px; grid-template-areas: 'head msg'; grid-template-rows: auto; }
  .tiles { grid-template-columns: repeat(auto-fill, minmax(240px, 300px)); }
  .variants { max-width: 610px; }
  .stove-next { margin-top: auto !important; padding-top: 14px; }
  .summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    grid-template-areas: 'h share' 'lines share' 'total share';
    grid-template-rows: auto auto 1fr;
    column-gap: 36px;
    padding: 26px 30px;
  }
  .summary h2 { grid-area: h; }
  .sum-lines { grid-area: lines; }
  .sum-total { grid-area: total; align-self: start; }
  .share-box { grid-area: share; align-self: start; margin-top: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .stove.warmup { animation: none; }
}

/* Галерея слайдов товара. На телефоне — во всю ширину карточки, листается пальцем */
.gallery { margin: -20px -20px 18px; }
.gal-frame {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 21px 21px 0 0;
  background: #1b0d07;
}
.gal-track {
  display: flex;
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  outline: none;
}
.gal-track::-webkit-scrollbar { display: none; }
.gal-track:focus-visible { box-shadow: inset 0 0 0 3px var(--ember-hi); }
.gal-slide { position: relative; flex: 0 0 100%; height: 100%; margin: 0; overflow: hidden; scroll-snap-align: start; scroll-snap-stop: always; cursor: zoom-in; }
.gal-img { position: relative; display: block; width: 100%; height: 100%; object-fit: contain; }
.gal-bg { position: absolute; inset: -24px; width: calc(100% + 48px); height: calc(100% + 48px); object-fit: cover; filter: blur(18px) brightness(0.72); }
.gal-count {
  position: absolute;
  left: 10px;
  bottom: 10px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(20, 10, 5, 0.66);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  pointer-events: none;
}
.gal-arrow, .gal-zoom, .gal-close {
  position: absolute;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  touch-action: manipulation;
}
.gal-arrow { top: 50%; width: 38px; height: 38px; transform: translateY(-50%); background: rgba(255, 255, 255, 0.9); color: var(--ink); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.28); }
.gal-arrow svg, .gal-zoom svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.gal-prev { left: 8px; }
.gal-next { right: 8px; }
.gal-arrow:disabled { opacity: 0; pointer-events: none; }
.gal-zoom { right: 10px; bottom: 10px; width: 34px; height: 34px; background: rgba(20, 10, 5, 0.66); color: #fff; }
.gal-zoom svg { width: 17px; height: 17px; }
.gal-thumbs { display: flex; gap: 8px; padding: 10px 20px 2px; overflow-x: auto; scrollbar-width: none; }
.gal-thumbs::-webkit-scrollbar { display: none; }
.gal-thumb { flex: 0 0 auto; width: 64px; height: 48px; padding: 0; border: 2px solid transparent; border-radius: 10px; overflow: hidden; background: #1b0d07; opacity: 0.6; }
.gal-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.gal-thumb.on { border-color: var(--ember); opacity: 1; }
.gal-hint { margin: 6px 20px 0; font-size: 12.5px; color: var(--ink-2); }

/* Весь экран */
.gal-full { position: fixed; inset: 0; width: 100vw; height: 100vh; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: #0f0805; }
.gal-full::backdrop { background: #0f0805; }
.gal-full .gallery { height: 100%; margin: 0; }
.gal-full .gal-frame { height: 100%; aspect-ratio: auto; border-radius: 0; background: transparent; }
.gal-full .gal-slide { cursor: default; }
.gal-full .gal-count { left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%); }
.gal-close { top: max(10px, env(safe-area-inset-top)); right: 10px; z-index: 2; width: 44px; height: 44px; background: rgba(255, 255, 255, 0.16); color: #fff; font-size: 28px; line-height: 1; }
body:has(.gal-full[open]) { overflow: hidden; }

@media (min-width: 860px) {
  .gallery { margin: 0 0 22px; }
  .gal-frame { border-radius: 14px; }
  .gal-thumbs { padding: 10px 0 2px; }
  .gal-hint { margin: 6px 0 0; }
  .gal-full .gal-arrow { width: 48px; height: 48px; }
  .gal-full .gal-prev { left: 20px; }
  .gal-full .gal-next { right: 20px; }
}
.gal-hint .gal-pos { color: var(--ink); font-weight: 600; }
.gal-thumbs { position: relative; } /* позиция миниатюр считается от ленты, а не от страницы */
.gal-slide picture { position: relative; display: block; width: 100%; height: 100%; }

/* Промокод: «было → стало» */
.ladder s, .sum-lines s, .sum-total s { margin-right: 4px; font-weight: 400; color: var(--ink-2); }
.stove s { margin-right: 4px; color: rgba(255, 228, 196, 0.6); }
.stove-was { margin-top: 8px !important; font-size: 14px; color: #ffd27a; font-weight: 600; }
.sum-save { margin: 0 0 14px; padding: 10px 14px; border-radius: 12px; background: #e8f5ee; color: #1d6b45; font-weight: 600; }
.promo { margin-bottom: 18px; }
.promo-label { display: block; margin-bottom: 5px; font-size: 13.5px; color: var(--ink-2); }
.promo-row { display: flex; gap: 8px; }
.promo-row input {
  flex: 1 1 auto;
  min-width: 0;
  height: 46px;
  padding: 0 14px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font-size: 16px;
  text-transform: uppercase;
}
.promo-row input::placeholder { text-transform: none; color: #9aa8b1; }
.promo-row input:focus { outline: none; border-color: var(--ember-hi); box-shadow: 0 0 0 3px rgba(242, 106, 27, 0.18); }
.promo-row .btn-share { flex: 0 0 auto; min-height: 46px; padding: 0 16px; }
.promo-form .lead-err { margin-top: 8px; }
.promo-ok { margin: 0; padding: 10px 14px; border-radius: 12px; background: var(--tint); color: var(--ember); font-weight: 600; }
.promo-ok .link-btn { margin: 0 0 0 6px; font-weight: 500; }
.promo-banner { margin: 14px 0 0; padding: 10px 14px; border-radius: 12px; background: var(--tint); color: var(--ember); font-weight: 600; max-width: 34em; }
