:root {
  --bg: #13123A;
  --bg-deep: #0D0C29;
  --surface: #1B1A4B;
  --surface-hover: #22215C;
  --ink: #FFFFFF;
  --ink-muted: #CBD5E1;
  --gold: #D4A338;
  --gold-bright: #F0C45A;
  --gold-soft: rgba(212, 163, 56, 0.14);
  --mp-blue: #009EE3;
  --mp-blue-dark: #007EB5;
  --badge-red: #E11D48;
  --green: #22C55E;
  --border: rgba(212, 163, 56, 0.24);
  --radius: 12px;
  --shadow: 0 14px 36px rgba(0, 0, 0, 0.36);
  --font-serif: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
.container { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 20px; }

/* Marketplace Header (Amazon + Mercado Livre) */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg-deep);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}
.topbar-main {
  display: flex; align-items: center; gap: 18px;
  padding: 12px 0;
}
.brand {
  display: flex; align-items: center; gap: 10px; flex-shrink: 0;
  font-family: var(--font-serif); font-size: 1.15rem; font-weight: 700;
  color: var(--gold); letter-spacing: 0.04em;
}
.brand-logo {
  width: 40px; height: 40px; object-fit: cover; border-radius: 9px;
  border: 1px solid var(--border);
}

.search-bar {
  flex: 1; display: flex; align-items: center;
  background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 10px; overflow: hidden;
}
.search-bar input {
  flex: 1; background: transparent; border: none; color: #FFF;
  padding: 10px 14px; font-size: 0.95rem; font-family: inherit;
}
.search-bar input::placeholder { color: #94A3B8; }
.search-bar input:focus { outline: none; }
.search-bar button {
  background: var(--gold); color: var(--bg-deep); border: none;
  padding: 10px 18px; font-weight: 700; cursor: pointer; font-size: 0.9rem;
}
.header-cta { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* Category Strip (Shopee / Mercado Livre) */
.cat-strip {
  display: flex; align-items: center; gap: 10px; overflow-x: auto;
  padding: 10px 0 12px; border-top: 1px solid rgba(212, 163, 56, 0.12);
  scrollbar-width: none;
}
.cat-strip::-webkit-scrollbar { display: none; }
.cat-pill {
  white-space: nowrap; padding: 6px 14px; border-radius: 999px;
  font-size: 0.84rem; font-weight: 600; cursor: pointer;
  background: var(--surface); color: var(--ink-muted);
  border: 1px solid rgba(212, 163, 56, 0.18); transition: all 0.2s;
}
.cat-pill:hover, .cat-pill.active {
  background: var(--gold); color: var(--bg-deep); border-color: var(--gold);
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 20px; border-radius: 9px; font-weight: 700; font-size: 0.92rem;
  cursor: pointer; border: none; transition: all 0.2s ease;
}
.btn-gold { background: linear-gradient(135deg, var(--gold-bright), var(--gold)); color: var(--bg-deep); }
.btn-gold:hover { filter: brightness(1.07); transform: translateY(-1px); }
.btn-mp { background: var(--mp-blue); color: #FFF; }
.btn-mp:hover { background: var(--mp-blue-dark); transform: translateY(-1px); }
.btn-outline { background: transparent; border: 1.5px solid var(--gold); color: var(--gold); }
.btn-outline:hover { background: var(--gold); color: var(--bg-deep); }
.btn-sm { padding: 8px 14px; font-size: 0.84rem; }
.btn-block { width: 100%; }

/* Banner + Trust Strip (Mercado Livre) */
.hero-banner-section { padding: 22px 0 10px; background: var(--bg-deep); }
.brand-banner-img {
  display: block; width: 100%; max-height: 280px; object-fit: cover;
  border-radius: 14px; border: 1px solid var(--border); box-shadow: var(--shadow);
}
.ml-trust-bar {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
  margin-top: 16px; padding-bottom: 18px;
}
.ml-trust-item {
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; display: flex; align-items: center; gap: 10px; font-size: 0.86rem;
}
.ml-trust-icon { font-size: 1.25rem; color: var(--gold); flex-shrink: 0; }
.ml-trust-item strong { display: block; color: #FFF; font-size: 0.88rem; }
.ml-trust-item span { color: var(--ink-muted); font-size: 0.78rem; }

/* Catalog Toolbar & Grid (Amazon + Shopee) */
.catalog-section { padding: 36px 0 64px; }
.catalog-toolbar {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center;
  gap: 14px; margin-bottom: 24px;
}
.catalog-toolbar h1, .catalog-toolbar h2 { font-family: var(--font-serif); font-size: 1.65rem; }
.catalog-meta { display: flex; align-items: center; gap: 12px; font-size: 0.9rem; color: var(--ink-muted); }
.sort-select {
  background: var(--surface); color: #FFF; border: 1px solid var(--border);
  border-radius: 8px; padding: 8px 12px; font-size: 0.88rem; font-family: inherit;
}

.marketplace-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px;
}
.product-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; justify-content: space-between;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.product-card:hover {
  transform: translateY(-4px); border-color: var(--gold);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.42);
}
.card-cover {
  position: relative; padding: 20px 18px; min-height: 215px;
  background: linear-gradient(155deg, #1E1D57 0%, #0D0C29 100%);
  border-bottom: 1px solid var(--border);
  display: flex; flex-direction: column; justify-content: space-between;
}
.card-badges {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
}
.badge-tag {
  background: var(--gold); color: var(--bg-deep); font-size: 0.7rem; font-weight: 800;
  padding: 3px 8px; border-radius: 5px; text-transform: uppercase;
}
.badge-off {
  background: var(--badge-red); color: #FFF; font-size: 0.7rem; font-weight: 800;
  padding: 3px 8px; border-radius: 5px;
}
.card-cover-center { text-align: center; padding: 10px 0; }
.card-emblem {
  width: 52px; height: 42px; object-fit: cover; border-radius: 7px;
  border: 1px solid rgba(212, 163, 56, 0.35); margin-bottom: 8px;
}
.card-cover-title {
  font-family: var(--font-serif); font-size: 1.15rem; line-height: 1.25; color: #FFF;
}
.card-cover-author { font-size: 0.72rem; color: var(--gold); text-transform: uppercase; letter-spacing: 0.06em; }

.card-body { padding: 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card-cat { font-size: 0.74rem; color: var(--gold); font-weight: 700; text-transform: uppercase; }
.card-title { font-family: var(--font-serif); font-size: 1.05rem; line-height: 1.3; color: #FFF; }
.card-rating { font-size: 0.82rem; color: var(--gold-bright); display: flex; align-items: center; gap: 6px; }
.card-rating span { color: var(--ink-muted); font-size: 0.78rem; }
.card-price-block { margin-top: auto; padding-top: 8px; }
.card-old-price { font-size: 0.8rem; color: #94A3B8; text-decoration: line-through; }
.card-price { font-size: 1.45rem; font-weight: 800; color: #FFF; line-height: 1.15; }
.card-mp-info { font-size: 0.76rem; color: #7DD3FC; font-weight: 600; margin-top: 2px; }
.card-actions { display: grid; gap: 8px; margin-top: 12px; }

/* Product Page (Amazon 3-column Buy Box) */
.breadcrumb { padding: 18px 0 8px; font-size: 0.85rem; color: var(--ink-muted); }
.breadcrumb a:hover { color: var(--gold); }
.pdp-grid {
  display: grid; grid-template-columns: 300px 1fr 330px; gap: 32px;
  padding: 20px 0 64px; align-items: start;
}
.pdp-cover-box {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; text-align: center;
}
.book-3d {
  width: 100%; min-height: 340px; padding: 26px 20px;
  background: linear-gradient(155deg, #1E1D57 0%, #0D0C29 100%);
  border-radius: 6px 14px 14px 6px; border: 1px solid rgba(212, 163, 56, 0.45);
  box-shadow: -10px 14px 30px rgba(0,0,0,0.45);
  display: flex; flex-direction: column; justify-content: space-between; text-align: left;
}
.book-emblem { width: 58px; height: 46px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.book-tag { font-size: 0.72rem; color: var(--gold); font-weight: 700; text-transform: uppercase; margin-top: 10px; }
.book-title { font-family: var(--font-serif); font-size: 1.45rem; margin: 10px 0; color: #FFF; }
.book-sub { font-size: 0.82rem; color: var(--ink-muted); }
.book-footer { border-top: 1px solid var(--border); padding-top: 10px; font-size: 0.72rem; color: var(--gold); text-transform: uppercase; }

.pdp-info h1 { font-family: var(--font-serif); font-size: clamp(1.75rem, 3vw, 2.3rem); margin-bottom: 10px; }
.pdp-sub { font-size: 1.05rem; color: var(--ink-muted); margin-bottom: 16px; }
.benefits-list { list-style: none; display: grid; gap: 10px; margin: 18px 0 26px; }
.benefits-list li { padding-left: 24px; position: relative; font-size: 0.95rem; }
.benefits-list li::before { content: '✓'; position: absolute; left: 0; color: var(--gold); font-weight: 800; }

.toc-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.toc-item { padding: 12px 0; border-bottom: 1px solid var(--border); }
.toc-item:last-child { border-bottom: none; padding-bottom: 0; }
.toc-cap { font-size: 0.75rem; font-weight: 700; color: var(--gold); text-transform: uppercase; }
.toc-title { font-weight: 600; color: #FFF; }
.toc-desc { font-size: 0.88rem; color: var(--ink-muted); }

.buy-box {
  position: sticky; top: 130px;
  background: var(--surface); border: 1.5px solid var(--gold); border-radius: var(--radius);
  padding: 24px; box-shadow: var(--shadow); display: grid; gap: 14px;
}
.mp-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(0, 158, 227, 0.14); border: 1px solid rgba(0, 158, 227, 0.4);
  color: #7DD3FC; padding: 7px 12px; border-radius: 8px; font-size: 0.8rem; font-weight: 700;
}
.buy-price-old { text-decoration: line-through; color: #94A3B8; font-size: 0.9rem; }
.buy-price-now { font-size: 2.1rem; font-weight: 800; color: #FFF; line-height: 1.1; }
.buy-meta { font-size: 0.84rem; color: var(--ink-muted); display: grid; gap: 6px; }

/* Lead Box & Editorial Pillars */
section.section-alt { background: var(--bg-deep); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 56px 0; }
.pillars-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.pillar-num { font-family: var(--font-serif); font-size: 1.25rem; font-weight: 700; color: var(--gold); margin-bottom: 8px; }
.card h3 { font-family: var(--font-serif); font-size: 1.15rem; margin-bottom: 8px; }
.card p { font-size: 0.92rem; color: var(--ink-muted); }

.lead-section { padding: 56px 0; }
.lead-box {
  background: linear-gradient(135deg, #1B1A4B, #0D0C29); border: 1px solid var(--border);
  border-radius: 16px; padding: 40px; display: grid; grid-template-columns: 1.1fr 0.9fr; gap: 36px; align-items: center;
}
.lead-box h2 { font-family: var(--font-serif); font-size: 1.9rem; margin-bottom: 10px; }
.lead-box p { color: var(--ink-muted); }
.lead-form {
  background: var(--bg); border: 1px solid var(--border); border-radius: 12px;
  padding: 24px; display: grid; gap: 12px;
}
.lead-form label { font-size: 0.82rem; font-weight: 600; color: var(--gold); display: block; margin-bottom: 4px; }
.lead-form input {
  width: 100%; padding: 10px 12px; background: var(--bg-deep); color: #FFF;
  border: 1px solid var(--border); border-radius: 8px; font-size: 0.92rem;
}
.form-msg { font-size: 0.88rem; padding: 9px 12px; border-radius: 8px; display: none; }
.form-msg.ok { display: block; background: rgba(34, 197, 94, 0.16); color: #86EFAC; border: 1px solid rgba(34, 197, 94, 0.4); }
.form-msg.err { display: block; background: rgba(239, 68, 68, 0.16); color: #FCA5A5; border: 1px solid rgba(239, 68, 68, 0.4); }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(6, 5, 20, 0.8);
  display: none; place-items: center; padding: 20px; z-index: 60;
}
.modal-backdrop.open { display: grid; }
.modal {
  background: var(--surface); max-width: 650px; width: 100%; max-height: 85vh; overflow-y: auto;
  border: 1px solid var(--border); border-radius: 16px; padding: 32px; position: relative;
}
.modal-close { position: absolute; top: 14px; right: 18px; background: none; border: none; font-size: 1.6rem; color: var(--gold); cursor: pointer; }
.modal-body p { margin-top: 14px; line-height: 1.75; color: var(--ink-muted); }

footer { padding: 36px 0; background: var(--bg-deep); border-top: 1px solid var(--border); color: var(--ink-muted); font-size: 0.88rem; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px; align-items: center; }

@media (max-width: 1080px) {
  .marketplace-grid { grid-template-columns: repeat(3, 1fr); }
  .pdp-grid { grid-template-columns: 1fr; }
  .buy-box { position: static; }
}
@media (max-width: 760px) {
  .topbar-main { flex-wrap: wrap; }
  .header-cta { display: none; }
  .ml-trust-bar, .pillars-grid, .lead-box { grid-template-columns: 1fr; }
  .marketplace-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
}
@media (max-width: 480px) {
  .marketplace-grid { grid-template-columns: 1fr; }
}
