/* ============================================================================
   CRIMSON SHOP · NEON CARDS
   ----------------------------------------------------------------------------
   Novo visual dos cards de produto (fundo escuro, borda holográfica, hover
   elevado, entrada escalonada) + badges neon flutuantes sobre a mídia do
   produto + cabeçalho da seção "Featured Products".

   ► CARREGUE DEPOIS de styles.css e theme.css:
         <link rel="stylesheet" href="neon-cards.css" />
   ► As regras usam o prefixo ".product-grid" e, quando precisam vencer o
     tema (styles.css / theme.css), repetem a classe do card
     (".product-card.product-card"). Esse truque de especificidade garante que
     o visual neon prevaleça sem nenhum !important e independente da ordem
     de carregamento dos arquivos.
   ► Nenhuma classe existente é removida ou renomeada: .product-card,
     .product-icon, .product-topline, .game-label, .product-number,
     .product-description, .product-price, .add-button, .calculator-card,
     .product-card.skeleton, .calculator-result e .robux-input-label
     continuam funcionando exatamente como antes.
   ========================================================================== */

/* ───────────────────────────────────────────────────────────────────────────
   1. TOKENS NEON
   Redeclarados aqui para que este arquivo não dependa da ordem de
   carregamento (nem de styles.css / theme.css).
   ─────────────────────────────────────────────────────────────────────────── */
/* A paleta (carmim/ônix) fica centralizada no neon-base.css — aqui só
   ficam os tokens exclusivos dos cards, para não haver duas palettes
   competindo (a do base usa html:root e venceria esta). */
html:root {
  --neon-ease: cubic-bezier(.22, 1, .36, 1);
  --neon-stagger: 40ms;
  --neon-card-radius: 18px;
}

/* ───────────────────────────────────────────────────────────────────────────
   2. CARD — base, hover e anel holográfico
   ─────────────────────────────────────────────────────────────────────────── */
.product-grid .product-card.product-card {
  position: relative;
  isolation: isolate;
  background: rgba(15, 14, 15, .84);
  border: 1px solid var(--neon-line);
  border-radius: var(--neon-card-radius);
  color: var(--neon-ink);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .38);
  transition: all .32s var(--neon-ease);
}

/* Anel holográfico: gradiente recortado em 1px sobre a borda do card. */
.product-grid .product-card.product-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  padding: 1px;
  border-radius: inherit;
  background: var(--holo-gradient);
  background-size: 220% 220%;
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask-composite: exclude;
  opacity: 0;
  pointer-events: none;
  transition: opacity .32s var(--neon-ease);
  animation: neon-holo-drift 7s linear infinite paused;
}

/* Hover: elevação + glow neon + anel holográfico aceso. */
.product-grid .product-card.product-card:hover {
  transform: translateY(-6px);
  background: rgba(23, 24, 38, .94);
  border-color: rgba(168, 85, 247, .55);
  box-shadow:
    0 22px 48px rgba(0, 0, 0, .55),
    0 0 0 1px rgba(168, 85, 247, .45),
    0 0 24px rgba(168, 85, 247, .35),
    0 0 48px rgba(34, 211, 238, .18);
}

.product-grid .product-card.product-card:hover::before {
  opacity: 1;
  animation-play-state: running;
}

/* Tema claro: mantém a identidade neon escura do card. */
body[data-theme="light"] .product-grid .product-card.product-card {
  background: rgba(15, 14, 15, .92);
  border-color: var(--neon-line);
  color: var(--neon-ink);
}

body[data-theme="light"] .product-grid .product-card.product-card:hover {
  background: rgba(23, 24, 38, .97);
  border-color: rgba(168, 85, 247, .55);
}

/* ───────────────────────────────────────────────────────────────────────────
   3. ENTRADA ESCALONADA (fade-up, stagger de 40ms)
   O atributo data-neon-intro="on" é aplicado uma única vez pela primeira
   renderização real de produtos (app.js › renderProducts), evitando que a
   animação repita a cada busca/filtro/adição ao carrinho.
   ─────────────────────────────────────────────────────────────────────────── */
