/* ==========================================================================
   Dota 2 Store — собственные стили магазина
   Тёмная тема Steam, обычные пропорции интерфейса: шапка 64px, сетка карточек,
   контрольные отступы 8px, радиусы 10px, кнопки 40px.
   ========================================================================== */

:root {
  --bg: #16202b;
  --bg-soft: #1b2836;
  --surface: #1e2d3d;
  --surface-2: #24384b;
  --line: rgba(255, 255, 255, .09);
  --line-strong: rgba(255, 255, 255, .16);
  --ink: #e6eef6;
  --muted: #9db0c2;
  --accent: #66c0f4;
  --accent-ink: #10202e;
  --green: #a8d14a;
  --red: #e2705a;

  --radius: 10px;
  --radius-sm: 7px;
  --gap: 16px;
  --section: 64px;

  --font: "Figtree", -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Sora", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-mono: "Martian Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --rar-common: #9fb0bd;
  --rar-uncommon: #5aa64b;
  --rar-rare: #4a90d9;
  --rar-mythic: #9a5ad0;
  --rar-immortal: #e0a13a;
  --rar-legendary: #d2452f;
  --rar-arcana: #e0b53c;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: -.02em; margin: 0; line-height: 1.2; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }

.container { width: min(100% - 48px, 1280px); margin-inline: auto; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

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

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 18px; border-radius: var(--radius-sm);
  border: 1px solid transparent; background: var(--surface-2); color: var(--ink);
  font-size: 15px; font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background .15s ease, border-color .15s ease, transform .12s ease, color .15s ease;
}
.btn:hover { background: #2c455c; }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--primary:hover { background: #86cbf7; }
.btn--ghost { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); background: transparent; }
.btn--sm { height: 32px; padding: 0 12px; font-size: 13px; font-weight: 500; }
.btn--block { width: 100%; }

/* ---------- Шапка ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(22, 32, 43, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 28px; height: 64px; }
.logo {
  display: inline-flex; align-items: center; gap: 9px;
  font-family: var(--font-display); font-weight: 700; font-size: 17px; letter-spacing: -.02em;
  flex: none;
}
.logo__mark {
  width: 26px; height: 26px; border-radius: 6px; flex: none;
  background: linear-gradient(135deg, #2b4a66, #16202b);
  border: 1px solid var(--line-strong);
  position: relative;
}
.logo__mark::after {
  content: ""; position: absolute; inset: 8px;
  background: var(--accent); border-radius: 2px;
}
.logo span { color: var(--muted); font-weight: 400; }
.header-nav { display: flex; align-items: center; gap: 22px; margin-right: auto; }
.header-nav a { font-size: 15px; color: var(--muted); transition: color .15s ease; }
.header-nav a:hover { color: var(--ink); }
.header-actions { display: flex; align-items: center; gap: 14px; flex: none; }
.lang {
  height: 32px; padding: 0 10px; border-radius: var(--radius-sm);
  background: transparent; border: 1px solid var(--line-strong);
  color: var(--muted); font-size: 13px; font-weight: 600; letter-spacing: .04em; cursor: pointer;
  transition: color .15s ease, border-color .15s ease;
}
.lang:hover { color: var(--ink); border-color: var(--accent); }
.cart-link {
  display: inline-flex; align-items: center; gap: 8px; font-size: 15px;
  padding: 7px 14px; border-radius: var(--radius-sm); border: 1px solid var(--line-strong);
  transition: border-color .15s ease, background .15s ease;
}
.cart-link:hover { border-color: var(--accent); background: rgba(102, 192, 244, .08); }
.cart-count {
  min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
  background: var(--accent); color: var(--accent-ink);
  font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
}

/* ---------- Секции ---------- */
.section { padding: var(--section) 0; }
.section--alt { background: var(--bg-soft); border-block: 1px solid var(--line); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.section-head h2 { font-size: 26px; }
.section-head p { color: var(--muted); font-size: 15px; max-width: 620px; }
.eyebrow {
  display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 12px;
}

/* ---------- Первый экран ---------- */
.hero { border-bottom: 1px solid var(--line); background: var(--bg-soft); }
.hero-inner {
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 48px; align-items: center; padding: 56px 0;
}
.hero h1 { font-size: 42px; line-height: 1.12; margin-bottom: 14px; }
.hero .lead { font-size: 18px; color: var(--muted); max-width: 460px; margin-bottom: 24px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 32px; }
.hero-facts { display: flex; gap: 32px; flex-wrap: wrap; }
.hero-facts li { display: flex; flex-direction: column; gap: 2px; }
.hero-facts b { font-size: 22px; font-family: var(--font-display); }
.hero-facts span { font-size: 13px; color: var(--muted); }
.hero-art {
  border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line);
  aspect-ratio: 16 / 9; background: #0e151d;
}
.hero-art img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- Хит продаж ---------- */
.cards--feature .card { border-color: rgba(102, 192, 244, .26); }
.cards--feature .card:hover { border-color: var(--accent); }

/* ---------- Панель фильтров ---------- */
.toolbar { margin-bottom: 24px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.chip {
  height: 32px; padding: 0 13px; border-radius: 16px;
  background: transparent; border: 1px solid var(--line-strong); color: var(--muted);
  font-size: 13px; cursor: pointer; transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.chip:hover { color: var(--ink); border-color: var(--accent); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.chip span { opacity: .65; margin-left: 6px; font-family: var(--font-mono); font-size: 11px; }
.toolbar-controls { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.field input, .field select {
  height: 38px; padding: 0 12px; border-radius: var(--radius-sm);
  background: var(--surface); border: 1px solid var(--line-strong); color: var(--ink);
  font-size: 14px; min-width: 190px;
}
.field input::placeholder { color: #7e91a4; }
.field select { cursor: pointer; }
.field--check { flex-direction: row; align-items: center; gap: 8px; padding-bottom: 9px; }
.field--check input { width: 16px; height: 16px; min-width: 0; accent-color: var(--accent); }
.field--check > span { text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--ink); }
.toolbar-controls .btn { margin-left: auto; }

/* ---------- Карточки ---------- */
.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); }
.cards--6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.cards--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card {
  display: flex; flex-direction: column; gap: 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.card:hover { transform: translateY(-3px); border-color: var(--line-strong); box-shadow: 0 12px 26px rgba(0, 0, 0, .3); }
.card__art {
  position: relative; display: block; aspect-ratio: 1; overflow: hidden;
  border-radius: var(--radius-sm);
  background: radial-gradient(120% 100% at 50% 0%, rgba(102, 192, 244, .12), transparent 60%), #131c26;
}
.card__art img { width: 100%; height: 100%; object-fit: contain; padding: 12%; transition: transform .25s ease; }
.card:hover .card__art img { transform: scale(1.04); }
.card__off {
  position: absolute; top: 8px; left: 8px; padding: 3px 8px; border-radius: 5px;
  background: var(--red); color: #fff; font-size: 12px; font-weight: 700;
}
.card__rar { position: absolute; top: 10px; right: 10px; width: 10px; height: 10px; border-radius: 50%; box-shadow: 0 0 0 2px rgba(0, 0, 0, .5); }
.rar-common { background: var(--rar-common); }
.rar-uncommon { background: var(--rar-uncommon); }
.rar-rare { background: var(--rar-rare); }
.rar-mythic { background: var(--rar-mythic); }
.rar-immortal { background: var(--rar-immortal); }
.rar-legendary { background: var(--rar-legendary); }
.rar-arcana { background: var(--rar-arcana); }
.card__name { font-size: 14px; font-weight: 600; line-height: 1.35; display: block; }
a.card__name:hover { color: var(--accent); }
.card__meta { font-size: 12px; color: var(--muted); }
.card__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; flex-wrap: nowrap; }
.price { display: flex; align-items: baseline; gap: 7px; flex: none; white-space: nowrap; }
.price s { color: var(--muted); font-size: 12px; }
.price b { font-size: 15px; font-weight: 700; }
.card__foot .btn { height: 34px; padding: 0 13px; font-size: 13px; flex: none; }

.empty { text-align: center; padding: 56px 0; color: var(--muted); }
.empty .btn { margin-top: 16px; }
.pager { display: flex; gap: 6px; justify-content: center; margin-top: 32px; flex-wrap: wrap; }
.pager button {
  min-width: 38px; height: 38px; border-radius: var(--radius-sm);
  background: transparent; border: 1px solid var(--line-strong); color: var(--ink); cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.pager button:hover { border-color: var(--accent); }
.pager button[aria-current="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.pager__gap { align-self: center; color: var(--muted); padding: 0 4px; }

/* ---------- Подарки ---------- */
.gifts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gap); }
.gift {
  display: flex; flex-direction: column; gap: 10px; text-align: left;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px;
}
.gift__sum { font-size: 30px; font-family: var(--font-display); font-weight: 700; }
.gift p.small { color: var(--muted); }
.gift .btn { margin-top: auto; }

/* ---------- Страница предмета ---------- */
.product { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 40px; align-items: start; }
.product__art {
  aspect-ratio: 1; border-radius: var(--radius); overflow: hidden;
  background: radial-gradient(120% 100% at 50% 0%, rgba(102, 192, 244, .16), transparent 62%), #131c26;
  display: grid; place-items: center; padding: 32px;
}
.product__art img { width: 100%; height: 100%; object-fit: contain; }
.product h1 { font-size: 32px; margin: 6px 0 14px; }
.product .lead { color: var(--muted); font-size: 16px; max-width: 560px; margin-bottom: 22px; }
.tags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 22px; }
.tag {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; color: var(--muted);
  border: 1px solid var(--line-strong); border-radius: 14px; padding: 4px 12px;
}
.tag i { width: 9px; height: 9px; border-radius: 50%; display: block; }
.product__price { display: flex; align-items: baseline; gap: 12px; margin-bottom: 22px; }
.product__price b { font-size: 34px; font-family: var(--font-display); }
.product__price s { color: var(--muted); font-size: 16px; }
.product__actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------- Корзина ---------- */
.cart { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 32px; align-items: start; }
.cart-list { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.cart-row { display: flex; gap: 16px; align-items: center; padding: 16px; border-bottom: 1px solid var(--line); }
.cart-row:last-child { border-bottom: 0; }
.cart-row__art { width: 80px; height: 80px; flex: none; border-radius: var(--radius-sm); background: #131c26; padding: 6px; }
.cart-row__art img { width: 100%; height: 100%; object-fit: contain; }
.cart-row__info { flex: 1; min-width: 0; }
.cart-row__name { font-size: 15px; font-weight: 600; display: block; }
.cart-row__name:hover { color: var(--accent); }
.cart-row__meta { font-size: 13px; color: var(--muted); margin-top: 3px; }
.cart-row__right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.cart-row__sum { font-size: 15px; font-weight: 700; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); overflow: hidden; }
.qty button { width: 28px; height: 28px; border: 0; background: transparent; color: var(--ink); cursor: pointer; font-size: 15px; line-height: 1; }
.qty button:hover { background: var(--surface-2); }
.qty span { min-width: 30px; text-align: center; font-size: 13px; }
.summary { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; position: sticky; top: 88px; }
.summary h3 { font-size: 18px; margin-bottom: 16px; }
.summary__row { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; font-size: 14px; color: var(--muted); }
.summary__row b { color: var(--ink); }
.summary__total { display: flex; justify-content: space-between; align-items: baseline; border-top: 1px solid var(--line); margin-top: 12px; padding-top: 14px; }
.summary__total b { font-size: 24px; font-family: var(--font-display); }
.promo { display: flex; gap: 8px; margin: 20px 0 6px; }
.promo input { flex: 1; height: 38px; padding: 0 12px; border-radius: var(--radius-sm); background: var(--bg); border: 1px solid var(--line-strong); font-size: 14px; }
.promo .btn { height: 38px; }
.msg { font-size: 13px; min-height: 18px; margin: 0 0 10px; }
.msg--ok { color: var(--green); }
.msg--err { color: var(--red); }
.pay { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; }
.pay label { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); font-size: 14px; cursor: pointer; }
.pay label:has(input:checked) { border-color: var(--accent); background: rgba(102, 192, 244, .08); }
.pay input { accent-color: var(--accent); }

/* ---------- Шторка корзины ---------- */
.drawer { position: fixed; inset: 0; z-index: 90; }
.drawer__mask { position: absolute; inset: 0; background: rgba(6, 10, 15, .65); opacity: 0; transition: opacity .2s ease; }
.drawer.is-open .drawer__mask { opacity: 1; }
.drawer__panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: 400px; max-width: 92vw;
  display: flex; flex-direction: column; background: var(--bg-soft);
  border-left: 1px solid var(--line); box-shadow: -16px 0 48px rgba(0, 0, 0, .45);
  transform: translateX(100%); transition: transform .22s ease;
}
.drawer.is-open .drawer__panel { transform: none; }
.drawer__head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.drawer__head h2 { font-size: 18px; }
.drawer__body { flex: 1; overflow: auto; padding: 8px 20px; }
.drawer__foot { padding: 16px 20px 20px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; }
.drawer__total { display: flex; justify-content: space-between; align-items: baseline; }
.drawer__total span { color: var(--muted); }
.drawer__total b { font-size: 22px; font-family: var(--font-display); }
.icon-btn { background: transparent; border: 0; color: var(--muted); font-size: 16px; cursor: pointer; padding: 6px 9px; border-radius: var(--radius-sm); }
.icon-btn:hover { color: var(--ink); background: var(--surface); }
.drawer__line { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.drawer__line:last-child { border-bottom: 0; }
.drawer__art { width: 64px; height: 64px; flex: none; border-radius: var(--radius-sm); background: #131c26; padding: 5px; }
.drawer__art img { width: 100%; height: 100%; object-fit: contain; }
.drawer__info { flex: 1; min-width: 0; }
.drawer__name { font-size: 14px; font-weight: 600; line-height: 1.35; display: block; }
.drawer__meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.drawer__right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.drawer__sum { font-size: 14px; font-weight: 600; }
.drawer__note { font-size: 13px; color: var(--green); padding: 12px 0; }
.drawer__empty { text-align: center; color: var(--muted); padding: 48px 0; }

/* ---------- Модальное окно ---------- */
.modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; }
.modal__mask { position: absolute; inset: 0; background: rgba(6, 10, 15, .72); }
.modal__box {
  position: relative; width: min(520px, 100%); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 26px;
  display: flex; flex-direction: column; gap: 14px; box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
}
.modal__box h2 { font-size: 22px; }
.modal__box .summary { position: static; padding: 0; background: transparent; border: 0; }

/* ---------- Уведомление ---------- */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 120;
  background: var(--surface-2); border: 1px solid var(--line-strong); color: var(--ink);
  padding: 11px 18px; border-radius: var(--radius-sm); font-size: 14px; box-shadow: 0 12px 30px rgba(0, 0, 0, .4);
}

/* ---------- Подвал ---------- */
.site-footer { border-top: 1px solid var(--line); background: var(--bg-soft); padding: 48px 0 28px; margin-top: 24px; }
.footer-grid { display: grid; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); gap: 32px; margin-bottom: 32px; }
.footer-grid p { color: var(--muted); font-size: 14px; max-width: 380px; margin-top: 10px; }
.footer-col h3 { font-size: 14px; margin-bottom: 12px; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { font-size: 14px; color: var(--muted); }
.footer-col a:hover { color: var(--ink); }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  border-top: 1px solid var(--line); padding-top: 20px; font-size: 13px; color: var(--muted);
}
.footer-bottom summary { cursor: pointer; color: var(--muted); }
.footer-bottom summary:hover { color: var(--ink); }
.footer-bottom details p { max-width: 620px; margin-top: 8px; font-size: 13px; }

