:root {
  /* DODASKY-matched identity: dark header/hero + light body pages. */
  --bg: #f4f7f5;
  --bg-alt: #e7f3ec;
  --card: #ffffff;
  --card-hover: #f5f2ff;
  --border: #e2e8e4;
  --text: #101a15;
  --text-dim: #5b6b62;
  --accent: #0a6b46;
  --accent-2: #084f34;
  --accent-bright: #22c55e;
  --gold: #d4af37;
  --good: #0a6b46;
  --sky: #0ea5e9;
  --sky-dark: #0284c7;
  --warn: #b8932c;
  --danger: #c0392b;
  /* Dark zone (header + hero) tokens. */
  --dark: #0a1410;
  --dark2: #0e1f17;
  --dark-text: #f2f7f4;
  --dark-muted: #9fb8ac;
  --radius: 16px;
  --shadow: 0 10px 28px rgba(10, 20, 16, 0.12);
  font-size: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Cairo", "Segoe UI", "Tahoma", system-ui, -apple-system, sans-serif;
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ---------- Header ---------- */
header.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(12px);
  background: rgba(10,20,16,0.85);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  gap: 16px;
  /* Keep the header layout fixed (logo left, language switch right) in
     both languages instead of flipping with the page's RTL/LTR direction. */
  direction: ltr;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: 0.5px;
}

.logo .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 14px var(--accent);
}

.logo span.doda { color: var(--gold); }
.logo span.game { color: #ffffff; }

nav.main-nav {
  display: flex;
  gap: 22px;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--dark-muted);
}

nav.main-nav a:hover { color: var(--dark-text); }

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.lang-toggle {
  display: flex;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 999px;
  overflow: hidden;
}

.lang-toggle button {
  background: transparent;
  border: none;
  color: var(--dark-muted);
  padding: 6px 14px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: 0.2s;
}

.lang-toggle button.active {
  background: var(--accent);
  color: white;
}

.currency-select {
  background: transparent;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 999px;
  color: var(--dark-muted);
  padding: 6px 10px;
  font-size: 0.8rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
}
.currency-select option {
  color: #111;
}

/* ---------- Hero ---------- */
/* Dark zone: merges visually with the sticky dark header above it (see
   DODASKY's dark-header + dark-hero + light-body-pages identity), with a
   light search-bar "card" floating on top of it (unchanged below). */
.hero {
  padding: 64px 0 40px;
  text-align: center;
  background: linear-gradient(180deg, var(--dark) 0%, var(--dark2) 100%);
}

.hero h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 900;
  margin: 0 0 14px;
  background: linear-gradient(135deg, #fff 30%, var(--accent-bright) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero p {
  color: var(--dark-muted);
  font-size: 1.1rem;
  max-width: 640px;
  margin: 0 auto 30px;
  line-height: 1.7;
}

.search-bar {
  max-width: 620px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 8px 6px 20px;
  box-shadow: var(--shadow);
}

[dir="rtl"] .search-bar { padding: 6px 20px 6px 8px; }

.search-bar input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  color: var(--text);
  font-size: 1rem;
  padding: 10px 8px;
}

.search-bar input::placeholder { color: var(--text-dim); }

.search-bar button {
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  border: none;
  color: white;
  font-weight: 700;
  padding: 12px 26px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 0.95rem;
  white-space: nowrap;
}

/* ---------- Filters ---------- */
.filters-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin: 40px 0 20px;
}

.chip-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.chip {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 8px 18px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.88rem;
  cursor: pointer;
  transition: 0.2s;
}

.chip:hover { border-color: var(--accent); color: var(--text); }
.chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.sort-select {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
  font-size: 0.88rem;
}

.sort-select select {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 12px;
  border-radius: 10px;
  font-size: 0.88rem;
  cursor: pointer;
}

/* Level 2 (product kind) and level 3 (exact device) filter rows — visually
   secondary/tertiary compared to the main platform-family row above them,
   so the hierarchy (family -> kind -> device) reads clearly at a glance. */
.sub-filters-bar {
  margin: 0 0 14px;
  justify-content: flex-start;
}

.chip-group-sub .chip {
  padding: 6px 14px;
  font-size: 0.8rem;
}

.chip-group-sub .chip.active {
  background: rgba(14,165,233,0.12);
  border-color: var(--sky);
  color: var(--sky-dark);
}

.results-count {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-bottom: 18px;
}

/* ---------- Product grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 20px;
  padding-bottom: 60px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform 0.18s, border-color 0.18s, background 0.18s;
}

/* Hovering a card makes it unmistakable which one the customer is
   pointing at: a 2px GOLD border only (per Mohamed's request), while the
   card body itself washes to the soft light-purple tint from the old
   identity, not gold. */
