/* ============================================================
   МОМЕНТ v6 — «Ledger» (serious dark)
   Тёмный профессиональный маркетплейс цифровых товаров.
   Дизайн-система: ui-ux-pro-max — пара «Financial Trust»
   (IBM Plex Sans, банковское/fintech настроение) + тёмная
   slate-палитра. Один сдержанный акцент — трастовый синий.
   Никаких 3D-кнопок, блобов, неона и дисплейных шрифтов.
   ============================================================ */

:root {
  --bg: #0E131B;              /* глубокий графитово-синий */
  --surface: #151C27;         /* карточка */
  --surface-2: #1B2432;       /* утопленные поля, шапки таблиц */
  --glass: rgba(14, 19, 27, .82);
  --line: #232E3F;
  --line-strong: #33415A;
  --text: #E7EDF5;
  --text-2: #8FA0B6;

  --primary: #3E7BFA;         /* трастовый синий: CTA, ссылки, фокус */
  --primary-hover: #5B90FF;
  --primary-active: #2F63D6;
  --primary-dim: rgba(62, 123, 250, .14);

  --cta: var(--primary);      /* одна акцентная роль — серьёзный тон */
  --cta-hover: var(--primary-hover);
  --cta-active: var(--primary-active);
  --cta-edge: transparent;

  --ok: #3DD68C;              /* моментальная выдача, успех */
  --ok-dim: rgba(61, 214, 140, .12);
  --amber: #E5A13D;           /* ожидание, мало на складе */
  --amber-dim: rgba(229, 161, 61, .12);
  --error: #E5484D;
  --error-dim: rgba(229, 72, 77, .12);
  --sale: #E5484D;            /* скидка */
  --sale-dim: rgba(229, 72, 77, .12);

  --shadow-1: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .22);
  --shadow-2: 0 2px 6px rgba(0, 0, 0, .35), 0 20px 48px rgba(0, 0, 0, .35);
  --glow-cta: none;

  --font-display: 'IBM Plex Sans', system-ui, sans-serif;
  --font-body: 'IBM Plex Sans', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --r-card: 12px;
  --r-ctl: 8px;
  --r-badge: 6px;
  --container: 1200px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* фон: едва заметная вертикальная виньетка сверху, без сеток и блобов */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background: linear-gradient(180deg, rgba(62, 123, 250, .05), transparent 520px);
}
body::after { content: none; }

img { max-width: 100%; display: block; }
svg { flex: none; }
a { color: var(--primary-hover); text-decoration: none; transition: color .18s var(--ease-out); }
a:hover { color: #85AEFF; }
a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, summary:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }

h1, h2 { font-family: var(--font-display); font-weight: 600; letter-spacing: -.02em; color: var(--text); }
h1 { font-size: 40px; line-height: 1.18; }
h2 { font-size: 26px; line-height: 1.3; }
h3 { font-size: 17px; line-height: 1.4; font-weight: 600; letter-spacing: -.01em; }
.muted { color: var(--text-2); }
.small { font-size: 13px; line-height: 1.5; }

section { padding: 88px 0 0; }
section.tight { padding-top: 44px; }

/* разделитель секций: тонкая линия */
main > section + section { position: relative; margin-top: 88px; padding-top: 88px; }
main > section + section::before {
  content: ""; position: absolute; top: 0; left: 24px; right: 24px; height: 1px;
  background: var(--line);
}

