/* =========================================================================
   GamesPrices — базовые стили
   Палитра: тёмная, игровая, с акцентами для цен/скидок.
   ========================================================================= */

:root {
  --bg: #0F1420;
  --surface: #1A2233;
  --surface-2: #212B40;
  --border: #2B3650;
  --text: #F5F6FA;
  --text-muted: #9AA5B1;
  --accent: #6C5CE7;
  --accent-2: #00D9B5;
  --danger: #FF4757;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  --container: 1200px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4 { margin: 0 0 .5em; font-weight: 700; line-height: 1.25; }
p { margin: 0 0 1em; color: var(--text-muted); }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  border: none;
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn-primary { background: linear-gradient(135deg, var(--accent), #8b7bf0); color: #fff; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(108,92,231,.4); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm { padding: 7px 14px; font-size: 13px; }

/* ---------------------------------------------------------------- Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15, 20, 32, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header__inner {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 14px 20px;
}
.logo { flex-shrink: 0; height: 34px; }
.logo img { height: 100%; width: auto; }

.main-nav { display: flex; gap: 20px; margin-right: auto; }
.main-nav a { color: var(--text-muted); font-weight: 500; font-size: 15px; transition: color .15s; }
.main-nav a:hover, .main-nav a.active { color: var(--text); }

.header-search { position: relative; width: 320px; max-width: 40vw; }
.header-search input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 14px;
}
.header-search input:focus { outline: none; border-color: var(--accent); }
.header-search__icon {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  width: 16px; height: 16px; opacity: .6;
}
.search-suggest {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: var(--shadow); overflow: hidden; display: none; z-index: 60;
}
.search-suggest.is-open { display: block; }
.search-suggest a {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; font-size: 14px;
}
.search-suggest a:hover { background: rgba(255,255,255,.04); }
.search-suggest img { width: 32px; height: 20px; object-fit: cover; border-radius: 4px; }
.search-suggest .price { margin-left: auto; color: var(--accent-2); font-weight: 600; white-space: nowrap; }

.burger { display: none; background: none; border: none; color: var(--text); font-size: 22px; cursor: pointer; }

/* ---------------------------------------------------------------- Hero */
.hero {
  padding: 64px 0 48px;
  background: radial-gradient(ellipse at top, rgba(108,92,231,.18), transparent 60%);
  text-align: center;
}
.hero h1 { font-size: clamp(28px, 4vw, 44px); margin-bottom: 14px; }
.hero h1 span { color: var(--accent-2); }
.hero p.lead { max-width: 620px; margin: 0 auto 28px; font-size: 17px; }
.hero-search { max-width: 560px; margin: 0 auto; position: relative; }
.hero-search input {
  width: 100%; padding: 16px 20px 16px 48px; border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-size: 16px;
}
.hero-search input:focus { outline: none; border-color: var(--accent); }
.hero-search__icon { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; opacity: .6; }

.trust-row { display: flex; justify-content: center; gap: 28px; flex-wrap: wrap; margin-top: 30px; color: var(--text-muted); font-size: 13px; }
.trust-row strong { color: var(--text); display: block; font-size: 20px; }

/* ---------------------------------------------------------------- Sections */
.section { padding: 40px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 20px; gap: 12px; flex-wrap: wrap; }
.section-head h2 { font-size: 24px; }
.section-head a { color: var(--accent-2); font-size: 14px; font-weight: 600; }

/* ---------------------------------------------------------------- Game card */
.game-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.game-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  display: flex; flex-direction: column;
}
.game-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--accent); }
.game-card__cover { position: relative; aspect-ratio: 16/9; overflow: hidden; background: var(--surface-2); }
.game-card__cover img { width: 100%; height: 100%; object-fit: cover; }
.game-card__discount {
  position: absolute; top: 10px; left: 10px; background: var(--danger); color: #fff;
  font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 6px;
}
.game-card__body { padding: 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.game-card__title { font-size: 15px; font-weight: 600; }
.game-card__genres { font-size: 12px; color: var(--text-muted); }
.game-card__footer { margin-top: auto; display: flex; align-items: center; justify-content: space-between; }
.game-card__price { font-size: 17px; font-weight: 700; color: var(--accent-2); }
.game-card__price small { display: block; font-size: 11px; color: var(--text-muted); font-weight: 400; }
.game-card__old-price { text-decoration: line-through; color: var(--text-muted); font-size: 12px; margin-right: 6px; }

/* ---------------------------------------------------------------- How it works */
.steps-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.step-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.step-card__num {
  width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; margin-bottom: 14px;
}
.step-card h3 { font-size: 17px; margin-bottom: 8px; }
.step-card p { font-size: 14px; margin: 0; }

/* ---------------------------------------------------------------- Sales strip */
.sale-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.sale-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; display: flex; flex-direction: column; gap: 8px; transition: border-color .15s, transform .15s;
}
.sale-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.sale-card__title { font-size: 16px; font-weight: 600; }
.sale-card__when { color: var(--accent-2); font-weight: 600; font-size: 14px; }

