/*
  Витрина и админка. Направление дизайна:
  - продукт: магазин игровой валюты, наборов и подписок, оплата переводом, выдача в Telegram;
  - характер: быстрый, прямой, чуть игровой;
  - мир: ночная игровая витрина — глубокий фиолетовый, яркими остаются только картинки товаров;
  - сигнатура: «чек» — номер заказа моноширинным шрифтом и надрез с полукруглыми вырезами.
*/

/* Шрифты лежат на нашем сервере: никаких запросов к сторонним сайтам. Лицензия OFL — в /fonts. */
@font-face {
  font-family: "Onest"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(/fonts/onest-cyrillic-wght-normal.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Onest"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(/fonts/onest-latin-wght-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Onest"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(/fonts/onest-latin-ext-wght-normal.woff2) format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "JetBrains Mono"; font-style: normal; font-display: swap; font-weight: 500;
  src: url(/fonts/jetbrains-mono-latin-500-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+2000-206F, U+2116;
}
@font-face {
  font-family: "JetBrains Mono"; font-style: normal; font-display: swap; font-weight: 500;
  src: url(/fonts/jetbrains-mono-cyrillic-500-normal.woff2) format("woff2");
  unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1;
}

:root {
  /* Нейтральная шкала с фиолетовым оттенком */
  --bg: #1a0d35;          /* страница */
  --bg-2: #1e103d;        /* панели: корзина, окна */
  --surface: #241544;     /* карточки */
  --raised: #2c1b51;      /* поля, подложки картинок */
  --raised-2: #36235f;    /* наведение, всплывашки */
  --line: rgba(240, 232, 255, .09);
  --line-strong: rgba(240, 232, 255, .18);
  --text: #f3effb;
  --text-2: #bdb3d4;
  --muted: #9a90b6;
  /* Один акцент: главная кнопка, выбор, счётчик корзины */
  --accent: #9d1fb0;
  --accent-hover: #ae2cc2;
  --accent-ink: #ffffff;
  --accent-text: #dcaaf2;  /* акцент для ссылок и рамок на тёмном */
  --accent-soft: rgba(157, 31, 176, .14);
  --ok: #4cc38a;
  --danger: #f2777b;
  --warn: #e8b05a;

  /* Совместимость с админкой */
  --card: var(--surface);
  --card-2: var(--raised);
  --line-hover: var(--line-strong);
  --accent-2: var(--accent-text);

  --radius-control: 10px;
  --radius-card: 16px;
  --radius-panel: 20px;
  --radius: var(--radius-card);
  --radius-sm: 12px;
  --shadow: 0 16px 48px rgba(0, 0, 0, .4);
  --ease: cubic-bezier(.22, 1, .36, 1);          /* всё, что появляется и откликается */
  --ease-drawer: cubic-bezier(.32, .72, 0, 1);   /* выезжающая панель корзины */
  /* Расстояния движения. При «уменьшить движение» в системе они обнуляются — остаются только плавные проявления. */
  --m-rise: 8px;
  --m-scale: .96;
  --m-scale-out: .98;
  --m-drawer: 100%;
  --font: "Onest", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); scrollbar-gutter: stable; }
html.is-locked { overflow: hidden; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font: 400 15px/22px var(--font);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; }
img { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button, a, label, input, .tab { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
h1, h2 { text-wrap: balance; }
p, h3, .receipt__row span { text-wrap: pretty; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; }
.wrap { width: 100%; max-width: 1248px; margin: 0 auto; padding: 0 24px; }
.muted { color: var(--muted); }
.icon { width: 18px; height: 18px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link {
  position: absolute; left: 16px; top: -48px; z-index: 100; padding: 8px 12px; border-radius: var(--radius-control);
  background: var(--text); color: var(--bg); font-weight: 500; text-decoration: none;
}
.skip-link:focus { top: 8px; }

/* ---------- Шапка ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.topbar__in { display: flex; align-items: center; justify-content: space-between; height: 56px; gap: 12px; }
.logo {
  display: inline-flex; align-items: center; gap: 8px; min-width: 0;
  font-weight: 600; font-size: 17px; line-height: 1; color: var(--text); text-decoration: none;
}
.logo__mark { width: 16px; height: 16px; flex-shrink: 0; fill: var(--accent); }
.logo__text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar__nav { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.cart-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px;
  border-radius: var(--radius-control); border: 1px solid var(--line); background: var(--surface);
  font-weight: 500; transition: background-color .15s var(--ease), border-color .15s var(--ease), transform .12s var(--ease);
}
.cart-btn:active { transform: scale(.97); }
.badge {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent);
  color: var(--accent-ink); font-size: 12px; font-weight: 600; line-height: 20px; text-align: center;
  font-variant-numeric: tabular-nums;
}
.badge.tick { animation: tick .3s var(--ease); }
@keyframes tick { 35% { transform: scale(1.3); } }
.link-btn {
  background: none; border: 0; padding: 8px; color: var(--muted); border-radius: 8px;
  transition: color .15s var(--ease);
}
.link-btn--inline { padding: 0; color: var(--accent-text); text-decoration: underline; text-underline-offset: 2px; text-decoration-color: rgba(220, 170, 242, .4); }

/* ---------- Первый экран ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 48px; align-items: end; padding: 56px 0 40px; }
.hero__kicker { margin: 0 0 12px; color: var(--muted); font-size: 14px; }
.hero__title { margin: 0; font-size: 52px; line-height: 1.06; letter-spacing: -.025em; font-weight: 600; max-width: 720px; }
.hero__sub { margin: 16px 0 0; color: var(--text-2); font-size: 17px; line-height: 26px; max-width: 34rem; white-space: pre-line; }
.steps {
  list-style: none; margin: 0; padding: 8px 20px; border-radius: var(--radius-card);
  background: var(--surface); border: 1px solid var(--line);
}
.steps li { display: grid; grid-template-columns: 32px 1fr; align-items: baseline; padding: 12px 0; color: var(--text-2); }
.steps li + li { border-top: 1px solid var(--line); }
.steps b { font: 500 13px/1 var(--mono); color: var(--muted); }
.steps span { color: var(--text); }

/* ---------- Категории ---------- */
.catalog { scroll-margin-top: 56px; }
.tabs {
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  position: sticky; top: 56px; z-index: 10; padding: 12px 0; margin-bottom: 4px; background: var(--bg);
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex-shrink: 0; height: 36px; padding: 0 16px; border-radius: var(--radius-control); border: 1px solid var(--line);
  background: var(--surface); color: var(--text-2); font-weight: 500;
  transition: background-color .15s var(--ease), color .15s var(--ease), border-color .15s var(--ease);
}
.tab[aria-pressed="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }
.tabs.has-indicator .tab[aria-pressed="true"] { background: var(--surface); color: var(--text-2); border-color: var(--line); }
.tabs__on {
  position: absolute; left: 0; top: 12px; display: flex; gap: 8px; pointer-events: none;
  clip-path: inset(0 100% 0 0 round 10px); transition: clip-path .3s var(--ease);
}
.tabs__on .tab { display: inline-flex; align-items: center; background: var(--text); color: var(--bg); border-color: var(--text); }
.tabs__on.is-instant { transition: none; }

/* ---------- Товары ---------- */
.grid {
  display: grid; gap: 16px; padding-bottom: 64px;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}
/* Первая загрузка: заголовок, потом карточки волной (не больше 6 шагов). Смена категории: быстрое проявление. */
.is-ready .hero__kicker, .is-ready .hero__title { animation: rise .5s var(--ease) both; }
.is-ready .hero__sub { animation: rise .5s var(--ease) 60ms both; }
.is-ready .steps { animation: rise .5s var(--ease) 120ms both; }
.grid.is-entering .card { animation: rise .45s var(--ease) both; animation-delay: calc(140ms + var(--i, 0) * 45ms); }
.grid.is-switching .card { animation: fade-rise .22s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(var(--m-rise)); } }
@keyframes fade-rise { from { opacity: 0; transform: translateY(calc(var(--m-rise) / 2)); } }
@keyframes pop-in { from { opacity: 0; transform: scale(var(--m-scale)); } }
@keyframes swap-in { from { opacity: 0; transform: translateY(calc(var(--m-rise) / 2)); } }
@keyframes roll-up { from { opacity: 0; transform: translateY(calc(var(--m-rise) * .8)); } }
@keyframes roll-down { from { opacity: 0; transform: translateY(calc(var(--m-rise) * -.8)); } }
.pop-in { animation: pop-in .18s var(--ease) both; }
.roll-up { animation: roll-up .18s var(--ease) both; }
.roll-down { animation: roll-down .18s var(--ease) both; }
.is-new { animation: swap-in .24s var(--ease) both; }
.card {
  display: flex; flex-direction: column; min-width: 0; padding: 8px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-card);
  transition: border-color .15s var(--ease);
}
.card__media {
  aspect-ratio: 1; width: 100%; padding: 0; border: 0; border-radius: 8px; overflow: hidden;
  display: grid; place-items: center; background: var(--raised);
  transition: background-color .15s var(--ease), transform .16s var(--ease);
}
.card__media:active { transform: scale(.98); }
.card__media img { width: 100%; height: 100%; object-fit: contain; padding: 16px; }
.card__ph { font-size: 40px; font-weight: 600; color: var(--muted); }
.card__name {
  margin: 12px 4px 4px; font-weight: 500; font-size: 15px; line-height: 20px; min-height: 40px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere;
}
.card__price { margin: 0 4px 12px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.price { font-weight: 600; font-size: 17px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.old-price { color: var(--muted); text-decoration: line-through; font-size: 14px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.card__actions { margin-top: auto; }
.empty { grid-column: 1 / -1; text-align: center; padding: 64px 0; color: var(--muted); }

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 20px;
  border-radius: var(--radius-control); border: 1px solid transparent; font-weight: 500; text-decoration: none;
  white-space: nowrap; user-select: none; -webkit-user-select: none;
  transition: background-color .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease), opacity .15s var(--ease), transform .12s var(--ease);
}
.btn:active:not(:disabled) { transform: scale(.98); }
.btn--primary { background: var(--accent); color: var(--accent-ink); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .14); }
.btn--ghost { background: var(--raised); border-color: var(--line); color: var(--text); }
.btn--add { height: 40px; border-radius: 8px; }
.btn--block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.stepper {
  display: flex; align-items: center; justify-content: space-between; height: 40px; border-radius: 8px;
  background: var(--accent-soft); border: 1px solid rgba(220, 170, 242, .28); overflow: hidden;
}
.stepper button {
  display: grid; place-items: center; width: 40px; height: 100%; padding: 0; border: 0; background: none; color: var(--text);
  transition: background-color .15s var(--ease);
}
.stepper span { display: inline-block; font-weight: 600; font-variant-numeric: tabular-nums; }
.stepper .icon { transition: transform .12s var(--ease); }
.stepper button:active .icon { transform: scale(.8); }
.stepper--sm { height: 32px; background: var(--raised); border-color: var(--line); }
.stepper--sm button { width: 32px; }
.stepper--sm .icon { width: 16px; height: 16px; }

/* ---------- Подвал ---------- */
.footer { border-top: 1px solid var(--line); }
.footer__in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-top: 24px; padding-bottom: 24px; }
.footer__copy { color: var(--text-2); font-size: 14px; }
.footer__seller { color: var(--muted); font-size: 13px; line-height: 20px; white-space: pre-line; }
.footer__links { display: flex; flex-wrap: wrap; gap: 4px; margin: 0 -8px; }
.footer__links .link-btn { font-size: 14px; }

/* ---------- Оверлеи ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 50; background: rgba(8, 4, 16, .72);
  display: flex; justify-content: flex-end; animation: fade .24s var(--ease);
}
.overlay.is-closing { animation: fade-out .26s var(--ease) forwards; pointer-events: none; }
@keyframes fade-out { to { opacity: 0; } }
.overlay--center { justify-content: center; align-items: center; padding: 16px; }
@keyframes fade { from { opacity: 0; } }
.drawer {
  width: min(440px, 100%); height: 100%; display: flex; flex-direction: column;
  background: var(--bg-2); border-left: 1px solid var(--line); box-shadow: var(--shadow);
  animation: drawer-in .44s var(--ease-drawer);
}
@keyframes drawer-in { from { transform: translateX(var(--m-drawer)); } }
.is-closing .drawer { animation: drawer-out .26s var(--ease-drawer) forwards; }
@keyframes drawer-out { to { transform: translateX(var(--m-drawer)); } }
.drawer__head, .modal__head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; padding: 12px 20px;
  border-bottom: 1px solid var(--line);
}
.drawer__head h2, .modal__head h2 { margin: 0; font-size: 18px; line-height: 24px; font-weight: 600; overflow-wrap: anywhere; }
.drawer__body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 8px 20px 32px; }
.icon-btn {
  display: grid; place-items: center; width: 36px; height: 36px; padding: 0; flex-shrink: 0;
  border-radius: var(--radius-control); border: 1px solid var(--line); background: var(--surface); color: var(--text-2);
  transition: background-color .15s var(--ease), color .15s var(--ease), transform .12s var(--ease);
}
.icon-btn:active { transform: scale(.94); }
.modal {
  width: min(560px, 100%); max-height: min(88vh, 900px); max-height: min(88dvh, 900px); display: flex; flex-direction: column;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius-panel); box-shadow: var(--shadow);
  animation: pop .24s var(--ease);
}
@keyframes pop { from { transform: translateY(var(--m-rise)) scale(var(--m-scale)); opacity: 0; } }
.is-closing .modal { animation: pop-out .16s var(--ease) forwards; }
@keyframes pop-out { to { opacity: 0; transform: scale(var(--m-scale-out)); } }
/* Смена содержимого в открытом окне (оплата → заказ оформлен) */
.modal__head h2.is-new { animation: swap-in .26s var(--ease) both; }
.modal__body.is-swapping > * { animation: swap-in .28s var(--ease) both; }
.modal__body.is-swapping > .order-box--done { animation: none; }
.modal__body { overflow-y: auto; overscroll-behavior: contain; padding: 20px 20px 24px; }
.prose { white-space: pre-line; color: var(--text-2); overflow-wrap: anywhere; }
.prose a { color: var(--accent-text); text-underline-offset: 2px; }

/* ---------- Корзина ---------- */
.line {
  display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 12px; align-items: center;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.line__img { width: 48px; height: 48px; border-radius: 8px; background: var(--raised); overflow: hidden; display: grid; place-items: center; }
.line__img img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.line__img .card__ph { font-size: 18px; }
.line__name { font-weight: 500; line-height: 20px; overflow-wrap: anywhere; }
.line__price { color: var(--muted); font-size: 13px; line-height: 20px; font-variant-numeric: tabular-nums; }
.cart-empty { display: grid; justify-items: center; gap: 16px; color: var(--muted); padding: 48px 0; }
.cart-empty p { margin: 0; }
.promo { display: flex; gap: 8px; margin-top: 16px; }
.promo input { flex: 1; min-width: 0; }
.hint { min-height: 20px; margin: 4px 0 0; font-size: 13px; line-height: 20px; color: var(--muted); }
.hint.ok { color: var(--ok); }
.hint.bad { color: var(--danger); }

/* «Чек»: верх и низ разделены надрезом с полукруглыми вырезами по краям */
.receipt { margin: 8px 0 20px; }
.receipt--print { animation: print .62s var(--ease) both; }
@keyframes print {
  from { clip-path: inset(0 0 100% 0); transform: translateY(calc(var(--m-rise) * -1)); }
  to { clip-path: inset(0 0 -1px 0); }
}
.receipt--print ~ .order-cta { animation: rise .36s var(--ease) .4s both; }
.receipt__top, .receipt__bottom { background: var(--surface); padding: 16px; }
.receipt__top {
  border-radius: 12px 12px 0 0;
  -webkit-mask: radial-gradient(circle 8px at 0 100%, transparent 7.5px, #000 8px) left / 51% 100% no-repeat,
                radial-gradient(circle 8px at 100% 100%, transparent 7.5px, #000 8px) right / 51% 100% no-repeat;
          mask: radial-gradient(circle 8px at 0 100%, transparent 7.5px, #000 8px) left / 51% 100% no-repeat,
                radial-gradient(circle 8px at 100% 100%, transparent 7.5px, #000 8px) right / 51% 100% no-repeat;
}
.receipt__bottom {
  border-radius: 0 0 12px 12px; position: relative;
  -webkit-mask: radial-gradient(circle 8px at 0 0, transparent 7.5px, #000 8px) left / 51% 100% no-repeat,
                radial-gradient(circle 8px at 100% 0, transparent 7.5px, #000 8px) right / 51% 100% no-repeat;
          mask: radial-gradient(circle 8px at 0 0, transparent 7.5px, #000 8px) left / 51% 100% no-repeat,
                radial-gradient(circle 8px at 100% 0, transparent 7.5px, #000 8px) right / 51% 100% no-repeat;
}
.receipt__bottom::before {
  content: ""; position: absolute; left: 16px; right: 16px; top: 0; border-top: 1px dashed var(--line-strong);
}
.receipt__top:last-child { border-radius: 12px; -webkit-mask: none; mask: none; }
.receipt__row { display: flex; justify-content: space-between; gap: 12px; color: var(--text-2); padding: 2px 0; font-variant-numeric: tabular-nums; }
.receipt__row span:first-child { min-width: 0; overflow-wrap: anywhere; }
.receipt__row span:last-child { white-space: nowrap; }
.receipt__row--total { color: var(--text); font-size: 18px; line-height: 26px; font-weight: 600; }
.receipt__label { margin: 0; color: var(--muted); font-size: 13px; line-height: 20px; }
.receipt__id { font: 500 22px/30px var(--mono); letter-spacing: .04em; margin: 2px 0 0; overflow-wrap: anywhere; }
.receipt__sum { font-size: 40px; line-height: 44px; font-weight: 600; letter-spacing: -.02em; margin: 4px 0 0; font-variant-numeric: tabular-nums; }
.receipt__meta { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 16px; color: var(--muted); font-size: 13px; }
.receipt__meta b { font: 500 13px/20px var(--mono); color: var(--text-2); letter-spacing: .04em; }
.receipt .prose { color: var(--text); }

/* ---------- Формы ---------- */
input[type=text], input[type=email], input[type=number], input[type=password], input[type=url], textarea, select {
  width: 100%; height: 44px; padding: 0 14px; border-radius: var(--radius-control); border: 1px solid var(--line);
  background: var(--raised); outline: none; transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
textarea { height: auto; min-height: 72px; padding: 10px 14px; resize: vertical; line-height: 22px; }
select { background-color: var(--raised); color: var(--text); }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: none; border-color: var(--accent-text); box-shadow: 0 0 0 3px rgba(220, 170, 242, .16); }
::placeholder { color: var(--muted); opacity: .8; }
.field { display: block; margin-bottom: 16px; }
.field > span { display: block; font-size: 13px; line-height: 20px; color: var(--text-2); margin-bottom: 4px; }
.field .opt { color: var(--muted); }
.choices { border: 0; padding: 0; margin: 0 0 16px; min-width: 0; }
.choices legend { font-size: 13px; line-height: 20px; color: var(--text-2); margin-bottom: 4px; padding: 0; }
.choice {
  display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: var(--radius-control);
  border: 1px solid var(--line); background: var(--surface); margin-bottom: 8px; cursor: pointer;
  transition: border-color .15s var(--ease), background-color .15s var(--ease);
}
.choice:has(input:checked) { border-color: rgba(220, 170, 242, .45); background: var(--accent-soft); }
.choice input { margin: 3px 0 0; accent-color: var(--accent); flex-shrink: 0; }
.choice b { display: block; font-weight: 500; }
.choice small { color: var(--muted); font-size: 13px; }
.pay-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pay-grid .choice { margin: 0; }
.check { display: flex; gap: 12px; align-items: flex-start; font-size: 13px; line-height: 20px; color: var(--text-2); margin: 8px 0 12px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--accent); flex-shrink: 0; }
.checks { display: grid; gap: 8px; margin: 8px 0 12px; }
.checks .check { margin: 0; }
.error { color: var(--danger); min-height: 20px; margin: 0 0 8px; font-size: 14px; line-height: 20px; }

/* ---------- Окно товара и заказа ---------- */
.pview { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 20px; }
.pview__img { aspect-ratio: 1; border-radius: 12px; background: var(--raised); display: grid; place-items: center; overflow: hidden; }
.pview__img img { width: 100%; height: 100%; object-fit: contain; padding: 16px; }
.pview .card__price { margin: 0 0 12px; }
.pview .price { font-size: 24px; line-height: 32px; }
.pview .prose { margin: 0 0 20px; }
.order-box { text-align: left; }
.order-cta { height: 48px; font-size: 16px; }
.pay-hint { text-align: center; margin-top: 8px; }
.status { display: inline-block; padding: 4px 10px; border-radius: 8px; font-weight: 500; font-size: 13px; background: var(--raised); }
.status--cancelled { color: var(--danger); }

.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 80;
  max-width: calc(100% - 32px); padding: 12px 16px; border-radius: 12px;
  background: var(--raised-2); border: 1px solid var(--line-strong); color: var(--text); font-weight: 500;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35); animation: toast-in .24s var(--ease); pointer-events: none;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, var(--m-rise)); } }
.toast.is-leaving { animation: toast-out .18s var(--ease) forwards; }
@keyframes toast-out { to { opacity: 0; transform: translate(-50%, calc(var(--m-rise) / 2)); } }

/* Наведение — только там, где есть мышь: на телефоне состояние не «залипает» после касания */
@media (hover: hover) {
  .cart-btn:hover { background: var(--raised); border-color: var(--line-strong); }
  .link-btn:hover { color: var(--text); }
  .tab:not([aria-pressed="true"]):hover { color: var(--text); background: var(--raised); }
  .card:hover { border-color: var(--line-strong); }
  .card:hover .card__media { background: var(--raised-2); }
  .btn--primary:hover { background: var(--accent-hover); }
  .btn--ghost:hover { border-color: var(--line-strong); background: var(--raised-2); }
  .btn--add:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
  .stepper button:hover { background: rgba(255, 255, 255, .06); }
  .icon-btn:hover { background: var(--raised); color: var(--text); }
  .choice:hover { border-color: var(--line-strong); }
}
@media (pointer: fine) { html { overscroll-behavior: none; } }

@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; gap: 24px; }
  .steps { display: none; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .hero { padding: 32px 0 20px; }
  .hero__title { font-size: 36px; line-height: 1.08; letter-spacing: -.02em; }
  .hero__sub { font-size: 16px; line-height: 24px; margin-top: 12px; }
  .tabs { padding: 8px 0; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .card { border-radius: 14px; padding: 6px; }
  .card__media { border-radius: 8px; }
  .card__media img { padding: 12px; }
  .card__name { font-size: 14px; margin: 8px 4px 4px; }
  .card__price { margin-bottom: 8px; }
  .price { font-size: 16px; }
  .cart-btn { padding: 0 10px; }
  .cart-btn__label { display: none; }
  .pview { grid-template-columns: 1fr; }
  .pview__img { max-width: 220px; }
  .pay-grid { grid-template-columns: 1fr; }
  .drawer { width: 100%; border-left: 0; }
  .drawer__body { padding-bottom: calc(32px + env(safe-area-inset-bottom)); }
  .footer__in { flex-direction: column; align-items: flex-start; }
  .receipt__sum { font-size: 36px; line-height: 40px; }
  /* 16px в полях — иначе iPhone увеличивает страницу при вводе */
  input[type=text], input[type=email], input[type=number], input[type=password], input[type=url], textarea, select { font-size: 16px; }
}

/* «Уменьшить движение»: ничего не ездит и не масштабируется, остаются короткие проявления */
@media (prefers-reduced-motion: reduce) {
  :root { --m-rise: 0px; --m-scale: 1; --m-scale-out: 1; --m-drawer: 0%; }
  .tabs__on { transition: none; }
  .badge.tick { animation: none; }
  .receipt--print { animation-name: fade; }
  .btn:active:not(:disabled), .cart-btn:active, .card__media:active, .icon-btn:active, .stepper button:active .icon { transform: none; }
}
