/* ===========================================================================
   Simple Script  -  tienda Tebex headless
   Tema: neon sobre negro. Acento dominante = naranja de marca.
   Degradado azul/naranja/morado (del logo) reservado para logo + titulo hero.
   =========================================================================== */
:root {
  --bg:        #070709;
  --bg-2:      #0e0e13;   /* tarjetas */
  --bg-3:      #16161d;   /* media, inputs, qty */
  --text:      #f3f3f7;
  --text-dim:  #8c8c98;
  --primary:   #ff7a1f;   /* naranja: precios + acciones */
  --blue:      #2b9bff;
  --purple:    #b14dff;
  --free:      #27c93f;
  --danger:    #ff5f56;
  --border:    rgba(255,255,255,.07);
  --border-2:  rgba(255,255,255,.14);
  --radius:    13px;
  --grad:      linear-gradient(120deg, #2b9bff 0%, #ff7a1f 55%, #b14dff 110%);
  --shadow:    0 20px 50px rgba(0,0,0,.6);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.55;
}
h1, h2, h3, .header__title { font-family: 'Space Grotesk', system-ui, sans-serif; }
/* Orbitron SOLO en el titulo del hero */
.hero__title { font-family: 'Orbitron', 'Space Grotesk', system-ui, sans-serif; }

/* ---- Header --------------------------------------------------------------- */
.header {
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px;
  padding: 16px 6vw; border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 20;
  background: rgba(7,7,9,.88);
}
/* 3 columnas: marca | nav centrado | acciones a la derecha */
.header__brand   { justify-self: start; }
.header > .catnav { justify-self: center; }
.header__actions { justify-self: end; }
.header__brand { display: flex; align-items: center; gap: 12px; }
.logo-badge {
  width: 34px; height: 34px; flex: 0 0 auto;
  display: flex; align-items: center; justify-content: center;
  border-radius: 9px; border: 1px solid var(--border-2); background: var(--bg-2);
  font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 1.25rem;
  background-image: var(--grad);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.header__title { font-size: 1.2rem; font-weight: 600; letter-spacing: .2px; }
.header__tagline { display: none; }   /* el hero ya lleva el mensaje */

.header__nav { display: flex; align-items: center; gap: 26px; }
.header__actions { display: flex; align-items: center; gap: 12px; }
.header__link {
  color: var(--text-dim); text-decoration: none; font-size: .92rem; font-weight: 500;
  transition: color .15s ease;
}
.header__link:hover { color: var(--text); }
.header__link--discord {
  color: #0a0a0c; background: var(--primary);
  padding: 8px 16px; border-radius: 9px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 8px;
}
.header__link--discord:hover { color: #0a0a0c; opacity: .9; }

/* ---- Botones -------------------------------------------------------------- */
.btn {
  cursor: pointer; border: none; border-radius: 10px; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: 'Inter', sans-serif; font-size: .92rem; font-weight: 600; padding: 11px 20px;
  color: #0a0a0c; background: var(--primary);
  transition: transform .08s ease, opacity .15s ease, background .15s ease, border-color .15s ease;
}
.btn:hover  { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }

.btn--primary { background: var(--primary); color: #0a0a0c; }
.btn--ghost   { background: transparent; color: var(--text); border: 1px solid var(--border-2); }
.btn--ghost:hover { border-color: var(--text-dim); }

.btn--cart { background: var(--bg-2); border: 1px solid var(--border); color: var(--text); }
.cart-badge {
  display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px;
  background: var(--primary); color: #0a0a0c; border-radius: 999px;
  font-size: .78rem; font-weight: 700; text-align: center;
}
.btn--add { background: var(--cat, var(--primary)); color: #0a0a0c; }
.btn--add.is-in { background: transparent; border: 1px solid var(--cat, var(--primary)); color: var(--cat, var(--primary)); }
.btn--checkout { width: 100%; background: var(--primary); color: #0a0a0c; }

/* ---- Selector de idioma --------------------------------------------------- */
.langsw {
  display: inline-flex; gap: 2px; padding: 3px;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px;
}
.langsw__btn {
  cursor: pointer; border: none; background: transparent; color: var(--text-dim);
  font-family: 'Inter', sans-serif; font-size: .8rem; font-weight: 600;
  padding: 5px 9px; border-radius: 7px;
  transition: background .15s ease, color .15s ease;
}
.langsw__btn:hover { color: var(--text); }
.langsw__btn.is-active { background: var(--primary); color: #0a0a0c; }

/* ---- Cuenta Cfx.re (login / nombre) --------------------------------------- */
.account { display: inline-flex; align-items: center; gap: 6px; }
.account__login { background: var(--bg-2); border: 1px solid var(--border); color: var(--text); }
.account__login:hover { border-color: var(--border-2); }
.account__name {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 8px 12px; border-radius: 10px;
  background: var(--bg-2); border: 1px solid var(--border);
  font-size: .88rem; font-weight: 600; color: var(--text);
  max-width: 180px;
}
.account__name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account__name svg { color: var(--primary); flex-shrink: 0; }
.account__logout {
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; padding: 0;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 10px;
  color: var(--text-dim); transition: color .15s ease, border-color .15s ease;
}
.account__logout:hover { color: var(--danger); border-color: var(--danger); }

/* ---- Hero ----------------------------------------------------------------- */
.hero { text-align: center; padding: 46px 6vw 44px; }
.hero__eyebrow {
  display: inline-block; font-size: .72rem; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--blue); border: 1px solid rgba(43,155,255,.35);
  padding: 5px 13px; border-radius: 20px; margin-bottom: 22px;
}
.hero__title { font-size: clamp(2rem, 5vw, 2.9rem); font-weight: 700; line-height: 1.08; letter-spacing: -.5px; margin-bottom: 16px; }
.hero__grad { background-image: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero__sub { color: var(--text-dim); font-size: 1rem; max-width: 460px; margin: 0 auto 28px; }
.hero__cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero__stats { display: flex; gap: 44px; justify-content: center; margin-top: 40px; }
.hero__stat strong { display: block; font-family: 'Space Grotesk', sans-serif; font-size: 1.5rem; font-weight: 700; }
.hero__stat span { font-size: .82rem; color: var(--text-dim); }

/* ---- Nav de categorias ---------------------------------------------------- */
.catnav {
  display: flex; align-items: center; gap: 22px; flex-wrap: nowrap;
  position: relative; scrollbar-width: none;
}
.catnav::-webkit-scrollbar { display: none; }
.catnav__more-wrap { position: relative; }
.catnav__more { display: inline-flex; align-items: center; gap: 7px; }
.catnav__caret { width: 0; height: 0; display: inline-block; border-left: 4px solid transparent; border-right: 4px solid transparent; border-top: 5px solid currentColor; }
.catnav__dropdown {
  position: absolute; top: calc(100% + 8px); right: 0; min-width: 190px; z-index: 60;
  background: var(--bg-2); border: 1px solid var(--border-2); border-radius: 12px;
  padding: 6px; display: none; flex-direction: column; gap: 2px; box-shadow: var(--shadow);
}
.catnav__dropdown.is-open { display: flex; }
.catnav__dropdown-item {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  background: transparent; border: none; cursor: pointer; color: var(--text-dim);
  font-family: 'Inter', sans-serif; font-size: .88rem; font-weight: 600;
  padding: 9px 12px; border-radius: 8px;
}
.catnav__dropdown-item:hover { background: var(--bg-3); color: var(--text); }
.catnav__dropdown-item.is-active { background: var(--bg-3); color: var(--text); }
.catnav__chip {
  flex: 0 0 auto; cursor: pointer; white-space: nowrap;
  background: transparent; border: none; padding: 4px 1px;
  font-family: 'Inter', sans-serif; font-size: .9rem; font-weight: 500;
  color: var(--text-dim); border-bottom: 2px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}
.catnav__chip:hover { color: var(--text); }
.catnav__chip.is-active { color: var(--cat, var(--primary)); font-weight: 600; border-bottom-color: var(--cat, var(--primary)); }
.chip-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; vertical-align: middle; background: var(--text-dim); }
.chip-dot--all { background: linear-gradient(120deg, #2b9bff, #ff7a1f, #b14dff); }

/* ---- Catalogo ------------------------------------------------------------- */
.catalog { padding: 18px 6vw 70px; }
.category { margin-bottom: 44px; }
.category__title {
  font-size: 1.2rem; font-weight: 600; margin-bottom: 18px;
  padding-left: 12px; border-left: 3px solid var(--cat, var(--primary));
}
.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

.card {
  background: var(--bg-2); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; cursor: pointer;
  display: flex; flex-direction: column;
  transition: border-color .15s ease, transform .12s ease;
}
.card:hover { border-color: var(--cat, var(--border-2)); transform: translateY(-3px); }
.card__media { position: relative; }
.card__img { display: block; width: 100%; height: 156px; object-fit: cover; background: var(--bg-3); }
.card__img--placeholder {
  display: flex; align-items: center; justify-content: center; height: 156px;
  font-family: 'Space Grotesk', sans-serif; font-size: 2.6rem; font-weight: 700;
  color: var(--cat, var(--text-dim)); background: var(--bg-3);
}
.card__body { padding: 16px; display: flex; flex-direction: column; flex: 1; }
.card__title {
  font-size: 1.02rem; font-weight: 600; margin-bottom: 8px; line-height: 1.3;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; min-height: 2.6em;
}
.card__desc {
  color: var(--text-dim); font-size: .87rem; margin: 0 0 16px; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.card__footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; }
.card__price { font-size: 1.18rem; font-weight: 700; color: var(--cat, var(--primary)); }
.card__badge {
  position: absolute; top: 10px; left: 10px;
  font-size: .66rem; font-weight: 700; letter-spacing: .4px;
  padding: 4px 9px; background: rgba(0,0,0,.7); border: 1px solid var(--border-2);
  border-radius: 999px; color: var(--text);
}
.card__badge--free { left: auto; right: 10px; background: var(--free); border-color: var(--free); color: #04210c; }

/* ---- Mas vendidos (portada) ----------------------------------------------- */
.featured { padding: 14px 6vw 74px; }
.featured__title { font-size: 1.5rem; font-weight: 600; text-align: center; margin-bottom: 24px; }
/* Destacados: conjunto curado (hasta 4), tarjetas de ancho fijo centradas. */
#featured-grid { justify-content: center; grid-template-columns: repeat(auto-fit, minmax(240px, 280px)); }

/* ---- Carrito (panel lateral) --------------------------------------------- */
.cart {
  position: fixed; top: 0; right: 0; height: 100vh; width: min(420px, 92vw);
  background: var(--bg-2); border-left: 1px solid var(--border);
  box-shadow: var(--shadow); z-index: 40;
  display: flex; flex-direction: column;
  transform: translateX(105%); transition: transform .25s ease;
}
.cart.is-open { transform: translateX(0); }
.cart__header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px; border-bottom: 1px solid var(--border);
}
.cart__header h2 { font-size: 1.1rem; font-weight: 600; }
.cart__close { background: none; border: none; color: var(--text-dim); font-size: 1.3rem; cursor: pointer; line-height: 1; }
.cart__items { flex: 1; overflow: auto; padding: 12px 20px; }

.cart-row { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--border); gap: 12px; }
.cart-row__info { display: flex; flex-direction: column; }
.cart-row__name { font-weight: 600; }
.cart-row__price { color: var(--text-dim); font-size: .85rem; }
.cart-row__controls { display: flex; align-items: center; gap: 8px; }
.qty {
  width: 28px; height: 28px; border-radius: 8px; cursor: pointer;
  background: var(--bg-3); border: 1px solid var(--border); color: var(--text);
  font-size: 1rem; line-height: 1;
}
.qty:hover { border-color: var(--border-2); }
.qty__val { min-width: 22px; text-align: center; }
.cart-row__remove { background: none; border: none; color: var(--danger); cursor: pointer; font-size: 1rem; padding: 4px; }

.cart__footer { padding: 20px; border-top: 1px solid var(--border); }
.cart__total-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; font-size: 1.05rem; }
.cart__total-row strong { font-size: 1.3rem; color: var(--primary); }
.checkout-status { margin-top: 12px; font-size: .85rem; color: var(--text-dim); min-height: 1em; }
.checkout-status.is-error { color: var(--danger); }

/* ---- Modal de detalle ----------------------------------------------------- */
.modal { position: fixed; inset: 0; z-index: 50; display: none; align-items: center; justify-content: center; padding: 4vh 4vw; background: rgba(0,0,0,.72); }
.modal.is-open { display: flex; }
.modal__content {
  position: relative; width: min(720px, 100%); max-height: 92vh; overflow: auto;
  background: var(--bg-2); border: 1px solid var(--border-2);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.modal__close {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  width: 34px; height: 34px; border-radius: 50%; cursor: pointer;
  background: rgba(0,0,0,.6); border: 1px solid var(--border-2); color: #fff; font-size: 1.1rem; line-height: 1;
}
.modal__img { width: 100%; max-height: 320px; object-fit: cover; display: block; }
.modal__body { padding: 24px; }
.modal__title { font-size: 1.5rem; font-weight: 600; margin-bottom: 16px; }
.modal__desc { color: var(--text); font-size: .95rem; line-height: 1.6; }
.modal__desc img { max-width: 100%; height: auto; border-radius: 8px; }
.modal__desc h1, .modal__desc h2, .modal__desc h3 { font-size: 1.15rem; margin: 14px 0 8px; }
.modal__footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--border); }
.modal__price { font-size: 1.6rem; font-weight: 700; color: var(--primary); }

/* ---- Estados / footer ----------------------------------------------------- */
.empty { color: var(--text-dim); text-align: center; padding: 40px 0; }
.empty--error { color: var(--danger); }
.footer { text-align: center; color: var(--text-dim); font-size: .85rem; padding: 30px 6vw; border-top: 1px solid var(--border); }

@media (max-width: 720px) {
  .header { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px; }
  .catnav { order: 3; width: 100%; overflow-x: auto; }
  .hero__stats { gap: 30px; }
}

/* ---- Animaciones de entrada ----------------------------------------------- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
/* Bloques que aparecen/cambian (hero, featured, catalogo). Se re-dispara desde JS. */
.anim-in { animation: fadeUp .5s cubic-bezier(.2,.6,.2,1) both; }
/* Tarjetas: mismo fade con retardo escalonado segun --card-delay (lo setea store.js). */
.card    { animation: fadeUp .45s ease both; animation-delay: var(--card-delay, 0s); }

@media (prefers-reduced-motion: reduce) {
  .anim-in, .card { animation: none; }
}

/* ---- Pantalla de carga (splash) ------------------------------------------- */
.splash {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 45%, #14141c 0%, var(--bg) 70%);
  transition: opacity .55s ease, visibility .55s ease;
}
.splash.is-hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.splash__logo {
  width: min(180px, 40vw); height: auto;
  filter: drop-shadow(0 0 34px rgba(255,122,31,.35));
  animation: splashPulse 1.8s ease-in-out infinite;
}
@keyframes splashPulse {
  0%, 100% { transform: scale(1);    opacity: .92; }
  50%      { transform: scale(1.06); opacity: 1;   }
}
@media (prefers-reduced-motion: reduce) {
  .splash__logo { animation: none; }
}
