/* ============================================================================
   livethegame — estilos base + sistema de temas por marca (CSS variables)
   ========================================================================== */

:root {
  /* Defaults = marca paraguas "livethegame" (hub oscuro y neutro) */
  --bg: #0E0F13;
  --surface: #16181F;
  --surface2: #1E2129;
  --text: #ECEEF3;
  --muted: #8A8F9C;
  --border: rgba(236,238,243,0.10);
  --accent: #00E0A4;
  --accent2: #7C6CFF;
  --grad: linear-gradient(90deg, #7C6CFF, #00E0A4);
  --grad-warm: linear-gradient(90deg, #FF7C9C, #FFC36B);
  --font-h: 'Space Grotesk', system-ui, sans-serif;
  --font-b: 'Inter', system-ui, sans-serif;
  --radius: 12px;
  --maxw: 1180px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-b);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background .3s ease, color .3s ease;
}
h1, h2, h3, .ptitle, .brandmark { font-family: var(--font-h); }
a { color: inherit; text-decoration: none; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }

/* ---- Header ---- */
.site-head {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 22px;
  padding: 14px 22px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.brandmark { font-weight: 700; font-size: 1.15rem; letter-spacing: -.02em; display: flex; align-items: center; gap: 8px; }
.bm-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--grad); display: inline-block; }
.mainnav { display: flex; gap: 16px; margin-left: 8px; flex-wrap: wrap; }
.mainnav a { color: var(--muted); font-size: .92rem; padding: 4px 2px; border-bottom: 2px solid transparent; }
.mainnav a:hover { color: var(--text); }
.mainnav a.on { color: var(--text); border-bottom-color: var(--accent); }
.head-actions { margin-left: auto; display: flex; gap: 14px; align-items: center; }
.ico { font-size: 1rem; color: var(--text); display: inline-flex; gap: 5px; align-items: center; }
.ico b { font-size: .78rem; background: var(--surface2); border-radius: 999px; padding: 1px 7px; }

/* ---- Buttons & badges ---- */
.btn {
  font-family: var(--font-b); font-weight: 600; font-size: .92rem;
  border: 1px solid var(--border); background: var(--surface2); color: var(--text);
  padding: 11px 18px; border-radius: var(--radius); cursor: pointer;
  transition: transform .08s ease, filter .2s ease, background .2s ease;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--grad); color: #0b0b0f; border: none; }
.btn.ghost { background: transparent; }
.btn.block { width: 100%; }
.btn.lg { padding: 14px 22px; font-size: 1rem; }

