:root {
  --bg: #f6f5f2;
  --surface: #ffffff;
  --ink: #12151a;
  --ink-2: #4a505a;
  --muted: #8a909b;
  --line: #e6e4de;
  --red: #d42a2f;
  --red-dark: #b01f24;
  --dark: #0f1216;
  --wa: #1fa855;
  --wa-dark: #178a45;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(18, 21, 26, .06), 0 8px 24px rgba(18, 21, 26, .06);
  --gutter: 16px;
  --max: 1200px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
h1, h2, h3 { line-height: 1.15; margin: 0; letter-spacing: -.02em; }
.ic { width: 1.25em; height: 1.25em; flex: none; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Шапка ---------- */
.header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .92);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.header .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.02em; }
.brand img { height: 46px; width: auto; }
.brand span { display: none; font-size: 18px; }
.head-left { display: flex; align-items: center; gap: 6px; min-width: 0; }
.burger { width: 44px; height: 44px; border: 0; background: transparent; border-radius: 12px; display: inline-flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px; flex: none; }
.burger span { display: block; width: 22px; height: 2px; border-radius: 2px; background: var(--ink); }
.burger:hover { background: rgba(0,0,0,.05); }
.menu-overlay { position: fixed; inset: 0; background: rgba(15,18,22,.5); z-index: 90; }
.menu { position: fixed; top: 0; left: 0; bottom: 0; width: min(320px, 86vw); background: #fff; z-index: 100; padding: 16px 20px calc(20px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 18px; transform: translateX(-102%); transition: transform .25s ease; box-shadow: 8px 0 30px rgba(0,0,0,.15); visibility: hidden; }
.menu.open { transform: none; visibility: visible; }
.menu-head { display: flex; align-items: center; justify-content: space-between; font-weight: 800; font-size: 18px; }
.menu-head button { width: 44px; height: 44px; border: 0; background: transparent; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; }
.menu-head svg { width: 24px; height: 24px; }
.menu-nav { display: flex; flex-direction: column; flex: 1; }
.menu-nav a { padding: 16px 4px; font-size: 18px; font-weight: 600; border-bottom: 1px solid var(--line); }
.menu-nav a:hover { color: var(--red); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 22px; border-radius: 999px; border: 0;
  font-weight: 700; font-size: 16px; transition: transform .15s, background .15s, box-shadow .15s;
}
.btn:active { transform: scale(.98); }
.btn-wa { background: var(--wa); color: #fff; }
.btn-wa:hover { background: var(--wa-dark); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #000; }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-sm { min-height: 40px; padding: 0 16px; font-size: 14px; }
.btn-block { width: 100%; }
.header .btn-wa .label { display: none; }
.header .btn-wa { padding: 0 14px; min-height: 42px; }

/* ---------- Hero ---------- */
.hero { background: var(--dark); color: #fff; position: relative; overflow: hidden; }
.hero::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(600px 300px at 90% -10%, rgba(212, 42, 47, .35), transparent 70%),
    radial-gradient(500px 280px at -10% 110%, rgba(255, 255, 255, .06), transparent 70%);
  pointer-events: none;
}
.hero .wrap { position: relative; padding-top: 36px; padding-bottom: 40px; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px;
  border: 1px solid rgba(255, 255, 255, .18); border-radius: 999px;
  font-size: 13px; color: #d7dae0; margin-bottom: 18px;
}
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--red); }
.hero h1 { font-size: 34px; font-weight: 800; max-width: 14em; }
.hero h1 em { font-style: normal; color: var(--red); }
.hero p.lead { color: #b9bec8; margin: 14px 0 22px; font-size: 16px; max-width: 34em; }
.search {
  display: flex; align-items: center; gap: 10px; background: #fff; color: var(--ink);
  border-radius: 999px; padding: 6px 6px 6px 18px; max-width: 640px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
}
.search .ic { color: var(--muted); }
.search input {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  font: inherit; font-size: 16px; padding: 10px 0; color: var(--ink);
}
.search input::placeholder { color: var(--muted); }
.search .btn { min-height: 44px; padding: 0 20px; }
.quick { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.quick button {
  background: rgba(255, 255, 255, .08); color: #e7e9ee; border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 999px; padding: 8px 14px; font-size: 14px; transition: background .15s;
}
.quick button:hover { background: rgba(255, 255, 255, .16); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 30px; padding-top: 22px; border-top: 1px solid rgba(255, 255, 255, .12); max-width: 640px; }
.stats b { display: block; font-size: 22px; font-weight: 800; }
.stats span { color: #9aa0ab; font-size: 13px; }

/* ---------- Секции ---------- */
.section { padding: 40px 0 8px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.section h2 { font-size: 26px; font-weight: 800; }
.section .sub { color: var(--muted); font-size: 14px; }

/* Категории */
.cats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.cat {
  display: flex; flex-direction: column; gap: 10px; text-align: left;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; transition: border-color .15s, transform .15s, box-shadow .15s;
}
.cat:hover { border-color: var(--red); box-shadow: var(--shadow); transform: translateY(-2px); }
.cat .ic { width: 28px; height: 28px; color: var(--red); }
.cat b { font-size: 15px; font-weight: 700; line-height: 1.25; }
.cat small { color: var(--muted); font-size: 13px; }
.cat.active { border-color: var(--ink); background: var(--ink); color: #fff; }
.cat.active .ic { color: #fff; }
.cat.active small { color: #bfc3cb; }

/* Фильтры */
.toolbar { position: sticky; top: 64px; z-index: 20; background: var(--bg); padding: 10px 0 8px; margin: 0 calc(var(--gutter) * -1); padding-left: var(--gutter); padding-right: var(--gutter); }
.search.light { box-shadow: none; border: 1px solid var(--line); max-width: none; background: var(--surface); padding-left: 16px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 10px 0 4px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; background: var(--surface); border: 1px solid var(--line); color: var(--ink-2);
  border-radius: 999px; padding: 8px 14px; font-size: 14px; font-weight: 500; white-space: nowrap;
  transition: all .15s;
}
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.chip-label { flex: none; align-self: center; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding-right: 2px; }
.result-line { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 14px; margin: 8px 0 14px; }
.reset { background: none; border: 0; color: var(--red); font-weight: 600; padding: 4px 0; }

/* Карточки товаров */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.card {
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; transition: transform .2s, box-shadow .2s, border-color .2s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #d8d5cc; }
.card-img { position: relative; aspect-ratio: 1 / 1; background: #e9e7e1; overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.card:hover .card-img img { transform: scale(1.04); }
.tag {
  position: absolute; left: 8px; top: 8px; background: rgba(255, 255, 255, .94); color: var(--ink);
  font-size: 11px; font-weight: 600; padding: 4px 9px; border-radius: 999px;
}
.badge-video {
  position: absolute; right: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 5px;
  background: rgba(15, 18, 22, .82); color: #fff; font-size: 11px; font-weight: 600; padding: 4px 9px; border-radius: 999px;
}
.badge-video .ic { width: 12px; height: 12px; fill: currentColor; }
.badge-count { position: absolute; right: 8px; top: 8px; background: rgba(15, 18, 22, .82); color: #fff; font-size: 11px; font-weight: 600; padding: 4px 9px; border-radius: 999px; }
.card-body { padding: 12px 12px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card h3 { font-size: 14.5px; font-weight: 700; letter-spacing: -.01em; line-height: 1.3; }
.card .models { color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.card-cta { margin-top: auto; padding-top: 6px; display: inline-flex; align-items: center; gap: 6px; color: var(--red); font-size: 13.5px; font-weight: 700; }
.card-cta .ic { width: 1em; height: 1em; transition: transform .2s; }
.card:hover .card-cta .ic { transform: translateX(3px); }

.empty { text-align: center; padding: 40px 16px; background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); }
.empty h3 { font-size: 20px; margin-bottom: 8px; }
.empty p { color: var(--ink-2); margin: 0 0 18px; }

/* Шаги */
.steps { display: grid; gap: 12px; }
.step { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; display: flex; gap: 16px; align-items: flex-start; }
.step .num { flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--red); color: #fff; font-weight: 800; display: grid; place-items: center; }
.step b { display: block; margin-bottom: 4px; font-size: 16px; }
.step p { margin: 0; color: var(--ink-2); font-size: 14.5px; }

/* CTA */
.cta { margin: 40px 0 0; background: var(--dark); color: #fff; border-radius: 24px; padding: 28px 22px; display: grid; gap: 18px; }
.cta h2 { font-size: 24px; }
.cta p { margin: 8px 0 0; color: #b9bec8; }

/* Подвал */
.footer { margin-top: 48px; background: var(--dark); color: #aeb3bd; padding: 32px 0 calc(32px + env(safe-area-inset-bottom)); font-size: 14px; }
.footer .wrap { display: grid; gap: 18px; }
.footer .brand { color: #fff; }
.footer small { color: #7a808b; }
.footer a:hover { color: #fff; }

/* ---------- Страница товара ---------- */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 16px 0 12px; font-size: 14px; color: var(--muted); }
.crumbs a { color: var(--ink-2); display: inline-flex; align-items: center; gap: 4px; }
.crumbs a:hover { color: var(--red); }
.product { display: grid; gap: 22px; padding-bottom: 12px; }
.gallery { display: grid; gap: 10px; align-content: start; }
.main-img { position: relative; aspect-ratio: 1 / 1; background: #e9e7e1; border-radius: var(--radius); overflow: hidden; cursor: zoom-in; border: 1px solid var(--line); }
.main-img img { width: 100%; height: 100%; object-fit: cover; }
.thumbs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.thumbs::-webkit-scrollbar { display: none; }
.thumb { flex: none; width: 72px; height: 72px; border-radius: 12px; overflow: hidden; border: 2px solid transparent; padding: 0; background: #e9e7e1; opacity: .75; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.active { border-color: var(--red); opacity: 1; }
.thumb.video { position: relative; }
.thumb.video::after { content: ""; position: absolute; inset: 0; background: rgba(15, 18, 22, .45); }
.thumb.video .ic { position: absolute; z-index: 1; left: 50%; top: 50%; transform: translate(-50%, -50%); color: #fff; fill: #fff; width: 22px; height: 22px; }
.video-box { border-radius: var(--radius); overflow: hidden; background: #000; border: 1px solid var(--line); aspect-ratio: 9 / 16; max-height: 70vh; }
.video-box video { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }

.info .tagline { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; background: #fff; border: 1px solid var(--line); color: var(--ink-2); }
.pill.red { background: #fdecec; border-color: #f6cfd0; color: var(--red-dark); }
.info h1 { font-size: 27px; font-weight: 800; }
.info .short { color: var(--ink-2); margin: 10px 0 0; }
.price-note { margin: 18px 0; padding: 14px 16px; border-radius: 14px; background: #fff; border: 1px solid var(--line); display: flex; gap: 12px; align-items: center; }
.price-note b { display: block; font-size: 17px; }
.price-note span { color: var(--muted); font-size: 13.5px; }
.price-note .ic { width: 26px; height: 26px; color: var(--red); }
.block { margin-top: 22px; }
.block h2 { font-size: 17px; margin-bottom: 10px; }
.block p { margin: 0; color: var(--ink-2); }
.list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.list li { display: flex; gap: 10px; align-items: flex-start; color: var(--ink-2); }
.list .ic { color: var(--wa); width: 1.15em; height: 1.15em; margin-top: 3px; }
.specs { display: grid; grid-template-columns: auto 1fr; gap: 8px 16px; font-size: 14.5px; }
.specs dt { color: var(--muted); }
.specs dd { margin: 0; font-weight: 600; }
.actions { margin-top: 24px; display: grid; gap: 10px; }
.sticky-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  background: rgba(255, 255, 255, .96); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line); padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom));
}
.sticky-bar .btn { width: 100%; min-height: 52px; }
body.has-sticky { padding-bottom: 84px; }
.related h2 { font-size: 22px; margin: 36px 0 16px; }

/* Лайтбокс */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(8, 10, 12, .96); display: none; align-items: center; justify-content: center; }
.lightbox.open { display: flex; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }
.lb-btn { position: absolute; background: rgba(255, 255, 255, .12); color: #fff; border: 0; border-radius: 50%; width: 46px; height: 46px; display: grid; place-items: center; }
.lb-btn:hover { background: rgba(255, 255, 255, .24); }
.lb-close { top: 14px; right: 14px; }
.lb-prev { left: 10px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 10px; top: 50%; transform: translateY(-50%); }
.lb-prev .ic { transform: rotate(180deg); }
.lb-count { position: absolute; bottom: 18px; left: 0; right: 0; text-align: center; color: #aeb3bd; font-size: 14px; }

/* Уведомление */
#toast {
  position: fixed; left: 50%; bottom: 96px; transform: translate(-50%, 20px); z-index: 120;
  background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 14px; font-size: 14px;
  max-width: calc(100% - 32px); opacity: 0; pointer-events: none; transition: all .25s; box-shadow: var(--shadow);
  text-align: center;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Планшет ---------- */
@media (min-width: 640px) {
  .grid { grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .cats { grid-template-columns: repeat(4, 1fr); }
  .steps { grid-template-columns: repeat(3, 1fr); }
  .step { flex-direction: column; }
  .hero h1 { font-size: 44px; }
}

/* ---------- Компьютер ---------- */
@media (min-width: 960px) {
  :root { --gutter: 28px; }
  .header .wrap { height: 76px; }
  .brand img { height: 56px; }
  .brand span { display: inline; }
  .header .btn-wa .label { display: inline; }
  .header .btn-wa { padding: 0 20px; }
  .hero .wrap { padding-top: 72px; padding-bottom: 76px; }
  .hero h1 { font-size: 60px; }
  .hero p.lead { font-size: 18px; }
  .section { padding-top: 64px; }
  .section h2 { font-size: 34px; }
  .cats { grid-template-columns: repeat(4, 1fr); gap: 14px; }
  .cat { padding: 22px; }
  .toolbar { top: 76px; display: flex; flex-direction: column; }
  .grid { grid-template-columns: repeat(4, 1fr); gap: 20px; }
  .card-body { padding: 14px 16px 16px; }
  .card h3 { font-size: 16px; }
  .cta { grid-template-columns: 1fr auto; align-items: center; padding: 44px; }
  .cta h2 { font-size: 32px; }
  .footer .wrap { grid-template-columns: 1fr auto; align-items: center; }

  .product { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 48px; align-items: start; padding-top: 8px; }
  .gallery { position: sticky; top: 100px; }
  .thumb { width: 84px; height: 84px; }
  .info h1 { font-size: 36px; }
  .sticky-bar { display: none; }
  body.has-sticky { padding-bottom: 0; }
  #toast { bottom: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  html { scroll-behavior: auto; }
}
