:root {
  --bg: #0b0d14;
  --panel: #141823;
  --panel-2: #1b2030;
  --line: #262d40;
  --text: #f2f4fa;
  --muted: #8f98b3;
  --accent: #f5c542;
  --brand: #7c3aed;
  --danger: #f87171;
  --ok: #4ade80;
  color-scheme: dark;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 system-ui, -apple-system, 'Segoe UI', sans-serif; min-height: 100vh; }
a { color: var(--accent); }
img { max-width: 100%; }
button, .btn { font: inherit; cursor: pointer; border: 0; border-radius: 10px; padding: 10px 16px; background: var(--brand); color: #fff; text-decoration: none; display: inline-block; text-align: center; transition: filter .15s, transform .05s; }
button:hover, .btn:hover { filter: brightness(1.1); }
button:active { transform: translateY(1px); }
button:disabled { opacity: .5; cursor: not-allowed; filter: none; }
button.secondary, .btn.secondary { background: transparent; border: 1px solid var(--line); color: var(--text); }
button.buy { background: #f2f4fa; color: #0b0d14; font-weight: 600; width: 100%; }
button.buy:hover { background: #fff; }
button.ghost { background: var(--panel-2); color: var(--text); width: 100%; }

/* Topo */
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 16px; padding: 12px 20px; background: rgba(11,13,20,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { font-weight: 900; letter-spacing: 3px; color: var(--accent); text-decoration: none; font-size: 22px; }
.nav { display: flex; gap: 16px; margin-left: 8px; }
.nav a { color: var(--muted); text-decoration: none; font-weight: 600; }
.nav a:hover { color: var(--text); }
.search { flex: 1; max-width: 360px; margin-left: auto; }
.search input { width: 100%; background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; font: inherit; }
.cart-btn { background: var(--text); color: var(--bg); border-radius: 10px; padding: 9px 14px; text-decoration: none; font-weight: 600; white-space: nowrap; }
.cart-btn .badge { background: var(--brand); color: #fff; border-radius: 999px; padding: 1px 8px; margin-left: 6px; font-size: 12px; }

main { max-width: 1140px; margin: 0 auto; padding: 20px 16px 48px; }

/* Abas de categoria */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 20px; }
.tab { background: var(--panel); color: var(--muted); border: 1px solid var(--line); border-radius: 999px; padding: 7px 16px; }
.tab.active { background: var(--text); color: var(--bg); border-color: var(--text); }

.section-title { display: flex; align-items: center; gap: 10px; margin: 28px 0 12px; font-size: 18px; font-weight: 800; }
.section-title::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* Grade de produtos */
.grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; }
.tile-ravok {
  border-color: #f87171;
  box-shadow: 0 12px 28px rgba(127, 29, 29, .3);
}
.tile-ravok .art { background: #8f1111 !important; }
.art { position: relative; aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center; padding: 14px; text-align: center; background: var(--art, #333); }
.art::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 30% 20%, rgba(255,255,255,.35), transparent 55%), repeating-linear-gradient(45deg, rgba(0,0,0,.08) 0 10px, transparent 10px 20px); }
.art span { position: relative; font-weight: 900; font-size: 26px; letter-spacing: 1px; color: #fff; text-shadow: 0 2px 10px rgba(0,0,0,.45); text-transform: uppercase; line-height: 1.1; }
.art-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.art.has-img span { display: none; }
.art small { display: block; font-size: 12px; font-weight: 700; letter-spacing: 2px; opacity: .9; margin-top: 6px; }
.tile-body { padding: 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.tile-name { font-weight: 700; }
.tile-desc { color: var(--muted); font-size: 13px; flex: 1; }
.price { font-size: 18px; font-weight: 800; color: var(--text); }
.tile-actions { display: grid; gap: 6px; margin-top: 4px; }

/* Rodapé */
footer { border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; text-align: center; padding: 20px; }
.note { color: var(--muted); font-size: 14px; margin-top: 24px; }
.error { color: var(--danger); font-size: 13px; }
.hidden { display: none !important; }

/* Checkout */
.checkout { display: grid; gap: 20px; max-width: 880px; margin: 0 auto; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 18px; }
.panel h2 { margin: 0 0 12px; font-size: 18px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
form { display: grid; gap: 12px; }
label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
input[type="text"], input[type="email"], input[type="password"], input[type="date"], input[type="search"], select { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); border-radius: 10px; padding: 10px; font: inherit; }
.check { display: flex; gap: 8px; align-items: flex-start; color: var(--text); }
.pix { display: grid; gap: 10px; justify-items: start; }
.pix img { width: 220px; max-width: 100%; background: #fff; border-radius: 10px; padding: 8px; }
.pix code { display: block; word-break: break-all; background: var(--panel-2); border: 1px solid var(--line); padding: 10px; border-radius: 10px; font-size: 12px; width: 100%; }
.status { font-weight: 700; }
.status.approved { color: var(--ok); }
.status.pending { color: var(--accent); }
.status.refunded, .status.rejected, .status.cancelled { color: var(--danger); }

/* Painel administrativo */
.kpis { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px; }
.kpi span { color: var(--muted); font-size: 13px; }
.kpi strong { display: block; font-size: 22px; color: var(--accent); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0; }
.table-wrap { overflow-x: auto; }

@media (max-width: 720px) {
  .nav { display: none; }
  .topbar { flex-wrap: wrap; }
  .search { order: 3; max-width: none; width: 100%; margin-left: 0; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .art span { font-size: 20px; }
}
