:root {
  --bg: #fffaf4;
  --surface: #ffffff;
  --surface-muted: #fff0df;
  --text: #1e2024;
  --muted: #333333;
  --line: #eadfd3;
  --accent: #f05a28;
  --accent-dark: #c73d12;
  --shadow: 0 18px 45px rgba(101, 58, 28, .11);
}

* { box-sizing: border-box; }
main { min-height: 100vh; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  transition: background .25s ease, color .25s ease;
}

body.dark-mode {
  --bg: #12171d;
  --surface: #1b232c;
  --surface-muted: #26394a;
  --text: #edf4fa;
  --muted: #c5d0da;
  --line: #344451;
  --accent: #65b8e8;
  --accent-dark: #98d7fa;
  --shadow: 0 18px 45px rgba(0, 0, 0, .28);
}

a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { cursor: pointer; }

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 10;
}

.header-inner, main, .footer-inner { max-width: 1180px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.header-inner { min-height: 78px; display: flex; align-items: center; gap: 28px; }
.brand { display: inline-flex; align-items: center; justify-content: center; gap: 14px; }
.brand-logo { display: block; height: 58px; width: auto; max-width: 300px; object-fit: contain; filter: drop-shadow(0 7px 12px rgba(14, 23, 32, 0.08)); }
.brand-name {
  font-size: clamp(1.6rem, 2.2vw, 2.2rem);
  font-weight: 900;
  letter-spacing: -.06em;
  color: var(--text);
  text-transform: none;
  line-height: 1;
}
.nav-links { display: flex; gap: 18px; color: var(--muted); font-size: .9rem; }
.nav-links a:hover { color: var(--accent); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.icon-button, .cart-link { border: 1px solid var(--line); background: var(--surface); color: var(--text); border-radius: 6px; padding: 9px 12px; }
.icon-button { display: inline-grid; width: 42px; height: 42px; padding: 0; place-items: center; font-family: "Segoe UI Symbol", sans-serif; font-size: 1.2rem; line-height: 1; }
.icon-button:hover, .cart-link:hover { border-color: var(--accent); color: var(--accent); }

.hero { padding: 72px 0 42px; display: grid; grid-template-columns: 1fr .8fr; gap: 44px; align-items: end; }
.eyebrow { color: var(--accent); font-size: .75rem; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(2.7rem, 6vw, 5.8rem); line-height: .92; letter-spacing: -.07em; max-width: 700px; margin-bottom: 24px; }
.hero-copy { color: var(--muted); max-width: 470px; line-height: 1.7; }
.hero-note { border-left: 3px solid var(--accent); padding: 14px 0 14px 20px; color: var(--muted); line-height: 1.55; }

.toolbar { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 18px 0; display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
.search { flex: 1 1 250px; min-width: 0; position: relative; }
.search input { width: 100%; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); color: var(--text); padding: 13px 16px 13px 42px; outline: none; }
.search input:focus { border-color: var(--accent); }
.search::before { content: "⌕"; position: absolute; left: 15px; top: 7px; color: var(--muted); font-size: 1.5rem; }
.category-picker { position: relative; flex: 0 1 255px; }
.category-trigger { position: relative; width: 100%; border: 1px solid var(--line); border-radius: 5px; background: var(--surface); color: var(--text); padding: 13px 44px 13px 16px; text-align: left; transition: border-color .2s ease, box-shadow .2s ease; }
.category-trigger::after { content: ""; position: absolute; right: 18px; top: 50%; width: 7px; height: 7px; border-right: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: translateY(-65%) rotate(45deg); transition: transform .2s ease; }
.category-trigger:hover, .category-trigger[aria-expanded="true"] { border-color: var(--accent); }
.category-trigger[aria-expanded="true"] { box-shadow: 0 0 0 3px rgba(240, 90, 40, .12); }
.category-trigger[aria-expanded="true"]::after { transform: translateY(-25%) rotate(225deg); }
.category-panel { position: absolute; z-index: 5; top: calc(100% + 10px); right: 0; width: min(360px, calc(100vw - 48px)); padding: 18px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); }
.category-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.category-close { border: 0; background: transparent; color: var(--muted); font-size: 1.5rem; line-height: 1; padding: 0 4px; }
.category-close:hover { color: var(--accent); }
.category-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 14px 8px 2px 0; max-height: 260px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--accent) var(--surface-muted); }
.category-options::-webkit-scrollbar { width: 9px; }
.category-options::-webkit-scrollbar-track { border-radius: 99px; background: var(--surface-muted); }
.category-options::-webkit-scrollbar-thumb { border: 2px solid var(--surface-muted); border-radius: 99px; background: var(--accent); }
.category-options::-webkit-scrollbar-thumb:hover { background: var(--accent-dark); }
.filter-button { border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 4px; padding: 10px 12px; text-align: left; }
.filter-button.active, .filter-button:hover { background: var(--accent); border-color: var(--accent); color: #fff; }

.section-heading { display: flex; justify-content: space-between; align-items: baseline; padding: 42px 0 20px; }
.section-heading h2 { font-size: 1.8rem; letter-spacing: -.04em; margin: 0; }
#result-count { color: var(--muted); font-size: .88rem; }
.product-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; padding-bottom: 70px; }
.product-card { overflow: hidden; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); transition: transform .2s ease, box-shadow .2s ease; }
.product-card:hover { transform: translateY(-5px); box-shadow: 0 22px 50px rgba(101, 58, 28, .18); }
.product-card.sold-out { opacity: .82; filter: saturate(.7); }
.product-card-top { position: relative; }
.product-image { width: 100%; height: auto; aspect-ratio: 460 / 215; object-fit: cover; background: var(--surface-muted); display: block; }
.image-fallback { object-fit: cover; }
.sold-badge, .sold-status, .detail-sold-tag, .detail-sold-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.sold-badge {
  position: absolute;
  right: 12px;
  top: 12px;
  background: rgba(17, 17, 17, .8);
  color: #fff;
  padding: 7px 10px;
}
.sold-status {
  background: rgba(240, 90, 40, .12);
  color: var(--accent-dark);
  padding: 7px 10px;
}
.detail-sold-tag {
  margin-left: 10px;
  background: rgba(240, 90, 40, .12);
  color: var(--accent-dark);
  padding: 7px 12px;
  vertical-align: middle;
}
.detail-sold-status {
  margin-bottom: 18px;
  padding: 10px 14px;
  background: rgba(240, 90, 40, .08);
  color: var(--accent-dark);
  width: fit-content;
}
.image-fallback { object-fit: cover; }
.load-more { display: block; margin: -36px auto 70px; border: 1px solid var(--accent); border-radius: 5px; background: transparent; color: var(--accent); padding: 12px 20px; font-weight: 800; }
.load-more[hidden], .list-end-message[hidden] { display: none; }
.load-more:hover { background: var(--accent); color: #fff; }
.list-end-message { margin: -36px auto 70px; color: var(--muted); font-size: .88rem; text-align: center; }
.card-body { padding: 18px; }
.card-meta { display: flex; justify-content: space-between; color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .08em; }
.card-body h3 { font-size: 1.3rem; margin: 12px 0 8px; }
.card-description { color: var(--muted); line-height: 1.5; min-height: 48px; font-size: .9rem; }
.card-footer { border-top: 1px solid var(--line); margin-top: 16px; padding-top: 15px; display: flex; align-items: center; justify-content: space-between; }
.price { font-weight: 900; font-size: 1.12rem; }
.cta { display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 5px; background: var(--accent); color: #fff; padding: 11px 16px; font-weight: 800; }
.cta:hover { background: var(--accent-dark); }
.empty-state { grid-column: 1 / -1; text-align: center; padding: 70px 20px; color: var(--muted); }

.page-shell { padding-top: 55px; padding-bottom: 80px; min-height: calc(100vh - 160px); }
.back-link { color: var(--accent); font-size: .9rem; font-weight: 800; }
.detail { display: grid; grid-template-columns: .9fr 1.1fr; gap: 48px; padding-top: 24px; }
.detail-media { min-width: 0; }
.detail-info { padding-top: 2px; }
.detail-info .back-link { display: inline-flex; margin-bottom: 22px; }
.detail-info .eyebrow { margin-bottom: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.detail-image { width: 100%; height: auto; aspect-ratio: 460 / 215; object-fit: cover; background: var(--surface-muted); box-shadow: var(--shadow); }
.detail-gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 12px; }
.gallery-thumb { min-width: 0; aspect-ratio: 16 / 9; overflow: hidden; padding: 0; border: 2px solid transparent; background: var(--surface-muted); cursor: pointer; }
.gallery-thumb.active, .gallery-thumb:hover { border-color: var(--accent); }
.gallery-thumb img { display: block; width: 100%; height: 100%; aspect-ratio: auto; object-fit: cover; }
.detail h1 { font-size: clamp(2.4rem, 5vw, 4.8rem); margin-top: 14px; }
.detail-description { color: var(--muted); font-size: 1.08rem; line-height: 1.7; max-width: 620px; }
.detail-price { font-size: 2rem; font-weight: 900; margin: 28px 0 18px; }
.specs { display: grid; gap: 14px; margin: 36px 0; }
.spec { border-top: 1px solid var(--line); padding-top: 13px; }
.spec strong { display: block; font-size: .78rem; color: var(--accent); text-transform: uppercase; letter-spacing: .1em; margin-bottom: 7px; }
.spec span { color: var(--muted); line-height: 1.5; }

.content-narrow { max-width: 760px; margin: 0 auto; }
.content-narrow h1 { font-size: clamp(2.8rem, 7vw, 5rem); }

.video-shell {
  position: relative;
  width: 100%;
  margin-top: 24px;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: var(--surface-muted);
  box-shadow: var(--shadow);
}

.video-shell iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-actions {
  display: flex;
  justify-content: center;
  margin-top: 20px;
}

.youtube-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 22px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  font-weight: 900;
  letter-spacing: .02em;
  box-shadow: 0 12px 28px rgba(240, 90, 40, .25);
  transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}

.youtube-button::before {
  content: "▶";
  font-size: .85rem;
}

.youtube-button:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(240, 90, 40, .32);
  filter: brightness(1.02);
}