.badges { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.badge { font-size: .68rem; font-weight: 700; padding: 3px 8px; border-radius: 999px; letter-spacing: .02em; }
.badge.dig { background: var(--accent); color: #06110d; }
.badge.phy { background: var(--surface2); color: var(--text); border: 1px solid var(--border); }
.badge.pre { background: var(--grad-warm); color: #2a1300; }
.badge.tag { background: color-mix(in srgb, var(--accent2) 22%, transparent); color: var(--text); }

/* ---- Hero (brand & umbrella) ---- */
.hero { padding: 64px 0 40px; }
.hero .kicker { color: var(--accent); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: .78rem; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.4rem); margin: 12px 0 10px; letter-spacing: -.02em; line-height: 1.05; }
.hero p { color: var(--muted); max-width: 620px; font-size: 1.05rem; }
.hero-cta { margin-top: 22px; display: flex; gap: 12px; flex-wrap: wrap; }

/* ============================================================================
   Brand hero enriquecido (fiel a las webs de cada marca) + Destacados bento
   ========================================================================== */
.brand-hero {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 30px; align-items: center;
  padding: 56px 0 46px;
}
.bh-kick { color: var(--accent); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; font-size: .76rem; }
.bh-title {
  font-family: var(--font-h); font-weight: 900; text-transform: uppercase;
  font-size: clamp(2.3rem, 6vw, 4rem); line-height: .94; letter-spacing: -.01em;
  margin: 12px 0 0;
}
.bh-logo { max-width: 460px; width: 100%; height: auto; margin: 8px 0 0; display: block; }
.grad-bar { width: min(320px, 80%); height: 7px; border-radius: 99px; background: var(--grad); margin: 18px 0 20px; }
.bh-blurb { color: var(--muted); max-width: 460px; font-size: 1.04rem; }
.bh-cta { margin-top: 24px; display: flex; gap: 12px; flex-wrap: wrap; }
.bh-cta .btn { border-radius: 999px; }

/* Decoración derecha */
.bh-deco { position: relative; min-height: 340px; }
.bh-dots {
  position: absolute; width: 90px; height: 90px; opacity: .5;
  background-image: radial-gradient(currentColor 2px, transparent 2px);
  background-size: 15px 15px;
}
.cap { position: absolute; height: 22px; border-radius: 99px; }

/* Word-pills (cluster icónico de Mr. iO) */
.wordpills {
  position: relative; display: flex; flex-wrap: wrap; gap: 9px;
  align-items: center; justify-content: center; max-width: 420px; margin: 0 auto;
  padding: 20px 0;
}
.wp {
  font-family: var(--font-h); font-weight: 800; color: #fff;
  padding: 9px 17px; border-radius: 99px; font-size: 1rem; white-space: nowrap;
  box-shadow: 0 6px 16px rgba(0,0,0,.25);
}
.wordpills .robot { font-size: 2.4rem; filter: drop-shadow(0 4px 10px rgba(0,0,0,.4)); }
.wp:nth-child(3n) { transform: rotate(-4deg); }
.wp:nth-child(3n+1) { transform: rotate(3deg); }

/* Destacados (bento, alimentado por Medusa) */
.featured { padding-bottom: 30px; }
.feat-grid { display: grid; grid-template-columns: repeat(3, 1fr); grid-auto-rows: 150px; gap: 16px; }
.feat-card {
  position: relative; overflow: hidden; border-radius: 18px; display: block;
  border: 1px solid var(--border); background: var(--surface2);
  transition: transform .15s ease;
}
.feat-card:hover { transform: translateY(-4px); }
.feat-card.big { grid-column: span 2; grid-row: span 2; }
.feat-card .fc-art { position: absolute; inset: 0; }
.feat-card .fc-art img { width: 100%; height: 100%; object-fit: cover; }
.feat-card .fc-grad { position: absolute; inset: 0; background: linear-gradient(180deg, transparent 35%, rgba(0,0,0,.78)); }
.feat-card .fc-body { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px 16px; color: #fff; }
.feat-card .fc-type { font-size: .68rem; text-transform: uppercase; letter-spacing: .06em; opacity: .85; }
.feat-card .fc-title { font-family: var(--font-h); font-weight: 800; line-height: 1.1; margin: 3px 0 4px; }
.feat-card.big .fc-title { font-size: 1.5rem; }
.feat-card .fc-price { font-weight: 700; }
.feat-card .fc-badge { position: absolute; top: 12px; left: 12px; background: var(--grad-warm); color: #2a1300; font-size: .68rem; font-weight: 800; padding: 4px 10px; border-radius: 99px; }

/* ---- Brand cards (umbrella) ---- */
.brandgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; padding: 8px 0 60px; }
.brandtile {
  position: relative; overflow: hidden; border-radius: 16px; padding: 26px;
  min-height: 220px; border: 1px solid var(--border); display: flex; flex-direction: column;
  justify-content: flex-end; transition: transform .15s ease;
}
.brandtile:hover { transform: translateY(-4px); }
.brandtile .glow { position: absolute; inset: 0; opacity: .9; z-index: 0; }
.brandtile > * { position: relative; z-index: 1; }
.brandtile h3 { margin: 0 0 4px; font-size: 1.5rem; }
.brandtile .bt-kick { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; opacity: .85; }
.brandtile .bt-tag { font-size: .9rem; opacity: .92; margin-top: 6px; }

/* ---- Product grid & cards ---- */
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin: 36px 0 16px; gap: 12px; flex-wrap: wrap; }
.section-head h2 { margin: 0; font-size: 1.5rem; }
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; padding-bottom: 60px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: transform .15s ease, border-color .2s ease; }
.card:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--accent) 50%, var(--border)); }
.card-img { position: relative; display: block; aspect-ratio: 1/1; background: var(--surface2); }
.card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.wish { position: absolute; top: 10px; right: 10px; border: none; cursor: pointer; width: 34px; height: 34px; border-radius: 50%; background: color-mix(in srgb, var(--bg) 70%, transparent); color: var(--text); font-size: 1rem; line-height: 1; backdrop-filter: blur(4px); }
.wish.on { background: var(--accent2); color: #fff; }
.card-body { padding: 13px 14px 15px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.ptype { font-size: .72rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.ptitle { font-size: 1.02rem; font-weight: 600; line-height: 1.2; }
.price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.price strong { font-size: 1.12rem; }
.compare { color: var(--muted); text-decoration: line-through; font-size: .85rem; }
.usd { color: var(--muted); font-size: .78rem; margin-left: auto; }
.card-body .buy { margin-top: 8px; }

/* ---- Product detail ---- */
.pdp { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; padding: 38px 0 60px; }
.pdp .pimg { border-radius: 16px; overflow: hidden; border: 1px solid var(--border); background: var(--surface2); position: relative; }
.pdp .pimg img { width: 100%; display: block; }
.pdp h1 { font-size: 2.1rem; margin: 6px 0 8px; letter-spacing: -.02em; }
.pdp .price { font-size: 1.1rem; margin: 14px 0; }
.pdp .price strong { font-size: 1.7rem; }
.pdp .desc { color: var(--muted); margin: 14px 0 22px; }
.pdp .meta { border-top: 1px solid var(--border); margin-top: 22px; padding-top: 18px; display: grid; gap: 10px; font-size: .92rem; }
.pdp .meta .row { display: flex; gap: 10px; }
.pdp .meta .row span:first-child { color: var(--muted); min-width: 130px; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.qty button { background: var(--surface2); border: none; color: var(--text); width: 38px; height: 42px; font-size: 1.1rem; cursor: pointer; }
.qty input { width: 48px; text-align: center; border: none; background: var(--surface); color: var(--text); height: 42px; font-size: 1rem; }
.pdp-actions { display: flex; gap: 12px; align-items: center; margin: 18px 0; flex-wrap: wrap; }

/* ---- Cart / checkout / tables ---- */
.page-title { font-size: 2rem; margin: 34px 0 18px; }
.layout-2 { display: grid; grid-template-columns: 1fr 360px; gap: 28px; align-items: start; padding-bottom: 60px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.line { display: grid; grid-template-columns: 72px 1fr auto; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--border); }
.line:last-child { border-bottom: none; }
.line img { width: 72px; height: 72px; border-radius: 10px; object-fit: cover; background: var(--surface2); }
.line .lt { font-weight: 600; }
.line .lmeta { color: var(--muted); font-size: .82rem; }
.line .lrm { color: var(--muted); cursor: pointer; background: none; border: none; font-size: .8rem; text-decoration: underline; padding: 0; }
.totrow { display: flex; justify-content: space-between; padding: 7px 0; }
.totrow.grand { border-top: 1px solid var(--border); margin-top: 8px; padding-top: 12px; font-size: 1.2rem; font-weight: 700; }
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field label { font-size: .82rem; color: var(--muted); }
.field input, .field select {
  background: var(--surface2); border: 1px solid var(--border); color: var(--text);
  padding: 11px 12px; border-radius: var(--radius); font-family: var(--font-b); font-size: .95rem;
}
.pay-opts { display: grid; gap: 10px; margin: 8px 0 16px; }
.pay-opt { display: flex; align-items: center; gap: 12px; border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; cursor: pointer; }
.pay-opt.on { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
.pay-opt .pi { font-size: 1.4rem; }
.pay-opt .pd { font-size: .8rem; color: var(--muted); }
.empty { text-align: center; padding: 70px 0; color: var(--muted); }

/* ---- Library / order success ---- */
.dl-item { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.dl-item .di { font-size: 1.8rem; }
.success-hero { text-align: center; padding: 50px 0 10px; }
.success-hero .check { font-size: 3rem; }

/* ---- Toast ---- */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px);
  background: var(--text); color: var(--bg); padding: 12px 20px; border-radius: 999px;
  font-weight: 600; font-size: .9rem; opacity: 0; pointer-events: none; transition: all .25s ease; z-index: 100;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---- Footer ---- */
.site-foot { border-top: 1px solid var(--border); margin-top: 40px; padding: 30px 22px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; max-width: var(--maxw); margin-left: auto; margin-right: auto; }

/* ---- Peruru: tema claro necesita botón primario legible ---- */
body[data-brand="peruru"] .btn.primary { color: #fff; }
body[data-brand="peruru"] .badge.dig { color: #fff; }
body[data-brand="peruru"] .toast { background: var(--text); color: #fff; }
/* Peruru: titulares en rojo-vino (como su web) */
body[data-brand="peruru"] .bh-title,
body[data-brand="peruru"] .section-head h2 { color: #A8423D; }
body[data-brand="peruru"] .card { box-shadow: 0 6px 20px rgba(68,52,58,0.06); }

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .brandgrid { grid-template-columns: 1fr; }
  .pdp { grid-template-columns: 1fr; }
  .layout-2 { grid-template-columns: 1fr; }
  .mainnav { display: none; }
  .brand-hero { grid-template-columns: 1fr; }
  .bh-deco { min-height: 260px; order: -1; }
  .feat-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 140px; }
  .feat-card.big { grid-column: span 2; grid-row: span 1; grid-auto-rows: 200px; min-height: 200px; }
}
