/* ============================================================
   Альпина — оптово-розничная витрина
   Дизайн-токены и стили по design handoff (high-fidelity, 1440px)
   ============================================================ */

:root {
  /* Цвета */
  --ink:            #16130F;
  --ink-2:          #4A443B;
  --ink-3:          #6E6759;
  --muted:          #8C857A;
  --muted-2:        #A39B8E;
  --bg:             #FAF9F6;
  --surface:        #FFFDF9;
  --surface-alt:    #EFEDE7;
  --border:         #E4E0D9;
  --border-2:       #DCD7CE;
  --border-3:       #C9C3B8;
  --divider:        #EFEDE7;
  --accent:         #FF4A17;
  --accent-hover:   #D63403;
  --accent-hover-d: #FF6A3D;
  --on-dark:        #F3F1ED;
  --on-dark-muted:  #BDB7AC;
  --ok:             #2E7D53;
  --warn:           #B4762A;

  /* Типографика */
  --sans: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Consolas, monospace;

  /* Раскладка */
  --pad-x: 48px;
  --shell: 1440px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--surface-alt);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }

img { max-width: 100%; display: block; }

button { font-family: var(--sans); }

h1, h2, h3, p { margin: 0; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- Общие утилиты ---------- */

.page {
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
  background: var(--bg);
  min-height: 100vh;
  padding-bottom: 80px;
}

.label {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}

.eyebrow {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.mono { font-family: var(--mono); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- Кнопки ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  cursor: pointer;
  font-family: var(--sans);
  text-align: center;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  padding: 16px 28px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
}
.btn-primary:hover { background: var(--accent-hover); color: #fff; }

.btn-secondary {
  border: 1px solid var(--border-3);
  background: transparent;
  color: var(--ink);
  padding: 16px 28px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
}
.btn-secondary:hover { border-color: var(--ink); color: var(--ink); }

.btn-light {
  background: var(--on-dark);
  color: var(--ink);
  padding: 14px 24px;
  border-radius: 9px;
  font-size: 15px;
  font-weight: 700;
}
.btn-light:hover { background: #fff; color: var(--ink); }

.btn-order {
  background: var(--accent);
  color: #fff;
  padding: 9px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
}
.btn-order:hover { background: var(--accent-hover); color: #fff; }
.btn-order.is-added { background: var(--ok); }

/* ---------- Топбар ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px var(--pad-x);
  background: var(--ink);
  color: var(--on-dark);
  font-size: 13px;
  letter-spacing: 0.01em;
}
.topbar__left { display: flex; gap: 28px; align-items: center; flex-wrap: wrap; }
.topbar__dim { opacity: 0.55; }
/* Телефон в топбаре — только для узких экранов: на десктопе он уже есть в шапке */
.topbar__phone { display: none; color: var(--on-dark); font-weight: 700; white-space: nowrap; }
.topbar__phone:hover { color: #fff; }

/* ---------- Хедер ---------- */

.header {
  display: flex;
  align-items: center;
  gap: 40px;
  padding: 24px var(--pad-x);
  border-bottom: 1px solid var(--border);
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 20;
}

.logo { display: flex; align-items: baseline; gap: 10px; color: var(--ink); }
.logo:hover { color: var(--ink); }
.logo__name { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.logo__tag {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  white-space: nowrap;
}

/* min-width:0 + перенос — чтобы длинное меню не распирало шапку по горизонтали */
.nav { display: flex; flex-wrap: wrap; gap: 4px 6px; flex: 1; min-width: 0; }
.nav__link {
  display: inline-flex;
  align-items: center;
  border: none;
  background: transparent;
  color: var(--ink-3);
  font-size: 15px;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color .15s ease, color .15s ease;
}
.nav__link:hover { color: var(--ink); background: rgba(22,19,15,.05); }
.nav__link.is-active { background: var(--surface-alt); color: var(--ink); }
.nav__link.is-muted { color: var(--muted-2); }
.nav__link.is-muted:hover { background: rgba(22,19,15,.04); color: var(--ink-3); }

.header__side { display: flex; align-items: center; gap: 20px; }

.header__phone { text-align: right; }
.header__phone a { color: var(--ink); font-size: 17px; font-weight: 700; display: block; white-space: nowrap; }
.header__phone a:hover { color: var(--accent); }
.header__phone span { font-size: 12px; color: var(--muted); white-space: nowrap; }

.btn-dealer {
  border: 1px solid var(--ink);
  background: var(--bg);
  color: var(--ink);
  padding: 11px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color .15s ease, color .15s ease;
}
.btn-dealer:hover { background: var(--ink); color: var(--bg); }

.cart-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--ink);
  color: var(--bg);
  padding: 11px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}
.cart-badge:hover { background: #241F19; color: var(--bg); }

.burger {
  display: none;
  width: 42px; height: 42px;
  border: 1px solid var(--border-2);
  background: var(--surface);
  border-radius: 8px;
  cursor: pointer;
  padding: 0;
  align-items: center;
  justify-content: center;
}
.burger span { display: block; width: 18px; height: 1.5px; background: var(--ink); position: relative; }
.burger span::before,
.burger span::after {
  content: ''; position: absolute; left: 0; width: 18px; height: 1.5px; background: var(--ink);
}
.burger span::before { top: -6px; }
.burger span::after  { top: 6px; }

/* ---------- Подвал ---------- */

.footer {
  margin-top: 24px;
  padding: 44px var(--pad-x) 0;
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 32px;
}
.footer__brand { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 10px; }
.footer__about { font-size: 14px; color: var(--muted); line-height: 1.55; max-width: 280px; }
.footer__title {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted-2);
  margin-bottom: 12px;
}
.footer__links { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.footer__links a { font-size: 14px; color: var(--ink-2); }
.footer__links a:hover { color: var(--accent); }

/* ---------- Переключатель цен ---------- */

.price-switch {
  display: flex;
  gap: 8px;
  background: var(--surface-alt);
  padding: 4px;
  border-radius: 10px;
  flex-shrink: 0;
}
.price-switch button {
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 9px 18px;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color .15s ease, color .15s ease;
}
.price-switch button.is-active { background: var(--surface); color: var(--ink); }

.price-switch--sm { gap: 4px; border-radius: 9px; }
.price-switch--sm button { padding: 8px 14px; border-radius: 6px; font-size: 13px; }

/* ---------- Карточка товара ---------- */

.card {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color .15s ease;
}
.card:hover { border-color: var(--ink); }

/* Плейсхолдер лежит фоном: если фото товара ещё не загружено на хостинг,
   <img> прячется скриптом и остаётся аккуратная заглушка. */
.card__media {
  position: relative;
  height: 230px;
  overflow: hidden;
  background: var(--surface-alt) url('../img/placeholder-product.svg') center / cover no-repeat;
}
.card__media img { width: 100%; height: 100%; object-fit: cover; }

.card__badge {
  position: absolute;
  top: 12px; left: 12px;
  background: var(--ink);
  color: var(--bg);
  font-size: 11px;
  font-weight: 600;
  padding: 5px 9px;
  border-radius: 6px;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.card__body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}
.card__sku { font-family: var(--mono); font-size: 11px; color: var(--muted-2); }
.card__name { font-size: 16px; font-weight: 700; line-height: 1.3; }
.card__spec { font-size: 13px; color: var(--muted); flex: 1; }
.card__price-row { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.card__price { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.card__price-note { font-size: 13px; color: var(--muted); }
.card__foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding-top: 4px;
}
.card__stock { font-size: 12px; font-weight: 600; color: var(--ok); }
.card__stock.is-order { color: var(--warn); }

/* Вариант карточки в каталоге */
.card--catalog .card__media { height: 240px; }
.card--catalog .card__name { font-size: 17px; }
.card--catalog .card__price { font-size: 23px; }
.card--catalog .btn-order { padding: 10px 16px; }

/* ============================================================
   ГЛАВНАЯ
   ============================================================ */

.hero {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  border-bottom: 1px solid var(--border);
}
.hero__left {
  padding: 76px var(--pad-x) 72px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 28px;
}
.hero__title {
  font-size: 64px;
  line-height: 1.02;
  font-weight: 800;
  letter-spacing: -0.03em;
  text-wrap: pretty;
}
.hero__text {
  font-size: 19px;
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 520px;
  text-wrap: pretty;
}
.hero__actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero__stats {
  display: flex;
  gap: 40px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}
.hero__stat-value { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.hero__stat-label { font-size: 13px; color: var(--muted); }
.hero__media {
  background: var(--accent);
  padding: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero__frame {
  width: 100%;
  height: 520px;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255,255,255,.12) url('../img/placeholder-hero.svg') center / cover no-repeat;
}
.hero__frame img { width: 100%; height: 100%; object-fit: cover; }

.section { padding: 56px var(--pad-x); border-bottom: 1px solid var(--border); }
.section--plain { border-bottom: none; }

.section__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.section__title { font-size: 34px; font-weight: 800; letter-spacing: -0.02em; }
.section__sub { font-size: 15px; color: var(--muted); margin-top: 6px; }
.section__link { font-size: 15px; font-weight: 600; }

.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }

.cat-card {
  display: block;
  text-align: left;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 14px;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  color: var(--ink);
  transition: border-color .15s ease;
}
.cat-card:hover { border-color: var(--ink); color: var(--ink); }
.cat-card__media {
  height: 150px;
  overflow: hidden;
  background: var(--surface-alt) url('../img/placeholder-category.svg') center / cover no-repeat;
}
.cat-card__media img { width: 100%; height: 100%; object-fit: cover; }
.cat-card__foot {
  padding: 16px 18px 18px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.cat-card__name { font-size: 17px; font-weight: 700; }
.cat-card__count { font-family: var(--mono); font-size: 12px; color: var(--muted); }

.panel-dark {
  background: var(--ink);
  color: var(--on-dark);
  border-radius: 16px;
  padding: 44px 40px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.panel-dark h2 { font-size: 32px; font-weight: 800; letter-spacing: -0.02em; }
.panel-dark p { font-size: 17px; line-height: 1.55; color: var(--on-dark-muted); max-width: 420px; }
.tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 8px; }
.tier {
  border: 1px solid rgba(243,241,237,0.18);
  border-radius: 10px;
  padding: 16px;
}
.tier__qty { font-family: var(--mono); font-size: 11px; color: var(--muted); text-transform: uppercase; }
.tier__discount { font-size: 24px; font-weight: 800; margin-top: 6px; }
.panel-dark .btn-light { align-self: flex-start; margin-top: 10px; }

.panel-light {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 44px 40px;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.panel-light h2 { font-size: 32px; font-weight: 800; letter-spacing: -0.02em; }
.step {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--divider);
}
.step:last-child { padding-bottom: 0; border-bottom: none; }
.step__n { font-family: var(--mono); font-size: 12px; color: var(--accent); padding-top: 3px; }
.step__title { font-size: 17px; font-weight: 700; }
.step__text { font-size: 14px; color: var(--ink-3); line-height: 1.5; margin-top: 3px; }

/* ============================================================
   КАТАЛОГ
   ============================================================ */

.catalog {
  display: grid;
  grid-template-columns: 280px 1fr;
  min-height: 900px;
}

.filters {
  border-right: 1px solid var(--border);
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  background: var(--bg);
  align-content: start;
}
.filters__group-title { margin-bottom: 12px; }
.filters__list { display: flex; flex-direction: column; gap: 2px; }

.filter-cat {
  text-align: left;
  border: none;
  background: transparent;
  color: var(--ink-2);
  padding: 9px 12px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  transition: background-color .15s ease, color .15s ease;
}
.filter-cat:hover { background: var(--surface-alt); }
.filter-cat.is-active { background: var(--ink); color: var(--bg); font-weight: 700; }
.filter-cat.is-active:hover { background: var(--ink); }
.filter-cat__count { font-family: var(--mono); font-size: 12px; opacity: 0.5; }

.price-inputs { display: flex; gap: 8px; }
.price-inputs input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border-2);
  background: var(--surface);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink);
}
.price-inputs input:focus { outline: none; border-color: var(--ink); }

.check-list { display: flex; flex-direction: column; gap: 9px; }
.check {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  cursor: pointer;
  color: var(--ink);
}
.check input { position: absolute; opacity: 0; width: 0; height: 0; }
.check__box {
  width: 18px; height: 18px; flex: 0 0 18px;
  border: 1px solid var(--border-3);
  border-radius: 5px;
  background: transparent;
  position: relative;
  transition: background-color .12s ease, border-color .12s ease;
}
.check input:checked + .check__box { background: var(--ink); border-color: var(--ink); }
.check input:checked + .check__box::after {
  content: ''; position: absolute; left: 5px; top: 1px;
  width: 5px; height: 10px;
  border: solid var(--bg); border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}
.check input:focus-visible + .check__box { outline: 2px solid var(--accent); outline-offset: 2px; }
.check__count { font-family: var(--mono); font-size: 12px; color: var(--muted-2); margin-left: auto; }
.check--dim { color: var(--ink-3); }

.btn-reset {
  border: 1px solid var(--border-2);
  background: transparent;
  padding: 11px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-3);
  cursor: pointer;
  transition: border-color .15s ease, color .15s ease;
}
.btn-reset:hover { border-color: var(--ink); color: var(--ink); }

.catalog__main { padding: 32px var(--pad-x); min-width: 0; }
.crumbs { font-family: var(--mono); font-size: 12px; color: var(--muted-2); margin-bottom: 10px; }
.catalog__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
  flex-wrap: wrap;
}
.catalog__title-wrap { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.catalog__title { font-size: 38px; font-weight: 800; letter-spacing: -0.025em; }
.catalog__count { font-size: 20px; font-weight: 600; color: var(--muted-2); }
.catalog__tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.catalog__tools-label { font-size: 14px; color: var(--muted); }

.btn-sort {
  border: 1px solid var(--border-2);
  background: var(--surface);
  color: var(--ink);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .15s ease;
}
.btn-sort:hover { border-color: var(--ink); }

.empty-state {
  border: 1px dashed var(--border-2);
  border-radius: 14px;
  padding: 56px 32px;
  text-align: center;
  color: var(--ink-3);
  grid-column: 1 / -1;
}
.empty-state strong { display: block; font-size: 18px; color: var(--ink); margin-bottom: 8px; }

.filters-toggle { display: none; }

/* ============================================================
   ОПТ И УСЛОВИЯ
   ============================================================ */

.wholesale {
  padding: 56px var(--pad-x);
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 48px;
  align-items: start;
}
.wholesale__col { display: flex; flex-direction: column; gap: 40px; min-width: 0; }
.wholesale__eyebrow { margin-bottom: 14px; }
.wholesale__title {
  font-size: 52px;
  line-height: 1.05;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 16px;
  text-wrap: pretty;
}
.wholesale__lead { font-size: 18px; line-height: 1.6; color: var(--ink-2); max-width: 640px; }

.tier-table {
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface);
}
.tier-table__head,
.tier-table__row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1fr;
  gap: 12px;
}
.tier-table__head {
  padding: 16px 24px;
  background: var(--surface-alt);
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-3);
}
.tier-table__row { padding: 20px 24px; border-top: 1px solid var(--divider); align-items: center; }
.tier-table__name { font-size: 17px; font-weight: 700; }
.tier-table__qty,
.tier-table__terms { font-size: 16px; color: var(--ink-2); }
.tier-table__discount { font-size: 19px; font-weight: 800; color: var(--accent); }
.tier-table__label { display: none; }

.perk {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  background: var(--surface);
}
.perk__title { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.perk__text { font-size: 14px; line-height: 1.55; color: var(--ink-3); }

.lead-form {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px;
  background: var(--ink);
  color: var(--on-dark);
  position: sticky;
  top: 120px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.lead-form h2 { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 6px; }
.lead-form__sub { font-size: 14px; color: var(--muted-2); line-height: 1.5; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.field input {
  border: 1px solid rgba(243,241,237,0.2);
  background: rgba(243,241,237,0.06);
  color: var(--on-dark);
  border-radius: 9px;
  padding: 13px 14px;
  font-family: var(--sans);
  font-size: 15px;
  width: 100%;
}
.field input::placeholder { color: rgba(243,241,237,0.35); }
.field input:focus { outline: none; border-color: var(--accent); }
.field input[aria-invalid="true"] { border-color: var(--accent); }
.field__error { font-size: 12px; color: var(--accent-hover-d); }

.btn-submit {
  border: none;
  background: var(--accent);
  color: #fff;
  padding: 16px;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 6px;
  transition: background-color .15s ease;
}
.btn-submit:hover { background: var(--accent-hover-d); color: #fff; }
.btn-submit:disabled { opacity: .6; cursor: default; }

.lead-form__note { font-size: 12px; color: var(--muted); line-height: 1.5; }

.form-status {
  font-size: 14px;
  line-height: 1.5;
  border-radius: 9px;
  padding: 12px 14px;
  display: none;
}
.form-status.is-ok { display: block; background: rgba(46,125,83,.20); color: #8FD9B0; }
.form-status.is-err { display: block; background: rgba(255,74,23,.15); color: var(--accent-hover-d); }

/* ---------- Всплывающее уведомление ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 20px);
  background: var(--ink);
  color: var(--on-dark);
  padding: 13px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  z-index: 60;
  max-width: calc(100% - 32px);
  text-align: center;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* ============================================================
   АДАПТИВ
   ============================================================ */

@media (max-width: 1240px) {
  :root { --pad-x: 32px; }
  .hero__left { padding: 56px var(--pad-x); }
  .hero__title { font-size: 52px; }
  .hero__frame { height: 440px; }
  .header { gap: 20px; }
  .nav { gap: 4px 2px; }
  .nav__link { padding: 10px 12px; font-size: 14px; }
  /* «Войти как дилер» — вторичное действие, убираем раньше, чем начнёт жать меню */
  .btn-dealer { display: none; }
  .panel-dark, .panel-light { padding: 36px 32px; }
  .wholesale { grid-template-columns: 1fr 360px; gap: 32px; }
  .wholesale__title { font-size: 44px; }
  .catalog { grid-template-columns: 250px 1fr; }
  .filters { padding: 28px 20px; }
}

@media (max-width: 1080px) {
  .header__phone { display: none; }
  .topbar__phone { display: block; }
  .grid-4 { grid-template-columns: repeat(3, 1fr); }
  .hero { grid-template-columns: 1fr; }
  .hero__media { order: -1; padding: 24px; }
  .hero__frame { height: 340px; }
  .hero__left { padding: 44px var(--pad-x) 48px; }
  .hero__title { font-size: 46px; }
  .wholesale { grid-template-columns: 1fr; }
  .lead-form { position: static; }
  .catalog { grid-template-columns: 1fr; min-height: 0; }
  .filters {
    border-right: none;
    border-bottom: 1px solid var(--border);
    display: none;
  }
  .filters.is-open { display: flex; }
  .filters-toggle {
    display: block;
    margin: 24px var(--pad-x) 0;
    border: 1px solid var(--border-2);
    background: var(--surface);
    color: var(--ink);
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    width: calc(100% - var(--pad-x) * 2);
    text-align: left;
  }
}

@media (max-width: 900px) {
  :root { --pad-x: 24px; }
  .header { flex-wrap: wrap; gap: 12px; }
  .nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 4px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: 12px var(--pad-x) 20px;
    box-shadow: 0 12px 24px rgba(22,19,15,.06);
  }
  .nav.is-open { display: flex; }
  .burger { display: flex; order: 3; }
  .header__side { margin-left: auto; gap: 10px; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .footer { grid-template-columns: 1fr 1fr; gap: 28px; }
  .section { padding: 40px var(--pad-x); }
  .wholesale { padding: 40px var(--pad-x); }
  .wholesale__title { font-size: 36px; }
  .catalog__title { font-size: 30px; }
  .catalog__count { font-size: 17px; }
  .tier-table__head { display: none; }
  .tier-table__row {
    grid-template-columns: auto 1fr;
    gap: 6px 16px;
    padding: 18px 20px;
  }
  .tier-table__label {
    display: block;
    font-family: var(--mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    align-self: center;
  }
  .tier-table__row > span:not(.tier-table__label) { text-align: right; }
}

@media (max-width: 620px) {
  :root { --pad-x: 16px; }
  .topbar { font-size: 12px; }
  .topbar__left { gap: 4px 16px; }
  .topbar__dim { display: none; }
  .logo__name { font-size: 20px; }
  .logo__tag { display: none; }
  .hero__title { font-size: 34px; letter-spacing: -0.02em; }
  .hero__text { font-size: 17px; }
  .hero__frame { height: 240px; }
  .hero__actions .btn { flex: 1 1 100%; }
  .hero__stats { gap: 20px; }
  .section__title { font-size: 26px; }
  .grid-4, .grid-3 { grid-template-columns: 1fr; }
  .card__media { height: 240px; }
  .footer { grid-template-columns: 1fr; padding-top: 32px; }
  .footer__about { max-width: none; }
  .panel-dark, .panel-light { padding: 28px 22px; }
  .panel-dark h2, .panel-light h2 { font-size: 26px; }
  .tiers { grid-template-columns: 1fr; }
  .wholesale__title { font-size: 30px; }
  .wholesale__lead { font-size: 16px; }
  .lead-form { padding: 24px 20px; }
  .catalog__head { align-items: flex-start; }
  .catalog__tools { width: 100%; }
  .price-switch { flex: 1; }
  .price-switch button { flex: 1; padding: 9px 10px; }
  .cart-badge { padding: 11px 12px; }
  .page { padding-bottom: 48px; }
}

/* ---------- Печать ---------- */

@media print {
  .header, .topbar, .price-switch, .btn-order,
  .filters, .filters-toggle, .toast { display: none !important; }
  .page { max-width: none; }
}

/* ============================================================
   КОРЗИНА (выезжает справа)
   ============================================================ */

.cart-overlay {
  position: fixed; inset: 0;
  background: rgba(22, 19, 15, .45);
  opacity: 0; pointer-events: none;
  transition: opacity .2s ease;
  z-index: 90;
}
.cart-overlay.is-open { opacity: 1; pointer-events: auto; }

.cart-drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 460px; max-width: 100%;
  background: var(--bg);
  z-index: 100;
  display: flex; flex-direction: column;
  transform: translateX(101%);
  transition: transform .24s ease;
  box-shadow: -12px 0 40px rgba(22, 19, 15, .14);
}
.cart-drawer.is-open { transform: none; }

.cart-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  padding: 24px 28px 18px;
  border-bottom: 1px solid var(--border);
}
.cart-head h2 { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; }
.cart-head__sub { font-size: 13px; color: var(--muted); margin-top: 4px; }
.cart-close {
  border: none; background: transparent; cursor: pointer;
  font-size: 24px; line-height: 1; color: var(--ink-3);
  padding: 4px 8px; border-radius: 8px; align-self: flex-start;
}
.cart-close:hover { background: var(--surface-alt); color: var(--ink); }

.cart-body { flex: 1; overflow-y: auto; padding: 8px 28px; }

.cart-empty { padding: 56px 8px; text-align: center; color: var(--ink-3); }
.cart-empty strong { display: block; font-size: 17px; color: var(--ink); margin-bottom: 8px; }

.cart-item {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 14px;
  padding: 18px 0;
  border-bottom: 1px solid var(--divider);
  align-items: start;
}
.cart-item__media {
  width: 64px; height: 64px; border-radius: 9px; overflow: hidden;
  background: #fff; border: 1px solid var(--border);
}
/* contain, а не cover: карточки товаров широкие, в квадратной миниатюре
   при cover от телефона остаётся только середина */
.cart-item__media img { width: 100%; height: 100%; object-fit: contain; }
.cart-item__name { font-size: 15px; font-weight: 700; line-height: 1.3; }
.cart-item__sku { font-family: var(--mono); font-size: 11px; color: var(--muted-2); margin-top: 3px; }
.cart-item__unit { font-size: 13px; color: var(--muted); margin-top: 6px; }
.cart-item__right { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.cart-item__sum { font-size: 16px; font-weight: 800; letter-spacing: -0.02em; white-space: nowrap; }

.qty { display: flex; align-items: center; gap: 2px; }
.qty button {
  width: 28px; height: 28px; border: 1px solid var(--border-2);
  background: var(--surface); color: var(--ink);
  border-radius: 7px; cursor: pointer; font-size: 15px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.qty button:hover { border-color: var(--ink); }
.qty input {
  width: 46px; height: 28px; text-align: center;
  border: 1px solid var(--border-2); background: var(--surface);
  border-radius: 7px; margin: 0 4px;
  font-family: var(--mono); font-size: 13px; color: var(--ink);
}
.qty input:focus { outline: none; border-color: var(--ink); }

.cart-remove {
  border: none; background: transparent; cursor: pointer;
  font-size: 12px; color: var(--muted); padding: 2px 0;
}
.cart-remove:hover { color: var(--accent); }

.cart-foot { border-top: 1px solid var(--border); padding: 20px 28px 24px; background: var(--surface); }
.cart-total { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 4px; }
.cart-total__label { font-size: 15px; color: var(--ink-3); }
.cart-total__value { font-size: 26px; font-weight: 800; letter-spacing: -0.02em; }
.cart-note { font-size: 12px; color: var(--muted); line-height: 1.5; margin-bottom: 16px; }
.cart-note b { color: var(--warn); font-weight: 600; }

.cart-form { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.cart-form input {
  width: 100%; border: 1px solid var(--border-2); background: var(--bg);
  border-radius: 8px; padding: 11px 12px; font-family: var(--sans);
  font-size: 14px; color: var(--ink);
}
.cart-form input:focus { outline: none; border-color: var(--ink); }
.cart-form input[aria-invalid="true"] { border-color: var(--accent); }

.cart-actions { display: flex; flex-direction: column; gap: 8px; }
.cart-actions .btn-submit { margin-top: 0; padding: 14px; font-size: 15px; }
.btn-wa {
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-2); background: var(--bg); color: var(--ink);
  padding: 12px; border-radius: 10px; font-size: 14px; font-weight: 600;
  cursor: pointer; text-align: center;
}
.btn-wa:hover { border-color: var(--ink); color: var(--ink); }
.cart-clear {
  border: none; background: transparent; color: var(--muted);
  font-size: 13px; cursor: pointer; padding: 6px; align-self: center;
}
.cart-clear:hover { color: var(--accent); }

.cart-status { font-size: 13px; line-height: 1.5; border-radius: 8px; padding: 10px 12px; margin-bottom: 10px; display: none; }
.cart-status.is-ok  { display: block; background: rgba(46,125,83,.14); color: #1E5C3B; }
.cart-status.is-err { display: block; background: rgba(255,74,23,.12); color: var(--accent-hover); }

body.cart-open { overflow: hidden; }

@media (max-width: 620px) {
  .cart-head { padding: 18px 18px 14px; }
  .cart-body { padding: 4px 18px; }
  .cart-foot { padding: 16px 18px 20px; }
  .cart-item { grid-template-columns: 52px 1fr; gap: 12px; }
  .cart-item__media { width: 52px; height: 52px; }
  .cart-item__right { grid-column: 1 / -1; flex-direction: row; align-items: center; justify-content: space-between; width: 100%; }
  .cart-form { grid-template-columns: 1fr; }
}
