/* ============================================================
   Ценники А4 — «индустриальный прайс-борд»
   Жёлтый + чёрный, кондесированный гротеск, интерфейс-инструмент
   ============================================================ */

:root {
  --yellow: #ffc400;
  --yellow-hi: #ffd84d;
  --ink: #101114;
  --coal: #191b1f;
  --steel: #24262b;
  --line: #383b42;
  --txt: #ecebe4;
  --muted: #9c9b92;
  --paper: #ffffff;
  --cut: #b8b8b8;
  --danger: #ff5340;
  --disp: 'Oswald', 'Arial Narrow', sans-serif;
  --body: 'IBM Plex Sans', sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--txt);
  background:
    radial-gradient(1200px 500px at 70% -10%, rgba(255, 196, 0, .07), transparent 60%),
    var(--ink);
}

.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

::selection { background: var(--yellow); color: var(--ink); }

a { color: var(--yellow); }
a:hover { color: var(--yellow-hi); }

/* ---------- хазард-лента ---------- */
.hazard {
  height: 12px;
  background: repeating-linear-gradient(-45deg,
    var(--yellow) 0 16px, var(--ink) 16px 32px);
  background-size: 45.25px 45.25px;
  animation: hazard-in .9s cubic-bezier(.2, .9, .2, 1) both;
}
@keyframes hazard-in {
  from { background-position-x: 90px; opacity: 0; }
  to   { background-position-x: 0; opacity: 1; }
}

/* ---------- шапка ---------- */
header.site {
  background: var(--coal);
  border-bottom: 1px solid var(--line);
}
.site-bar {
  display: flex; align-items: center; gap: 28px;
  padding: 14px 0; flex-wrap: wrap;
}
.logo {
  font-family: var(--disp); font-weight: 700; font-size: 22px;
  letter-spacing: .06em; text-transform: uppercase;
  color: var(--txt); text-decoration: none;
  display: inline-flex; align-items: center; gap: 10px;
}
.logo b {
  background: var(--yellow); color: var(--ink);
  padding: 1px 8px 2px;
}
nav.site-nav { display: flex; gap: 4px 18px; flex-wrap: wrap; margin-left: auto; }
nav.site-nav a {
  font-family: var(--disp); font-size: 14px; font-weight: 500;
  letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); text-decoration: none;
  padding: 4px 2px; border-bottom: 2px solid transparent;
}
nav.site-nav a:hover { color: var(--txt); }
nav.site-nav a[aria-current="page"] {
  color: var(--yellow); border-bottom-color: var(--yellow);
}

/* ---------- герой ---------- */
.hero { padding: 40px 0 26px; }
.hero h1 {
  font-family: var(--disp); font-weight: 700;
  font-size: clamp(30px, 5vw, 52px);
  line-height: 1.18; text-transform: uppercase; letter-spacing: .015em;
  max-width: 20ch;
  animation: rise .7s cubic-bezier(.2, .9, .25, 1) both;
}
.hero h1 em {
  font-style: normal; color: var(--ink);
  background: var(--yellow);
  padding: 0 .18em;
  box-decoration-break: clone; -webkit-box-decoration-break: clone;
}
.hero .lead {
  margin-top: 14px; max-width: 62ch; color: var(--muted); font-size: 17px;
  animation: rise .7s .12s cubic-bezier(.2, .9, .25, 1) both;
}
@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: none; }
}

/* ---------- инструмент ---------- */
.tool { padding: 10px 0 8px; }
.tool-panel {
  background: var(--coal);
  border: 1px solid var(--line);
  border-top: 4px solid var(--yellow);
  box-shadow: 0 24px 60px -30px rgba(0, 0, 0, .8);
  animation: rise .7s .2s cubic-bezier(.2, .9, .25, 1) both;
}
.tool-grid {
  display: grid; grid-template-columns: 1.25fr 1fr; gap: 0;
}
.tool-col { padding: 26px 28px 28px; min-width: 0; }
.tool-col--input { border-right: 1px solid var(--line); }

.lbl {
  display: block;
  font-family: var(--disp); font-size: 13px; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--yellow); margin-bottom: 8px;
}
.hint { font-size: 13.5px; color: var(--muted); margin-bottom: 10px; }
.hint code {
  background: var(--steel); padding: 1px 6px; font-size: 12.5px;
  color: var(--txt); border-radius: 2px;
}

