/* ===== Design tokens ===== */
:root {
  --page: #f4f4f5;
  --surface: #ffffff;
  --ink: #1a1a1a;
  --ink-soft: #5b5b5b;
  --primary: #febd17;      /* amarelo DeWalt */
  --primary-ink: #1a1a1a;
  --success: #16a34a;
  --border: #e6e6e8;
  --radius: 14px;
  --max: 480px;
  --shadow: 0 6px 24px rgba(0,0,0,.10);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

[hidden] { display: none !important; }

html.bg-page { background: var(--page); }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--ink);
  line-height: 1.5;
  background: var(--page);
  -webkit-font-smoothing: antialiased;
  padding-bottom: 84px; /* espaço p/ barra fixa */
}

h1, h2, h3, .price-now, .title, .section-title, .rating-big {
  font-family: 'Archivo', 'Inter', sans-serif;
}

main { max-width: var(--max); margin: 0 auto; }

/* ===== Topbar urgência ===== */
.topbar {
  background: var(--ink);
  color: #fff;
  text-align: center;
  font-size: .8rem;
  letter-spacing: .04em;
  padding: 8px 12px;
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
}
.topbar strong { color: var(--primary); }

.pulse-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #ef4444; display: inline-block;
  box-shadow: 0 0 0 0 rgba(239,68,68,.7);
  animation: pulse 1.4s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(239,68,68,.7); }
  70% { box-shadow: 0 0 0 8px rgba(239,68,68,0); }
  100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); }
}

/* ===== Hero ===== */
.hero { background: var(--surface); }

