:root {
  --navy-900: #070f26;
  --navy-800: #0b1533;
  --navy-700: #14214a;
  --navy-600: #1d2d5e;
  --steel: #3f5f97;
  --gold: #f4b41a;
  --gold-600: #d99a06;
  --tear: #6fb6ec;
  --text: #eef2fd;
  --muted: #a9b5d6;
  --ok: #43c486;
  --err: #ff7a7a;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: Inter, system-ui, -apple-system, Segoe UI, sans-serif;
  background:
    radial-gradient(1200px 500px at 50% -200px, #1b2d66 0%, transparent 70%),
    var(--navy-800);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.5;
}
a { color: var(--gold); }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: Oswald, Impact, sans-serif; text-transform: uppercase; letter-spacing: .02em; line-height: 1.1; margin: 0 0 .5em; }
button, input, select { font: inherit; }

/* Topo */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 10px clamp(14px, 4vw, 40px);
  background: rgba(7, 15, 38, .88); backdrop-filter: blur(8px);
  border-bottom: 2px solid var(--gold);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--text); }
.brand img { width: 44px; height: auto; }
.brand b { font-family: Oswald, sans-serif; font-size: 1.25rem; white-space: nowrap; text-transform: uppercase; display: block; line-height: 1; }
.brand small { color: var(--gold); text-transform: uppercase; letter-spacing: .18em; font-size: .68rem; font-weight: 600; }
.topbar nav { display: flex; align-items: center; gap: 18px; }
.topbar nav a { color: var(--text); text-decoration: none; font-weight: 600; font-size: .95rem; }
.topbar nav a:hover { color: var(--gold); }
.cart-link { position: relative; display: inline-flex; padding: 6px; }
#cart-count[hidden] { display: none; }
#cart-count {
  position: absolute; top: -4px; right: -8px;
  background: var(--gold); color: var(--navy-900); font-size: .72rem; font-weight: 800;
  border-radius: 999px; min-width: 20px; height: 20px; display: grid; place-items: center; padding: 0 5px;
}

main { flex: 1; width: 100%; max-width: 1120px; margin: 0 auto; padding: 24px clamp(14px, 4vw, 32px) 60px; outline: none; }
.loading { padding: 60px 0; text-align: center; color: var(--muted); }

/* Hero */
.hero {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 24px;
  background: linear-gradient(135deg, var(--navy-700), var(--navy-900));
  border: 1px solid var(--navy-600); border-radius: 22px; padding: clamp(20px, 4vw, 40px);
  margin-bottom: 28px; box-shadow: var(--shadow); overflow: hidden; position: relative;
}
.hero h1 { font-size: clamp(2rem, 6vw, 3.4rem); }
.hero h1 span { color: var(--gold); }
.hero p { color: var(--muted); max-width: 46ch; margin: 0 0 4px; }
.hero img { width: clamp(110px, 20vw, 200px); filter: drop-shadow(0 12px 20px rgba(0,0,0,.5)); transform: rotate(4deg); }
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.pill { background: rgba(244, 180, 26, .12); color: var(--gold); border: 1px solid rgba(244,180,26,.35); padding: 4px 12px; border-radius: 999px; font-size: .82rem; font-weight: 600; }

