/* =============================================================================
   polimer-sjr.ru — основной стиль (mobile-first)
   ============================================================================= */

:root {
  --bg: #ffffff;
  --bg-alt: #f5f7fa;
  --bg-order: #0d1b2a;
  --text: #1a1a1a;
  --text-muted: #5c6470;
  --border: #e4e7eb;
  --accent: #c8102e;
  --accent-dark: #9c0d24;
  --primary: #0d1b2a;
  --primary-light: #1b3a5e;
  --warn-bg: #fff8e1;
  --warn-border: #ffd54f;
  --radius: 8px;
  --shadow: 0 2px 8px rgba(0,0,0,0.06);
  --shadow-md: 0 6px 24px rgba(0,0,0,0.08);
  --maxw: 1100px;
  --gap: 24px;
}

/* ----- Reset ----- */
*, *::before, *::after { box-sizing: border-box; }
/* HTML-атрибут hidden должен побеждать любые наши display-правила */
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen,
               Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--primary-light); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 16px; }
h1 { font-size: clamp(1.8rem, 4vw + 1rem, 3rem); font-weight: 700; }
h2 { font-size: clamp(1.4rem, 2vw + 1rem, 2rem); margin-bottom: 24px; }
h3 { font-size: 1.15rem; font-weight: 600; }
p { margin: 0 0 12px; }
table { border-collapse: collapse; width: 100%; }

