/* ============================================================
   Hub de Vendas — Design System
   Paleta: Dark luxury com acento dourado e CTA verde esmeralda
   Fontes: Playfair Display (títulos) + Inter (UI)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;0,700;1,400&family=Inter:wght@300;400;500;600&display=swap');

/* ── Tokens ─────────────────────────────────────────────── */
:root {
  --bg-deep:      #09090F;
  --bg-surface:   #111118;
  --bg-card:      #16161F;
  --bg-card-hover:#1C1C28;
  --gold-bright:  #D4A94A;
  --gold-dim:     #8A6A28;
  --gold-glow:    rgba(212, 169, 74, 0.15);
  --cta-green:    #1DB954;
  --cta-green-hv: #17A349;
  --text-primary: #F0EDE6;
  --text-second:  #9A9AA8;
  --text-muted:   #5A5A6A;
  --border-subtle:#222232;
  --border-gold:  rgba(212, 169, 74, 0.35);
  --radius-card:  12px;
  --radius-btn:   8px;
  --transition:   180ms ease;
}

@media (prefers-color-scheme: light) {
  :root {
    /* O site tem identidade dark — mantemos dark mesmo em sistema claro */
    color-scheme: dark;
  }
}

/* ── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; color-scheme: dark; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
a   { color: inherit; text-decoration: none; }

/* ── Tipografia ──────────────────────────────────────────── */
.serif { font-family: 'Playfair Display', Georgia, serif; }

h1, h2, h3 { font-family: 'Playfair Display', Georgia, serif; line-height: 1.2; }
h1 { font-size: clamp(2rem, 5vw, 3.5rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); font-weight: 600; }
h3 { font-size: 1.25rem; font-weight: 600; }

/* ── Layout ──────────────────────────────────────────────── */
.container {
  width: min(1200px, 100% - 2rem);
  margin-inline: auto;
  padding-inline: 1rem;
}

/* ── Header ──────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(9, 9, 15, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 1rem;
}

.logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--gold-bright);
  letter-spacing: -0.02em;
}

.logo span { color: var(--text-primary); }

.nav-links { display: flex; gap: 1.5rem; align-items: center; }
.nav-links a {
  font-size: .875rem;
  color: var(--text-second);
  transition: color var(--transition);
}
.nav-links a:hover { color: var(--gold-bright); }

/* ── Hero principal (index) ──────────────────────────────── */
.site-hero {
  text-align: center;
  padding: 5rem 1rem 4rem;
  position: relative;
}

.site-hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse 70% 60% at 50% 0%, var(--gold-glow), transparent 70%);
  pointer-events: none;
}

.site-hero .eyebrow {
  display: inline-block;
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--gold-bright);
  margin-bottom: 1rem;
  border: 1px solid var(--border-gold);
  padding: .25rem .75rem;
  border-radius: 20px;
}

.site-hero h1 { margin-bottom: 1rem; }
.site-hero p  { color: var(--text-second); max-width: 55ch; margin-inline: auto; }

/* ── Filtro de categorias ─────────────────────────────────── */
.filter-bar {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  justify-content: center;
  padding: 0 1rem 2.5rem;
}

.filter-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-second);
  padding: .375rem 1rem;
  border-radius: 20px;
  font-size: .8125rem;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all var(--transition);
}

.filter-btn:hover,
.filter-btn.active {
  background: var(--gold-glow);
  border-color: var(--gold-dim);
  color: var(--gold-bright);
}

/* ── Grid de produtos ─────────────────────────────────────── */
.products-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  padding-bottom: 5rem;
}

/* ── Card de produto ─────────────────────────────────────── */
.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
  position: relative;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-gold);
  box-shadow: 0 16px 48px rgba(0,0,0,.5), 0 0 0 1px var(--border-gold);
}

.product-card:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 2px;
}

.card-cover {
  aspect-ratio: 3/4;
  overflow: hidden;
  position: relative;
  background: var(--bg-surface);
}

.card-cover img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 320ms ease;
}

.product-card:hover .card-cover img { transform: scale(1.04); }

.card-cover-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--bg-surface) 0%, var(--bg-card) 100%);
  color: var(--text-muted);
  font-size: 3rem;
}

/* Badges */
.badge {
  position: absolute; top: .75rem; left: .75rem;
  font-size: .65rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  padding: .2rem .55rem; border-radius: 4px;
}

