/* ============================================================
   NEXA STORE — DESIGN SYSTEM TOKENS
   Premium FiveM marketplace. Dark graphite + royal violet,
   cold cyan for technical metadata. Space Grotesk / Inter / JetBrains Mono.
   ============================================================ */

:root {
  /* ---- Surface hierarchy (near-black graphite, violet undertone) ---- */
  --bg-base:      #08070C;   /* page background, deepest */
  --bg-deep:      #0A0912;   /* deep blue-black wash */
  --surface-1:    #100E18;   /* raised section */
  --surface-2:    #161320;   /* card */
  --surface-3:    #1D1929;   /* card hover / nested */
  --surface-4:    #251F35;   /* elevated control */

  /* ---- Hairlines & borders (no thick borders) ---- */
  --line-soft:    rgba(255,255,255,0.06);
  --line:         rgba(255,255,255,0.09);
  --line-strong:  rgba(255,255,255,0.14);
  --line-violet:  rgba(124,92,255,0.34);

  /* ---- Brand: refined royal violet ---- */
  --violet-300:   #C3B5FF;
  --violet-400:   #9B82FF;
  --violet-500:   #7C5CFF;   /* PRIMARY brand */
  --violet-600:   #6743F0;
  --violet-700:   #5733D6;
  --violet-ink:   #1C1340;   /* violet-tinted dark fill */

  /* ---- Secondary accent: cold electric cyan (metadata only) ---- */
  --cyan-300:     #8FF4F6;
  --cyan-400:     #3FE0EA;
  --cyan-500:     #20C9D6;
  --cyan-ink:     #08272B;

  /* ---- Lavender highlight ---- */
  --lavender:     #B7AEE6;

  /* ---- Text ---- */
  --text-hi:      #F4F3FA;   /* primary, soft white */
  --text:         #C6C3D4;   /* default body */
  --text-mid:     #908CA3;   /* secondary gray */
  --text-low:     #66617A;   /* muted technical metadata */
  --text-faint:   #443F58;

  /* ---- Status ---- */
  --ok:           #3FD08A;
  --ok-ink:       #0C2A1E;
  --warn:         #F2B23E;
  --warn-ink:     #2C200A;
  --err:          #F25555;
  --err-ink:      #2C1012;
  --info:         var(--cyan-400);

  /* ---- Glow (carefully designed, restrained) ---- */
  --glow-violet:  0 0 0 1px rgba(124,92,255,.18), 0 18px 50px -18px rgba(124,92,255,.45);
  --glow-cyan:    0 0 24px -6px rgba(63,224,234,.45);

  /* ---- Shadows (layered depth, soft) ---- */
  --sh-sm:  0 1px 2px rgba(0,0,0,.4);
  --sh-md:  0 8px 24px -12px rgba(0,0,0,.6);
  --sh-lg:  0 24px 60px -24px rgba(0,0,0,.7);
  --sh-xl:  0 40px 90px -40px rgba(0,0,0,.8);

  /* ---- Radius (controlled, not oversized) ---- */
  --r-xs: 6px;
  --r-sm: 9px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --r-pill: 999px;

  /* ---- Spacing scale (4-based) ---- */
  --s1: 4px;  --s2: 8px;  --s3: 12px; --s4: 16px; --s5: 20px;
  --s6: 24px; --s7: 32px; --s8: 40px; --s9: 48px; --s10: 64px;
  --s11: 80px; --s12: 96px; --s13: 128px;

  /* ---- Layout ---- */
  --container: 1240px;
  --container-wide: 1400px;
  --header-h: 68px;

  /* ---- Type families ---- */
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  /* ---- Motion ---- */
  --ease: cubic-bezier(.4, 0, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --t-fast: .14s;
  --t: .22s;
  --t-slow: .4s;
}

/* ============================================================
   RESET / BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

body {
  font-family: var(--font-body);
  background: var(--bg-base);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv11", "ss01";
}

h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  color: var(--text-hi);
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-weight: 600;
  text-wrap: balance;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
img, svg, video { display: block; max-width: 100%; }
ul { list-style: none; padding: 0; }
input, textarea, select { font-family: inherit; }

::selection { background: rgba(124,92,255,.32); color: #fff; }

:focus-visible {
  outline: 2px solid var(--violet-400);
  outline-offset: 2px;
  border-radius: 3px;
}

/* ============================================================
   TYPE SCALE UTILITIES
   ============================================================ */
.t-display { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.03em; line-height: 1.02; font-size: clamp(2.6rem, 6vw, 4.6rem); }
.t-h1 { font-size: clamp(2rem, 4vw, 3rem); }
.t-h2 { font-size: clamp(1.7rem, 3vw, 2.35rem); }
.t-h3 { font-size: clamp(1.25rem, 2vw, 1.55rem); }
.t-h4 { font-size: 1.15rem; }
.t-lead { font-size: clamp(1.02rem, 1.4vw, 1.18rem); color: var(--text); line-height: 1.62; }
.t-body { font-size: 1rem; }
.t-sm { font-size: 0.875rem; }
.t-xs { font-size: 0.78rem; }

/* monospace technical metadata — compact, tracked, selective */
.mono {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-low);
  font-feature-settings: "zero" 1;
}
.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--violet-400);
  font-weight: 500;
}

