/* Главная «Под рукой». Общие токены и шрифты — в style.css. */
.home .wrap { max-width: 1140px; }
.home main section { padding: 8px 0; }
.home h2 { font-size: clamp(28px, 4vw, 40px); margin: 0; }

/* ---------- Шапка страницы: заголовок + лист с расчётом ---------- */
.hero { position: relative; padding: 40px 0 56px !important; }
.hero::before { /* красная линия полей, как в школьной тетради */
  content: ""; position: absolute; top: 0; bottom: 0; left: max(10px, calc(50% - 570px - 4px));
  border-left: 2px solid var(--margin); opacity: .85;
}
.hero-grid { display: grid; gap: 40px; align-items: center; padding-left: 28px !important; }
@media (min-width: 900px) { .hero-grid { grid-template-columns: 1.05fr .95fr; gap: 56px; } }
.hero h1 { font-size: clamp(34px, 5vw, 58px); line-height: 1.04; margin: 0 0 22px; max-width: 16ch; }
.hero-lead { font-size: clamp(17px, 1.6vw, 19px); color: var(--muted); max-width: 46ch; margin: 0 0 28px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px 14px; }
.btn.big { font-size: 16px; padding: 13px 20px; min-height: 50px; }

.sheet {
  --c: 34px;
  margin: 0; position: relative;
  background-color: var(--surface);
  background-image:
    linear-gradient(rgba(43, 57, 201, .16) 1px, transparent 1px),
    linear-gradient(90deg, rgba(43, 57, 201, .16) 1px, transparent 1px);
  background-size: var(--c) var(--c);
  border: 1.5px solid var(--text); border-radius: 4px;
  box-shadow: 10px 10px 0 var(--accent);
  padding: 26px 28px 24px;
  transform: rotate(-1.4deg);
}
@media (prefers-color-scheme: dark) {
  .sheet { background-image: linear-gradient(rgba(154, 166, 255, .14) 1px, transparent 1px), linear-gradient(90deg, rgba(154, 166, 255, .14) 1px, transparent 1px); box-shadow: 10px 10px 0 #0c0d1c; }
}
.sheet-cap { font-size: 15px; color: var(--muted); margin: 0 0 18px; max-width: 34ch; background: var(--surface); }
.sum-in { display: grid; gap: 6px; margin-bottom: 20px; }
.sum-in > span:first-child { font-weight: 600; font-size: 15px; }
.sum-field { display: flex; align-items: baseline; gap: 8px; border-bottom: 2.5px solid var(--text); background: var(--surface); padding: 0 4px; max-width: 320px; }
.sum-field input {
  flex: 1; min-width: 0; border: 0; background: transparent; color: var(--accent);
  font: 700 46px/1.1 var(--f-hand); padding: 2px 0; outline: none;
}
.sum-field span { font: 700 30px/1 var(--f-hand); color: var(--accent); }
.sum-field:focus-within { border-bottom-color: var(--accent); box-shadow: 0 3px 0 var(--accent-soft); }

.column { display: grid; gap: 0; }
.column .row { display: grid; grid-template-columns: var(--c) auto 1fr; align-items: center; height: var(--c); }
.column .op { font: 700 32px/var(--c) var(--f-hand); color: var(--text); text-align: center; height: var(--c); }
.column .digits { display: flex; justify-content: flex-end; min-width: calc(var(--c) * 6.4); }
.column .digits b, .column .digits .gap {
  display: inline-grid; place-items: center; width: var(--c); height: var(--c);
  font: 700 32px/1 var(--f-hand); color: var(--accent);
}
.column .digits .gap { width: calc(var(--c) / 3); }
.column .note { font: 600 21px/1 var(--f-hand); color: var(--muted); padding-left: 12px; min-width: 0; }
.column .row.total { border-top: 2.5px solid var(--text); }
.column .row.total .digits b { color: var(--margin); }
.column .row.total .note { color: var(--text); }
.sheet-foot { margin: 16px 0 6px; font-size: 15px; background: var(--surface); display: inline-block; padding: 0 4px; }
.sheet-link { display: block; font-size: 15px; font-weight: 600; background: var(--surface); width: fit-content; padding: 0 4px; }
@media (max-width: 520px) {
  .sheet { --c: 23px; padding: 20px 14px; transform: none; box-shadow: 6px 6px 0 var(--accent); }
  .column .digits { min-width: calc(var(--c) * 6.4); }
  .column .digits b { font-size: 25px; }
  .column .op { font-size: 26px; }
  .column .note { font-size: 17px; line-height: 1; padding-left: 8px; }
  .sum-field input { font-size: 40px; }
}
@media (prefers-reduced-motion: no-preference) {
  .column .digits b { animation: ink .35s ease-out both; }
  @keyframes ink { from { opacity: 0; transform: translateY(-3px); } }
}

/* ---------- Заголовки разделов ---------- */
.sec-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 24px; margin-bottom: 22px; }
.sec-head p { margin: 0; color: var(--muted); max-width: 46ch; }
.shop-sec, .calcs, .how { scroll-margin-top: 12px; }
.shop-sec { padding-top: 48px !important; }