/* Grade de produtos */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px; }
.card {
  background: var(--navy-700); border: 1px solid var(--navy-600); border-radius: var(--radius);
  overflow: hidden; text-decoration: none; color: var(--text); display: flex; flex-direction: column;
  transition: transform .15s, border-color .15s, box-shadow .15s;
}
.card:hover { transform: translateY(-3px); border-color: var(--gold); box-shadow: var(--shadow); }
.card .img { aspect-ratio: 1; background: #fff; display: grid; place-items: center; }
.card .img img { width: 100%; height: 100%; object-fit: cover; }
.card .body { padding: 12px 14px 16px; }
.card h3 { font-size: 1.05rem; margin: 0 0 6px; }
.price { font-weight: 800; color: var(--gold); font-size: 1.1rem; }
.price s { color: var(--muted); font-weight: 500; font-size: .85rem; margin-left: 6px; }
.from { color: var(--muted); font-size: .8rem; }

/* Produto */
.product { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(18px, 4vw, 44px); }
.gallery .main { background: #fff; border-radius: var(--radius); overflow: hidden; aspect-ratio: 1; }
.gallery .main img { width: 100%; height: 100%; object-fit: contain; }
.thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; }
.thumbs button { border: 2px solid transparent; border-radius: 10px; padding: 0; background: #fff; width: 64px; height: 64px; flex: none; cursor: pointer; overflow: hidden; }
.thumbs button[aria-current="true"] { border-color: var(--gold); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.product h1 { font-size: clamp(1.6rem, 4vw, 2.4rem); }
.product .price { font-size: 1.6rem; }
.attr { margin: 18px 0; }
.attr label { display: block; font-weight: 700; margin-bottom: 8px; font-size: .9rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt {
  min-width: 48px; padding: 9px 14px; border-radius: 10px; cursor: pointer;
  background: var(--navy-700); color: var(--text); border: 1.5px solid var(--navy-600); font-weight: 600;
}
.opt:hover { border-color: var(--steel); }
.opt[aria-pressed="true"] { border-color: var(--gold); background: rgba(244,180,26,.14); color: var(--gold); }
.opt:disabled { opacity: .35; cursor: not-allowed; text-decoration: line-through; }
.desc { color: var(--muted); margin-top: 24px; border-top: 1px solid var(--navy-600); padding-top: 16px; }
.desc img { border-radius: 8px; }

.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--navy-600); border-radius: 10px; overflow: hidden; }
.qty button { background: var(--navy-700); color: var(--text); border: 0; width: 38px; height: 40px; cursor: pointer; font-size: 1.1rem; }
.qty span { min-width: 36px; text-align: center; font-weight: 700; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--gold); color: var(--navy-900); border: 0; border-radius: 12px;
  padding: 13px 22px; font-weight: 800; cursor: pointer; text-decoration: none;
  text-transform: uppercase; letter-spacing: .04em; font-size: .95rem;
  box-shadow: 0 4px 0 var(--gold-600); transition: transform .08s, box-shadow .08s, filter .15s;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--gold-600); }