.story-summary {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.story-summary h2 {
  margin-bottom: 20px;
  font-size: clamp(2rem, 4vw, 2.8rem);
  letter-spacing: -.05em;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.summary-card {
  padding: 22px 20px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-muted) 100%);
  box-shadow: 0 16px 30px rgba(19, 28, 38, .04);
}

.summary-tag {
  display: inline-block;
  margin-bottom: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(240, 90, 40, .12);
  color: var(--accent-dark);
  font-size: .7rem;
  font-weight: 900;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.summary-card h3 {
  margin-bottom: 10px;
  font-size: 1.2rem;
  letter-spacing: -.04em;
}

.summary-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.form { display: grid; gap: 16px; margin-top: 30px; }
.form label { display: grid; gap: 7px; font-weight: 800; font-size: .9rem; }
.form input, .form select { border: 1px solid var(--line); background: var(--surface); color: var(--text); padding: 13px; border-radius: 4px; }
.payment-details { display: grid; }
.payment-panel { display: grid; gap: 14px; border: 1px solid var(--line); background: var(--surface-muted); padding: 22px; }
.payment-panel h2 { margin: 0; font-size: 1.25rem; }
.boleto-required { color: var(--accent); }
.payment-panel label { background: var(--surface); padding: 12px; border: 1px solid var(--line); }
.payment-panel input, .payment-panel select { width: 100%; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.installments-title { margin: 0 0 10px; font-size: .95rem; }
.installment-control { display: grid; gap: 8px; border-top: 1px solid var(--line); padding-top: 16px; }
.installment-control > label { padding: 0; border: 0; background: transparent; }
.installment-input-row { display: flex; align-items: center; gap: 12px; }
.installment-input-row input { width: 92px; font-size: 1.15rem; font-weight: 900; text-align: center; }
.installment-input-row span { color: var(--muted); font-size: .85rem; font-weight: 400; }
.installment-summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--accent); background: var(--surface); }
.installment-summary strong { color: var(--accent); font-size: 1.15rem; }
.installment-summary span { color: var(--muted); font-size: .82rem; text-align: right; }
.boleto-customer { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.boleto-customer p { margin: 0; overflow-wrap: anywhere; }
.boleto-products { display: grid; gap: 9px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.boleto-products-title { color: var(--accent); font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; }
.boleto-product, .boleto-summary { display: flex; justify-content: space-between; gap: 18px; }
.boleto-product span { overflow-wrap: anywhere; }
.boleto-product strong, .boleto-summary strong { white-space: nowrap; }
.boleto-summary { display: grid; gap: 8px; padding-top: 14px; }
.boleto-summary p { margin: 0; color: var(--muted); }
.qr-code { position: relative; isolation: isolate; width: 184px; height: 184px; margin: 0 auto; border: 10px solid #fff; background-color: #fff; background-image: repeating-linear-gradient(0deg, #111 0 5px, transparent 5px 10px), repeating-linear-gradient(90deg, transparent 0 5px, #111 5px 10px); background-size: 10px 10px; box-shadow: 0 0 0 1px #d8d8d8, inset 0 0 0 2px #111; }
.qr-code::before, .qr-code::after, .qr-code span::before { content: ""; position: absolute; z-index: 2; width: 31px; height: 31px; border: 7px solid #111; background: #fff; box-shadow: inset 0 0 0 7px #111; }
.qr-code::before { top: 0; left: 0; }
.qr-code::after { top: 0; right: 0; }
.qr-code span::before { bottom: 0; left: 0; }
.qr-code span { position: absolute; z-index: 3; left: 50%; top: 50%; width: 25px; height: 25px; transform: translate(-50%, -50%); border: 5px solid #111; background: #fff; box-shadow: 0 0 0 5px #fff; }
.payment-code { overflow-wrap: anywhere; font-family: monospace; font-size: .82rem; text-align: center; color: var(--text); margin: 0; }
.pix-panel > p:not(.payment-code) { text-align: center; color: var(--muted); margin: 0; }
.pix-timer { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); padding-top: 14px; color: var(--muted); }
.pix-timer strong { color: var(--accent); font-size: 1.4rem; font-variant-numeric: tabular-nums; }
.barcode { overflow: hidden; font-family: monospace; font-size: 1.7rem; letter-spacing: .12em; white-space: nowrap; margin: 0; }
.secondary-button { justify-self: start; border: 1px solid var(--accent); background: transparent; color: var(--accent); border-radius: 5px; padding: 10px 14px; font-weight: 800; }
.secondary-button:hover { background: var(--accent); color: #fff; }
.cart-list { display: grid; gap: 12px; margin: 28px 0; }
.cart-summary { display: grid; gap: 10px; border-top: 1px solid var(--line); padding-top: 16px; }
.cart-summary > div:not(.cart-total) { display: flex; justify-content: space-between; gap: 18px; color: var(--muted); }
.cart-summary p { margin: 4px 0 6px; color: var(--accent); font-size: .88rem; font-weight: 800; }
.cart-item { display: flex; gap: 18px; align-items: center; border-bottom: 1px solid var(--line); padding: 0 0 14px; }
.cart-item img { width: 120px; height: 76px; object-fit: cover; }
.cart-item-main { flex: 1; }
.cart-item-main h3 { margin: 0 0 5px; }
.cart-item-main p { color: var(--muted); margin: 0; font-size: .9rem; }
.remove-button { border: 0; background: none; color: var(--muted); }
.remove-button:hover { color: var(--accent); }
.cart-total { display: flex; justify-content: space-between; align-items: center; border-top: 2px solid var(--text); padding-top: 18px; font-size: 1.25rem; font-weight: 900; }
.recommendations { margin-top: 68px; border-top: 1px solid var(--line); padding-top: 8px; }
.recommendations .section-heading { padding-bottom: 18px; }
.recommendations .section-heading span { color: var(--muted); font-size: .82rem; }
.recommendation-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.recommendation-item { display: flex; min-width: 0; gap: 12px; border: 1px solid var(--line); background: var(--surface); padding: 10px; }
.recommendation-item img { width: 112px; height: 58px; flex: 0 0 auto; object-fit: cover; }
.recommendation-item > div { display: flex; min-width: 0; flex: 1; flex-direction: column; align-items: flex-start; align-self: stretch; gap: 4px; }
.recommendation-item strong, .recommendation-item span { overflow-wrap: anywhere; }
.recommendation-item span { color: var(--muted); font-size: .76rem; }
.recommendation-item b { font-size: .9rem; }
.recommendation-item .secondary-button { align-self: flex-end; margin-top: auto; padding: 7px 10px; font-size: .8rem; white-space: nowrap; }
.success { text-align: center; padding: 80px 0; }
.success-mark { color: var(--accent); font-size: 4rem; font-weight: 900; }
.order-json-area { display: grid; justify-items: center; margin: 28px auto; }
.order-json-area .secondary-button { justify-self: center; width: fit-content; max-width: 100%; text-align: center; }
.order-json { justify-self: stretch; max-height: 420px; overflow: auto; margin: 16px 0 0; padding: 18px; border: 1px solid var(--line); background: var(--surface-muted); color: var(--text); font: .82rem/1.55 Consolas, monospace; text-align: left; white-space: pre-wrap; overflow-wrap: anywhere; }
.video-placeholder { aspect-ratio: 16 / 9; border: 1px dashed var(--accent); display: grid; place-items: center; margin-top: 30px; color: var(--muted); background: var(--surface-muted); }
.site-footer { border-top: 1px solid var(--line); color: var(--muted); padding: 22px 0; font-size: .83rem; }
.footer-inner { display: flex; justify-content: space-between; gap: 20px; }

@media (max-width: 760px) {
  .header-inner { gap: 14px; flex-wrap: wrap; padding-top: 14px; padding-bottom: 14px; }
  .nav-links { order: 3; width: 100%; justify-content: space-between; }
  .hero, .detail { grid-template-columns: 1fr; gap: 22px; padding-top: 45px; }
  h1 { font-size: 3.5rem; }
  .category-picker { flex-basis: 100%; }
  .category-panel { position: static; width: 100%; margin-top: 10px; }
  .product-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; gap: 16px; }
  .recommendation-grid { grid-template-columns: 1fr; }
  .recommendation-item img { width: 104px; }
  .section-heading { padding-top: 32px; }
  .footer-inner { flex-direction: column; }
}

@media print {
  @page { size: A4; margin: 12mm; }
  html, body { width: 100%; height: 100%; margin: 0; padding: 0; overflow: hidden; }
  body * { visibility: hidden; }
  #boleto, #boleto * { visibility: visible; }
  #boleto { position: fixed; inset: 0; width: 100%; height: auto; max-height: 100%; border: 1px solid #111; color: #111; background: #fff; padding: 24px; page-break-inside: avoid; break-inside: avoid; }
  #print-boleto { display: none; }
}
