:root {
  --bg: #f6f5f2;
  --surface: #ffffff;
  --text: #1d1f22;
  --muted: #6b6f76;
  --line: #e4e2dc;
  --accent: #1f5f5b;
  --accent-soft: #e3efed;
  --ok: #2e7d4f;
  --ok-soft: #e5f3ea;
  --warn: #9a6a00;
  --warn-soft: #fbf1d9;
  --off: #8a8f96;
  --off-soft: #efefef;
  --radius: 10px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}
a { color: var(--accent); }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Шапка */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.header-row { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.logo { font-weight: 700; font-size: 19px; color: var(--text); text-decoration: none; letter-spacing: .2px; }
.logo-tag { margin-left: 8px; font-size: 12px; font-weight: 600; color: var(--accent); background: var(--accent-soft); padding: 2px 8px; border-radius: 99px; vertical-align: 3px; text-transform: uppercase; letter-spacing: .5px; }
.nav { display: flex; gap: 22px; }
.nav a { color: var(--text); text-decoration: none; font-weight: 500; }
.nav a:hover { color: var(--accent); }

/* Первый экран и условия */
.hero { background: var(--surface); border-bottom: 1px solid var(--line); padding: 40px 0 32px; }
.hero h1 { font-size: 32px; max-width: 760px; }
.lead { font-size: 17px; color: var(--muted); max-width: 760px; margin: 0 0 24px; }
.tiers { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; max-width: 760px; }
.tier { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; background: var(--bg); }
.tier-qty { font-size: 22px; font-weight: 700; }
.tier-qty small { font-size: 13px; font-weight: 500; color: var(--muted); }
.tier-title { color: var(--accent); font-weight: 600; font-size: 13px; text-transform: uppercase; letter-spacing: .4px; }
.terms-note { color: var(--muted); font-size: 14px; max-width: 760px; margin: 14px 0 0; }

/* Каталог */
.catalog { padding: 32px 20px 8px; }
.catalog-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.catalog-head h2 { font-size: 24px; margin: 0; }
.synced { color: var(--muted); font-size: 13px; }
.series { margin: 22px 0 34px; }
.series-head h3 { font-size: 19px; margin-bottom: 4px; }
.series-head p { color: var(--muted); margin: 0 0 16px; max-width: 820px; font-size: 14px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; }

.card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; color: inherit; text-decoration: none; transition: box-shadow .15s, transform .15s; }
.card:hover { box-shadow: 0 6px 22px rgba(0, 0, 0, .08); transform: translateY(-2px); }
.card-img { aspect-ratio: 3 / 4; background: #eceae4; }
.card-img img { width: 100%; height: 100%; object-fit: cover; }
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-meta { color: var(--muted); font-size: 12.5px; text-transform: uppercase; letter-spacing: .4px; }
.card-title { font-size: 16.5px; margin: 0; }
.ladder-mini { width: 100%; border-collapse: collapse; font-size: 14px; }
.ladder-mini td { padding: 4px 0; border-top: 1px dashed var(--line); }
.ladder-mini tr:first-child td { border-top: 0; }
.ladder-mini td.num { font-weight: 600; }
.ladder-mini tr:last-child td.num { color: var(--accent); }
.card-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; padding-top: 4px; }
.unit { color: var(--muted); font-size: 12.5px; }

.stock { display: inline-block; font-size: 12.5px; font-weight: 600; padding: 3px 9px; border-radius: 99px; white-space: nowrap; }
.stock-in { color: var(--ok); background: var(--ok-soft); }
.stock-low { color: var(--warn); background: var(--warn-soft); }
.stock-out, .stock-unknown { color: var(--off); background: var(--off-soft); }