.btn:disabled { filter: grayscale(.6) brightness(.8); cursor: not-allowed; }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; color: var(--text); border: 1.5px solid var(--navy-600); box-shadow: none; }
.btn.ghost:hover { border-color: var(--gold); color: var(--gold); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

/* Painéis */
.panel { background: var(--navy-700); border: 1px solid var(--navy-600); border-radius: var(--radius); padding: clamp(16px, 3vw, 24px); }
.two { display: grid; grid-template-columns: 1.4fr 1fr; gap: 22px; align-items: start; }
.line { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--navy-600); }
.line:last-child { border-bottom: 0; }
.line img { width: 64px; height: 64px; border-radius: 8px; object-fit: cover; background: #fff; }
.line .name { font-weight: 600; }
.line .meta { color: var(--muted); font-size: .85rem; }
.link-btn { background: none; border: 0; color: var(--muted); cursor: pointer; text-decoration: underline; font-size: .82rem; padding: 0; }
.sum { display: flex; justify-content: space-between; padding: 6px 0; color: var(--muted); }
.sum.total { color: var(--text); font-weight: 800; font-size: 1.2rem; border-top: 1px solid var(--navy-600); margin-top: 8px; padding-top: 12px; }
.sum.total span:last-child { color: var(--gold); }

/* Formulários */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.field label { font-size: .82rem; font-weight: 600; color: var(--muted); }
.field input, .field select {
  background: var(--navy-900); border: 1.5px solid var(--navy-600); color: var(--text);
  border-radius: 10px; padding: 11px 12px; outline: none; width: 100%;
}
.field input:focus { border-color: var(--gold); }
.grid-form { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0 12px; }
.c2 { grid-column: span 2; } .c3 { grid-column: span 3; } .c4 { grid-column: span 4; } .c6 { grid-column: span 6; } .c1 { grid-column: span 1; }
.ship-opts { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.ship-opt { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1.5px solid var(--navy-600); border-radius: 10px; cursor: pointer; }
.ship-opt:has(input:checked) { border-color: var(--gold); background: rgba(244,180,26,.08); }
.ship-opt input { accent-color: var(--gold); }
.ship-opt .grow { flex: 1; }
.ship-opt small { color: var(--muted); display: block; }

.msg { padding: 10px 12px; border-radius: 10px; margin: 10px 0; font-size: .92rem; }
.msg.err { background: rgba(255,122,122,.12); color: var(--err); border: 1px solid rgba(255,122,122,.35); }
.msg.ok { background: rgba(67,196,134,.12); color: var(--ok); border: 1px solid rgba(67,196,134,.35); }
.muted { color: var(--muted); }
.center { text-align: center; }

/* Pix */
.pix { display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center; }
.pix .qr { background: #fff; padding: 12px; border-radius: 14px; width: 240px; }
.copy-box { display: flex; gap: 8px; margin: 12px 0; }
.copy-box input { flex: 1; min-width: 0; font-family: ui-monospace, monospace; font-size: .8rem; }
.timer { font-family: Oswald, sans-serif; font-size: 1.6rem; color: var(--gold); }
.pulse { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--gold); margin-right: 8px; animation: pulse 1.2s infinite; }
@keyframes pulse { 50% { opacity: .25; } }

/* Linha do tempo */
.steps { list-style: none; padding: 0; margin: 20px 0; display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; counter-reset: s; }
.steps li { text-align: center; font-size: .78rem; color: var(--muted); position: relative; padding-top: 42px; }
.steps li::before {
  counter-increment: s; content: counter(s);
  position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--navy-900); border: 2px solid var(--navy-600); font-weight: 800; color: var(--muted);
}
.steps li.done { color: var(--text); }
.steps li.now { color: var(--gold); }
.steps li.done::before { content: "✓"; background: var(--gold); border-color: var(--gold); color: var(--navy-900); }
.steps li.now::before { border-color: var(--gold); color: var(--gold); }

.empty { text-align: center; padding: 50px 10px; }
.empty img { width: 120px; margin: 0 auto 16px; opacity: .9; }

#toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 120px);
  background: var(--gold); color: var(--navy-900); font-weight: 700; padding: 12px 20px; border-radius: 12px;
  box-shadow: var(--shadow); transition: transform .25s, visibility .25s; z-index: 50; max-width: 90vw; visibility: hidden;
}
#toast.show { transform: translate(-50%, 0); visibility: visible; }

.footer { text-align: center; color: var(--muted); font-size: .8rem; padding: 26px 16px 34px; border-top: 1px solid var(--navy-700); }
.footer img { width: 36px; margin: 0 auto 8px; opacity: .8; }

@media (max-width: 820px) {
  .product, .two, .pix { grid-template-columns: 1fr; }
  .pix .qr { margin: 0 auto; }
  .hero { grid-template-columns: 1fr; text-align: center; }
  .hero img { margin: 0 auto; order: -1; }
  .hero p { margin-inline: auto; }
  .pill-row { justify-content: center; }
  .grid-form { grid-template-columns: repeat(2, 1fr); }
  .c1, .c2 { grid-column: span 1; } .c3, .c4, .c6 { grid-column: span 2; }
  .steps li { font-size: .68rem; }
  .topbar nav a:not(.cart-link) { font-size: .85rem; }
}
@media (max-width: 420px) { .brand small { display: none; } .brand b { font-size: 1.05rem; } .brand img { width: 36px; } .topbar nav { gap: 12px; } }