.badge-new        { background: #1DB954; color: #000; }
.badge-bestseller { background: var(--gold-bright); color: #000; }
.badge-hot        { background: #E53E3E; color: #fff; }

/* Stars */
.stars {
  display: flex; gap: 2px;
  color: var(--gold-bright);
  font-size: .75rem;
}

.stars .empty { color: var(--border-subtle); }
.stars .half { color: transparent; background: linear-gradient(90deg, var(--gold-bright) 50%, var(--border-subtle) 50%); background-clip: text; -webkit-background-clip: text; }

.card-body {
  padding: 1rem;
  display: flex; flex-direction: column; gap: .5rem;
  flex: 1;
}

.card-category {
  font-size: .7rem; font-weight: 500;
  color: var(--gold-dim);
  text-transform: uppercase; letter-spacing: .1em;
}

.card-title {
  font-family: 'Playfair Display', serif;
  font-size: 1rem; font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.card-short-desc {
  font-size: .8125rem;
  color: var(--text-second);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 1rem 1rem;
  margin-top: auto;
}

.card-price {
  font-size: 1.125rem; font-weight: 600;
  color: var(--gold-bright);
}

.card-affiliate-badge {
  font-size: .7rem; font-weight: 500;
  background: rgba(29, 185, 84, 0.15);
  color: var(--cta-green);
  border: 1px solid rgba(29, 185, 84, 0.3);
  padding: .15rem .5rem; border-radius: 20px;
}

/* ── Botões ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center; justify-content: center;
  gap: .5rem;
  font-family: 'Inter', sans-serif;
  font-size: .875rem;
  font-weight: 600;
  padding: .75rem 1.75rem;
  border-radius: var(--radius-btn);
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-cta {
  background: var(--cta-green);
  color: #fff;
  box-shadow: 0 0 24px rgba(29, 185, 84, 0.25);
}

.btn-cta:hover {
  background: var(--cta-green-hv);
  box-shadow: 0 0 32px rgba(29, 185, 84, 0.4);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
}

.btn-outline:hover { border-color: var(--gold-dim); color: var(--gold-bright); }

.btn-gold {
  background: linear-gradient(135deg, var(--gold-bright), var(--gold-dim));
  color: #000;
}

.btn-gold:hover { filter: brightness(1.1); transform: translateY(-1px); }

/* ── Página do produto — Hero fullscreen ─────────────────── */
.product-hero {
  position: relative;
  min-height: 85vh;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}

.product-hero-bg {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  filter: brightness(.55);
  transform: scale(1.04);
  transition: transform 8s ease;
}

.product-hero:hover .product-hero-bg { transform: scale(1); }

.product-hero-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(
    to top,
    var(--bg-deep) 0%,
    rgba(9,9,15,.7) 40%,
    rgba(9,9,15,.2) 80%,
    transparent 100%
  );
}

.product-hero-content {
  position: relative;
  z-index: 2;
  padding: 3rem 2rem 4rem;
  width: 100%;
  max-width: 800px;
}

.product-hero-content .eyebrow {
  font-size: .75rem; font-weight: 600;
  letter-spacing: .15em; text-transform: uppercase;
  color: var(--gold-bright); margin-bottom: .75rem;
}

.product-hero-content h1 {
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 1rem;
  text-shadow: 0 2px 20px rgba(0,0,0,.6);
}

.product-hero-content .short-desc {
  font-size: 1.0625rem;
  color: rgba(240,237,230,.85);
  max-width: 58ch;
  line-height: 1.65;
}

/* ── Seção de detalhes do produto ────────────────────────── */
.product-detail-wrap {
  max-width: 860px;
  margin-inline: auto;
  padding: 4rem 1.5rem 6rem;
}

.product-description {
  font-size: 1rem;
  color: var(--text-second);
  line-height: 1.8;
  margin-bottom: 3rem;
}

.product-description p + p { margin-top: 1em; }

/* Divider dourado */
.divider-gold {
  width: 60px; height: 2px;
  background: linear-gradient(90deg, var(--gold-bright), transparent);
  margin-bottom: 2rem;
}

/* ── Card de afiliado ─────────────────────────────────────── */
.affiliate-card {
  background: var(--bg-card);
  border: 1px solid var(--border-gold);
  border-radius: var(--radius-card);
  padding: 1.5rem;
  margin-bottom: 2.5rem;
  position: relative;
  overflow: hidden;
}

.affiliate-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--gold-bright), var(--gold-dim), transparent);
}

.affiliate-card h3 {
  color: var(--gold-bright);
  margin-bottom: .5rem;
}

.affiliate-stats {
  display: flex; gap: 2rem; margin-top: 1rem; flex-wrap: wrap;
}

