/* Витрина магазина. Типографика и ритм — в духе apple.com:
   крупные заголовки, много воздуха, сдержанная палитра, мягкие анимации. */

:root {
  --bg: #ffffff;
  --surface: #f5f5f7;          /* фирменный светло-серый Apple */
  --surface-2: #ebebf0;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --line: rgba(0, 0, 0, .08);
  --accent: #0071e3;
  --accent-text: #ffffff;
  --shadow: 0 4px 24px rgba(0, 0, 0, .06);
  --shadow-lift: 0 12px 40px rgba(0, 0, 0, .12);
  --radius: 18px;
  --radius-lg: 28px;
  --ease: cubic-bezier(.32, .72, 0, 1);   /* мягкое замедление, как в iOS */
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --surface: #1c1c1e;
    --surface-2: #2c2c2e;
    --text: #f5f5f7;
    --muted: #98989d;
    --line: rgba(255, 255, 255, .12);
    --accent: #0a84ff;
    --shadow: 0 4px 24px rgba(0, 0, 0, .5);
    --shadow-lift: 0 12px 40px rgba(0, 0, 0, .7);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  padding: 0 20px calc(40px + env(safe-area-inset-bottom));
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: contain;
}

.hidden { display: none !important; }

/* Появление блоков при прокрутке */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.reveal.shown { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal, .card { transition: none !important; opacity: 1 !important; transform: none !important; }
  html { scroll-behavior: auto; }
}

/* ── Первый экран ──────────────────────────────────────────── */
.hero { padding: 56px 0 36px; text-align: center; }