/* ---------- Магазин ---------- */
.filters { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 14px; margin-bottom: 8px; scrollbar-width: thin; }
.chip {
  flex: none; font: 600 15px/1 var(--f-text); color: var(--text); background: var(--surface);
  border: 1.5px solid var(--border); border-radius: 999px; padding: 10px 16px; min-height: 42px; cursor: pointer;
}
.chip:hover { border-color: var(--text); }
.chip[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }

.goods { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 22px; }
.good {
  display: flex; flex-direction: column; background: var(--surface);
  border: 1.5px solid var(--text); border-radius: var(--radius); overflow: hidden;
}
.good .cover { display: block; aspect-ratio: 4 / 3; background: var(--surface-2); border-bottom: 1.5px solid var(--text); overflow: hidden; }
.good .cover img { display: block; width: 100%; height: 100%; object-fit: contain; padding: 10px; }
.good .cover.empty { background-image: linear-gradient(var(--grid) 1px, transparent 1px), linear-gradient(90deg, var(--grid) 1px, transparent 1px); background-size: 16px 16px; }
.good-body { display: flex; flex-direction: column; flex: 1; padding: 14px 16px 16px; }
.good .kind { font-size: 13px; color: var(--muted); font-weight: 500; }
.good h3 { font-size: 17px; line-height: 1.3; margin: 4px 0 6px; }
.good p { font-size: 14px; line-height: 1.45; color: var(--muted); margin: 0 0 14px; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.good .buy { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.good .price { font: 700 22px/1 var(--f-text); font-variant-numeric: tabular-nums; }
.good s { color: var(--muted); font-size: 14px; }
.good .btn { font-size: 14px; padding: 9px 13px; min-height: 40px; }
.good.is-bundle { background: var(--marker); color: #191b33; }
.good.is-bundle .kind, .good.is-bundle p, .good.is-bundle s { color: #4b4a3a; }
.good.is-bundle .cover { background: #fff6b8; }
@media (min-width: 900px) { .good.is-bundle { grid-column: span 2; flex-direction: row; } .good.is-bundle .cover { flex: 0 0 46%; aspect-ratio: auto; border-bottom: 0; border-right: 1.5px solid var(--text); } }
.empty-note { color: var(--muted); }
.more-goods { grid-column: 1 / -1; justify-self: center; margin-top: 6px; font-size: 16px; padding: 12px 22px; }

/* ---------- Как купить: настоящая последовательность ---------- */
.how { padding-top: 56px !important; }
.how .steps { list-style: none; counter-reset: s; display: grid; gap: 18px; padding: 0; margin: 24px 0 0; }
@media (min-width: 760px) { .how .steps { grid-template-columns: repeat(3, 1fr); } }
.how .steps li { counter-increment: s; position: relative; padding: 18px 18px 18px 74px; margin: 0; background: var(--surface); border: 1.5px dashed var(--border); border-radius: var(--radius); }
.how .steps li::before {
  content: counter(s); position: absolute; left: 18px; top: 10px;
  font: 700 54px/1 var(--f-hand); color: var(--margin);
}
.how .steps b { display: block; font-size: 18px; margin-bottom: 4px; }
.how .steps span { color: var(--muted); font-size: 15px; }

/* ---------- Калькуляторы: как оглавление тетради ---------- */
.calcs { padding-top: 56px !important; }
.toc { display: grid; gap: 8px 56px; background: var(--surface); border: 1.5px solid var(--text); border-radius: var(--radius); padding: 10px 24px 22px; }
@media (min-width: 860px) { .toc { grid-template-columns: 1fr 1fr; } }
.toc h3 { font: 400 19px/1.2 var(--f-display); margin: 18px 0 8px; }
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc a { display: flex; align-items: baseline; gap: 8px; padding: 7px 0; text-decoration: none; color: var(--text); }
.toc a span { font-weight: 600; }
.toc a i { flex: 1; border-bottom: 2px dotted var(--border); transform: translateY(-4px); min-width: 16px; }
.toc a em { font: 600 20px/1 var(--f-hand); color: var(--muted); font-style: normal; white-space: nowrap; }
.toc a:hover span { color: var(--accent); text-decoration: underline; text-decoration-thickness: 2px; }
.toc a:hover i { border-color: var(--accent); }
@media (max-width: 520px) { .toc a { flex-wrap: wrap; } .toc a i { display: none; } .toc a em { width: 100%; font-size: 18px; } }

.razvod { display: grid; gap: 4px; margin-top: 22px; padding: 18px 22px; text-decoration: none; color: var(--text);
  border-left: 6px solid var(--margin); background: var(--surface); border-radius: 0 var(--radius) var(--radius) 0; }
.razvod b { font-size: 18px; }
.razvod span { color: var(--muted); font-size: 15px; max-width: 70ch; }
.razvod:hover b { color: var(--accent); }

/* ---------- Вопросы ---------- */
.faq-sec { padding-top: 56px !important; }
.faq-sec .faq > * { max-width: 860px; }
.faq-sec h2 { margin-bottom: 14px; }
.faq details { border-bottom: 1.5px solid var(--border); padding: 14px 0; }
.faq summary { font-size: 18px; }
.faq details > div { color: var(--muted); max-width: 70ch; }

.nav-bot { color: var(--accent) !important; font-weight: 700; }
@media (max-width: 640px) { .home .nav { font-size: 14px; gap: 2px 12px; } }