.product-grid[data-neon-intro="on"] .product-card:not(.skeleton) {
  animation: neon-fade-up .55s var(--neon-ease) backwards;
  animation-delay: calc(min(var(--i, 0), 14) * var(--neon-stagger));
}

/* ───────────────────────────────────────────────────────────────────────────
   4. MÍDIA DO PRODUTO (wrapper novo que ancora os badges)
   ─────────────────────────────────────────────────────────────────────────── */
.product-grid .product-media {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 112px;
  margin-bottom: 13px;
  border-radius: 14px;
  overflow: hidden;
  background:
    radial-gradient(120% 92% at 50% 0%, rgba(168, 85, 247, .18), transparent 62%),
    radial-gradient(96% 84% at 100% 100%, rgba(34, 211, 238, .14), transparent 58%),
    var(--neon-base);
  box-shadow: inset 0 0 0 1px var(--neon-line);
  transition: box-shadow .32s var(--neon-ease);
}

.product-grid .product-card.product-card:hover .product-media {
  box-shadow: inset 0 0 0 1px rgba(168, 85, 247, .45), 0 0 22px rgba(168, 85, 247, .16);
}

/* Com imagem: a imagem preenche a mídia. */
/* FIX: o .product-icon legado é `display:grid` e a <img> usava `height:100%`.
   Num grid, isso resolvia para 37px (altura do conteúdo) enquanto a imagem
   tinha 260px — ela transbordava e era CORTADA pelo overflow do .product-media.
   → display:block + aspect-ratio 1/1: a caixa tem altura real e a imagem
   preenche sem distorcer nem cortar. */
.product-grid .product-media .product-icon.has-image {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  margin: 0;
  border: 0;
  border-radius: inherit;
  background: var(--neon-base);
  overflow: hidden;
}

.product-grid .product-media .product-icon.has-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  border-radius: inherit;
}

/* Sem imagem: o ícone vira um chip neon centralizado no palco. */
.product-grid .product-media .product-icon:not(.has-image) {
  width: 62px;
  height: 62px;
  margin: 0;
  border-radius: 16px;
  border: 1px solid rgba(34, 211, 238, .38);
  background: linear-gradient(145deg, rgba(168, 85, 247, .18), rgba(34, 211, 238, .10));
  color: var(--neon-cyan);
  box-shadow: 0 0 18px rgba(168, 85, 247, .22), inset 0 0 16px rgba(34, 211, 238, .12);
}

.product-grid .product-media .product-icon:not(.has-image) .game-icon {
  width: 30px;
  height: 30px;
  color: var(--neon-cyan);
}

/* ───────────────────────────────────────────────────────────────────────────
   5. BADGES NEON (flutuantes sobre a mídia)
   Decorativos: todos carregam aria-hidden="true". O nome do jogo continua
   no .game-label e o status de estoque no .product-price small, então
   nenhuma informação essencial existe apenas dentro dos badges.
   ─────────────────────────────────────────────────────────────────────────── */
.neon-badge {
  --badge-color: var(--neon-cyan);
  --badge-glow: 34, 211, 238;

  position: absolute;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  max-width: calc(100% - 20px);
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(var(--badge-glow), .45);
  background: rgba(8, 9, 16, .62);
  -webkit-backdrop-filter: blur(8px) saturate(150%);
  backdrop-filter: blur(8px) saturate(150%);
  color: var(--badge-color);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 0 10px rgba(var(--badge-glow), .55);
  box-shadow:
    0 0 12px rgba(var(--badge-glow), .38),
    0 0 26px rgba(var(--badge-glow), .16),
    0 6px 18px rgba(0, 0, 0, .45);
  pointer-events: none;
}

/* Selo promocional — canto superior esquerdo. */
.neon-badge--discount {
  top: 10px;
  left: 10px;
  --badge-color: var(--neon-pink);
  --badge-glow: 255, 46, 136;
}