.hero-eyebrow {
  margin: 0 0 14px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero-title {
  margin: 0;
  font-size: clamp(38px, 12vw, 56px);
  line-height: 1.05;
  letter-spacing: -.035em;
  font-weight: 700;
  background: linear-gradient(180deg, var(--text) 30%, var(--muted) 130%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-title.reveal { transition-delay: .06s; }

.hero-lead {
  margin: 14px auto 0;
  max-width: 30ch;
  font-size: 18px;
  line-height: 1.4;
  color: var(--muted);
}
.hero-lead.reveal { transition-delay: .12s; }

.stats {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 30px;
}
.stats.reveal { transition-delay: .18s; }

.stat {
  flex: 1;
  max-width: 118px;
  padding: 16px 8px 14px;
  border-radius: var(--radius);
  background: var(--surface);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.stat-icon {
  width: 24px;
  height: 24px;
  margin-bottom: 6px;
  fill: none;
  stroke: var(--text);
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: .9;
}

.stat b {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.02em;
  white-space: nowrap;
}
.stat span {
  font-size: 11px;
  line-height: 1.25;
  color: var(--muted);
  text-align: center;
}

/* ── Поиск и категории ─────────────────────────────────────── */
.sticky-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  margin: 0 -20px;
  padding: 12px 20px 10px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s var(--ease);
}
.sticky-bar.stuck { border-bottom-color: var(--line); }

.search { position: relative; display: flex; align-items: center; }

.search-icon {
  position: absolute;
  left: 13px;
  width: 17px; height: 17px;
  fill: none;
  stroke: var(--muted);
  stroke-width: 2;
  stroke-linecap: round;
  pointer-events: none;
}

.search input {
  width: 100%;
  padding: 11px 38px 11px 38px;
  border: none;
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 16px;
  transition: background .25s var(--ease);
}
.search input:focus { outline: none; background: var(--surface-2); }
.search input::-webkit-search-cancel-button { display: none; }

.search-clear {
  position: absolute;
  right: 8px;
  width: 26px; height: 26px;
  border: none; border-radius: 50%;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
}

.chips {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  margin: 10px -20px 0;
  padding: 2px 20px 2px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }

.chip {
  flex: 0 0 auto;
  padding: 7px 14px;
  border: none;
  border-radius: 999px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition: background .25s var(--ease), color .25s var(--ease), transform .15s var(--ease);
}
.chip:active { transform: scale(.94); }
.chip.active { background: var(--text); color: var(--bg); }

/* ── Сетка товаров ─────────────────────────────────────────── */
.grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: 22px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 16px 14px 14px;
  border: none;
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--text);
  text-align: left;
  font: inherit;
  cursor: pointer;
  opacity: 0;
  transform: translateY(20px) scale(.98);
  animation: card-in .55s var(--ease) forwards;
  transition: box-shadow .3s var(--ease), transform .2s var(--ease);
}
.card:active { transform: scale(.97); }
@media (hover: hover) {
  .card:hover { box-shadow: var(--shadow-lift); }
}

@keyframes card-in {
  to { opacity: 1; transform: none; }
}

/* Грид растягивает строку под натуральный размер картинки, и height:100%
   считается уже от неё — товар вылезает за рамку и обрезается.
   minmax(0, 1fr) удерживает трек в размерах контейнера. */
.card-visual, .cart-emoji, .addon-visual, .related-visual, .gallery-slide {
  grid-template-rows: minmax(0, 1fr);
  grid-template-columns: minmax(0, 1fr);
}
.card-visual img, .cart-emoji img, .addon-visual img,
.related-visual img, .gallery-slide img {
  max-width: 100%;
  max-height: 100%;
  min-width: 0;
  min-height: 0;
}

.card-visual {
  height: 116px;
  display: grid;
  place-items: center;
  font-size: 46px;
  margin-bottom: 12px;
  overflow: hidden;
}
.card-visual img {
  width: 100%; height: 100%;
  object-fit: contain;
  transition: transform .5s var(--ease);
}
@media (hover: hover) {
  .card:hover .card-visual img { transform: scale(1.06); }
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -.01em;
}
.card-variant {
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-prices { margin-top: auto; padding-top: 12px; }
.card-price { font-size: 16px; font-weight: 700; letter-spacing: -.02em; }
.card-old { margin-left: 6px; font-size: 12px; color: var(--muted); text-decoration: line-through; }

.badge {
  position: absolute;
  top: 12px; left: 12px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.badge.muted { background: var(--muted); }

.sentinel { height: 1px; }

/* ── Карточка товара ───────────────────────────────────────── */
.product-visual {
  height: 260px;
  display: grid;
  place-items: center;
  font-size: 100px;
  background: var(--surface);
  border-radius: 32px;
  margin: 14px 0 26px;
  overflow: hidden;
  animation: zoom-in .6s var(--ease) both;
}
/* Трек грида не должен расти под картинку, иначе height: 100% считается
   от её натуральной высоты и рендер вылезает за рамку. */
.product-visual { grid-template-rows: minmax(0, 1fr); grid-template-columns: minmax(0, 1fr); }
.product-visual img {
  width: 100%; height: 100%;
  object-fit: contain; padding: 20px;
}

@keyframes zoom-in {
  from { opacity: 0; transform: scale(.94); }
  to { opacity: 1; transform: none; }
}

.fade-up { animation: fade-up .5s var(--ease) both; }
.fade-up:nth-of-type(2) { animation-delay: .05s; }
.fade-up:nth-of-type(3) { animation-delay: .1s; }
@keyframes fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: none; }
}

.product-title {
  margin: 0;
  font-size: clamp(26px, 8vw, 34px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -.03em;
}
.product-variant { margin: 8px 0 0; color: var(--muted); font-size: 16px; }

.product-prices { display: flex; align-items: baseline; gap: 12px; margin: 22px 0; flex-wrap: wrap; }
.product-price { font-size: 32px; font-weight: 700; letter-spacing: -.03em; }
.product-old { color: var(--muted); text-decoration: line-through; }
.product-save {
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 13px;
  font-weight: 600;
}

.section-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 28px 0 12px;
}

.options { display: flex; flex-wrap: wrap; gap: 8px; }
.option {
  padding: 9px 16px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: border-color .2s var(--ease), color .2s var(--ease), transform .15s var(--ease);
}
.option:active { transform: scale(.95); }
.option.active { border-color: var(--accent); color: var(--accent); font-weight: 600; }

.specs { list-style: none; padding: 0; margin: 0; }
.specs li {
  display: flex;
  gap: 10px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}
.specs li:last-child { border-bottom: none; }
.specs li::before { content: "—"; color: var(--muted); }

.product-desc { color: var(--muted); font-size: 15px; line-height: 1.6; }

.stock { font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 7px; }
.stock.in { color: #1a9d4b; }
.stock.out { color: var(--muted); }
.stock .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: currentColor;
  animation: pulse 2.4s var(--ease) infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .45; transform: scale(.8); }
}

.credit { margin-top: 26px; font-size: 11px; color: var(--muted); }

/* ── Корзина ───────────────────────────────────────────────── */
.view-title {
  font-size: clamp(28px, 9vw, 36px);
  font-weight: 700;
  letter-spacing: -.03em;
  margin: 34px 0 22px;
  animation: fade-up .5s var(--ease) both;
}