textarea, input[type="text"], select {
  width: 100%;
  background: var(--ink);
  border: 1px solid var(--line);
  color: var(--txt);
  font-family: var(--body); font-size: 15px;
  padding: 10px 12px;
  border-radius: 0;
}
textarea {
  resize: vertical; min-height: 210px; line-height: 1.6;
  font-variant-numeric: tabular-nums;
}
textarea:focus, input:focus, select:focus {
  outline: 2px solid var(--yellow); outline-offset: -1px;
}
::placeholder { color: #5d5f66; }

.row-add {
  display: grid; grid-template-columns: 2fr .8fr .8fr auto;
  gap: 8px; margin-top: 12px;
}
.mini-actions { margin-top: 12px; display: flex; gap: 18px; }
.linklike {
  background: none; border: none; cursor: pointer;
  color: var(--muted); font-family: var(--body); font-size: 13.5px;
  text-decoration: underline; text-underline-offset: 3px; padding: 0;
}
.linklike:hover { color: var(--yellow); }

/* размеры-карточки */
.sizes {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 18px;
}
.size-card { display: block; cursor: pointer; }
.size-card input { position: absolute; opacity: 0; }
.size-card-body {
  display: block; padding: 9px 12px;
  border: 1px solid var(--line); background: var(--steel);
  transition: border-color .15s, background .15s;
}
.size-card-body b {
  display: block; font-family: var(--disp); font-weight: 600;
  font-size: 15px; letter-spacing: .04em; text-transform: uppercase;
}
.size-card-body i {
  display: block; font-style: normal; font-size: 12px; color: var(--muted);
}
.size-card input:checked + .size-card-body {
  border-color: var(--yellow); background: #2b2410;
  box-shadow: inset 0 0 0 1px var(--yellow);
}
.size-card input:checked + .size-card-body b { color: var(--yellow); }
.size-card input:focus-visible + .size-card-body { outline: 2px solid var(--yellow); }

.opt-line { margin-bottom: 16px; }
.field { margin-bottom: 14px; }

.chk {
  display: flex; align-items: flex-start; gap: 9px;
  font-size: 14px; color: var(--txt); margin: 10px 0; cursor: pointer;
}
.chk input { accent-color: var(--yellow); width: 16px; height: 16px; margin-top: 2px; }

/* кнопки */
.btn {
  font-family: var(--disp); font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; cursor: pointer; border-radius: 0;
  transition: transform .12s, box-shadow .12s;
}
.btn--primary {
  display: block; width: 100%; margin-top: 18px;
  background: var(--yellow); color: var(--ink);
  border: 2px solid var(--ink);
  font-size: 17px; padding: 14px 20px;
  box-shadow: 5px 5px 0 rgba(255, 196, 0, .25);
}
.btn--primary:hover {
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0 rgba(255, 196, 0, .3);
}
.btn--primary:active { transform: translate(1px, 1px); box-shadow: 2px 2px 0 rgba(255,196,0,.25); }
.btn--ghost {
  background: transparent; color: var(--txt);
  border: 1px solid var(--line); font-size: 13px; padding: 9px 14px;
}
.btn--ghost:hover { border-color: var(--yellow); color: var(--yellow); }

.tool-error {
  margin: 14px 0 0; padding: 10px 14px;
  border: 1px solid var(--danger); color: var(--danger); font-size: 14px;
}

/* ---------- результат ---------- */
.result { padding: 28px 0 10px; }
.result-bar {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  margin-bottom: 16px;
}
.result-stats {
  font-family: var(--disp); font-size: 15px; letter-spacing: .05em;
  text-transform: uppercase; color: var(--muted);
}
.btn--print {
  margin-left: auto;
  background: var(--yellow); color: var(--ink);
  border: 2px solid var(--ink);
  font-size: 15px; padding: 11px 22px;
  box-shadow: 4px 4px 0 rgba(255, 196, 0, .25);
}
.btn--print:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 rgba(255,196,0,.3); }

.preview { overflow: hidden; }
#sheets { width: 210mm; }
.sheet {
  width: 210mm; height: 297mm;
  background: var(--paper); color: #000;
  padding: 7mm;
  box-shadow: 0 18px 50px -18px rgba(0, 0, 0, .9);
  margin-bottom: 24px;
}
.sheet-grid {
  display: grid; width: 100%; height: 100%;
  grid-template-columns: repeat(var(--c), 1fr);
  grid-template-rows: repeat(var(--r), 1fr);
  border-top: 1px dashed var(--cut);
  border-left: 1px dashed var(--cut);
}

/* ---------- сам ценник (продукт!) ---------- */
.tag {
  border-right: 1px dashed var(--cut);
  border-bottom: 1px dashed var(--cut);
  display: flex; flex-direction: column;
  padding: 4mm 4.5mm 3mm;
  overflow: hidden; min-width: 0; min-height: 0;
  font-family: var(--body);
}
.tag--empty { background: transparent; }