/* Tom do selo promocional (varia por produto, see app.js › renderProducts). */
.neon-badge--tone-hot { --badge-color: var(--neon-pink); --badge-glow: 255, 46, 136; }
.neon-badge--tone-top { --badge-color: var(--neon-yellow); --badge-glow: 255, 212, 38; }
.neon-badge--tone-novo { --badge-color: var(--neon-purple); --badge-glow: 168, 85, 247; }
.neon-badge--tone-destaque { --badge-color: var(--neon-cyan); --badge-glow: 34, 211, 238; }

/* Selo de prazo/estoque — canto superior direito. */
.neon-badge--time {
  top: 10px;
  right: 10px;
  --badge-color: var(--neon-green);
  --badge-glow: 34, 227, 154;
}

.neon-badge--time.is-backorder { --badge-color: var(--neon-yellow); --badge-glow: 255, 212, 38; }
.neon-badge--time.is-soldout { --badge-color: var(--neon-red); --badge-glow: 255, 59, 92; }

/* Selo de categoria — canto inferior esquerdo. */
.neon-badge--category {
  bottom: 10px;
  left: 10px;
  --badge-color: var(--neon-cyan);
  --badge-glow: 34, 211, 238;
}

/* ───────────────────────────────────────────────────────────────────────────
   6. TOPLINE, TÍTULO, DESCRIÇÃO, PREÇO E BOTÃO
   ─────────────────────────────────────────────────────────────────────────── */
.product-grid .product-card.product-card .product-topline {
  margin-bottom: 9px;
}

.product-grid .product-card.product-card .game-label {
  color: var(--neon-cyan);
  border-color: rgba(34, 211, 238, .4);
  background: rgba(34, 211, 238, .10);
  text-shadow: 0 0 10px rgba(34, 211, 238, .45);
  box-shadow: 0 0 12px rgba(34, 211, 238, .16);
}

.product-grid .product-card.product-card .product-number {
  color: var(--neon-muted);
  font-variant-numeric: tabular-nums;
}

.product-grid .product-card.product-card h3 {
  color: var(--neon-ink);
  letter-spacing: -.025em;
  font-weight: 700;
  text-shadow: 0 0 18px rgba(168, 85, 247, .16);
}

.product-grid .product-card.product-card .product-description {
  color: var(--neon-muted);
  letter-spacing: -.005em;
}

.product-grid .product-card.product-card .product-price strong {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--neon-green);
  background-image: linear-gradient(96deg, var(--neon-green) 0%, var(--neon-cyan) 48%, var(--neon-purple) 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 0 10px rgba(34, 227, 154, .28));
}

.product-grid .product-card.product-card .product-price small {
  color: var(--neon-muted);
}

/* Botão "Adicionar ao pedido" com glow neon verde/violeta. */
.product-grid .product-card.product-card .add-button {
  border-radius: 12px;
  border: 1px solid rgba(34, 227, 154, .32);
  background: linear-gradient(180deg, rgba(34, 227, 154, .10), rgba(34, 227, 154, .03));
  color: var(--neon-ink);
  font-weight: 700;
  transition: all .3s var(--neon-ease);
}

.product-grid .product-card.product-card .add-button > span:first-child {
  color: var(--neon-ink);
  font-size: 10px;
  letter-spacing: .01em;
}

.product-grid .product-card.product-card .add-button > span:last-child {
  flex: none;
  color: var(--neon-green);
  font-size: 15px;
  text-shadow: 0 0 12px rgba(34, 227, 154, .6);
  transition: text-shadow .3s var(--neon-ease);
}

.product-grid .product-card.product-card .add-button:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: var(--neon-green);
  background: linear-gradient(180deg, rgba(34, 227, 154, .20), rgba(168, 85, 247, .14));
  box-shadow:
    0 0 0 1px rgba(34, 227, 154, .28),
    0 0 18px rgba(34, 227, 154, .40),
    0 0 38px rgba(168, 85, 247, .22);
}