/* ---------- Адаптив ---------- */
@media (max-width: 1100px) {
  .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cards--6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cards--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .gifts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-inner { grid-template-columns: 1fr; gap: 32px; }
  .hero-art { order: -1; aspect-ratio: 16 / 9; }
  .cart { grid-template-columns: minmax(0, 1fr); }
  .summary { position: static; }
  .product { grid-template-columns: minmax(0, 340px) minmax(0, 1fr); }
}
@media (max-width: 860px) {
  .header-nav { display: none; }
  .product { grid-template-columns: minmax(0, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .container { width: min(100% - 32px, 1280px); }
  /* в две колонки цена и кнопка не помещаются в строку — кнопка под ценой */
  .card__foot { flex-direction: column; align-items: stretch; gap: 8px; }
  .card__foot .btn { width: 100%; }
  .cards--6, .cards--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  :root { --section: 44px; }
  .header-inner { height: 56px; gap: 12px; }
  .header-actions { margin-left: auto; }
  .cart-link span:not(.cart-count) { display: none; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gifts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-inner { padding: 36px 0; }
  .hero h1 { font-size: 30px; }
  .hero .lead { font-size: 16px; }
  .section-head h2 { font-size: 22px; }
  .field input, .field select { min-width: 0; width: 100%; }
  .toolbar-controls { display: grid; grid-template-columns: 1fr 1fr; }
  .toolbar-controls .field:first-child { grid-column: 1 / -1; }
  .toolbar-controls .btn { margin-left: 0; width: 100%; }
  .cart-row { flex-wrap: wrap; }
  .footer-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 360px) {
  .cards, .cards--6, .cards--3, .gifts { grid-template-columns: minmax(0, 1fr); }
}