.hero-media {
  position: relative;
  background: #fafafa;
}
.hero-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  display: block;
}
.badge-desc {
  position: absolute;
  top: 12px; left: 12px;
  background: #ef4444;
  color: #fff;
  font-family: 'Archivo', sans-serif;
  font-weight: 900;
  font-size: 1.1rem;
  padding: 8px 12px;
  border-radius: 10px;
}
.hero-social {
  position: absolute;
  bottom: 12px; left: 12px;
}
.chip {
  background: rgba(0,0,0,.7);
  color: #fff;
  font-size: .72rem;
  font-weight: 600;
  padding: 6px 10px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.hero-info { padding: 18px 16px 24px; }

.stars-line { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.stars { color: var(--primary); letter-spacing: 2px; font-size: 1rem; }
.stars.sm { font-size: .85rem; letter-spacing: 1px; }
.stars-count { color: var(--ink-soft); font-size: .8rem; }

.title {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.2;
  text-wrap: balance;
}
.subtitle { color: var(--ink-soft); font-size: .92rem; margin-top: 6px; }

.price-box { margin: 18px 0 14px; }
.price-old { color: var(--ink-soft); text-decoration: line-through; font-size: .9rem; }
.price-now-line { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.price-now { font-size: 2.4rem; font-weight: 900; line-height: 1; }
.price-now .cents { font-size: 1.3rem; }
.price-tag {
  background: rgba(22,163,74,.12);
  color: var(--success);
  font-weight: 700;
  font-size: .78rem;
  padding: 4px 10px;
  border-radius: 999px;
}
.price-installment { color: var(--ink-soft); font-size: .85rem; display: block; margin-top: 4px; }

.trust-row {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin: 14px 0 20px;
}
.trust-row li { font-size: .82rem; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.trust-row .ico {
  background: var(--success); color: #fff;
  width: 18px; height: 18px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .7rem;
}

/* ===== Botão comprar ===== */
.btn-buy {
  width: 100%;
  background: var(--primary);
  color: var(--primary-ink);
  border: none;
  font-family: 'Archivo', sans-serif;
  font-weight: 800;
  font-size: 1.15rem;
  padding: 16px;
  border-radius: 12px;
  cursor: pointer;
  transition: transform .12s ease, filter .12s ease;
  box-shadow: 0 6px 16px rgba(254,189,23,.4);
}
.btn-buy:hover { filter: brightness(1.03); }
.btn-buy:active { transform: scale(.98); }
.btn-buy.sm { width: auto; padding: 13px 22px; font-size: 1rem; box-shadow: none; }
.btn-buy.full { width: 100%; margin-top: 8px; }
.btn-buy:disabled { opacity: .6; cursor: not-allowed; }

.stock-warn { text-align: center; font-size: .82rem; color: var(--ink-soft); margin-top: 12px; }
.stock-warn strong { color: #ef4444; }

/* ===== Seções ===== */
.section-title {
  font-size: 1.35rem;
  font-weight: 800;
  padding: 0 16px;
  margin-bottom: 16px;
  text-wrap: balance;
}

.features { padding: 28px 0; }
.feature-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 16px;
}
.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.feature-ico { font-size: 1.6rem; display: block; margin-bottom: 8px; }
.feature-card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 4px; }
.feature-card p { font-size: .84rem; color: var(--ink-soft); }
.feature-photo { margin-top: 16px; padding: 0 16px; }
.feature-photo img { width: 100%; border-radius: var(--radius); display: block; }

/* ===== Avaliações ===== */
.reviews { padding: 8px 0 32px; }
.reviews-head { padding: 0 16px; }
.rating-summary { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.rating-big { font-size: 2.6rem; font-weight: 900; line-height: 1; }
.rating-sub { display: block; color: var(--ink-soft); font-size: .78rem; }

.review-list { display: flex; flex-direction: column; gap: 12px; padding: 0 16px; }
.review-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.review-card header { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--ink); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-family: 'Archivo', sans-serif;
}
.review-name { display: block; font-weight: 700; font-size: .9rem; }
.verified { color: var(--success); font-weight: 600; font-size: .72rem; }
.review-text { font-size: .9rem; color: #333; margin-bottom: 10px; }
.review-photo { width: 100%; border-radius: 10px; display: block; }

/* ===== Barra de compra fixa ===== */
.buybar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 30;
  max-width: var(--max);
  margin: 0 auto;
  box-shadow: 0 -4px 16px rgba(0,0,0,.06);
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
}
.buybar-price { display: flex; flex-direction: column; }
.buybar-now { font-family: 'Archivo', sans-serif; font-weight: 900; font-size: 1.25rem; }
.buybar-old { font-size: .78rem; color: var(--ink-soft); text-decoration: line-through; }

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 60;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.modal {
  background: var(--surface);
  width: 100%;
  max-width: var(--max);
  border-radius: 18px 18px 0 0;
  padding: 20px 16px calc(24px + env(safe-area-inset-bottom));
  max-height: 92vh;
  overflow-y: auto;
  position: relative;
  animation: slideUp .28s ease;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@media (min-width: 520px) {
  .modal-overlay { align-items: center; }
  .modal { border-radius: 18px; }
}

.modal-close {
  position: absolute;
  top: 10px; right: 12px;
  background: var(--page);
  border: none;
  width: 34px; height: 34px;
  border-radius: 50%;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: var(--ink);
}

.order-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--page);
  border-radius: var(--radius);
  padding: 10px;
  margin: 6px 0 18px;
}
.order-summary img { width: 56px; height: 56px; object-fit: contain; border-radius: 8px; background:#fff; }
.os-name { display: block; font-size: .82rem; font-weight: 600; line-height: 1.3; }
.os-price { display: block; font-weight: 800; font-family: 'Archivo', sans-serif; margin-top: 2px; }
.os-price small { color: var(--success); font-weight: 700; font-size: .72rem; }

.step-title { font-size: 1.2rem; font-weight: 800; margin-bottom: 14px; }

/* Formulário */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field.full { grid-column: 1 / -1; }
.field span { font-size: .78rem; font-weight: 600; color: var(--ink-soft); }
.field span small { font-weight: 400; }
.field input {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 12px;
  font-size: .95rem;
  font-family: inherit;
  background: #fff;
  color: var(--ink);
  width: 100%;
}
.field input:focus { outline: 2px solid var(--primary); border-color: var(--primary); }

.form-error {
  background: rgba(239,68,68,.1);
  color: #b91c1c;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: .84rem;
  margin: 14px 0 0;
}

.secure-note { text-align: center; font-size: .78rem; color: var(--ink-soft); margin-top: 12px; }

/* PIX */
.pix-instruction { font-size: .9rem; color: var(--ink-soft); margin-bottom: 14px; }
.pix-amount {
  text-align: center;
  font-size: 1rem;
  margin-bottom: 14px;
}
.pix-amount strong { font-family: 'Archivo', sans-serif; font-size: 1.3rem; }
.pix-qr {
  display: flex;
  justify-content: center;
  padding: 12px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 0 auto 16px;
  width: fit-content;
}
.pix-qr img, .pix-qr canvas { width: 200px; height: 200px; display: block; }

.pix-code-label { font-size: .78rem; font-weight: 600; color: var(--ink-soft); display: block; margin-bottom: 4px; }
.pix-code-box textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  font-size: .78rem;
  font-family: monospace;
  resize: none;
  color: var(--ink);
  background: var(--page);
  word-break: break-all;
}
.btn-copy {
  width: 100%;
  margin-top: 10px;
  background: var(--ink);
  color: #fff;
  border: none;
  padding: 14px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  font-family: 'Archivo', sans-serif;
}
.btn-copy.copied { background: var(--success); }

.pix-status {
  margin-top: 18px;
  text-align: center;
  font-weight: 600;
  font-size: .92rem;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.spinner {
  width: 18px; height: 18px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Sucesso */
.success-step { text-align: center; padding: 20px 0; }
.success-check {
  width: 72px; height: 72px;
  background: var(--success);
  color: #fff;
  border-radius: 50%;
  font-size: 2.4rem;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
  animation: pop .3s ease;
}
@keyframes pop { from { transform: scale(0); } to { transform: scale(1); } }
.success-step p { color: var(--ink-soft); font-size: .92rem; }

/* Footer */
.footer {
  text-align: center;
  padding: 24px 16px 32px;
  color: var(--ink-soft);
  font-size: .78rem;
  max-width: var(--max);
  margin: 0 auto;
}
.footer-small { margin-top: 4px; opacity: .8; }

body.modal-open { overflow: hidden; }

/* ===== Opções de frete ===== */
.ship-group {
  border: none;
  margin: 4px 0 8px;
  padding: 0;
}
.ship-group legend {
  font-family: 'Archivo', sans-serif;
  font-weight: 700;
  font-size: .95rem;
  margin-bottom: 8px;
  color: var(--ink);
}
.ship-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.ship-opt:has(input:checked) {
  border-color: var(--primary);
  background: #fffdf3;
}
.ship-opt input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  flex-shrink: 0;
}
.ship-body { display: flex; flex-direction: column; flex: 1; }
.ship-title {
  font-weight: 700;
  font-size: .92rem;
  display: flex;
  align-items: center;
  gap: 6px;
}
.ship-carrier {
  font-size: .68rem;
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--page);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 1px 6px;
}
.ship-sub { font-size: .8rem; color: var(--ink-soft); }
.ship-price { font-weight: 800; font-size: .95rem; white-space: nowrap; }
.ship-free { color: var(--success); }

/* ===== Resumo de total ===== */
.order-total {
  background: var(--page);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin: 4px 0 12px;
}
.ot-row {
  display: flex;
  justify-content: space-between;
  font-size: .9rem;
  color: var(--ink-soft);
  padding: 3px 0;
}
.ot-total {
  border-top: 1px dashed var(--border);
  margin-top: 6px;
  padding-top: 8px;
  font-family: 'Archivo', sans-serif;
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--ink);
}