/* ---------- служебные строки: серия · номер · статус ---------- */
.status {
  font: 400 12px/1.5 var(--font-mono);
  color: var(--text-2);
  text-transform: uppercase; letter-spacing: .07em;
}
.status.ok { color: var(--ok); }
.status.warn { color: var(--amber); }
.status.err { color: var(--error); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ---------- чип «моментально» ---------- */
.stamp {
  display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px;
  border-radius: var(--r-badge);
  color: var(--ok); background: var(--ok-dim);
  border: 1px solid rgba(61, 214, 140, .3);
  font: 600 11px/1 var(--font-body); text-transform: uppercase; letter-spacing: .08em;
}

/* ============ HEADER ============ */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--glass);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--line);
}
.site-header .container {
  display: flex; align-items: center; gap: 20px;
  height: 64px;
}
.logo {
  display: inline-flex; align-items: center; gap: 7px;
  font: 700 19px/1 var(--font-display); letter-spacing: -.01em;
  color: var(--text); white-space: nowrap;
}
.logo:hover { color: var(--text); }
.logo .bolt { display: inline-flex; color: var(--primary); }
.logo .bolt svg { width: 17px; height: 17px; }
.nav-catalog {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 16px; border: 1px solid var(--line-strong); border-radius: var(--r-ctl);
  color: var(--text); font-weight: 500; font-size: 15px;
  background: var(--surface);
  transition: border-color .18s var(--ease-out), background .18s var(--ease-out);
  cursor: pointer;
}
.nav-catalog svg { width: 16px; height: 16px; color: var(--primary-hover); }
.nav-catalog:hover { border-color: var(--primary); color: var(--text); background: var(--surface-2); }
.nav-catalog:active { background: var(--bg); }
.header-search { flex: 1; display: flex; min-width: 0; }
.header-search input { min-width: 0; border-radius: var(--r-ctl) 0 0 var(--r-ctl); border-right: 0; }
.header-search button {
  border-radius: 0 var(--r-ctl) var(--r-ctl) 0;
  padding: 0 18px; border: 1px solid var(--primary); background: var(--primary); color: #fff;
  font: 500 15px var(--font-body); cursor: pointer;
  transition: background .18s var(--ease-out);
}
.header-search button:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.header-links { display: flex; gap: 20px; align-items: center; }
.header-links a { color: var(--text-2); font-size: 15px; font-weight: 500; white-space: nowrap; }
.header-links a:hover { color: var(--text); }

/* ============ FOOTER ============ */
.site-footer {
  margin-top: 96px; border-top: 1px solid var(--line);
  background: #0A0F16;
  color: var(--text-2);
  padding: 48px 0 32px;
  font-size: 14px;
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; }
.site-footer h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: #5D6D84; margin-bottom: 14px; font-weight: 600; }
.site-footer ul { list-style: none; }
.site-footer li { margin-bottom: 8px; }
.site-footer a { color: var(--text-2); }
.site-footer a:hover { color: var(--text); }
.site-footer .logo, .site-footer .logo:hover { color: var(--text); }
.site-footer .muted { color: #5D6D84; }
.footer-bottom {
  margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  color: #5D6D84; font-size: 13px;
}
.site-footer .status.ok { color: var(--ok); }

/* ============ КНОПКИ: плоские, спокойные ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 46px; padding: 0 22px; border-radius: var(--r-ctl);
  font: 600 15px/1 var(--font-body); cursor: pointer;
  border: 1px solid transparent;
  transition: background .18s var(--ease-out), border-color .18s var(--ease-out),
              color .18s var(--ease-out);
  text-align: center;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); color: #fff; }
.btn-primary:active { background: var(--primary-active); }
.btn-secondary {
  background: transparent; color: var(--text); border-color: var(--line-strong);
}
.btn-secondary:hover { border-color: var(--primary); color: var(--text); background: var(--primary-dim); }
.btn-secondary:active { background: var(--surface-2); }
.btn-danger { background: transparent; color: var(--error); border-color: rgba(229, 72, 77, .45); }
.btn-danger:hover { background: var(--error-dim); }
.btn-danger:active { background: rgba(229, 72, 77, .2); }
.btn:disabled, .btn.is-disabled { opacity: .45; cursor: not-allowed; pointer-events: none; }
.btn.is-loading { pointer-events: none; opacity: .8; }
.btn.is-loading::before {
  content: ""; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.btn-block { width: 100%; }
.btn-sm { height: 38px; padding: 0 16px; font-size: 14px; }

/* ============ ФОРМЫ ============ */
label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 6px; }
.hint { font-size: 13px; color: var(--text-2); margin-top: 6px; }
input[type="text"], input[type="email"], input[type="number"], input[type="password"],
input[type="search"], select, textarea {
  width: 100%; height: 46px; padding: 0 14px;
  background: var(--surface-2); color: var(--text);
  border: 1px solid var(--line-strong); border-radius: var(--r-ctl);
  font: 400 16px var(--font-body);
  transition: border-color .18s var(--ease-out), box-shadow .18s var(--ease-out);
}
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%); background-position: calc(100% - 18px) 55%, calc(100% - 13px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; background-color: var(--surface-2); }
textarea { height: auto; padding: 12px 14px; min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-dim);
}
input::placeholder, textarea::placeholder { color: #5D6D84; }
.field { margin-bottom: 20px; }
.field.has-error input { border-color: var(--error); box-shadow: 0 0 0 3px var(--error-dim); }
.field-error { color: var(--error); font-size: 13px; margin-top: 6px; }
.checkbox { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; font-weight: 400; cursor: pointer; }
.checkbox input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--primary); flex: none; }