.cart-items { display: flex; flex-direction: column; gap: 10px; }

.cart-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--surface);
  animation: fade-up .45s var(--ease) both;
}
.cart-emoji { width: 46px; height: 46px; display: grid; place-items: center; font-size: 26px; flex: 0 0 auto; }
.cart-emoji img { width: 100%; height: 100%; object-fit: contain; }
.cart-info { flex: 1; min-width: 0; }
.cart-name { font-size: 15px; font-weight: 600; letter-spacing: -.01em; }
.cart-meta { font-size: 12px; color: var(--muted); margin-top: 3px; }

.qty { display: flex; align-items: center; gap: 2px; }
.qty button {
  width: 30px; height: 30px;
  border: none; border-radius: 9px;
  background: var(--bg); color: var(--text);
  font-size: 18px; line-height: 1;
  cursor: pointer; font-family: inherit;
  transition: transform .15s var(--ease);
}
.qty button:active { transform: scale(.88); }
.qty span { min-width: 22px; text-align: center; font-size: 15px; font-weight: 600; }

.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 26px 0 6px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.02em;
}

.empty { text-align: center; color: var(--muted); padding: 56px 0; }

/* ── Форма ─────────────────────────────────────────────────── */
.form { display: flex; flex-direction: column; gap: 16px; margin-top: 30px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field-label { font-size: 12px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.optional { font-weight: 400; text-transform: none; letter-spacing: 0; }

input, textarea {
  width: 100%;
  padding: 14px 15px;
  border: 1.5px solid transparent;
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  resize: vertical;
  transition: border-color .2s var(--ease), background .2s var(--ease);
}
input:focus, textarea:focus { outline: none; border-color: var(--accent); background: var(--bg); }
input::placeholder, textarea::placeholder { color: var(--muted); }

.form-error {
  margin: 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 59, 48, .12);
  color: #ff3b30;
  font-size: 14px;
  animation: shake .4s var(--ease);
}
@keyframes shake {
  10%, 90% { transform: translateX(-2px); }
  30%, 70% { transform: translateX(4px); }
  50% { transform: translateX(-4px); }
}

.form-note { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.5; }

/* ── Успех ─────────────────────────────────────────────────── */
.done { text-align: center; padding: 84px 0; }

.done-mark { width: 76px; height: 76px; margin-bottom: 26px; }
.done-circle {
  fill: none; stroke: var(--accent); stroke-width: 2.5;
  stroke-dasharray: 152; stroke-dashoffset: 152;
  animation: draw .6s var(--ease) forwards;
}
.done-check {
  fill: none; stroke: var(--accent); stroke-width: 3.5;
  stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 40; stroke-dashoffset: 40;
  animation: draw .4s var(--ease) .5s forwards;
}
@keyframes draw { to { stroke-dashoffset: 0; } }

.done h2 { margin: 0 0 10px; font-size: 26px; font-weight: 700; letter-spacing: -.02em; }
.done p { color: var(--muted); margin: 0 0 32px; }

.primary-btn {
  padding: 15px 32px;
  border: none; border-radius: 999px;
  background: var(--accent); color: var(--accent-text);
  font: inherit; font-weight: 600; font-size: 16px;
  cursor: pointer;
  transition: transform .15s var(--ease);
}
.primary-btn:active { transform: scale(.96); }

.ghost-btn {
  margin-top: 16px;
  padding: 13px 26px;
  border: 1.5px solid var(--line); border-radius: 999px;
  background: transparent; color: var(--text);
  font: inherit; font-weight: 600;
  cursor: pointer;
  transition: border-color .2s var(--ease), transform .15s var(--ease);
}
.ghost-btn:active { transform: scale(.96); }

/* ── Подвал ────────────────────────────────────────────────── */
.page-footer {
  margin-top: 56px;
  padding: 38px 24px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  text-align: center;
}
.page-footer h3 { margin: 0 0 8px; font-size: 21px; font-weight: 700; letter-spacing: -.02em; }
.page-footer p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.5; }

@media (min-width: 620px) {
  body { max-width: 760px; margin: 0 auto; }
  .grid { grid-template-columns: repeat(3, 1fr); }
  .product-visual { height: 340px; }
}

/* ── Группировка моделей ───────────────────────────────────── */
.card-options {
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
}
.card-price .from {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}
.product-range {
  font-size: 13px;
  color: var(--muted);
}
.hint {
  margin-top: 22px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--surface);
  font-size: 13px;
  line-height: 1.5;
  color: var(--muted);
}
.options { margin-bottom: 4px; }

