:root {
  color-scheme: dark;
  --bg: #0f131c;
  --surface: #171d29;
  --surface-2: #1f2733;
  --surface-3: #28313f;
  --header: #0c1119;
  --header-2: #141b27;
  --line: #28313f;
  --line-2: #3a4556;
  --text: #e7ebf3;
  --muted: #94a0b6;
  --blue: #3b82f6;
  --green: #22c55e;
  --green-2: #19a64c;
  --gold: #f5a623;
  --gold-2: #ffc456;
  --red: #ef4759;
  --cyan: #38bdf8;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  --shadow-2: 0 8px 26px rgba(0, 0, 0, 0.5);
  --sans: "Segoe UI", system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0; min-height: 100vh; color: var(--text); font-family: var(--sans);
  display: flex; flex-direction: column; /* rodapé sempre no fundo (sticky footer) */
  background: var(--bg) radial-gradient(1400px 420px at 50% -140px, rgba(245, 166, 35, 0.12), transparent 70%) no-repeat;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-2); }
h1, h2, h3, h4 { color: var(--text); margin: 0 0 8px; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.center { text-align: center; }
.hidden { display: none !important; }
::selection { background: rgba(245, 166, 35, 0.3); }

/* ---------- header ---------- */
.site-header { background: linear-gradient(180deg, var(--header-2), var(--header)); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); position: sticky; top: 0; z-index: 50; }
.header-inner { max-width: 1600px; margin: 0 auto; padding: 0 32px; height: 60px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; font-size: 20px; font-weight: 800; color: #fff; letter-spacing: 0.3px; }
.brand span { color: var(--gold); }
.brand .tag-loja { font-size: 11px; font-weight: 800; color: #4a3100; background: var(--gold); padding: 3px 8px; border-radius: 6px; letter-spacing: 1px; }
nav { display: flex; align-items: center; gap: 14px; }
.navlink { font-size: 14px; font-weight: 600; color: rgba(255, 255, 255, 0.74); }
.navlink:hover { color: #fff; }
.cart-btn { position: relative; background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.14); color: #fff; border-radius: 10px; height: 38px; padding: 0 14px; cursor: pointer; font-size: 15px; transition: background 0.15s; }
.cart-btn:hover { background: rgba(255, 255, 255, 0.14); }
.cart-count { position: absolute; top: -7px; right: -7px; background: var(--gold); color: #3a2700; font-size: 11px; font-weight: 800; min-width: 19px; height: 19px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; padding: 0 5px; }
.cart-count.zero { display: none; }
.btn-login { background: var(--gold); color: #3a2700; border: 0; border-radius: 10px; height: 38px; padding: 0 16px; font-weight: 800; cursor: pointer; font-size: 14px; }
.btn-login:hover { background: var(--gold-2); }
.auth-pill { display: inline-flex; align-items: center; gap: 9px; padding: 5px 10px 5px 6px; border-radius: 999px; background: rgba(255, 255, 255, 0.07); border: 1px solid rgba(255, 255, 255, 0.14); }
.auth-pill img { width: 28px; height: 28px; border-radius: 7px; image-rendering: pixelated; }
.auth-pill .who { font-size: 13px; font-weight: 700; color: #fff; max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auth-pill button { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 12px; }
.auth-pill button:hover { color: var(--red); }

/* ---------- layout ---------- */
.wrap { width: 100%; max-width: 1600px; margin: 0 auto; padding: 34px 32px 56px; flex: 1; } /* flex:1 empurra o rodapé p/ baixo */
.hero { text-align: center; margin: 10px 0 38px; }
.hero h1 { font-size: 40px; font-weight: 800; }
.hero h1 span { color: var(--gold); }
.hero-sub { color: var(--muted); font-size: 15px; max-width: 620px; margin: 0 auto; }
.shop-layout { display: grid; grid-template-columns: 230px 1fr; gap: 34px; align-items: start; }

/* categorias */
.cats { position: sticky; top: 80px; display: flex; flex-direction: column; gap: 6px; }
.cat-tab { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 11px; border: 1px solid transparent; background: transparent; color: var(--muted); cursor: pointer; font-size: 14px; font-weight: 600; text-align: left; transition: background 0.14s, color 0.14s; }
.cat-tab:hover { background: var(--surface); color: var(--text); }
.cat-tab.active { background: var(--surface-2); color: #fff; border-color: var(--line-2); }
.cat-tab .ico { font-size: 18px; }

/* secções de categoria (todas na página) + grelha de itens */
.catalog { display: flex; flex-direction: column; gap: 40px; }
.cat-section { scroll-margin-top: 80px; } /* não fica escondida sob o header ao saltar */
.cat-section-title { display: flex; align-items: center; gap: 10px; font-size: 21px; font-weight: 800; color: #fff; margin: 0 0 18px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.cat-section-title .ico { font-size: 23px; }
.catalog-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; }
.card { background: linear-gradient(180deg, var(--surface), var(--surface-2)); border: 1px solid var(--line); border-radius: 16px; padding: 22px; display: flex; flex-direction: column; gap: 10px; position: relative; overflow: hidden; transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s; }
.card::before { content: ""; position: absolute; inset: 0 0 auto; height: 4px; background: var(--accent, var(--gold)); opacity: 0.9; }
.card:hover { transform: translateY(-3px); border-color: var(--line-2); box-shadow: var(--shadow-2); }
.card .icon { font-size: 42px; line-height: 1; }
.card .name { font-size: 17px; font-weight: 800; color: #fff; }
.card .desc { font-size: 13px; color: var(--muted); line-height: 1.45; flex: 1; }
.card .badge { position: absolute; top: 14px; right: 14px; font-size: 10px; font-weight: 800; letter-spacing: 0.6px; color: #3a2700; background: var(--gold); padding: 3px 8px; border-radius: 6px; }
.card .price-row { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.card .price { font-size: 19px; font-weight: 800; color: var(--gold); }
.btn-add { background: var(--surface-3); color: #fff; border: 1px solid var(--line-2); border-radius: 10px; height: 36px; padding: 0 14px; font-weight: 700; cursor: pointer; font-size: 13px; transition: background 0.14s; }
.btn-add:hover { background: var(--gold); color: #3a2700; border-color: var(--gold); }
.btn-add.added { background: var(--green-2); border-color: var(--green-2); color: #fff; }

/* ---------- botões ---------- */
.btn-primary { background: var(--gold); color: #3a2700; border: 0; border-radius: 11px; height: 44px; padding: 0 20px; font-weight: 800; cursor: pointer; font-size: 15px; transition: background 0.14s, opacity 0.14s; }
.btn-primary:hover { background: var(--gold-2); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }
.block { width: 100%; }

/* ---------- drawer carrinho ---------- */
.overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.55); z-index: 60; }
.drawer { position: fixed; top: 0; right: 0; width: 380px; max-width: 92vw; height: 100%; background: var(--surface); border-left: 1px solid var(--line); z-index: 70; display: flex; flex-direction: column; box-shadow: var(--shadow-2); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.drawer-head h3 { margin: 0; }
.drawer-body { flex: 1; overflow-y: auto; padding: 14px 20px; display: flex; flex-direction: column; gap: 12px; }
.drawer-empty { color: var(--muted); text-align: center; margin-top: 40px; }
.cart-line { display: flex; gap: 12px; align-items: center; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.cart-line .ci { font-size: 26px; }
.cart-line .cinfo { flex: 1; min-width: 0; }
.cart-line .cname { font-weight: 700; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-line .cprice { font-size: 12px; color: var(--gold); }
.qty { display: flex; align-items: center; gap: 6px; }
.qty button { width: 26px; height: 26px; border-radius: 7px; border: 1px solid var(--line-2); background: var(--surface-3); color: #fff; cursor: pointer; font-size: 15px; line-height: 1; }
.qty button:hover { background: var(--surface); }
.qty span { min-width: 18px; text-align: center; font-weight: 700; font-size: 14px; }
.drawer-foot { padding: 16px 20px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 12px; }
.cart-total { display: flex; justify-content: space-between; align-items: baseline; }
.cart-total strong { font-size: 22px; color: var(--gold); }
.x { background: none; border: 0; color: var(--muted); font-size: 18px; cursor: pointer; line-height: 1; }
.x:hover { color: #fff; }

/* ---------- modais ---------- */
.modal { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.6); z-index: 80; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-card { background: var(--surface); border: 1px solid var(--line-2); border-radius: 18px; padding: 26px; width: 100%; max-width: 420px; position: relative; box-shadow: var(--shadow-2); }
.modal-card .x { position: absolute; top: 16px; right: 18px; }
.modal-card form { display: flex; flex-direction: column; gap: 13px; margin-top: 14px; }
.modal-card label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.modal-card input { background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 10px; height: 42px; padding: 0 13px; color: var(--text); font-size: 15px; }
.modal-card input:focus { outline: none; border-color: var(--gold); }
.form-err { color: var(--red); font-size: 13px; margin: 0; }
.done-emoji { font-size: 52px; margin-bottom: 6px; }

/* nick checkout */
.nick-row { display: flex; gap: 14px; align-items: flex-start; margin: 16px 0; }
.nick-head { width: 64px; height: 64px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-2); display: flex; align-items: center; justify-content: center; font-size: 30px; flex-shrink: 0; image-rendering: pixelated; overflow: hidden; }
.nick-head img { width: 100%; height: 100%; image-rendering: pixelated; }
.nick-input-wrap { flex: 1; }
.nick-input-wrap input { width: 100%; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 10px; height: 46px; padding: 0 14px; color: var(--text); font-size: 16px; font-weight: 600; }
.nick-input-wrap input:focus { outline: none; border-color: var(--gold); }
.nick-status { display: block; font-size: 13px; margin-top: 7px; min-height: 18px; }
.nick-status.ok { color: var(--green); }
.nick-status.bad { color: var(--red); }
.nick-status.checking { color: var(--muted); }
.checkout-summary { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; margin-bottom: 16px; font-size: 13px; }
.checkout-summary .ln { display: flex; justify-content: space-between; padding: 3px 0; }
.checkout-summary .ttl { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 8px; font-weight: 800; }
.checkout-summary .ttl span:last-child { color: var(--gold); }

/* ---------- footer ---------- */
.site-footer { text-align: center; color: var(--muted); font-size: 13px; padding: 30px 0 40px; border-top: 1px solid var(--line); margin-top: 20px; }

/* ---------- responsivo ---------- */
@media (max-width: 820px) {
  .shop-layout { grid-template-columns: 1fr; }
  .cats { position: static; flex-direction: row; flex-wrap: wrap; }
  .hero h1 { font-size: 28px; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