/* Преимущества */
.advantages { padding: 8px 20px 40px; }
.advantages h2 { font-size: 22px; }
.adv-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.adv { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.adv-title { font-weight: 600; margin-bottom: 4px; }
.adv p { margin: 0; color: var(--muted); font-size: 14px; }

/* Карточка товара */
.crumbs { padding: 18px 0; color: var(--muted); font-size: 14px; }
.product { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 36px; padding-bottom: 48px; }
.gallery-main { width: 100%; border-radius: var(--radius); border: 1px solid var(--line); background: #eceae4; }
.gallery-thumbs { display: flex; gap: 10px; margin-top: 10px; }
.thumb { width: 84px; border: 2px solid transparent; border-radius: 8px; overflow: hidden; }
.thumb.active { border-color: var(--accent); }
.info h1 { font-size: 28px; margin-top: 4px; }
.stock-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.ladder { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.ladder th, .ladder td { padding: 11px 14px; border-bottom: 1px solid var(--line); text-align: left; }
.ladder th { font-size: 12.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; background: var(--bg); }
.ladder th.num, .ladder td.num { text-align: right; }
.ladder tr:last-child td { border-bottom: 0; }
.ladder .price { font-size: 18px; font-weight: 700; }
.tier-name { color: var(--muted); font-size: 13px; margin-left: 6px; }
.specs { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 22px 0; }
.specs dt { color: var(--muted); }
.specs dd { margin: 0; }
.series-lead, .pickup { color: var(--muted); font-size: 14px; }

.empty { padding: 60px 20px; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.crossed { text-decoration: line-through; color: var(--muted); font-weight: 400; }
.ladder .price.crossed { font-size: 15px; }
.personal { color: var(--accent); font-weight: 700; }
.tag-personal { display: block; font-size: 11px; color: var(--accent); font-weight: 600; text-transform: uppercase; letter-spacing: .3px; }

/* Кнопки и сообщения */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600; padding: 10px 18px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text); cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: #184c49; color: #fff; }
.btn[disabled] { opacity: .45; cursor: not-allowed; pointer-events: none; }
.btn-ghost { background: transparent; }
.btn-block { width: 100%; }
.btn-big { padding: 14px 26px; font-size: 16px; }
.btn-sm { padding: 5px 12px; font-size: 13.5px; }
.link-btn { font: inherit; color: var(--accent); background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; }
.js .nojs { display: none; }
.flash { border-radius: var(--radius); padding: 12px 16px; margin: 14px 0; font-size: 14.5px; }
.flash.ok { background: var(--ok-soft); color: #1e5a38; }
.flash.err { background: #fbe7e5; color: #8f2a20; }

/* Шапка: вход и корзина */
.header-actions { display: flex; align-items: center; gap: 14px; }
.head-link { color: var(--text); text-decoration: none; font-weight: 500; }
.head-link:hover { color: var(--accent); }
.cart-link { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--text); text-decoration: none; padding: 7px 12px; border: 1px solid var(--line); border-radius: 99px; }
.cart-link.has-items { border-color: var(--accent); color: var(--accent); }
.cart-badge { background: var(--accent); color: #fff; font-size: 12px; padding: 1px 8px; border-radius: 99px; }

/* В корзину (карточка товара) */
.add-form { display: flex; align-items: flex-end; gap: 12px; margin: 18px 0 6px; flex-wrap: wrap; }
.add-qty { display: flex; flex-direction: column; font-size: 13px; color: var(--muted); gap: 4px; }
.add-qty input { width: 110px; }
input[type="text"], input[type="email"], input[type="tel"], input[type="number"], textarea {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid #cfccc4; border-radius: 8px; padding: 9px 11px; width: 100%;
}
input:focus, textarea:focus { outline: 2px solid var(--accent-soft); border-color: var(--accent); }
textarea { resize: vertical; }

/* Страницы корзины, оформления, заказа */
.page { padding-top: 10px; padding-bottom: 48px; }
.page h1 { font-size: 28px; margin-top: 14px; }
.narrow { max-width: 860px; }
.cart-layout, .checkout-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 28px; align-items: start; }
.cart-summary, .checkout-summary { position: sticky; top: 76px; }
.cart-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cart-table th { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; background: var(--bg); text-align: left; padding: 9px 12px; }
.cart-table th.num { text-align: right; }
.cart-table td { padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: middle; }
.cart-table tfoot td { font-weight: 600; }
.cart-table tfoot .total td { font-size: 17px; }
.c-prod { display: flex; gap: 12px; align-items: center; }
.c-img { flex: 0 0 auto; width: 48px; border-radius: 6px; overflow: hidden; background: #eceae4; }
.c-title { font-weight: 600; color: var(--text); text-decoration: none; }
a.c-title:hover { color: var(--accent); }
.c-meta { color: var(--muted); font-size: 12.5px; }
.c-warn { color: var(--warn); font-size: 12.5px; }
.c-warn:empty { display: none; }
.c-sum { font-weight: 700; min-width: 90px; }
.c-qty-h { width: 140px; }
.cart-row:not(.on) .c-sum, .cart-row:not(.on) .c-price { color: var(--muted); }
.qty { display: inline-flex; align-items: stretch; border: 1px solid #cfccc4; border-radius: 8px; overflow: hidden; background: var(--surface); }
.qty input { width: 64px; border: 0; border-radius: 0; text-align: center; padding: 7px 4px; -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty-btn { width: 34px; border: 0; background: var(--bg); font: inherit; font-size: 18px; cursor: pointer; color: var(--text); }
.qty-btn:hover { background: var(--accent-soft); color: var(--accent); }
.more { margin-top: 18px; }
.more summary { cursor: pointer; font-weight: 600; color: var(--accent); padding: 6px 0 12px; }

.sum-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 10px; }
.sum-title { font-weight: 700; font-size: 17px; display: flex; justify-content: space-between; align-items: baseline; }
.sum-title a { font-size: 13.5px; font-weight: 500; }
.sum-row { display: flex; justify-content: space-between; gap: 12px; font-size: 14.5px; }
.sum-row span { color: var(--muted); }
.sum-row b { text-align: right; }
.sum-row.total { font-size: 20px; border-top: 1px solid var(--line); padding-top: 10px; }
.sum-row.total span { color: var(--text); }
.sum-save { color: var(--ok); font-weight: 600; font-size: 14px; }
.sum-note { color: var(--muted); font-size: 12.5px; }
.sum-login { margin: 0; font-size: 13.5px; color: var(--muted); }
.sum-lines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.sum-lines li { display: flex; justify-content: space-between; gap: 10px; }
.sum-lines small { display: block; color: var(--muted); font-size: 12px; }
.sum-bar { display: none; }
.hint { background: var(--accent-soft); border-radius: 8px; padding: 10px 12px; font-size: 13.5px; }
.hint.warn { background: var(--warn-soft); color: #6d4b00; }

.checkout-form fieldset { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 16px 18px 6px; margin: 0 0 16px; }
.checkout-form legend { font-weight: 700; padding: 0 6px; margin-left: -6px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 5px; }
.field-note { color: var(--muted); font-size: 12.5px; margin-top: 4px; }
.field-note.ok { color: var(--ok); }
.field-note.warn { color: var(--warn); }
.field-error { color: #b3261e; font-size: 13px; margin-top: 4px; }
.has-error input, .has-error textarea { border-color: #b3261e; }
.static { padding: 4px 0; font-weight: 600; }
.inn-row { display: flex; gap: 8px; }
.inn-row input { max-width: 220px; }
.radio { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 12px; cursor: pointer; }
.radio input, .consent input { margin-top: 4px; accent-color: var(--accent); }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; margin: 4px 0 16px; cursor: pointer; }
.consent.has-error span { color: #b3261e; }
.consent + .field-error { margin: -10px 0 14px; }
.retail-note { font-size: 13px; color: var(--muted); margin: -4px 0 12px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.order-meta { color: var(--muted); display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.status { display: inline-block; font-size: 12.5px; font-weight: 600; padding: 3px 10px; border-radius: 99px; background: var(--warn-soft); color: var(--warn); white-space: nowrap; }
.status-paid, .status-confirmed { background: var(--accent-soft); color: var(--accent); }
.status-shipped { background: var(--ok-soft); color: var(--ok); }
.status-cancelled { background: var(--off-soft); color: var(--off); }
.order-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 16px 0 20px; }
.order-actions .field-note { max-width: 420px; margin: 0; }
.order-specs dd .muted { font-size: 13.5px; }
.steps { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; margin: 10px 0 18px; }
.steps-title { font-weight: 700; margin-bottom: 4px; }
.steps ol { margin: 0; padding-left: 20px; }
.steps li { margin: 4px 0; }
.login-form { max-width: 360px; }
.login-again { margin-top: 14px; font-size: 14px; color: var(--muted); }
.account-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }

/* Подвал */
.site-footer { background: #1f2326; color: #c9cdd2; padding: 32px 0; font-size: 14px; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 24px; }
.footer-title { color: #fff; font-weight: 600; margin-bottom: 6px; }
.site-footer p { margin: 0 0 6px; }
.site-footer a { color: #9fd3cd; }
.footer-req { margin-top: 24px; padding-top: 16px; border-top: 1px solid #343a3f; font-size: 13px; color: #9aa0a6; }

/* Юридические страницы */
.legal { max-width: 780px; }
.legal h2 { font-size: 19px; margin: 28px 0 8px; }
.legal p, .legal li { line-height: 1.6; }
.legal ul { padding-left: 22px; }
.legal li { margin: 4px 0; }
.legal-meta { color: var(--muted); font-size: 14px; }
.legal-others { margin-top: 32px; padding-top: 14px; border-top: 1px solid var(--line); }
.legal-req { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; margin: 8px 0 12px; font-size: 14.5px; }
.legal-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); font-size: 14px; }
.legal-table th, .legal-table td { text-align: left; vertical-align: top; padding: 9px 12px; border-top: 1px solid var(--line); }
.legal-table thead th { border-top: 0; background: var(--off-soft); font-weight: 600; }
.legal code { font-size: 13px; background: var(--off-soft); padding: 1px 5px; border-radius: 4px; }

@media (max-width: 760px) {
  .wrap { padding: 0 16px; }
  .hero { padding: 28px 0 24px; }
  .hero h1 { font-size: 25px; }
  .header-row { height: auto; padding: 10px 16px; flex-wrap: wrap; gap: 4px 16px; }
  .nav { gap: 14px; font-size: 14px; }
  .product { grid-template-columns: 1fr; gap: 20px; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
  .card-body { padding: 12px; }
  .header-actions { margin-left: auto; gap: 10px; font-size: 14px; }
  .cart-link { padding: 5px 10px; }
  .page h1 { font-size: 23px; }
  .cart-layout, .checkout-layout { grid-template-columns: 1fr; gap: 18px; }
  .cart-summary, .checkout-summary { position: static; }
  .checkout-summary { order: -1; }
  /* Корзина на телефоне: строка товара — сверху, цена/штуки/сумма — под ней */
  .cart-table thead { display: none; }
  .cart-table tr { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 4px 10px; padding: 10px 12px; border-top: 1px solid var(--line); }
  .cart-table tbody tr:first-child { border-top: 0; }
  .cart-table td { border: 0; padding: 0; }
  .cart-table td.c-prod { grid-column: 1 / -1; }
  .cart-table td.c-price { text-align: left; }
  .cart-table tfoot tr { display: flex; justify-content: space-between; }
  .order-table td:nth-child(2), .order-table td:nth-child(3) { font-size: 13.5px; color: var(--muted); }
  .account-orders tr { grid-template-columns: 1fr auto; }
  .account-orders td:first-child { grid-column: 1 / -1; }
  .qty input { width: 52px; }
  /* Итог корзины на телефоне — плашкой внизу экрана */
  .sum-bar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 16px; background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -4px 16px rgba(0, 0, 0, .06); }
  .sum-bar small { display: block; color: var(--muted); font-size: 12px; }
  .cart-page { padding-bottom: 90px; }
  /* Таблица целей в политике: строка — карточкой, заголовки колонок — подписями */
  .legal-table thead { display: none; }
  .legal-table tr { display: block; padding: 10px 12px; border-top: 1px solid var(--line); }
  .legal-table tbody tr:first-child { border-top: 0; }
  .legal-table td { display: block; border: 0; padding: 2px 0; }
  .legal-table td:first-child { font-weight: 600; }
  .legal-table td:nth-child(2)::before { content: "Данные: "; color: var(--muted); }
  .legal-table td:nth-child(3)::before { content: "Основание: "; color: var(--muted); }
}

/* --- Розница --- */
.r-price { font-size: 20px; font-weight: 700; }
.r-price .unit, .r-price-big .unit { font-size: 13px; font-weight: 400; color: var(--muted); }
.r-price-big { font-size: 30px; font-weight: 700; margin: 6px 0 10px; }
.r-ways { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; max-width: 900px; }
.r-ways-col { grid-template-columns: 1fr; margin: 18px 0 6px; }
.r-ways-more { margin: 12px 0 0; font-size: 14.5px; }
.r-way { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; background: var(--bg); }
.r-way p { margin: 4px 0 0; font-size: 14px; color: var(--muted); }
.r-way-title { font-weight: 600; }
.hero .r-closed { max-width: 760px; margin: 0 0 20px; }
.info .r-closed { margin: 14px 0; }
.ok-text { color: var(--ok); }
@media (max-width: 760px) {
  .r-price { font-size: 17px; }
  .r-price-big { font-size: 25px; }
}
.warn-text { color: var(--warn); }
.radio .field-note { display: block; }