/* ============================================================
   LAYOUT HELPERS
   ============================================================ */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--s6); }
.container-wide { max-width: var(--container-wide); }
.section { padding-block: clamp(var(--s10), 9vw, var(--s13)); }
.stack > * + * { margin-top: var(--s4); }

/* ============================================================
   BUTTONS — full hierarchy
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  font-family: var(--font-body); font-weight: 600; font-size: 0.92rem;
  letter-spacing: -0.01em; white-space: nowrap;
  padding: 0 var(--s5); height: 44px; border-radius: var(--r-sm);
  transition: transform var(--t-fast) var(--ease), background var(--t) var(--ease),
              box-shadow var(--t) var(--ease), border-color var(--t) var(--ease), color var(--t) var(--ease);
  user-select: none;
}
.btn:active { transform: translateY(1px) scale(.992); }
.btn svg { width: 17px; height: 17px; }

.btn-primary {
  background: linear-gradient(180deg, var(--violet-500), var(--violet-600));
  color: #fff;
  box-shadow: 0 1px 0 0 rgba(255,255,255,.16) inset, 0 12px 30px -12px rgba(124,92,255,.7);
}
.btn-primary:hover { background: linear-gradient(180deg, var(--violet-400), var(--violet-500)); box-shadow: 0 1px 0 0 rgba(255,255,255,.2) inset, 0 16px 38px -12px rgba(124,92,255,.85); }

.btn-secondary {
  background: var(--surface-3);
  color: var(--text-hi);
  box-shadow: inset 0 0 0 1px var(--line);
}
.btn-secondary:hover { background: var(--surface-4); box-shadow: inset 0 0 0 1px var(--line-strong); }

.btn-ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
.btn-ghost:hover { color: var(--text-hi); background: rgba(255,255,255,.03); box-shadow: inset 0 0 0 1px var(--line-strong); }

.btn-text { height: auto; padding: 0; background: none; color: var(--violet-300); font-weight: 600; }
.btn-text:hover { color: var(--violet-400); }

.btn-danger { background: var(--err-ink); color: #FF9B9B; box-shadow: inset 0 0 0 1px rgba(242,85,85,.35); }
.btn-danger:hover { background: rgba(242,85,85,.16); }

.btn-icon { width: 40px; height: 40px; padding: 0; border-radius: var(--r-sm); background: transparent; color: var(--text-mid); box-shadow: inset 0 0 0 1px var(--line); }
.btn-icon:hover { color: var(--text-hi); background: rgba(255,255,255,.04); box-shadow: inset 0 0 0 1px var(--line-strong); }

.btn-lg { height: 52px; font-size: 1rem; padding-inline: var(--s7); border-radius: var(--r-md); }
.btn-sm { height: 36px; font-size: 0.84rem; padding-inline: var(--s4); }
.btn-block { width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }

/* ============================================================
   BADGES — product + status
   ============================================================ */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-family: var(--font-mono); font-size: 0.66rem; font-weight: 500;
  letter-spacing: 0.08em; text-transform: uppercase;
  padding: 4px 9px; border-radius: var(--r-xs); line-height: 1;
  white-space: nowrap;
}
.badge .dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