.product-grid .product-card.product-card .add-button:hover:not(:disabled) > span:last-child {
  text-shadow: 0 0 16px rgba(34, 227, 154, .9);
}

.product-grid .product-card.product-card .add-button:disabled {
  opacity: .5;
  cursor: not-allowed;
  background: rgba(17, 18, 28, .72);
  border-color: var(--neon-line);
  color: var(--neon-muted);
}

.product-grid .product-card.product-card .add-button:disabled > span {
  color: var(--neon-muted);
  text-shadow: none;
}

/* ───────────────────────────────────────────────────────────────────────────
   7. CALCULADORA DE ROBUX
   ─────────────────────────────────────────────────────────────────────────── */
.product-grid .product-card.product-card.calculator-card {
  background: linear-gradient(160deg, rgba(168, 85, 247, .14), rgba(17, 18, 28, .92) 62%);
  border-color: rgba(168, 85, 247, .34);
}

.product-grid .product-card.product-card.calculator-card:hover {
  background: linear-gradient(160deg, rgba(168, 85, 247, .20), rgba(23, 24, 38, .96) 62%);
  border-color: rgba(168, 85, 247, .6);
}

.product-grid .product-card.product-card .robux-input-label {
  color: var(--neon-muted);
}

.product-grid .product-card.product-card .robux-input-label input {
  border-radius: 10px;
  border-color: var(--neon-line);
  background: var(--neon-base);
  color: var(--neon-ink);
}

.product-grid .product-card.product-card .robux-input-label input:focus {
  border-color: var(--neon-purple);
  box-shadow: 0 0 0 3px rgba(168, 85, 247, .22);
}

.product-grid .product-card.product-card .calculator-result {
  border-radius: 10px;
  border-color: rgba(168, 85, 247, .32);
  background: rgba(168, 85, 247, .08);
  color: var(--neon-ink);
}

.product-grid .product-card.product-card .calculator-result strong {
  color: var(--neon-purple);
  text-shadow: 0 0 12px rgba(168, 85, 247, .45);
}

/* ───────────────────────────────────────────────────────────────────────────
   8. SKELETON (loading) — preserva o shimmer original
   ─────────────────────────────────────────────────────────────────────────── */
.product-grid .product-card.product-card.skeleton {
  background: linear-gradient(90deg, var(--neon-surface-2) 25%, var(--neon-line) 50%, var(--neon-surface-2) 75%);
  background-size: 200% 100%;
  border-color: var(--neon-line);
  box-shadow: none;
}

.product-grid .product-card.product-card.skeleton::before {
  opacity: 0;
}

/* ───────────────────────────────────────────────────────────────────────────
   9. SEÇÃO "FEATURED PRODUCTS" — cabeçalho + botão outline
   .neon-section-head / .neon-section-head-icon / .neon-section-title /
   .neon-section-sub / .neon-outline-btn
   As mesmas regras se aplicam ao .section-heading já existente no HTML,
   para que o markup atual continue funcionando.
   ─────────────────────────────────────────────────────────────────────────── */
.neon-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}

.neon-section-head > div {
  display: flex;
  align-items: center;
  gap: 13px;
}

.neon-section-head-icon {
  flex: none;
  color: var(--neon-yellow);
  font-size: 24px;
  line-height: 1;
  filter: drop-shadow(0 0 8px rgba(255, 212, 38, .85));
  animation: neon-pulse 2.8s ease-in-out infinite;
}

.neon-section-title {
  margin: 0;
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 750;
  letter-spacing: -.035em;
  line-height: 1.1;
  background: var(--holo-gradient);
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: neon-holo-drift 8s linear infinite;
}

.neon-section-sub {
  margin: 0;
  max-width: 345px;
  color: var(--neon-muted);
  font-size: 11px;
  line-height: 1.7;
}

.neon-outline-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid rgba(34, 211, 238, .45);
  background: rgba(34, 211, 238, .06);
  color: var(--neon-cyan);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  text-shadow: 0 0 10px rgba(34, 211, 238, .5);
  transition: all .3s var(--neon-ease);
}