/* ── Допы к заказу ─────────────────────────────────────────── */
.addons { margin-top: 30px; }
.addons-title { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: -.02em; }
.addons-sub { margin: 4px 0 14px; font-size: 13px; color: var(--muted); }

.addons-row {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  margin: 0 -20px;
  padding: 2px 20px 6px;
  scrollbar-width: none;
}
.addons-row::-webkit-scrollbar { display: none; }

.addon {
  flex: 0 0 132px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  border: none;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: transform .18s var(--ease), background .25s var(--ease);
}
.addon:active { transform: scale(.95); }
.addon.added {
  background: var(--accent);
  color: var(--accent-text);
  animation: pop .26s var(--ease);
}
@keyframes pop {
  50% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

.addon-visual { height: 46px; display: grid; place-items: center; font-size: 26px; }
.addon-visual img { width: 100%; height: 100%; object-fit: contain; }
.addon-title {
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
}
.addon-price { font-size: 13px; font-weight: 700; }

/* ── Кружки цветов ─────────────────────────────────────────── */
.options-color .option {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding-left: 11px;
}

.dot-color {
  width: 18px; height: 18px;
  border-radius: 50%;
  flex: 0 0 auto;
  /* Тонкая рамка, чтобы белый кружок был виден на светлом фоне */
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .18), 0 1px 2px rgba(0, 0, 0, .14);
  transition: transform .2s var(--ease);
}
.options-color .option.active .dot-color { transform: scale(1.15); }

@media (prefers-color-scheme: dark) {
  .dot-color { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22); }
}
.empty .retry { margin-top: 14px; }

/* ── Галерея товара ────────────────────────────────────────── */
.product-visual.gallery { position: relative; display: block; padding: 0; }
.gallery-track {
  display: flex; height: 100%;
  overflow-x: auto; scroll-snap-type: x mandatory;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-slide { flex: 0 0 100%; height: 100%; scroll-snap-align: start; display: grid; place-items: center; }
.gallery-slide img { width: 100%; height: 100%; object-fit: contain; padding: 20px; }
.gallery-dots {
  position: absolute; left: 0; right: 0; bottom: 12px;
  display: flex; justify-content: center; gap: 6px; pointer-events: none;
}
.gallery-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--muted); opacity: .35; transition: opacity .2s, transform .2s;
}
.gallery-dot.active { opacity: 1; transform: scale(1.25); }