.badge-escrow   { color: var(--violet-300); background: rgba(124,92,255,.12); box-shadow: inset 0 0 0 1px rgba(124,92,255,.28); }
.badge-open     { color: var(--cyan-300); background: rgba(63,224,234,.10); box-shadow: inset 0 0 0 1px rgba(63,224,234,.26); }
.badge-new      { color: #B8F5D4; background: rgba(63,208,138,.12); box-shadow: inset 0 0 0 1px rgba(63,208,138,.3); }
.badge-updated  { color: var(--cyan-300); background: rgba(63,224,234,.10); box-shadow: inset 0 0 0 1px rgba(63,224,234,.24); }
.badge-featured { color: #FFE3A3; background: rgba(242,178,62,.12); box-shadow: inset 0 0 0 1px rgba(242,178,62,.3); }
.badge-best     { color: #FFD9A8; background: rgba(242,140,62,.12); box-shadow: inset 0 0 0 1px rgba(242,140,62,.3); }
.badge-soon     { color: var(--text-mid); background: rgba(255,255,255,.05); box-shadow: inset 0 0 0 1px var(--line); }
.badge-sale     { color: #FFB8B8; background: rgba(242,85,85,.12); box-shadow: inset 0 0 0 1px rgba(242,85,85,.3); }
.badge-solid    { color: #fff; background: var(--violet-600); }

/* technical/meta chip */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.78rem; color: var(--text-mid);
  padding: 6px 11px; border-radius: var(--r-pill);
  background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line);
}
.chip svg { width: 14px; height: 14px; color: var(--text-low); }

/* ============================================================
   SURFACES / CARDS
   ============================================================ */
.surface {
  background: var(--surface-2);
  border-radius: var(--r-lg);
  box-shadow: inset 0 0 0 1px var(--line-soft);
}
.panel {
  background:
    linear-gradient(180deg, rgba(255,255,255,.02), transparent 40%),
    var(--surface-1);
  border-radius: var(--r-lg);
  box-shadow: inset 0 0 0 1px var(--line-soft);
}

/* fine grid + grain textures (atmospheric, subtle) */
.grid-bg {
  background-image:
    linear-gradient(to right, rgba(255,255,255,.025) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255,255,255,.025) 1px, transparent 1px);
  background-size: 56px 56px;
}
.grain::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.035'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}

/* ============================================================
   LUCIDE ICONS — one consistent family, sized by context
   ============================================================ */
svg.lucide { width: 18px; height: 18px; stroke-width: 2; flex: 0 0 auto; }
i[data-lucide] { display: inline-flex; width: 18px; height: 18px; }
.ic-14 { width: 14px !important; height: 14px !important; }
.ic-15 { width: 15px !important; height: 15px !important; }
.ic-16 { width: 16px !important; height: 16px !important; }
.ic-18 { width: 18px !important; height: 18px !important; }
.ic-20 { width: 20px !important; height: 20px !important; }
.ic-22 { width: 22px !important; height: 22px !important; }
.ic-28 { width: 28px !important; height: 28px !important; }
.ic-34 { width: 34px !important; height: 34px !important; }
.btn svg.lucide, .btn i[data-lucide] { width: 17px; height: 17px; }
.btn-lg svg.lucide { width: 18px; height: 18px; }
.btn-sm svg.lucide { width: 15px; height: 15px; }
/* brand glyph (Discord) — kept as the single non-Lucide mark */
.glyph { width: 18px; height: 18px; flex: 0 0 auto; }

/* ============================================================
   PRODUCT MEDIA — clean, bright, never crushed
   ============================================================ */
.media-frame {
  position: relative; overflow: hidden; background: var(--bg-deep);
  border-radius: inherit;
}
.media-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-frame.contain img { object-fit: contain; }
/* ambient brand glow behind media, very light */
.media-frame::before {
  content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(120% 80% at 50% 0%, rgba(124,92,255,.10), transparent 60%);
}
.media-frame img { position: relative; z-index: 1; }
/* only a whisper of bottom gradient, applied just where badges/labels sit */
.media-shade-top::after {
  content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: linear-gradient(180deg, rgba(8,7,12,.42) 0%, transparent 26%);
}
/* play overlay for products with video */
.media-play {
  position: absolute; inset: 0; z-index: 3; display: grid; place-items: center;
  background: rgba(8,7,12,.18); opacity: 0; transition: opacity var(--t) var(--ease);
}
.media-frame:hover .media-play { opacity: 1; }
.media-play .pp {
  width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(124,92,255,.92); color: #fff; box-shadow: 0 8px 28px -6px rgba(124,92,255,.7);
}
.media-play .pp svg { width: 22px; height: 22px; }

/* branded fallback (no good media) — never imitates a game UI */
.media-fallback {
  position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px; text-align: center; padding: var(--s6);
  background:
    linear-gradient(180deg, var(--surface-1), var(--bg-deep)),
    linear-gradient(to right, rgba(255,255,255,.03) 1px, transparent 1px) 0 0 / 34px 34px,
    linear-gradient(to bottom, rgba(255,255,255,.03) 1px, transparent 1px) 0 0 / 34px 34px;
}
.media-fallback img.fb-logo { width: 34px; height: 34px; opacity: .9; }
.media-fallback .fb-cat { font-family: var(--font-mono); font-size: .64rem; letter-spacing: .16em; text-transform: uppercase; color: var(--violet-300); }
.media-fallback .fb-name { font-family: var(--font-display); font-size: 1.05rem; color: var(--text-hi); }

/* ============================================================
   CARD SYSTEM — exactly 3 variants
   ============================================================ */
.card {
  position: relative; display: flex; flex-direction: column;
  background: var(--surface-2); border-radius: var(--r-lg); overflow: hidden;
  box-shadow: inset 0 0 0 1px var(--line-soft);
  transition: transform var(--t) var(--ease-out), box-shadow var(--t) var(--ease-out);
}
.card:hover { transform: translateY(-4px); box-shadow: inset 0 0 0 1px var(--line-strong), var(--sh-lg); }

.card-media { position: relative; aspect-ratio: 16/9; overflow: hidden; background: var(--bg-deep); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--t-slow) var(--ease-out); }
.card:hover .card-media img { transform: scale(1.035); }

.card-badges { position: absolute; top: 12px; left: 12px; display: flex; gap: 6px; z-index: 4; }
.card-quick {
  position: absolute; top: 12px; right: 12px; z-index: 4;
  width: 34px; height: 34px; border-radius: var(--r-sm); display: grid; place-items: center;
  background: rgba(8,7,12,.55); backdrop-filter: blur(6px); box-shadow: inset 0 0 0 1px var(--line);
  color: var(--text-hi); opacity: 0; transform: translateY(-4px); transition: all var(--t) var(--ease);
}
.card:hover .card-quick { opacity: 1; transform: none; }
.card-quick:hover { background: rgba(124,92,255,.4); }

.card-body { padding: var(--s5); display: flex; flex-direction: column; flex: 1; }
.card-cat { font-family: var(--font-mono); font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; color: var(--text-low); }
.card-title { font-size: 1.16rem; margin-top: 9px; letter-spacing: -0.02em; }
.card-desc {
  color: var(--text-mid); font-size: .9rem; margin-top: 9px; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--s4); }