.affiliate-stat {
  display: flex; flex-direction: column; gap: .2rem;
}

.affiliate-stat .label {
  font-size: .75rem; text-transform: uppercase; letter-spacing: .1em;
  color: var(--text-muted);
}

.affiliate-stat .value {
  font-size: 1.5rem; font-weight: 700; color: var(--gold-bright);
}

/* ── Botões de compra (múltiplas plataformas) ────────────── */
.buy-section { margin-top: 2.5rem; }

.buy-section h2 { margin-bottom: 1.25rem; font-size: 1.375rem; }

.buy-links {
  display: flex; flex-wrap: wrap; gap: .75rem;
}

.buy-link-btn {
  display: inline-flex; align-items: center; gap: .5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: .75rem 1.5rem;
  border-radius: var(--radius-btn);
  font-size: .875rem; font-weight: 500;
  transition: all var(--transition);
}

.buy-link-btn:hover {
  background: var(--gold-glow);
  border-color: var(--border-gold);
  color: var(--gold-bright);
  transform: translateY(-2px);
}

.buy-link-btn.primary {
  background: var(--cta-green);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 0 20px rgba(29,185,84,.25);
}

.buy-link-btn.primary:hover {
  background: var(--cta-green-hv);
  box-shadow: 0 0 32px rgba(29,185,84,.4);
  color: #fff;
}

.platform-icon { font-size: 1.1rem; }

/* ── Estado vazio ────────────────────────────────────────── */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 5rem 1rem;
  color: var(--text-muted);
}

.empty-state p { margin-top: .5rem; font-size: .875rem; }

/* ── Toast / Notificação ─────────────────────────────────── */
.toast {
  position: fixed; bottom: 1.5rem; right: 1.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  padding: .875rem 1.25rem;
  border-radius: var(--radius-card);
  font-size: .875rem;
  box-shadow: 0 8px 32px rgba(0,0,0,.5);
  opacity: 0; transform: translateY(12px);
  transition: all 250ms ease;
  z-index: 9999;
  max-width: 320px;
}

.toast.show { opacity: 1; transform: translateY(0); }
.toast.success { border-left: 3px solid var(--cta-green); }
.toast.error   { border-left: 3px solid #E53E3E; }

/* ── Footer ──────────────────────────────────────────────── */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 2rem 1rem;
  text-align: center;
  font-size: .8125rem;
  color: var(--text-muted);
}

/* ── Página de produto ────────────────────────────────────── */
.product-page { background: var(--bg-deep); }
.product-hero {
  min-height: calc(100vh - 68px);
  display: flex;
  align-items: center;
  background-color: var(--bg-surface);
  background-size: cover;
  background-position: center;
  border-bottom: 1px solid var(--border-subtle);
}
.product-hero-content { padding-block: 4rem; }
.product-hero-content > * { max-width: 680px; }
.product-breadcrumb {
  display: flex; gap: .6rem; align-items: center;
  color: var(--text-second); font-size: .8rem; margin-bottom: 2.5rem;
}
.product-breadcrumb a:hover { color: var(--gold-bright); }
.product-detail-badge {
  display: inline-block; margin-bottom: 1rem; padding: .3rem .7rem;
  border: 1px solid var(--border-gold); border-radius: 999px;
  color: var(--gold-bright); font-size: .7rem; font-weight: 600;
  letter-spacing: .1em; text-transform: uppercase;
}
.product-hero .eyebrow { color: var(--gold-bright); letter-spacing: .16em; text-transform: uppercase; font-size: .72rem; margin-bottom: .7rem; }
.product-hero h1 { font-size: clamp(2.6rem, 6vw, 5.5rem); margin-bottom: 1rem; }
.product-lead { color: var(--text-second); font-size: clamp(1rem, 1.8vw, 1.2rem); max-width: 52ch; }
.product-rating { display: flex; align-items: center; gap: .65rem; margin-top: 1.3rem; color: var(--text-second); font-size: .85rem; }
.product-rating .stars { font-size: 1rem; }
.product-purchase-row { display: flex; align-items: center; gap: 2rem; margin-top: 2rem; }
.product-price-block { display: flex; flex-direction: column; }
.product-price-label { color: var(--text-second); font-size: .7rem; letter-spacing: .1em; text-transform: uppercase; }
.product-price-block strong { color: var(--text-primary); font-family: 'Playfair Display', Georgia, serif; font-size: 1.8rem; }
.btn-cta {
  display: inline-flex; justify-content: center; align-items: center; gap: .75rem;
  padding: .95rem 1.5rem; border: 0; border-radius: var(--radius-btn);
  background: var(--cta-green); color: #07120b; font: 600 .95rem 'Inter', sans-serif;
  transition: background var(--transition), transform var(--transition); cursor: pointer;
}
.btn-cta:hover { background: var(--cta-green-hv); transform: translateY(-2px); }
.btn-cta.is-disabled { opacity: .55; cursor: not-allowed; }
.product-other-links { display: flex; flex-wrap: wrap; gap: .65rem 1rem; align-items: center; margin-top: 1rem; color: var(--text-muted); font-size: .78rem; }
.product-other-links a { color: var(--gold-bright); }
.product-other-links a:hover { color: var(--text-primary); }
.product-details { display: grid; grid-template-columns: minmax(200px, .75fr) 1.25fr; gap: clamp(2rem, 6vw, 6rem); align-items: start; padding-block: clamp(3rem, 8vw, 7rem); }
.product-cover-detail { max-width: 360px; border: 1px solid var(--border-gold); border-radius: var(--radius-card); overflow: hidden; box-shadow: 0 24px 70px rgba(0,0,0,.4); }
.product-cover-detail img { width: 100%; }
.product-description h2 { max-width: 18ch; margin: .6rem 0 1.5rem; font-size: clamp(1.8rem, 3vw, 2.7rem); }
.description-copy { color: var(--text-second); line-height: 1.9; white-space: normal; }
.affiliate-note { display: flex; gap: 1rem; margin: 2rem 0; padding: 1rem 1.2rem; border: 1px solid var(--border-gold); border-radius: var(--radius-card); background: rgba(212,169,74,.05); }
.affiliate-note-icon { color: var(--gold-bright); font-size: 1.3rem; }
.affiliate-note strong { color: var(--gold-bright); font-size: .9rem; }
.affiliate-note p { color: var(--text-second); font-size: .82rem; margin-top: .25rem; }
.site-footer a:hover { color: var(--gold-bright); }