.tag-name {
  flex: 1 1 auto; overflow: hidden; min-height: 0;
  font-weight: 600; line-height: 1.22;
  overflow-wrap: break-word;
}
.tag-price {
  flex: 0 0 auto;
  display: flex; align-items: baseline; gap: .35em; flex-wrap: wrap;
  font-family: var(--disp); font-weight: 700; line-height: 1;
  margin-top: 1.5mm;
  font-variant-numeric: tabular-nums;
}
.tp-new { white-space: nowrap; }
.tp-rub { font-weight: 500; font-size: .62em; }
.tp-old {
  font-weight: 500; color: #444;
  text-decoration-thickness: 2px; white-space: nowrap;
}
.tag-unit {
  font-family: var(--body); font-weight: 400; font-size: 9pt; color: #333;
}
.tag-req {
  flex: 0 0 auto; margin-top: 1.6mm; padding-top: 1mm;
  border-top: 0.3mm solid #000;
  font-size: 6.5pt; color: #222; line-height: 1.3;
}

/* типоразмеры */
.tag--big   .tag-name  { font-size: 20pt; }
.tag--big   .tag-price { font-size: 58pt; }
.tag--big   .tag-unit  { font-size: 11pt; }

.tag--mid   .tag-name  { font-size: 14pt; }
.tag--mid   .tag-price { font-size: 36pt; }

.tag--small { padding: 2.5mm 3mm 2mm; }
.tag--small .tag-name  { font-size: 10pt; }
.tag--small .tag-price { font-size: 21pt; }
.tag--small .tag-unit  { font-size: 7.5pt; }
.tag--small .tag-req   { font-size: 5.5pt; }

.tag--shelf {
  flex-direction: row; align-items: center; gap: 5mm;
  padding: 2mm 5mm;
}
.tag--shelf .tag-name  { font-size: 12.5pt; align-self: center; max-height: 100%; }
.tag--shelf .tag-price { font-size: 24pt; margin-top: 0; margin-left: auto; }
.tag--shelf .tag-req   { display: none; }
.tag--shelf .tag-unit  { font-size: 8.5pt; }