/* инлайн-иконки в тексте и пунктах меню */
.pay-method > svg, .note-box svg, .account-nav svg {
  width: 16px; height: 16px; display: inline-block;
  vertical-align: -3px; color: var(--text-2); margin-right: 2px;
}
.pay-method > svg { color: var(--primary-hover); }

/* ============ БЕЙДЖИ ============ */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 9px; border-radius: var(--r-badge);
  font: 500 12px/1.5 var(--font-body); white-space: nowrap;
}
.badge-instant {
  background: var(--ok-dim); color: var(--ok);
  border: 1px solid rgba(61, 214, 140, .3);
  text-transform: uppercase; letter-spacing: .06em; font-size: 10.5px; font-weight: 600;
}
.badge-stock { background: var(--ok-dim); color: var(--ok); }
.badge-out { background: var(--surface-2); color: var(--text-2); }
.badge-sale { background: var(--sale-dim); color: #FF7A7E; font-weight: 600; }
.badge-new { background: var(--primary-dim); color: var(--primary-hover); }
.badge-guarantee { background: transparent; color: var(--text-2); border: 1px solid var(--line-strong); }

/* ============ КАРТОЧКА ТОВАРА ============
   Тёмная панель: тонкая рамка, сдержанный hover без прыжков */
.ticket {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card); overflow: hidden;
  transition: border-color .2s var(--ease-out), background .2s var(--ease-out);
}
.ticket:hover {
  border-color: var(--line-strong); background: #17202D;
}
.ticket-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px 0;
  font: 400 11px var(--font-mono); color: #5D6D84;
  text-transform: uppercase; letter-spacing: .08em;
}
.ticket-media {
  border-radius: 8px; border: 1px solid var(--line);
  background:
    radial-gradient(70% 80% at 50% 30%, rgba(62, 123, 250, .14), transparent 75%),
    var(--surface-2);
  display: flex; align-items: center; justify-content: center;
  color: var(--primary-hover);
}
/* полноширинное фото в карточке товара (как у ggsel) */
.ticket > .ticket-media {
  order: -1; margin: 0; width: 100%; aspect-ratio: 16 / 10; height: auto;
  border-radius: 0; border: none; border-bottom: 1px solid var(--line);
}
.ticket-media svg { width: 40px; height: 40px; }
.ticket > .ticket-media svg { width: 56px; height: 56px; }
.ticket-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ticket-body { padding: 12px 16px; flex: 1; }
.ticket-title {
  font: 600 15px/1.35 var(--font-body); color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 40px;
}
.ticket-title a { color: inherit; }
.ticket-title a:hover { color: var(--primary-hover); }
.ticket-attr { font-size: 13px; color: var(--text-2); margin-top: 4px; }
.ticket-badges { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 10px; }
.ticket-rating { font-size: 13px; color: var(--text-2); margin-top: 9px; }
.ticket-rating .star { color: var(--amber); }
.ticket-stub {
  border-top: 1px solid var(--line);
  padding: 12px 16px 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap;
  background: var(--surface-2);
}
.price { font: 600 18px/1.2 var(--font-display); font-variant-numeric: tabular-nums; color: var(--text); }
.price-old {
  font: 400 13px var(--font-mono); color: var(--text-2);
  text-decoration: line-through; margin-right: 6px;
}
.price-sale-pct { color: #FF7A7E; font: 600 13px var(--font-mono); }
.ticket.is-sale { border-color: rgba(229, 72, 77, .35); }
.ticket.is-sale .ticket-head { color: #FF7A7E; }
.ticket.is-out { opacity: .55; filter: grayscale(.5); }
.ticket.is-out:hover { border-color: var(--line); background: var(--surface); }

/* skeleton-состояние */
.ticket.is-skeleton * { visibility: hidden; }
.ticket.is-skeleton::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 30%, rgba(143, 160, 182, .08) 50%, transparent 70%);
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* сетки товаров */
.grid-products { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-top: 28px; }
.grid-products.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 28px; }