.card:hover {
  transform: translateY(-4px);
  border: 2px solid var(--gold);
  padding: 19px; /* compensate the border going from 1px to 2px so content doesn't shift */
  background: var(--card-hover);
  box-shadow: 0 10px 26px rgba(124,92,255,0.18);
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

/* Cover-image banner across the top of a storefront card — bleeds to the
   card's own edges via negative margins that exactly cancel .card's 20px
   padding, so it reads as a real product photo/box-art strip rather than a
   small icon. Falls back to the tinted emoji box (unchanged from before)
   whenever a product has no real Kinguin cover image linked yet — see
   js/app.js's liveImageFor(). */
.card-media {
  position: relative;
  margin: -20px -20px 4px -20px;
  height: 150px;
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
  background: var(--bg-alt);
  flex-shrink: 0;
}

.card-media .card-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.card-media .card-emoji {
  width: 100%;
  height: 100%;
  font-size: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border-radius: 0;
}

.card-media .badge {
  position: absolute;
  top: 10px;
  inset-inline-end: 10px;
  background: rgba(10,20,16,0.78);
  color: #fff;
  backdrop-filter: blur(2px);
}

/* Small icon used outside the card-media banner (e.g. the checkout order
   summary line) — unchanged size/look from before this feature. */
.card-emoji {
  font-size: 2.2rem;
  width: 54px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-alt);
  border-radius: 14px;
  flex-shrink: 0;
}

.badge {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--good);
  background: rgba(10,107,70,0.12);
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
}

/* Always exactly 2 lines — a short title (e.g. "Elden Ring") just leaves
   the second line blank, a long one (e.g. "Call of Duty: Black Ops 6
   (PS4 / PS5)") clips with an ellipsis — so every card's title block takes
   up the same height instead of sometimes 1 line, sometimes 2. */
.card h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.6em;
}

/* Always exactly 2 rows: platform on its own line, region + product kind
   together on the line below — never a variable 1-or-2-line wrap. */
.card .meta {
  color: var(--text-dim);
  font-size: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.card .meta-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Fixed height across every card — the same box size for a short note and
   a long one, per Mohamed's request. The text's own font-size is what
   adapts to fit (see js/app.js's fitActivationNotes()), not the box. */
.activation-note {
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--warn);
  background: rgba(184, 147, 44, 0.12);
  border: 1px solid rgba(184, 147, 44, 0.4);
  border-radius: 8px;
  padding: 6px 10px;
  margin-top: 4px;
  height: 92px;
  display: flex;
  align-items: center;
  overflow: hidden;
}

.account-warning {
  color: var(--danger);
  background: rgba(192, 57, 43, 0.1);
  border-color: rgba(192, 57, 43, 0.35);
  font-weight: 600;
}

.card .meta span { display: flex; align-items: center; gap: 4px; }

/* Clear, prominent price rectangle sitting directly above the Buy button —
   margin-top: auto pushes this (and the button right after it, via the
   shared gap) to the same fixed spot at the bottom of every card, so both
   line up across a whole row regardless of how much content (region
   picker, activation note, account warning) a given card has above them. */
.price-box {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
}

.price-box-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-dim);
}

.price-box-value {
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--accent);
}

.card-cta {
  margin-top: 0;
  display: block;
  text-align: center;
  padding: 12px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white;
  font-weight: 800;
  font-size: 0.92rem;
  cursor: pointer;
  border: none;
}

.card-cta:hover { filter: brightness(1.08); }

/* Real remaining-stock line (see js/app.js renderCard()) — built from
   Kinguin's own quantity data, never an invented number. */
.stock-line {
  font-size: 0.78rem;
  font-weight: 700;
  margin: 2px 0 6px;
}
.stock-line.stock-ok { color: var(--good); }
.stock-line.stock-low { color: #b8860b; }
.stock-line.stock-out { color: var(--danger); }

.card-sold-out { opacity: 0.72; }
.card-sold-out .card-media { filter: grayscale(0.6); }

.card-cta-disabled {
  margin-top: 0;
  display: block;
  text-align: center;
  padding: 12px;
  border-radius: 12px;
  background: #2a2a2a;
  color: #c9c9c9;
  font-weight: 800;
  font-size: 0.92rem;
  cursor: not-allowed;
  border: none;
}

.no-results {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-dim);
  font-size: 1.05rem;
}

/* ---------- How it works ---------- */
.how-section {
  padding: 70px 0;
  border-top: 1px solid var(--border);
}

.how-section h2 {
  text-align: center;
  font-size: 2rem;
  font-weight: 900;
  margin-bottom: 44px;
}

.how-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 26px;
}

.how-step {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  text-align: center;
}

.how-step h3 {
  color: var(--accent-2);
  font-size: 1.1rem;
  margin: 0 0 10px;
}

.how-step p {
  color: var(--text-dim);
  font-size: 0.92rem;
  line-height: 1.7;
  margin: 0;
}

/* ---------- Disclaimer ---------- */
.disclaimer-box {
  margin: 0 0 60px;
  padding: 18px 22px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-dim);
  font-size: 0.85rem;
  line-height: 1.7;
  text-align: center;
}

/* ---------- Footer ---------- */
footer.site-footer {
  border-top: 1px solid var(--border);
  padding: 30px 0;
  color: var(--text-dim);
  font-size: 0.85rem;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-links {
  display: flex;
  gap: 18px;
}

.footer-links a:hover { color: var(--text); }

@media (max-width: 640px) {
  nav.main-nav { display: none; }
  .hero { padding: 44px 0 30px; }
  .search-bar { flex-direction: column; align-items: stretch; border-radius: 20px; padding: 14px; }
  .search-bar button { margin-top: 8px; }
  .filters-bar { flex-direction: column; align-items: stretch; }
}