.card-tags .tg {
  font-family: var(--font-mono); font-size: .64rem; letter-spacing: .05em; color: var(--text-mid);
  padding: 4px 9px; border-radius: 6px; background: var(--surface-1); box-shadow: inset 0 0 0 1px var(--line-soft);
}
.card-meta { margin-top: var(--s4); display: flex; align-items: center; gap: var(--s5); font-size: .76rem; color: var(--text-low); }
.card-meta .mt { display: flex; align-items: center; gap: 6px; }
.card-foot {
  margin-top: auto; padding-top: var(--s5); display: flex; align-items: center;
  justify-content: space-between; gap: var(--s4);
}
.card-foot .actions { display: flex; align-items: center; gap: var(--s3); }

/* price block (shared) */
.price { display: flex; flex-direction: column; gap: 2px; }
.price .row { display: flex; align-items: baseline; gap: 8px; }
.price .now { font-family: var(--font-display); font-size: 1.45rem; font-weight: 600; color: var(--text-hi); letter-spacing: -0.02em; line-height: 1; }
.price .was { font-size: .9rem; color: var(--text-low); text-decoration: line-through; }
.price .lic { font-size: .66rem; color: var(--text-low); font-family: var(--font-mono); letter-spacing: .08em; text-transform: uppercase; }

/* ---- B. Featured editorial card ---- */
.card-editorial { display: grid; grid-template-columns: 1.04fr .96fr; }
.card-editorial .card-media { aspect-ratio: auto; height: 100%; min-height: 340px; }
.card-editorial .card-body { padding: clamp(var(--s6), 3vw, var(--s8)); justify-content: center; }
.card-editorial .card-title { font-size: clamp(1.6rem, 2.4vw, 2rem); margin-top: 12px; }
.card-editorial .card-desc { font-size: 1rem; -webkit-line-clamp: 3; max-width: 46ch; }
.card-editorial .feat-row { display: flex; align-items: center; gap: 10px; }

/* ---- C. Compact horizontal card ---- */
.card-compact { display: grid; grid-template-columns: 38% 1fr; align-items: stretch; min-height: 116px; }
.card-compact .card-media { aspect-ratio: auto; height: 100%; min-width: 130px; }
.card-compact .card-body { padding: var(--s4) var(--s5); }
.card-compact .card-title { font-size: 1rem; margin-top: 6px; }
.card-compact .card-desc { font-size: .82rem; margin-top: 6px; -webkit-line-clamp: 2; }
.card-compact .card-foot { padding-top: var(--s3); }
.card-compact .price .now { font-size: 1.15rem; }

@media (max-width: 900px) {
  .card-editorial { grid-template-columns: 1fr; }
  .card-editorial .card-media { aspect-ratio: 3/2; height: auto; min-height: 0; }
}