/* ============ КАТЕГОРИИ ============ */
.cat-card {
  display: flex; flex-direction: column; gap: 10px;
  padding: 18px; background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-card); color: var(--text);
  transition: border-color .2s var(--ease-out), background .2s var(--ease-out);
}
.cat-card:hover {
  border-color: var(--primary); color: var(--text); background: #17202D;
}
.cat-code {
  align-self: flex-start;
  font: 400 11px var(--font-mono); color: var(--primary-hover);
  background: var(--primary-dim);
  border: 1px solid rgba(62, 123, 250, .3); border-radius: var(--r-badge); padding: 2px 7px;
  letter-spacing: .1em;
}
.cat-card b { font-size: 16px; font-weight: 600; }
.cat-card span { font-size: 13px; color: var(--text-2); }

/* ============ HERO: спокойный, типографический ============ */
.hero {
  position: relative; overflow: hidden;
  padding: 80px 0;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(760px 440px at 78% 0%, rgba(62, 123, 250, .1), transparent 62%),
    var(--bg);
}
.hero::before { content: none; }
.hero-grid { display: grid; grid-template-columns: 7fr 5fr; gap: 48px; align-items: center; position: relative; }
.hero .eyebrow {
  font: 400 12px var(--font-mono); color: var(--primary-hover);
  text-transform: uppercase; letter-spacing: .14em; display: block; margin-bottom: 16px;
}
.hero p.sub { color: var(--text-2); font-size: 18px; margin: 18px 0 28px; max-width: 560px; }
.hero-search { display: flex; margin-bottom: 20px; max-width: 560px; }
.hero-search input { height: 54px; font-size: 16px; border-radius: var(--r-ctl) 0 0 var(--r-ctl); border-right: 0; min-width: 0; background: var(--surface); }
.hero-search button {
  border: 1px solid var(--primary); background: var(--primary); color: #fff; padding: 0 24px;
  border-radius: 0 var(--r-ctl) var(--r-ctl) 0; font: 600 16px var(--font-body); cursor: pointer;
  transition: background .18s var(--ease-out);
}
.hero-search button:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; }

/* ============ ВИТРИННАЯ КАРТА в hero: строгий тёмный сертификат ============ */
.hero-ticket { perspective: none; }
.paycard {
  position: relative; overflow: hidden;
  background: linear-gradient(165deg, #1B2534, #121926 70%);
  color: var(--text);
  border: 1px solid var(--line-strong); border-radius: 14px;
  box-shadow: var(--shadow-2);
  padding: 26px 26px 22px;
  transform: none;
  transition: border-color .25s var(--ease-out);
}
.hero-ticket:hover .paycard { border-color: rgba(62, 123, 250, .5); }
.paycard-guilloche { /* холодный блик в углу */
  position: absolute; right: -70px; top: -70px; width: 220px; height: 220px;
  border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle at center, rgba(62, 123, 250, .16), transparent 62%);
  filter: blur(8px);
}
.paycard-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.paycard-brand { font: 700 15px var(--font-display); letter-spacing: -.01em; color: var(--text); }
.paycard-nominal { font: 600 24px var(--font-display); font-variant-numeric: tabular-nums; color: var(--text); white-space: nowrap; }
.paycard-name { font: 400 14px/1.4 var(--font-body); color: var(--text-2); margin: 8px 0 18px; }
.paycard-bottom { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 18px; flex-wrap: wrap; }
.paycard-bottom .mono { font-size: 11px; color: #5D6D84; letter-spacing: .08em; }
.hero-card-hint { font: 400 12px var(--font-mono); color: var(--text-2); text-align: center; margin-top: 18px; letter-spacing: .06em; }

/* код под матовым стеклом: blur снимается при наведении */
.scratch {
  position: relative; border-radius: var(--r-ctl); overflow: hidden;
  border: 1px solid var(--line-strong);
  padding: 16px 12px; text-align: center; background: #0C111A;
}
.scratch-code { font: 600 17px/1 var(--font-mono); letter-spacing: .1em; color: var(--ok); }
.scratch-cover {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(27, 36, 50, .55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text-2); font: 600 10.5px var(--font-body);
  text-transform: uppercase; letter-spacing: .14em;
  transition: opacity .4s var(--ease-out);
}
.paycard:hover .scratch-cover, .scratch:hover .scratch-cover,
.paycard:active .scratch-cover, .scratch:active .scratch-cover { opacity: 0; }

/* ============ ШАГИ / ГАРАНТИИ / ОТЗЫВЫ ============ */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 28px; }
.step {
  padding: 22px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-card);
}
.step .num { font: 400 12px var(--font-mono); color: var(--primary-hover); letter-spacing: .12em; }
.step h3 { margin: 10px 0 6px; }
.step p { color: var(--text-2); font-size: 14px; }