/* Prévia rápida da capa */
.product-preview-dialog {
  width: min(860px, calc(100% - 2rem)); max-width: none; max-height: 90vh;
  margin: auto; padding: 0; overflow: auto; color: var(--text-primary);
  background: var(--bg-surface); border: 1px solid var(--border-gold); border-radius: 16px;
  box-shadow: 0 30px 100px rgba(0,0,0,.7);
}
.product-preview-dialog::backdrop { background: rgba(4,4,8,.82); backdrop-filter: blur(6px); }
.preview-layout { display: grid; grid-template-columns: minmax(220px, .85fr) 1fr; }
.preview-image-wrap { min-height: 320px; background: var(--bg-card); }
.preview-image-wrap img { width: 100%; height: 100%; min-height: 320px; object-fit: cover; }
.preview-copy { position: relative; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; padding: clamp(1.5rem, 4vw, 3rem); }
.preview-copy .eyebrow { color: var(--gold-bright); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; }
.preview-copy h2 { margin: .5rem 0 1rem; }
.preview-copy p { color: var(--text-second); margin-bottom: 1.5rem; }
.preview-close { position: absolute; top: .75rem; right: .75rem; width: 2.25rem; height: 2.25rem; border: 1px solid var(--border-subtle); border-radius: 50%; background: var(--bg-deep); color: var(--text-primary); font-size: 1.1rem; cursor: pointer; }
.preview-close:hover { border-color: var(--gold-bright); color: var(--gold-bright); }

/* ── Acessibilidade ──────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ── Responsivo ──────────────────────────────────────────── */
@media (max-width: 900px) {
  .products-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .products-grid { grid-template-columns: repeat(2, 1fr); gap: .75rem; }
  .product-hero { min-height: 70vh; }
  .product-hero-content { padding: 2rem 1rem 3rem; }
  .affiliate-stats { flex-direction: column; gap: .75rem; }
  .product-details { grid-template-columns: 1fr; }
  .product-cover-detail { width: min(280px, 75%); margin-inline: auto; }
  .product-hero { background-position: 62% center; }
  .product-hero-content { background: linear-gradient(90deg, rgba(9,9,15,.75), transparent); }
  .product-purchase-row { align-items: flex-start; flex-direction: column; gap: 1rem; }
  .preview-layout { grid-template-columns: 1fr; }
  .preview-image-wrap, .preview-image-wrap img { min-height: 180px; max-height: 42vh; }
}

@media (max-width: 400px) {
  .products-grid { grid-template-columns: 1fr; }
}
