:root {
  /* Paleta del manual de marca Zona Gamer */
  --red: #ff0000;
  --green: #00ff00;
  --gold: #d9a63a;
  --gold-grad: linear-gradient(90deg, #c8892c, #f5e08a 55%, #c8892c);
  --gray: #808080;
  --bg: #000000;
  --bg2: #0a0a0a;
  --card: #101010;
  --line: #262626;
  --text: #ffffff;
  --muted: #9a9a9a;
  --accent: var(--red);
  --sale: var(--red);
  --wa: var(--green);
  --radius: 12px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .6);
  --display: Orbitron, var(--display);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.45 Montserrat, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
}
a { color: inherit; }
img { display: block; max-width: 100%; }
button, select, input { font: inherit; color: inherit; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); font-size: 13px; }

/* ---------- Header ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  background: rgba(11, 13, 23, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.top-row { display: flex; align-items: center; gap: 14px; height: 64px; }
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; flex-shrink: 0; }
.logo img { height: 40px; width: auto; }
.logo-text { font: 700 24px/1 var(--display); letter-spacing: .5px; }
.logo-text b { color: var(--accent); margin-left: 2px; }
.search {
  flex: 1; display: flex; align-items: center; gap: 8px;
  background: var(--bg2); border: 1px solid var(--line); border-radius: 999px;
  padding: 0 14px; height: 42px; min-width: 0;
}
.search:focus-within { border-color: var(--accent); }
.search svg { width: 18px; fill: var(--muted); flex-shrink: 0; }
.search input { flex: 1; background: none; border: 0; outline: 0; min-width: 0; }
.cart-btn {
  position: relative; width: 44px; height: 44px; border-radius: 50%;
  background: var(--bg2); border: 1px solid var(--line); cursor: pointer; flex-shrink: 0;
  display: grid; place-items: center;
}
.cart-btn svg { width: 22px; fill: var(--text); }
.badge {
  position: absolute; top: -4px; right: -4px; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 999px; background: var(--sale); font-size: 12px; font-weight: 700;
  display: grid; place-items: center;
}

.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 10px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex-shrink: 0; border: 1px solid var(--line); background: transparent; border-radius: 999px;
  padding: 7px 14px; cursor: pointer; color: var(--muted); font-weight: 600; font-size: 14px;
}
.tab:hover { color: var(--text); }
.tab[aria-current="true"] { background: var(--text); color: var(--bg); border-color: var(--text); }

/* ---------- Hero ---------- */
.hero {
  margin: 20px 0 8px; padding: 22px 24px; border-radius: var(--radius);
  background: linear-gradient(120deg, #1b2a6b 0%, #3a1e72 60%, #521d5e 100%);
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.hero h1 { margin: 0 0 4px; font: 700 28px/1.1 var(--display); }
.hero p { margin: 0; color: #d7dbf5; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 10px; padding: 10px 16px; font-weight: 600; cursor: pointer;
  text-decoration: none; background: var(--accent); color: #fff;
}
.btn svg { width: 20px; fill: currentColor; }
.btn.wa { background: var(--wa); color: #06260f; }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--text); }
.btn.block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Toolbar ---------- */
.toolbar { display: flex; gap: 10px; align-items: center; justify-content: space-between; margin: 16px 0 6px; flex-wrap: wrap; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  border: 1px solid var(--line); background: var(--bg2); border-radius: 8px; padding: 5px 10px;
  font-size: 13px; cursor: pointer; color: var(--muted);
}
.chip[aria-pressed="true"] { border-color: var(--accent); color: var(--text); background: rgba(79, 124, 255, .15); }
#sort { background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; }
.count { color: var(--muted); font-size: 13px; margin: 4px 0 12px; }

/* ---------- Grid ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; cursor: pointer;
  transition: transform .15s, border-color .15s;
}
.card:hover { transform: translateY(-3px); border-color: #3a4170; }
.cover { position: relative; aspect-ratio: 3 / 4; background: var(--bg2); overflow: hidden; }
.cover img { width: 100%; height: 100%; object-fit: cover; }
.cover.wide img { object-fit: cover; object-position: center; }
.cover.code { aspect-ratio: 16 / 10; }
.plat {
  position: absolute; top: 8px; left: 8px; padding: 2px 8px; border-radius: 6px;
  font: 700 12px/1.6 var(--display); letter-spacing: .5px; background: rgba(0, 0, 0, .75);
}
.plat.PS5 { background: #f2f4ff; color: #0b0d17; }
.plat.PS4 { background: #0b3cc1; }
.plat.PS3 { background: #111; border: 1px solid #444; }
.tag {
  position: absolute; top: 8px; right: 8px; padding: 2px 7px; border-radius: 6px;
  font-size: 11px; font-weight: 700; background: var(--sale);
}
.tag.new { background: #12b886; }
.tag.pre { background: #f59f00; color: #1a1300; }
.tag.out { background: #555; }
.card-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-title { font-size: 14px; font-weight: 600; line-height: 1.3; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-sub { font-size: 12px; color: var(--muted); }
.price-row { margin-top: auto; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.price { font: 700 20px/1 var(--display); }
.old { color: var(--muted); text-decoration: line-through; font-size: 13px; }
.ask { color: var(--muted); font-size: 14px; font-weight: 600; }
.card-actions { display: flex; gap: 6px; }
.card-actions .btn { padding: 8px 10px; font-size: 13px; flex: 1; }
.card-actions .btn.add { flex: 0 0 auto; background: var(--bg2); border: 1px solid var(--line); }
.card.soldout { opacity: .55; }

/* Portada generada (cuando no hay imagen) */
.ph {
  width: 100%; height: 100%; display: flex; flex-direction: column; justify-content: flex-end;
  padding: 14px; gap: 6px; font: 700 18px/1.1 var(--display); text-align: left;
  background: radial-gradient(circle at 30% 20%, rgba(255,255,255,.12), transparent 50%), var(--phbg, linear-gradient(160deg, #24305e, #121527));
}
.ph small { font: 600 11px/1 Montserrat, sans-serif; opacity: .7; letter-spacing: 1px; text-transform: uppercase; }

/* Tarjetas de saldo generadas */
.giftcard {
  width: 100%; height: 100%; padding: 14px; display: flex; flex-direction: column; justify-content: space-between;
  color: #fff; background: var(--gc, #333); position: relative; overflow: hidden;
}
.giftcard::after {
  content: ""; position: absolute; inset: auto -30% -60% auto; width: 90%; aspect-ratio: 1;
  border-radius: 50%; background: rgba(255,255,255,.1);
}
.gc-brand { font: 700 18px/1 var(--display); letter-spacing: .5px; text-transform: uppercase; }
.gc-amount { font: 700 30px/1 var(--display); position: relative; z-index: 1; }
.gc-amount small { font-size: 14px; opacity: .85; display: block; margin-top: 2px; }

/* ---------- Promos ---------- */
.promos { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; margin-bottom: 18px; }
.promo {
  border-radius: var(--radius); padding: 18px; cursor: pointer; border: 1px solid var(--line);
  background: linear-gradient(135deg, #2a1b5e, #161a2e); display: flex; flex-direction: column; gap: 10px;
}
.promo h3 { margin: 0; font: 700 22px/1.1 var(--display); }
.promo .stack { display: flex; }
.promo .stack img { width: 56px; aspect-ratio: 3/4; object-fit: cover; border-radius: 6px; border: 2px solid var(--bg); margin-left: -12px; }
.promo .stack img:first-child { margin-left: 0; }

/* ---------- Modales ---------- */
.modal {
  border: 1px solid var(--line); border-radius: 18px; padding: 0; background: var(--bg2); color: var(--text);
  width: min(760px, calc(100% - 24px)); max-height: calc(100% - 24px); box-shadow: var(--shadow);
}
.modal.wide { width: min(980px, calc(100% - 24px)); }
.modal::backdrop { background: rgba(0, 0, 0, .65); }
.modal-inner { display: grid; grid-template-columns: 240px 1fr; gap: 20px; padding: 20px; }
.modal-inner .cover { border-radius: 12px; }
.modal h2 { margin: 0 0 6px; font: 700 26px/1.1 var(--display); }
.close { position: absolute; top: 10px; right: 12px; }
.icon { background: none; border: 0; font-size: 20px; cursor: pointer; color: var(--muted); padding: 6px; }
.facts { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 6px; font-size: 14px; }
.facts li span { color: var(--muted); }
.info { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 12px; font-size: 13px; color: #c9cde6; max-height: 220px; overflow: auto; }
.info p { margin: 0 0 6px; }
.includes { columns: 2; font-size: 13px; padding-left: 18px; color: #c9cde6; }
.modal .actions { display: flex; gap: 8px; margin-top: 16px; flex-wrap: wrap; }

.pick-head { padding: 18px 20px 10px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg2); z-index: 1; }
.pick-head h2 { padding-right: 30px; }
.pick-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; padding: 16px 20px; }
.pick {
  position: relative; border: 2px solid transparent; border-radius: 10px; overflow: hidden; cursor: pointer;
  background: var(--card); padding: 0; text-align: left;
}
.pick[aria-pressed="true"] { border-color: var(--wa); }
.pick[aria-pressed="true"]::after {
  content: "✓"; position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--wa); color: #06260f; font-weight: 700; display: grid; place-items: center;
}
.pick:disabled { opacity: .4; cursor: not-allowed; }
.pick .t { font-size: 12px; padding: 6px 8px; line-height: 1.25; }
.pick-foot { position: sticky; bottom: 0; background: var(--bg2); border-top: 1px solid var(--line); padding: 12px 20px; display: flex; gap: 10px; align-items: center; justify-content: space-between; }

/* ---------- Carrito ---------- */
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100%); z-index: 40;
  background: var(--bg2); border-left: 1px solid var(--line); display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .25s ease;
}
.drawer.open { transform: none; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0; font: 700 22px var(--display); }
.drawer-body { flex: 1; overflow: auto; padding: 10px 18px; }
.drawer-foot { padding: 16px 18px; border-top: 1px solid var(--line); display: grid; gap: 8px; }
.total { display: flex; justify-content: space-between; font-size: 18px; margin-bottom: 4px; }
.line { display: grid; grid-template-columns: 48px 1fr auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.line .thumb { width: 48px; aspect-ratio: 3/4; border-radius: 6px; overflow: hidden; background: var(--card); }
.line .thumb img { width: 100%; height: 100%; object-fit: cover; }
.line .n { font-size: 14px; font-weight: 600; }
.line .s { font-size: 12px; color: var(--muted); }
.qty { display: flex; align-items: center; gap: 6px; margin-top: 4px; }
.qty button { width: 26px; height: 26px; border-radius: 6px; border: 1px solid var(--line); background: var(--card); cursor: pointer; }
.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 30; }
.cart-empty { color: var(--muted); text-align: center; padding: 40px 0; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 120px); z-index: 50;
  background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-weight: 600;
  transition: transform .25s; box-shadow: var(--shadow); max-width: calc(100% - 32px);
}
.toast.show { transform: translate(-50%, 0); }

.more { display: flex; justify-content: center; margin: 22px 0; }
.empty { text-align: center; color: var(--muted); padding: 40px 0; }

.foot { border-top: 1px solid var(--line); margin-top: 40px; padding: 28px 0 40px; background: var(--bg2); }
.foot-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.foot p { margin: 6px 0; }

/* ---------- Mobile ---------- */
@media (max-width: 640px) {
  .top-row { gap: 10px; height: 58px; }
  .logo-text { font-size: 20px; }
  .logo img { height: 32px; }
  .hero { padding: 18px; }
  .hero h1 { font-size: 23px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .card-body { padding: 8px 10px 10px; }
  .price { font-size: 18px; }
  .card-actions .btn { font-size: 12px; padding: 7px 8px; }
  .modal-inner { grid-template-columns: 1fr; }
  .modal-inner .cover { max-width: 200px; }
  .includes { columns: 1; }
  .foot-grid { grid-template-columns: 1fr; }
  .pick-grid { grid-template-columns: repeat(3, 1fr); padding: 12px; }
}

/* ================= Marca Zona Gamer ================= */
.top { background: rgba(0, 0, 0, .9); border-bottom: 1px solid #1a1a1a; box-shadow: 0 1px 0 rgba(255, 0, 0, .25); }
.logo img { height: 44px; filter: drop-shadow(0 0 10px rgba(255, 0, 0, .35)); }
.logo-text { font: 700 19px/1 var(--display); letter-spacing: 2px; color: var(--text); }
.logo-text b { color: var(--red); margin-left: 6px; font-weight: 700; }
.search { background: #0d0d0d; }
.search:focus-within { border-color: var(--red); box-shadow: 0 0 0 3px rgba(255, 0, 0, .15); }
.tab { font-family: var(--display); font-size: 12px; letter-spacing: 1px; text-transform: uppercase; font-weight: 600; }
.tab:hover { border-color: #444; }
.tab[aria-current="true"] { background: var(--red); border-color: var(--red); color: #fff; box-shadow: 0 0 16px rgba(255, 0, 0, .35); }
.cart-btn { background: #0d0d0d; }
.cart-btn:hover { border-color: var(--red); }
.badge { background: var(--red); }

.hero {
  position: relative; overflow: hidden; min-height: 190px; padding: 28px;
  background:
    radial-gradient(ellipse at 85% 50%, rgba(255, 0, 0, .35), transparent 55%),
    linear-gradient(180deg, #0c0c0c, #050505);
  border: 1px solid #2a0000;
}
.hero::after {
  content: ""; position: absolute; right: -20px; top: 50%; width: 300px; aspect-ratio: 694 / 792;
  transform: translateY(-50%); background: url(img/logo-textura.png) center / contain no-repeat; opacity: .28;
  pointer-events: none;
}
.hero > * { position: relative; z-index: 1; }
.hero h1 { font-size: 26px; letter-spacing: 1px; text-transform: uppercase; max-width: 620px; }
.hero h1 em { font-style: normal; color: var(--red); }
.hero p { color: #cfcfcf; max-width: 560px; margin-top: 8px; }

.btn { background: var(--red); border-radius: 8px; letter-spacing: .3px; }
.btn:hover { filter: brightness(1.1); }
.btn.wa { background: var(--green); color: #000; font-weight: 700; }
.btn.ghost:hover { border-color: var(--red); }
.chip[aria-pressed="true"] { border-color: var(--red); background: rgba(255, 0, 0, .12); }
#sort:focus { outline: 1px solid var(--red); }

.card { background: var(--card); border-color: #1d1d1d; }
.card:hover { border-color: var(--red); box-shadow: 0 0 0 1px rgba(255, 0, 0, .4), 0 12px 30px rgba(255, 0, 0, .12); }
.price { font-size: 17px; letter-spacing: .5px; }
.old { color: var(--gray); }
.tag { background: var(--red); color: #fff; }
.tag.new { background: var(--green); color: #000; }
.tag.pre { background: var(--gold-grad); color: #2a1a00; }
.card-actions .btn.add { background: #0d0d0d; border-color: #333; color: var(--text); }
.card-actions .btn.add:hover { border-color: var(--red); color: var(--red); }

.ph { background: radial-gradient(circle at 30% 20%, rgba(255, 0, 0, .18), transparent 55%), var(--phbg, linear-gradient(160deg, #1a1a1a, #050505)); font-size: 14px; letter-spacing: .5px; }
.ph { position: relative; }
.ph::before {
  content: ""; position: absolute; left: 50%; top: 42%; width: 55%; aspect-ratio: 1; transform: translate(-50%, -50%);
  background: url(img/emblema.png) center / contain no-repeat; opacity: .22;
}
.ph small, .ph { z-index: 0; }

.promo {
  background: radial-gradient(ellipse at 100% 0%, rgba(255, 0, 0, .3), transparent 60%), linear-gradient(160deg, #141414, #070707);
  border-color: #3a2a00;
}
.promo:hover { border-color: var(--gold); }
.promo h3 { font-size: 17px; letter-spacing: .5px; text-transform: uppercase; }
.promo .price { background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; font-size: 22px; }
.promo .btn { background: var(--gold-grad); color: #1a1000; }
.promo .stack img { border-color: #000; }

.modal { background: #0a0a0a; border-color: #2a2a2a; }
.modal h2 { font-size: 20px; letter-spacing: .5px; }
.info { background: #050505; border-color: #222; }
.pick[aria-pressed="true"] { border-color: var(--green); }
.drawer { background: #0a0a0a; }
.drawer-head h2 { font-size: 18px; letter-spacing: 1px; text-transform: uppercase; }
.toast { background: var(--red); color: #fff; }

.foot { background: #050505; border-top: 1px solid #1a0000; }
.foot-logo { width: 110px; margin-bottom: 10px; }

@media (max-width: 640px) {
  .logo-text { display: none; }
  .logo img { height: 40px; }
  .hero { padding: 20px; min-height: 0; }
  .hero h1 { font-size: 19px; }
  .hero::after { width: 170px; right: -40px; opacity: .2; }
  .price { font-size: 15px; }
}

.notice { border: 1px solid #3a2a00; background: rgba(217, 166, 58, .08); color: #f1d58a; border-radius: 10px; padding: 10px 14px; margin: 0 0 14px; font-size: 14px; }
.warn { margin: 0; background: rgba(255, 0, 0, .12); border: 1px solid rgba(255, 0, 0, .5); border-radius: 8px; padding: 8px 10px; font-size: 13px; color: #ffb3b3; }

/* ---------- Cómo instalar ---------- */
.howto { margin-top: 18px; }
.section-title { font: 700 22px/1.2 var(--display); letter-spacing: 1px; text-transform: uppercase; margin: 0 0 6px; }
.videos { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.video-card { background: var(--card); border: 1px solid #1d1d1d; border-radius: var(--radius); overflow: hidden; }
.video-body { padding: 12px 14px 14px; display: grid; gap: 8px; justify-items: start; }
.video-body h3 { margin: 0; font-size: 15px; }
.yt { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; padding: 0; background: #050505; cursor: pointer; }
.yt img { width: 100%; height: 100%; object-fit: cover; opacity: .85; transition: opacity .15s; }
.yt:hover img { opacity: 1; }
.yt iframe { width: 100%; height: 100%; border: 0; display: block; }
.yt-play { position: absolute; left: 50%; top: 50%; width: 68px; height: 48px; transform: translate(-50%, -50%); border-radius: 12px; background: var(--red); box-shadow: 0 0 24px rgba(255, 0, 0, .5); }
.yt-play::after { content: ""; position: absolute; left: 50%; top: 50%; transform: translate(-35%, -50%); border-style: solid; border-width: 10px 0 10px 17px; border-color: transparent transparent transparent #fff; }
.yt.soon { display: grid; place-items: center; cursor: default; color: var(--muted); font: 600 13px/1 var(--display); letter-spacing: 1px; text-transform: uppercase;
  background: radial-gradient(circle, rgba(255, 0, 0, .12), transparent 60%), #050505; }
.howto-help { margin-top: 22px; padding: 18px; border: 1px solid #1d1d1d; border-radius: var(--radius); background: #0a0a0a; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.howto-help p { margin: 0; }
.tab[data-tab="instalar"] { border-color: rgba(255, 0, 0, .5); color: #fff; }

/* Pedido enviado */
.sent { border: 1px solid rgba(0, 255, 0, .4); background: rgba(0, 255, 0, .07); border-radius: 8px; padding: 10px 12px; font-size: 14px; }
.sent p { margin: 0 0 4px; }
.sent a { color: var(--green); }
@media (max-width: 640px) { .videos { grid-template-columns: 1fr; } }
.video-body p { margin: 0; }
.howto-nav { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.howto-nav a { border: 1px solid #333; border-radius: 999px; padding: 6px 14px; font-size: 13px; text-decoration: none; color: var(--muted); }
.howto-nav a:hover { border-color: var(--red); color: var(--text); }
#h-instalar, #h-canjear { scroll-margin-top: 130px; }
.detail-video { margin: 12px 0; }
.detail-video p { margin: 0 0 8px; font-size: 14px; }
.detail-video .yt { border-radius: 10px; overflow: hidden; }