.trust { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 28px; }
.trust-item {
  padding: 18px; border: 1px solid var(--line); border-radius: var(--r-card);
  background: var(--surface); font-size: 14px;
}
.trust-item b { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 15px; font-weight: 600; }
.trust-item b svg { width: 17px; height: 17px; color: var(--ok); }
.trust-item span { color: var(--text-2); }

.reviews { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 28px; }
.review-card {
  padding: 20px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-card);
  font-size: 14px;
}
.review-meta { display: flex; justify-content: space-between; color: var(--text-2); font-size: 13px; margin-bottom: 10px; }
.review-card .stars { color: var(--amber); margin-bottom: 8px; letter-spacing: 2px; }

/* ============ FAQ ============ */
.faq { max-width: 760px; margin-top: 24px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer; padding: 18px 0; font-weight: 600; font-size: 16px;
  list-style: none; display: flex; justify-content: space-between; gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--primary-hover); font: 400 20px var(--font-mono); }
.faq details[open] summary::after { content: "−"; color: var(--text-2); }
.faq details p { padding: 0 0 18px; color: var(--text-2); font-size: 15px; max-width: 640px; }

/* ============ SEO-текст ============ */
.seo-text { max-width: 800px; color: var(--text-2); font-size: 15px; }
.seo-text h2 { color: var(--text); margin-bottom: 12px; }
.seo-text p { margin-bottom: 12px; }
.seo-text a { color: var(--primary-hover); text-decoration: underline; text-underline-offset: 3px; }
.seo-text a:hover { color: #85AEFF; }

/* ============ ХЛЕБНЫЕ КРОШКИ ============ */
.breadcrumbs { padding: 20px 0 0; font-size: 13px; color: var(--text-2); }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.breadcrumbs li + li::before { content: "/"; margin-right: 6px; color: #40506A; }
.breadcrumbs a { color: var(--text-2); }
.breadcrumbs a:hover { color: var(--text); }

/* ============ КАТАЛОГ ============ */
.catalog-layout { display: grid; grid-template-columns: 260px 1fr; gap: 32px; margin-top: 28px; }
.filters { position: sticky; top: 84px; align-self: start; }
.filter-group { border: 1px solid var(--line); border-radius: var(--r-card); background: var(--surface); padding: 16px; margin-bottom: 14px; }
.filter-group h3 { font-size: 12px; margin-bottom: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--text-2); }
.filter-group .checkbox { margin-bottom: 10px; }
.filter-group ul { list-style: none; font-size: 14px; }
.filter-group li { margin-bottom: 8px; }
.filter-group li a { color: var(--text-2); }
.filter-group li a.active, .filter-group li a:hover { color: var(--text); }
.filter-group li a.active { font-weight: 600; color: var(--primary-hover); }
.price-range { display: flex; gap: 8px; }
.price-range input { height: 40px; font-size: 14px; }
.catalog-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.catalog-toolbar select { width: auto; height: 40px; font-size: 14px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; padding: 5px 10px; border-radius: var(--r-badge);
  background: var(--surface-2); border: 1px solid var(--line-strong); color: var(--text);
}
.chip button { background: none; border: 0; color: var(--text-2); cursor: pointer; font-size: 14px; line-height: 1; }
.chip button:hover { color: var(--error); }
.mobile-filters-btn { display: none; }

.pagination { display: flex; gap: 8px; margin-top: 36px; list-style: none; flex-wrap: wrap; }
.pagination a, .pagination span {
  display: inline-flex; min-width: 40px; height: 40px; align-items: center; justify-content: center;
  border: 1px solid var(--line-strong); border-radius: var(--r-ctl); color: var(--text-2);
  font: 400 14px var(--font-mono); padding: 0 10px; background: var(--surface);
}
.pagination .current { background: var(--primary); color: #fff; border-color: var(--primary); }
.pagination a:hover { border-color: var(--primary); color: var(--text); }

/* пустой результат */
.empty-state {
  text-align: center; padding: 72px 24px; border: 1px dashed var(--line-strong);
  border-radius: var(--r-card); margin-top: 28px; background: var(--surface);
}
.empty-state p { color: var(--text-2); margin: 8px 0 20px; }

/* ============ СТРАНИЦА ТОВАРА ============ */
.product-layout { display: grid; grid-template-columns: 1fr 380px; gap: 40px; margin-top: 24px; }
.product-media {
  height: 320px; border-radius: var(--r-card);
  background:
    radial-gradient(380px 240px at 50% 28%, rgba(62, 123, 250, .12), transparent 72%),
    var(--surface-2);
  border: 1px solid var(--line); display: flex; align-items: center; justify-content: center;
  color: var(--primary-hover); margin-bottom: 32px;
}
.product-media svg { width: 96px; height: 96px; }
.product-section { margin-bottom: 36px; }
.product-section h2 { font-size: 20px; margin-bottom: 12px; }
.product-section p, .product-section li { color: var(--text-2); font-size: 15px; }
.product-section ul { padding-left: 20px; }
.product-section li { margin-bottom: 6px; }

.buy-panel {
  position: sticky; top: 84px; align-self: start;
  background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--r-card);
  box-shadow: var(--shadow-1);
  padding: 24px;
}
.buy-panel .status { margin-bottom: 14px; }
.buy-price { font: 600 32px/1.1 var(--font-display); font-variant-numeric: tabular-nums; color: var(--text); margin: 6px 0 14px; letter-spacing: -.02em; }
.buy-price .price-old { font-size: 16px; font-weight: 400; }
.buy-panel .ticket-badges { margin: 0 0 18px; }
.buy-note { font-size: 13px; color: var(--text-2); margin-top: 12px; }
.buy-help { display: block; text-align: center; margin-top: 14px; font-size: 14px; color: var(--primary-hover); }
.buy-help:hover { color: #85AEFF; }

.sticky-buy { display: none; }

/* ============ CHECKOUT ============ */
.checkout-layout { display: grid; grid-template-columns: 1fr 420px; gap: 40px; margin-top: 24px; }
.order-ticket {
  background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-card);
  padding: 20px 20px 0; position: relative; overflow: hidden;
}
.order-row { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; font-size: 15px; }
.order-row.total {
  border-top: 1px solid var(--line-strong); margin-top: 8px; padding: 16px 0 20px;
  font: 600 20px var(--font-display); font-variant-numeric: tabular-nums; color: var(--text);
}
.pay-methods { display: grid; gap: 10px; }
.pay-method {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--line-strong); border-radius: var(--r-ctl); padding: 14px;
  cursor: pointer; background: var(--surface); font-weight: 600; font-size: 15px;
  transition: border-color .18s var(--ease-out), background .18s var(--ease-out);
}
.pay-method:hover { border-color: var(--primary); }
.pay-method input { width: 18px; height: 18px; accent-color: var(--primary); }
.pay-method span { font-weight: 400; color: var(--text-2); font-size: 13px; }
.pay-method:has(input:checked) {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
  background: var(--primary-dim);
}
details.promo { margin-bottom: 20px; }
details.promo summary { cursor: pointer; color: var(--primary-hover); font-size: 14px; list-style: none; }
details.promo summary:hover { color: #85AEFF; }
details.promo summary::-webkit-details-marker { display: none; }
details.promo .field { margin-top: 12px; }

/* ============ SUCCESS / ERROR ============ */
.result-box { max-width: 640px; margin: 48px auto 0; }
.result-status {
  display: flex; align-items: center; gap: 14px;
  padding: 20px; border-radius: var(--r-card); margin-bottom: 24px;
  font-weight: 600; font-size: 18px;
}
.result-status .mono { font-size: 12px; font-weight: 400; display: block; margin-top: 2px; }
.result-status.ok { background: var(--ok-dim); border: 1px solid rgba(61, 214, 140, .35); color: var(--ok); }
.result-status.err { background: var(--error-dim); border: 1px solid rgba(229, 72, 77, .4); color: #FF7A7E; }
.result-status.warn { background: var(--amber-dim); border: 1px solid rgba(229, 161, 61, .4); color: var(--amber); }
.result-icon {
  width: 44px; height: 44px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center; font-size: 22px;
  background: rgba(255, 255, 255, .06);
}
.result-icon svg { width: 22px; height: 22px; }
.goods-data {
  background: var(--surface);
  border: 1px solid var(--line-strong); border-radius: var(--r-card);
  box-shadow: var(--shadow-1);
  padding: 20px; margin-bottom: 20px;
}
/* выданный код */
.goods-secret {
  position: relative;
  font: 600 15px/1.7 var(--font-mono); letter-spacing: .06em; color: var(--ok);
  background: #0C111A;
  border: 1px solid rgba(61, 214, 140, .3); border-radius: var(--r-ctl);
  padding: 26px 14px 14px; margin: 14px 0; word-break: break-all;
}
.goods-secret::before {
  content: "код открыт · доступ выдан"; position: absolute; top: 8px; left: 14px;
  font: 600 9.5px var(--font-body); color: #5D6D84;
  text-transform: uppercase; letter-spacing: .14em;
}
.goods-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.note-box {
  border: 1px solid var(--line); border-left: 3px solid var(--amber);
  border-radius: var(--r-ctl); padding: 14px 16px; font-size: 14px; color: var(--text-2);
  margin-bottom: 20px; background: var(--surface);
}

/* ============ ЛИЧНЫЙ КАБИНЕТ ============ */
.account-layout { display: grid; grid-template-columns: 240px 1fr; gap: 32px; margin-top: 28px; }
.account-nav { list-style: none; position: sticky; top: 84px; align-self: start; }
.account-nav a {
  display: block; padding: 11px 14px; border-radius: var(--r-ctl);
  color: var(--text-2); font-weight: 500; font-size: 15px;
}
.account-nav a.active { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: inset 2px 0 0 var(--primary); }
.account-nav a:hover { color: var(--text); }
.order-list { display: grid; gap: 12px; margin-top: 20px; }
.order-item {
  display: grid; grid-template-columns: 1fr auto auto; gap: 8px 20px; align-items: center;
  background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-card);
  padding: 16px 20px;
}
.order-item .title { font-weight: 600; }
.order-item .sum { font: 600 16px var(--font-mono); font-variant-numeric: tabular-nums; }
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.tab {
  padding: 8px 14px; border-radius: var(--r-ctl); font-size: 14px;
  border: 1px solid var(--line-strong); color: var(--text-2);
  background: transparent; cursor: pointer;
  transition: background .18s var(--ease-out), color .18s var(--ease-out), border-color .18s var(--ease-out);
}
.tab:hover { color: var(--text); border-color: var(--primary); }
.tab.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }

/* ============ АДМИНКА ============ */
.admin-body { font-size: 14px; }
.admin-body::before, .admin-body::after { display: none; } /* без фоновых слоёв в панели */
.admin-layout { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.admin-menu {
  background: #0A0F16; border-right: 1px solid var(--line); padding: 20px 12px;
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
}
.admin-menu .logo { display: flex; padding: 0 10px 20px; font-size: 16px; }
.admin-menu a {
  display: block; padding: 9px 12px; border-radius: var(--r-ctl);
  color: var(--text-2); font-size: 14px; margin-bottom: 2px;
}
.admin-menu a.active { background: var(--primary-dim); color: var(--text); font-weight: 600; box-shadow: inset 2px 0 0 var(--primary); }
.admin-menu a:hover { color: var(--text); }
.admin-main { padding: 28px 32px; min-width: 0; }
.admin-main h1 { font-size: 24px; margin-bottom: 24px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(155px, 1fr)); gap: 14px; margin-bottom: 28px; }
.kpi {
  background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-card);
  padding: 16px; min-width: 0;
}
.kpi .val { font: 600 22px var(--font-display); font-variant-numeric: tabular-nums; color: var(--text); margin-top: 6px; white-space: nowrap; letter-spacing: -.01em; }
.kpi .lbl { color: var(--text-2); font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
.kpi.alert { border-color: rgba(229, 72, 77, .5); }
.kpi.alert .val { color: #FF7A7E; }
.kpi.warn { border-color: rgba(229, 161, 61, .5); }
.kpi.warn .val { color: var(--amber); }

.admin-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); padding: 20px; margin-bottom: 24px; overflow-x: auto; }
.admin-panel h2 { font-size: 15px; margin-bottom: 16px; }
.admin-table { width: 100%; min-width: 640px; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; }
.admin-table th, .admin-table td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); }
.admin-table th { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-2); background: var(--surface-2); }
.admin-table tr:hover td { background: var(--surface-2); }
.admin-table .mono { font-size: 13px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; }
.dot.ok { background: var(--ok); }
.dot.warn { background: var(--amber); }
.dot.err { background: var(--error); }
.dot.off { background: var(--line-strong); }