/* ---------------------------------------------------------------- Genre chips */
.chip-row { display: flex; gap: 10px; flex-wrap: wrap; }
.chip {
  padding: 8px 16px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border);
  font-size: 14px; color: var(--text-muted); transition: all .15s;
}
.chip:hover, .chip.active { border-color: var(--accent); color: var(--text); background: var(--surface-2); }

/* ---------------------------------------------------------------- Catalog layout */
.catalog-layout { display: grid; grid-template-columns: 240px 1fr; gap: 28px; align-items: start; }
.filters { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; position: sticky; top: 90px; }
.filters h3 { font-size: 14px; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); margin-bottom: 12px; }
.filters .filter-group { margin-bottom: 22px; }
.filters label { display: flex; align-items: center; gap: 8px; font-size: 14px; padding: 5px 0; cursor: pointer; }
.filters input[type=number] { width: 100%; padding: 8px 10px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--bg); color: var(--text); }
.sort-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; flex-wrap: wrap; gap: 10px; }
.sort-bar select {
  background: var(--surface); border: 1px solid var(--border); color: var(--text); padding: 8px 12px; border-radius: var(--radius-sm);
}
.result-count { color: var(--text-muted); font-size: 14px; }

.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 32px; }
.pagination a, .pagination span {
  min-width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); border: 1px solid var(--border); font-size: 14px;
}
.pagination a:hover { border-color: var(--accent); }
.pagination .current { background: var(--accent); border-color: var(--accent); }

/* ---------------------------------------------------------------- Game page */
.game-hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 36px; padding: 40px 0; align-items: start; }
.game-hero__cover { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); }
.game-hero__meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.badge { padding: 4px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: 12px; color: var(--text-muted); }

.best-price-card {
  background: linear-gradient(135deg, rgba(108,92,231,.15), rgba(0,217,181,.1));
  border: 1px solid var(--accent); border-radius: var(--radius); padding: 22px; margin-top: 18px;
}
.best-price-card .label { font-size: 13px; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }
.best-price-card .price { font-size: 36px; font-weight: 800; color: var(--accent-2); margin: 6px 0; }
.best-price-card .store { font-size: 14px; color: var(--text-muted); }

.price-table { width: 100%; border-collapse: collapse; margin-top: 20px; }
.price-table th { text-align: left; font-size: 12px; text-transform: uppercase; color: var(--text-muted); padding: 8px 12px; border-bottom: 1px solid var(--border); }
.price-table td { padding: 14px 12px; border-bottom: 1px solid var(--border); font-size: 15px; }
.price-table tr:hover td { background: rgba(255,255,255,.02); }
.store-badge { display: inline-flex; align-items: center; gap: 10px; font-weight: 600; }
.store-badge__dot { width: 28px; height: 28px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; color: #0F1420; }
.price-cell { font-weight: 700; color: var(--accent-2); }
.price-cell .old { color: var(--text-muted); text-decoration: line-through; font-weight: 400; margin-right: 8px; font-size: 13px; }
.discount-tag { background: var(--danger); color: #fff; font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 6px; margin-left: 8px; }
.stale-note { color: var(--text-muted); font-size: 13px; font-style: italic; }

.game-description { margin-top: 30px; line-height: 1.7; }
.game-description h2 { font-size: 20px; margin-top: 30px; }

.price-chart-wrap { margin-top: 30px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.price-chart-wrap h3 { font-size: 16px; margin-bottom: 14px; }

/* ---------------------------------------------------------------- Footer */
.site-footer { border-top: 1px solid var(--border); padding: 40px 0 24px; margin-top: 60px; color: var(--text-muted); font-size: 14px; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 24px; margin-bottom: 24px; }
.footer-grid h4 { color: var(--text); font-size: 14px; margin-bottom: 12px; }
.footer-grid a { display: block; padding: 4px 0; transition: color .15s; }
.footer-grid a:hover { color: var(--text); }
.footer-bottom { border-top: 1px solid var(--border); padding-top: 18px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; }

.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }

/* ---------------------------------------------------------------- Responsive */
@media (max-width: 900px) {
  .catalog-layout { grid-template-columns: 1fr; }
  .filters { position: static; }
  .game-hero { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .steps-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .main-nav, .header-search { display: none; }
  .burger { display: block; margin-left: auto; }
  .footer-grid { grid-template-columns: 1fr; }
  .price-table { display: block; overflow-x: auto; white-space: nowrap; }
}