/* ── Скидки ────────────────────────────────────────────────── */
.badge.sale { background: #e0362c; color: #fff; }
.badge.sale.inline { position: static; margin-left: 4px; }
.old-price { color: var(--muted); font-weight: 500; font-size: 13px; margin-left: 4px; }
.old-price.big { font-size: 18px; }

/* ── Избранное ─────────────────────────────────────────────── */
.heart {
  position: absolute; top: 8px; right: 8px; z-index: 2;
  width: 34px; height: 34px; border: none; border-radius: 50%;
  background: color-mix(in srgb, var(--bg) 70%, transparent);
  display: grid; place-items: center; cursor: pointer; padding: 0;
  transition: transform .15s var(--ease);
}
.heart svg { width: 18px; height: 18px; fill: none; stroke: var(--muted); stroke-width: 2; transition: fill .2s, stroke .2s; }
.heart.on svg { fill: #e0362c; stroke: #e0362c; }
.heart:active { transform: scale(.85); }
.heart-inline { position: static; flex: 0 0 auto; background: var(--surface); }
.product-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.product-head .product-title { flex: 1; }

/* ── Фильтры и шторка ──────────────────────────────────────── */
.chip-filter { border: 1.5px dashed var(--line); background: transparent; }
.chip-filter.active { border-style: solid; }
.sheet-overlay {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(0,0,0,.45); opacity: 0; pointer-events: none;
  transition: opacity .25s var(--ease);
}
.sheet-overlay.open { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41;
  max-height: 82vh; overflow-y: auto;
  padding: 16px 20px calc(24px + env(safe-area-inset-bottom));
  border-radius: 28px 28px 0 0;
  background: var(--bg);
  transform: translateY(100%);
  transition: transform .3s var(--ease);
}
.sheet.open { transform: none; }
.no-scroll { overflow: hidden; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.sheet-head h3 { margin: 0; font-size: 20px; letter-spacing: -.02em; }
.sheet-close {
  width: 34px; height: 34px; border: none; border-radius: 50%;
  background: var(--surface); color: var(--text); font: inherit; cursor: pointer;
}
.sheet-text { color: var(--muted); font-size: 14px; margin: 6px 0 14px; line-height: 1.4; }
.sheet-actions { display: flex; gap: 10px; margin-top: 22px; }
.sheet-actions .primary-btn { flex: 1; }
.sheet-actions .ghost-btn { margin-top: 0; }
.switch-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 0; font-weight: 500; border-bottom: 1px solid var(--line);
}
.switch-row input { width: 22px; height: 22px; accent-color: var(--accent); }

/* ── Купить в 1 клик, подписка ─────────────────────────────── */
.quick-row { display: flex; flex-direction: column; gap: 10px; margin: 18px 0 6px; }
.quick-buy { width: 100%; }
.alert-btn { margin-top: 0; width: 100%; font-size: 14px; }
.alert-btn:disabled { opacity: .55; }
.toast {
  position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 50;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  max-width: calc(100% - 40px); padding: 12px 18px; border-radius: 14px;
  background: var(--text); color: var(--bg); font-size: 14px; font-weight: 500; text-align: center;
  transition: opacity .25s var(--ease), transform .25s var(--ease);
}
.toast.shown { opacity: 1; transform: translate(-50%, 0); }

/* ── Сравнение конфигураций ────────────────────────────────── */
.compare { display: flex; flex-direction: column; gap: 6px; }
.compare-row {
  display: grid; grid-template-columns: auto 1fr auto; gap: 4px 12px; align-items: center;
  padding: 11px 14px; border: 1.5px solid var(--line); border-radius: 14px;
  background: transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.compare-row.active { border-color: var(--accent); }
.compare-name { grid-column: 1 / 3; grid-row: 1; font-weight: 600; font-size: 14px; }
.compare-note { grid-column: 1 / 3; grid-row: 2; font-size: 12px; color: var(--muted); line-height: 1.35; }
.compare-price { grid-column: 3; grid-row: 1 / 3; font-weight: 700; font-size: 14px; white-space: nowrap; }

/* ── Похожие и «с этим берут» ──────────────────────────────── */
.related-row {
  display: flex; gap: 10px; overflow-x: auto; margin: 0 -20px; padding: 2px 20px 6px;
  scrollbar-width: none;
}
.related-row::-webkit-scrollbar { display: none; }
.related-card {
  flex: 0 0 128px; display: flex; flex-direction: column; gap: 6px;
  padding: 12px; border: none; border-radius: var(--radius);
  background: var(--surface); color: var(--text); text-align: left; font: inherit; cursor: pointer;
  transition: transform .18s var(--ease);
}
.related-card:active { transform: scale(.95); }
.related-visual { height: 76px; display: grid; place-items: center; font-size: 34px; }
.related-visual img { width: 100%; height: 100%; object-fit: contain; }
.related-title { font-size: 12px; font-weight: 600; line-height: 1.25; }
.related-price { font-size: 12px; font-weight: 700; color: var(--muted); }

/* ── Плашка под фото в тёмной теме ──────────────────────────────
   Фотографии магазинов сняты на белом фоне. При вырезании фона белые
   части самого товара (корпус зарядки, кабель AirPods) тоже становятся
   прозрачными — на чёрном это выглядит как дыры. Светлая подложка
   возвращает им вид, заодно товар на ней читается лучше. */
@media (prefers-color-scheme: dark) {
  .card-visual, .product-visual, .addon-visual, .related-visual {
    background: #f2f2f5;
    border-radius: 16px;
  }
  .cart-emoji { background: #f2f2f5; border-radius: 10px; }
  .gallery-slide { background: #f2f2f5; }
  .product-visual { border-radius: 28px; }
  /* Эмодзи-заглушка на светлой плашке должна оставаться различимой */
  .card-visual:not(:has(img)), .product-visual:not(:has(img)),
  .addon-visual:not(:has(img)), .cart-emoji:not(:has(img)),
  .related-visual:not(:has(img)) {
    background: var(--surface-2);
  }
}

/* Конфигурация в карточке допа: без неё «Зарядка Deppa» за 1900 и 2300
   выглядят одинаково, и клиент не понимает, за что переплачивает. */
.addon-variant {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.2;
}
.addon-title { min-height: auto; }
.addon { min-height: 150px; }