.chart { display: flex; align-items: flex-end; gap: 6px; height: 140px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); }
.chart .bar { flex: 1; background: #2A3A54; border-radius: 3px 3px 0 0; position: relative; }
.chart .bar.today { background: var(--primary); }
.admin-toolbar { display: flex; gap: 12px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; }
.admin-toolbar input, .admin-toolbar select { width: auto; height: 40px; font-size: 14px; }

/* ============ АДАПТИВ ============ */
@media (max-width: 1024px) {
  h1 { font-size: 32px; }
  section { padding-top: 64px; }
  main > section + section { margin-top: 64px; padding-top: 64px; }
  .grid-products, .grid-products.grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-cats { grid-template-columns: repeat(3, 1fr); }
  .trust { grid-template-columns: repeat(2, 1fr); }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-ticket { display: none; }
  .catalog-layout, .product-layout, .checkout-layout, .account-layout { grid-template-columns: 1fr; }
  .filters { display: none; position: static; }
  .filters.is-open {
    display: block; position: fixed; inset: auto 0 0 0; z-index: 100;
    background: var(--surface); border-radius: 16px 16px 0 0;
    max-height: 80vh; overflow-y: auto; padding: 20px;
    box-shadow: 0 -20px 60px rgba(0, 0, 0, .5);
  }
  .mobile-filters-btn { display: inline-flex; }
  .buy-panel { position: static; }
  .account-nav { position: static; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

/* хедер: поиск переезжает на вторую строку раньше, чем ломается */
@media (max-width: 900px) {
  .site-header .container { flex-wrap: wrap; height: auto; padding-top: 12px; padding-bottom: 12px; row-gap: 10px; }
  .header-search { order: 3; flex-basis: 100%; }
  .header-links { margin-left: auto; }
}

@media (max-width: 640px) {
  h1 { font-size: 26px; }
  h2 { font-size: 20px; }
  section { padding-top: 48px; }
  main > section + section { margin-top: 48px; padding-top: 48px; }
  .container { padding: 0 16px; }
  .site-header { position: static; }
  .site-header .container { gap: 12px; }
  .header-links { gap: 12px; font-size: 14px; }
  .nav-catalog { padding: 8px 12px; font-size: 14px; }
  .hero { padding-top: 40px; padding-bottom: 40px; }
  .hero p.sub { font-size: 16px; }
  .grid-products, .grid-products.grid-3 { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .ticket > .ticket-media svg { width: 40px; height: 40px; }
  .ticket-title { font-size: 14px; }
  .grid-cats { grid-template-columns: repeat(2, 1fr); }
  .steps, .trust, .reviews { grid-template-columns: 1fr; }
  .btn { height: 50px; }
  .btn-sm { height: 40px; }
  .footer-grid { grid-template-columns: 1fr; }
  .filters, .account-nav, .buy-panel { top: 0; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-menu { position: static; height: auto; display: flex; gap: 4px; overflow-x: auto; padding: 10px; }
  .admin-menu .logo { padding: 6px 10px; }
  .admin-menu a { white-space: nowrap; }
  .admin-main { padding: 20px 16px; }
  .order-item { grid-template-columns: 1fr; }
  .sticky-buy {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    padding: 12px 16px; background: var(--glass); border-top: 1px solid var(--line-strong);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
  }
  .sticky-buy .btn { flex: 1; }
}