.neon-outline-btn:hover {
  transform: translateY(-2px);
  border-color: var(--neon-cyan);
  background: rgba(34, 211, 238, .12);
  box-shadow: 0 0 20px rgba(34, 211, 238, .35);
}

.neon-outline-btn:active {
  transform: scale(.98);
}

/* Aplicação no cabeçalho existente (.section-heading) do catálogo. */
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 30px;
}

.section-heading .eyebrow {
  color: var(--neon-cyan);
  letter-spacing: .21em;
}

.section-heading .eyebrow-line {
  background: linear-gradient(90deg, var(--neon-cyan), var(--neon-purple));
  box-shadow: 0 0 10px rgba(34, 211, 238, .6);
}

.section-heading h2 {
  letter-spacing: -.04em;
  background: var(--holo-gradient);
  background-size: 220% auto;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: neon-holo-drift 9s linear infinite;
}

.section-heading > p {
  max-width: 345px;
  margin: 0;
  color: var(--neon-muted);
  font-size: 11px;
  line-height: 1.7;
}

/* ───────────────────────────────────────────────────────────────────────────
   10. KEYFRAMES
   ─────────────────────────────────────────────────────────────────────────── */
@keyframes neon-fade-up {
  from { opacity: 0; transform: translateY(18px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes neon-holo-drift {
  0% { background-position: 0% 50%; }
  100% { background-position: 220% 50%; }
}

@keyframes neon-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .72; transform: scale(.92); }
}

/* ───────────────────────────────────────────────────────────────────────────
   11. RESPONSIVO
   ─────────────────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .section-heading > p {
    max-width: 100%;
  }
}

@media (max-width: 620px) {
  .neon-badge {
    font-size: 9px;
    padding: 3px 8px;
    letter-spacing: .03em;
  }

  /* O nome do jogo já aparece no .game-label: o selo de categoria sai
     para evitar sobreposição com o selo de prazo em telas estreitas. */
  .neon-badge--category {
    display: none;
  }

  .product-grid .product-media {
    min-height: 96px;
  }

  .product-grid .product-card.product-card .product-price strong {
    font-size: 13px;
  }

  .product-grid .product-card.product-card .add-button > span:first-child {
    font-size: 9px;
  }
}

@media (max-width: 420px) {
  .neon-badge--time {
    max-width: 58%;
  }
}

/* ───────────────────────────────────────────────────────────────────────────
   12. PREFERÊNCIA POR MENOS MOVIMENTO
   ─────────────────────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .product-grid .product-card,
  .product-grid .product-card::before,
  .product-grid .product-media,
  .product-grid .product-icon,
  .product-grid .product-icon img,
  .product-grid .add-button,
  .product-grid .add-button > span:last-child,
  .neon-badge,
  .neon-section-head-icon,
  .neon-section-title,
  .neon-outline-btn,
  .section-heading h2 {
    animation: none !important;
    transition: none !important;
  }

  .product-grid[data-neon-intro="on"] .product-card:not(.skeleton) {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }

  .product-grid .product-card:hover {
    transform: none;
  }
}

/* ════════════════════════════════════════════════════════════════════
   ISOLAMENTO DOS BADGES DOS CARDS
   O .neon-badge do neon-header.css posiciona o contador do carrinho em
   top:-6px; right:-6px. Sem reset, os badges dos cards herdavam esse
   top/right e se sobrepunham no canto superior esquerdo.
   O reset é escopado em .product-media para não afetar o header.
   ════════════════════════════════════════════════════════════════════ */
.product-media .neon-badge{
  top: auto;
  right: auto;
  bottom: auto;
  left: auto;
}
.product-media .neon-badge--discount{top:10px; left:10px; right:auto; bottom:auto}
.product-media .neon-badge--time{top:10px; right:10px; left:auto; bottom:auto}
.product-media .neon-badge--category{bottom:10px; left:10px; top:auto; right:auto}