/* ----- Layout ----- */
.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
.section { padding: 56px 0; }
.section--alt { background: var(--bg-alt); }
.section--order { background: var(--bg-order); color: #f0f3f7; }
.section--order h2 { color: #fff; }
.section--order .lead { color: #b8c2cf; }
.lead { font-size: 1.1rem; color: var(--text-muted); max-width: 760px; }
.note { color: var(--text-muted); font-size: 0.95rem; margin-top: 16px; }

/* ----- Header ----- */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.header__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 12px 16px;
}
.logo {
  display: inline-flex; align-items: center;
  color: var(--text); text-decoration: none;
  line-height: 1;
}
.logo img {
  display: block;
  height: 40px;            /* высота логотипа в шапке */
  width: auto;             /* пропорциональная ширина */
  max-width: 100%;
}
.nav {
  display: none;
  gap: 20px;
  align-items: center;     /* центровка всех элементов по вертикали */
}
.nav a {
  display: inline-flex;
  align-items: center;
  color: var(--text);
  line-height: 1;
}
.nav__cta {
  background: var(--accent); color: #fff !important;
  padding: 8px 16px; border-radius: var(--radius);
  font-weight: 500;
}
.nav__cta:hover { background: var(--accent-dark); text-decoration: none; }
.phone {
  display: none;
  font-weight: 600; color: var(--text); white-space: nowrap;
  line-height: 1;
}
@media (min-width: 768px) {
  .nav { display: flex; }
  .phone { display: inline-flex; align-items: center; }
}

/* ----- Hero ----- */
.hero {
  background: linear-gradient(135deg, var(--bg-alt) 0%, #e9eef5 100%);
  padding: 48px 0 56px;
}
.hero__inner { display: grid; gap: 32px; grid-template-columns: 1fr; align-items: center; }
.hero__lead { font-size: 1.1rem; color: var(--text-muted); margin: 16px 0 24px; }
.hero__benefits { padding-left: 20px; margin: 0 0 28px; }
.hero__benefits li { margin-bottom: 6px; }
.hero__price { display: flex; align-items: baseline; gap: 10px; margin-bottom: 24px; flex-wrap: wrap; }
.price { font-size: 2.4rem; font-weight: 700; color: var(--accent); }
.price-old { color: var(--text-muted); font-size: 1.2rem; }
.price-unit { color: var(--text-muted); }
.hero__cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero__media img { border-radius: var(--radius); box-shadow: var(--shadow-md); }
@media (min-width: 768px) {
  .hero__inner { grid-template-columns: 1.1fr 1fr; }
}

/* ----- Buttons ----- */
.btn {
  display: inline-block;
  padding: 12px 22px;
  font-size: 1rem; font-weight: 600;
  border: 1px solid transparent; border-radius: var(--radius);
  cursor: pointer; text-decoration: none; line-height: 1;
  transition: background .15s, transform .05s;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-dark); }
.btn--ghost { background: transparent; border-color: currentColor; color: var(--primary); }
.btn--ghost:hover { background: rgba(13,27,42,0.05); }
.section--order .btn--ghost { color: #f0f3f7; }
.section--order .btn--ghost:hover { background: rgba(255,255,255,0.08); }
/* Контрастный «выбрать»/«рассчитать» — синий solid на белом фоне формы */
.btn--select {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.btn--select:hover { background: var(--primary-light); border-color: var(--primary-light); }
.btn--select.is-active {
  background: #2e7d32;
  border-color: #2e7d32;
}
.btn--small { padding: 8px 14px; font-size: 0.9rem; }
.btn--wide { width: 100%; padding: 16px; font-size: 1.1rem; }
.btn[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  filter: grayscale(40%);
}
.btn[disabled]:hover { background: var(--accent); }

/* ----- Cards ----- */
.cards {
  display: grid; gap: 20px;
  grid-template-columns: 1fr;
  margin-top: 32px;
}
@media (min-width: 600px) { .cards { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px) { .cards { grid-template-columns: repeat(4, 1fr); } }
.cards--2col { grid-template-columns: 1fr; }
@media (min-width: 768px) { .cards--2col { grid-template-columns: 1fr 1fr; } }

.card {
  background: #fff; padding: 24px;
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card h3 { margin-bottom: 8px; color: var(--primary); }
.card--warn { background: var(--warn-bg); border-color: var(--warn-border); }

/* ----- Specs table ----- */
.specs { background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.specs th, .specs td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: top; }
.specs tr:last-child th, .specs tr:last-child td { border-bottom: 0; }
.specs th { width: 38%; color: var(--text-muted); font-weight: 500; }

/* ----- Steps ----- */
.steps {
  counter-reset: step;
  list-style: none; padding: 0; margin: 32px 0 0;
  display: grid; gap: 20px;
  grid-template-columns: 1fr;
}
@media (min-width: 600px) { .steps { grid-template-columns: 1fr 1fr; } }
@media (min-width: 900px) { .steps { grid-template-columns: repeat(4, 1fr); } }
.steps li {
  background: #fff; padding: 24px;
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  position: relative; counter-increment: step;
}
.steps li::before {
  content: counter(step);
  position: absolute; top: -16px; left: 20px;
  width: 36px; height: 36px;
  background: var(--accent); color: #fff;
  border-radius: 50%; display: grid; place-items: center;
  font-weight: 700;
}
.steps strong { display: block; margin: 4px 0 6px; color: var(--primary); }
.steps p { color: var(--text-muted); margin: 0; font-size: 0.95rem; }

/* ----- Order form ----- */
.order-form {
  background: #fff; color: var(--text);
  padding: 28px; border-radius: var(--radius);
  margin-top: 24px; max-width: 760px;
}
.order-form label { display: block; margin-bottom: 14px; font-size: 0.95rem; }
.order-form label > span:first-child { display: block; margin-bottom: 6px; font-weight: 500; color: var(--text); }
.order-form input[type="text"],
.order-form input[type="tel"],
.order-form input[type="email"],
.order-form input[type="number"],
.order-form input[type="file"],
.order-form textarea {
  width: 100%; padding: 11px 14px; font: inherit;
  border: 1px solid var(--border); border-radius: var(--radius); background: #fff;
}
.order-form input:focus, .order-form textarea:focus {
  outline: 2px solid var(--primary-light); outline-offset: 1px;
}
.order-form .req { color: var(--accent); }
.form-row {
  display: grid; gap: 14px;
  grid-template-columns: 1fr;
}
@media (min-width: 600px) { .form-row { grid-template-columns: 1fr 1fr; } }

.order-form fieldset {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 20px; margin: 8px 0 18px;
}
.order-form legend { padding: 0 8px; font-weight: 600; color: var(--primary); }

.radio {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: 8px; cursor: pointer;
}
.radio input { margin-top: 4px; }
.radio:has(input:checked) { border-color: var(--primary); background: var(--bg-alt); }
.radio small { color: var(--text-muted); }

.delivery__calc { margin: 4px 0 12px; }
.delivery__result { margin-top: 12px; min-height: 1em; color: var(--text-muted); }
.delivery__result table { margin-top: 8px; width: 100%; }
.delivery__result th, .delivery__result td {
  padding: 8px 10px; border-bottom: 1px solid var(--border);
  text-align: left; font-size: 0.92rem; vertical-align: middle;
}
.delivery__result tr.is-active td { background: rgba(46,125,50,0.08); }
.delivery__result th { color: var(--text-muted); font-weight: 500; }
.delivery__result td:nth-child(2),
.delivery__result td:nth-child(3) { white-space: nowrap; }

/* ----- Autocomplete (city + pickup point) ----- */
.autocomplete-wrap { position: relative; }
.autocomplete-list {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  max-height: 280px;
  overflow-y: auto;
  z-index: 50;
  box-shadow: var(--shadow-md);
}
.autocomplete-item {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--bg-alt);
  font-size: 0.95rem;
}
.autocomplete-item:last-child { border-bottom: 0; }
.autocomplete-item:hover,
.autocomplete-item.is-focused {
  background: var(--bg-alt);
}
.autocomplete-item strong { color: var(--text); }
.autocomplete-item small {
  display: block;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 2px;
}
.autocomplete-empty {
  padding: 10px 14px;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-style: italic;
}
.submit-hint {
  color: var(--accent);
  font-weight: 500;
  padding: 8px 12px;
  background: rgba(200, 16, 46, 0.08);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  margin-top: 8px;
}
.submit-hint::before {
  content: "! ";
  font-weight: 800;
  margin-right: 2px;
}

.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 0.9rem; }
.consent input { margin-top: 4px; }

.order-summary {
  background: var(--bg-alt); border-radius: var(--radius);
  padding: 16px 18px; margin: 18px 0;
}
.order-summary div { margin-bottom: 6px; }
.order-summary .total { font-size: 1.1rem; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }

.form-note { color: var(--text-muted); font-size: 0.85rem; margin-top: 14px; }

/* Honeypot (invisible) */
.hp { position: absolute !important; left: -9999px !important; opacity: 0 !important; }

/* ----- Contacts ----- */
.contacts {
  display: grid; gap: 20px;
  grid-template-columns: 1fr;
  margin-top: 24px;
}
@media (min-width: 768px) { .contacts { grid-template-columns: repeat(3, 1fr); } }
.contacts__item h3 { color: var(--primary); margin-bottom: 4px; }
.contacts__item p { margin: 0; }

/* ----- Footer ----- */
.site-footer {
  background: var(--primary); color: #b8c2cf;
  padding: 32px 0; font-size: 0.9rem;
}
.site-footer a { color: #e4e7eb; }
.footer__inner {
  display: grid; gap: 20px;
  grid-template-columns: 1fr;
}
@media (min-width: 768px) { .footer__inner { grid-template-columns: 1fr 1fr 1fr; } }
.copyright { color: #8b95a3; }

/* ----- Cookie banner ----- */
.cookie-banner {
  position: fixed; bottom: 16px; left: 16px; right: 16px;
  background: var(--primary); color: #fff;
  padding: 14px 16px; border-radius: var(--radius);
  box-shadow: var(--shadow-md); font-size: 0.9rem;
  display: flex; gap: 14px; align-items: center; justify-content: space-between;
  z-index: 200;
}
.cookie-banner a { color: #fff; text-decoration: underline; }
.cookie-banner .btn { white-space: nowrap; }
@media (min-width: 600px) {
  .cookie-banner { left: auto; right: 24px; bottom: 24px; max-width: 480px; }
}

/* ----- Accessibility ----- */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