.tag--promo .tag-name  { font-size: 15pt; }
.tag--promo .tag-price { font-size: 46pt; gap: .4em; }
.tag--promo .tp-old    { font-size: .42em; color: #333; }
.tag--promo .tp-new    { position: relative; }
.tag--promo .tag-unit  { font-size: 10pt; }

.tag--tiny { padding: 2mm 2.5mm 1.5mm; }
.tag--tiny .tag-name  { font-size: 7.5pt; line-height: 1.15; }
.tag--tiny .tag-price { font-size: 14pt; }
.tag--tiny .tag-unit  { font-size: 6pt; }
.tag--tiny .tag-req   { display: none; }

/* ---------- CPA ---------- */
.cpa {
  margin-top: 26px;
  border: 1px solid var(--line); border-left: 5px solid var(--yellow);
  background: var(--coal);
  padding: 20px 24px;
  display: flex; gap: 20px; align-items: center; flex-wrap: wrap;
}
.cpa-txt { flex: 1 1 320px; }
.cpa-txt b {
  display: block; font-family: var(--disp); font-size: 18px;
  font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  margin-bottom: 4px;
}
.cpa-txt p { font-size: 14px; color: var(--muted); }
.cpa-links { display: flex; gap: 10px; flex-wrap: wrap; }
.cpa-links a {
  font-family: var(--disp); font-size: 14px; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase; text-decoration: none;
  border: 1px solid var(--yellow); color: var(--yellow);
  padding: 10px 18px; white-space: nowrap;
}
.cpa-links a:hover { background: var(--yellow); color: var(--ink); }

/* ---------- контент / SEO ---------- */
.content { padding: 44px 0 8px; }
.content h2 {
  font-family: var(--disp); font-weight: 600;
  font-size: clamp(22px, 3vw, 30px);
  text-transform: uppercase; letter-spacing: .03em;
  margin: 34px 0 14px;
  padding-left: 14px; border-left: 5px solid var(--yellow);
}
.content h2:first-child { margin-top: 0; }
.content h3 {
  font-family: var(--disp); font-weight: 600; font-size: 19px;
  letter-spacing: .04em; text-transform: uppercase; margin: 24px 0 8px;
}
.content p, .content li { color: #cfcec6; max-width: 74ch; }
.content p { margin: 0 0 12px; }
.content ul, .content ol { margin: 0 0 14px 22px; }
.content li { margin-bottom: 6px; }
.content b, .content strong { color: var(--txt); }

.table-scroll { overflow-x: auto; margin: 16px 0 20px; -webkit-overflow-scrolling: touch; }
table.spec {
  border-collapse: collapse; min-width: 560px; width: 100%;
  font-size: 14.5px;
}
table.spec th, table.spec td {
  border: 1px solid var(--line); padding: 9px 14px; text-align: left;
}
table.spec th {
  font-family: var(--disp); font-weight: 600; font-size: 13px;
  letter-spacing: .09em; text-transform: uppercase;
  background: var(--steel); color: var(--yellow);
}
table.spec td { color: #cfcec6; }
table.spec td b { color: var(--txt); }

/* ---------- FAQ ---------- */
.faq { padding: 10px 0 30px; }
.faq h2 {
  font-family: var(--disp); font-weight: 600;
  font-size: clamp(22px, 3vw, 30px);
  text-transform: uppercase; letter-spacing: .03em;
  margin-bottom: 18px; padding-left: 14px; border-left: 5px solid var(--yellow);
}
.faq details {
  border: 1px solid var(--line); background: var(--coal);
  margin-bottom: 8px;
}
.faq summary {
  cursor: pointer; list-style: none;
  padding: 14px 18px;
  font-family: var(--disp); font-weight: 500; font-size: 16.5px;
  letter-spacing: .02em;
  display: flex; align-items: center; gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before {
  content: '+'; color: var(--yellow);
  font-weight: 700; font-size: 20px; line-height: 1; width: 16px;
  flex: 0 0 auto;
}
.faq details[open] summary::before { content: '–'; }
.faq details[open] summary { color: var(--yellow); }
.faq .faq-a { padding: 0 18px 16px 46px; color: #cfcec6; font-size: 15px; max-width: 80ch; }
.faq .faq-a p { margin-bottom: 8px; }

/* ---------- футер ---------- */
footer.site {
  margin-top: 40px;
  border-top: 1px solid var(--line);
  background: var(--coal);
  padding: 26px 0 34px;
  font-size: 13.5px; color: var(--muted);
}
footer.site .foot-nav { display: flex; gap: 8px 22px; flex-wrap: wrap; margin-bottom: 12px; }
footer.site a { color: var(--muted); text-decoration: none; }
footer.site a:hover { color: var(--yellow); }

/* ---------- мобильная адаптация ---------- */
@media (max-width: 860px) {
  .tool-grid { grid-template-columns: 1fr; }
  .tool-col--input { border-right: none; border-bottom: 1px solid var(--line); }
  .tool-col { padding: 20px 18px 22px; }
  .row-add { grid-template-columns: 1fr 1fr; }
  .row-add input:first-child { grid-column: 1 / -1; }
  .row-add .btn { grid-column: 1 / -1; }
  .btn--print { margin-left: 0; width: 100%; }
  .hero { padding: 28px 0 18px; }
  .cpa { padding: 18px; }

  /* компактнее шапка */
  .site-bar { gap: 8px 16px; padding: 10px 0; }
  .logo { font-size: 20px; }
  nav.site-nav { gap: 2px 14px; }
  nav.site-nav a { font-size: 13px; padding: 7px 2px; }

  /* формы: без iOS-зума, тап-таргеты ≥44px */
  textarea, input[type="text"], select { font-size: 16px; }
  input[type="text"], select { min-height: 44px; }
  .btn--ghost { min-height: 44px; font-size: 14px; }
  .btn--print { min-height: 48px; }
  .linklike { padding: 10px 0; }
  .chk { padding: 3px 0; }
  .chk input { width: 20px; height: 20px; flex: 0 0 auto; }
  .cpa-links a { padding: 12px 18px; }
}
@media (max-width: 640px) {
  .hero { padding: 22px 0 14px; }
  .hero .lead { font-size: 15.5px; }
  .content { padding: 34px 0 6px; }
  .content h2 { margin: 28px 0 12px; }

}
/* таблицы: заметная горизонтальная прокрутка (уже этой ширины min-width
   560px у table.spec не помещается в .wrap) */
@media (max-width: 600px) {
  .table-scroll::before {
    content: 'Таблица листается вбок \2192';
    display: block;
    font-family: var(--disp); font-size: 11px; font-weight: 500;
    letter-spacing: .14em; text-transform: uppercase;
    color: var(--muted); margin-bottom: 6px;
  }
  .table-scroll::-webkit-scrollbar { height: 6px; }
  .table-scroll::-webkit-scrollbar-track { background: var(--steel); }
  .table-scroll::-webkit-scrollbar-thumb { background: var(--yellow); }
}
@media (max-width: 480px) {
  .sizes { grid-template-columns: 1fr; }
}

/* ---------- печать: продукт — лист с ценниками ---------- */
@page { size: A4; margin: 0; }

@media print {
  .no-print { display: none !important; }
  html, body { background: #fff !important; }
  .result { padding: 0; }
  .wrap { max-width: none; padding: 0; margin: 0; }
  .preview { height: auto !important; overflow: visible; }
  #sheets { transform: none !important; width: auto; }
  .sheet {
    box-shadow: none; margin: 0;
    height: 296.5mm;
    break-after: page; page-break-after: always;
  }
  .sheet:last-child { break-after: auto; page-break-after: auto; }
  .sheet-grid, .tag { border-color: #999; }
  .tag { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
