/* =====================================================================
   Vitrinela — estilos
   Base: DESIGN.md (galeria branca, monocromático, pílulas, 24px, sem
   sombras; azul só para sinais comerciais). Fonte: Inter variável no
   lugar da Saans (650 títulos, 450 texto, 300 leve).
   ===================================================================== */

:root {
  --ink: #141414;
  --ink-soft: #262626;
  --muted: #707070;
  --faint: #adadad;
  --canvas: #ffffff;
  --canvas-soft: #f3f3f3;
  --field: #f0f0f0;
  --hair-soft: #f0f0f0;
  --hair: #e0e0e0;
  --accent: #0066ff;
  --on-primary: #ffffff;

  --r-sm: 16px;
  --r-md: 24px;
  --r-full: 9999px;

  --sp-xxs: 4px; --sp-xs: 8px; --sp-sm: 12px; --sp-md: 16px;
  --sp-lg: 24px; --sp-xl: 32px; --sp-xxl: 48px;
  --section: 56px;

  --w-max: 1200px;
  --gutter: 16px;
  --nav-top: 12px;
  --nav-h: 56px;

  --font: "Inter", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

@media (min-width: 768px) {
  :root { --section: 80px; --gutter: 24px; }
}
@media (min-width: 1024px) {
  :root { --section: 96px; --gutter: 32px; }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html:focus-within { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html:focus-within { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  font-weight: 450;
  line-height: 1.38;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: 0; text-wrap: balance; }
h1 { font-size: clamp(36px, 7vw, 64px); line-height: 1; }
h2 { font-size: clamp(28px, 4.2vw, 44px); line-height: 1.13; }
h3 { font-size: clamp(22px, 3vw, 32px); line-height: 1.13; }
h4 { font-size: 24px; line-height: 1.25; }
p { margin: 0; }

.lead { font-size: clamp(17px, 2.2vw, 20px); font-weight: 300; line-height: 1.38; color: var(--ink); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.caption { font-size: 12px; line-height: 1.33; }
.label { font-size: 12px; font-weight: 600; line-height: 1.33; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ───────── Layout ───────── */
.wrap { width: 100%; max-width: var(--w-max); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding-top: var(--section); }
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: var(--sp-md);
  margin-bottom: var(--sp-lg);
}
.section-head .lead { margin-top: var(--sp-xs); }
.section-head h2 { text-wrap: pretty; }
.section-head .btn { flex: 0 0 auto; }

/* ───────── Botões e chips ───────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 var(--sp-md);
  border-radius: var(--r-full); border: 1px solid transparent;
  font-size: 16px; font-weight: 600; line-height: 1;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  background: transparent; color: var(--ink);
  transition: background-color .15s ease, color .15s ease, border-color .15s ease, transform .1s ease;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--ink); color: var(--on-primary); }
.btn-primary:hover { background: var(--ink-soft); }
.btn-outline { background: var(--canvas); border-color: var(--hair); }
.btn-outline:hover { background: var(--canvas-soft); }
.btn-soft { background: var(--canvas-soft); }
.btn-soft:hover { background: var(--field); }
.btn-sm { height: 36px; padding: 0 14px; font-size: 14px; }
.btn-icon { width: 44px; padding: 0; }
.btn-icon.btn-sm { width: 36px; }
.btn-block { width: 100%; }
.btn svg { width: 18px; height: 18px; flex: 0 0 auto; }

/* Marcação "preencher": item que ainda falta o CEO informar */
.mark {
  background: transparent !important;
  color: var(--muted) !important;
  border: 1.5px dashed var(--faint) !important;
}
.mark .mark-tag { font-size: 11px; font-weight: 600; color: var(--faint); }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 14px; border: 0; border-radius: var(--r-full);
  background: var(--canvas-soft); color: var(--ink);
  font-size: 14px; font-weight: 600; white-space: nowrap; cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.chip:hover { background: var(--field); }
.chip[aria-pressed="true"], .chip.is-active { background: var(--ink); color: var(--on-primary); }
.chip .chip-emoji { font-size: 15px; line-height: 1; }
.chip .chip-count { font-weight: 450; opacity: .7; }
.chip-row {
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  padding: 2px var(--gutter); margin: 0 calc(-1 * var(--gutter));
  -webkit-overflow-scrolling: touch;
}
.chip-row::-webkit-scrollbar { display: none; }

.badge {
  display: inline-flex; align-items: center; height: 24px; padding: 0 10px;
  border-radius: var(--r-full); font-size: 12px; font-weight: 600; line-height: 1;
  white-space: nowrap;
}
.badge-accent { background: var(--accent); color: var(--on-primary); }
.badge-ink { background: var(--ink); color: var(--on-primary); }
.badge-overlay { background: rgba(115, 115, 115, .56); color: var(--on-primary); backdrop-filter: blur(6px); }
.badge-mark { background: rgba(255,255,255,.85); color: var(--muted); border: 1.5px dashed var(--faint); }

/* Ícone "squircle" (30%) */
.sq { display: grid; place-items: center; border-radius: 30%; flex: 0 0 auto; }

/* ───────── Barra de demonstração ───────── */
.demo-bar {
  text-align: center; font-size: 12px; color: var(--muted);
  padding: 8px var(--gutter);
}
.demo-bar b { color: var(--ink); font-weight: 600; }

/* ───────── Navegação flutuante ───────── */
.nav-wrap {
  position: sticky; top: var(--nav-top); z-index: 50;
  display: flex; justify-content: center; padding: 0 12px;
  pointer-events: none;
}
.nav {
  pointer-events: auto;
  display: flex; align-items: center; gap: 6px;
  width: 100%; max-width: 1040px; height: var(--nav-h);
  padding: 6px 6px 6px 12px;
  background: var(--canvas-soft); border-radius: var(--r-full);
  box-shadow: 0 0 0 6px rgba(255, 255, 255, .85); /* margem de canvas em volta da pílula, não é elevação */
}
.brand {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  font-weight: 650; font-size: 18px; line-height: 1; margin-right: auto;
}
.brand .sq { width: 28px; height: 28px; background: var(--ink); color: var(--on-primary); font-size: 15px; font-weight: 650; }
.nav-links { display: none; gap: 2px; margin-right: 4px; }
.nav-links a { text-decoration: none; font-weight: 600; font-size: 15px; padding: 0 12px; height: 40px; display: inline-flex; align-items: center; border-radius: var(--r-full); }
.nav-links a:hover { background: var(--field); }
.nav .btn-icon { width: 44px; height: 44px; background: var(--canvas); border-color: transparent; }
.nav .btn-cta { height: 44px; }
@media (min-width: 900px) { .nav-links { display: inline-flex; } }

/* ───────── Hero ───────── */
.hero { padding-top: clamp(40px, 8vw, 96px); }
.hero-grid { display: grid; gap: var(--sp-lg); max-width: 760px; }
.hero .lead { max-width: 560px; color: var(--muted); }
.hero-stats { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: 13px; }
.hero-stats b { color: var(--ink); font-weight: 600; }

.search {
  display: flex; align-items: center; gap: 8px;
  background: var(--field); border-radius: var(--r-sm);
  padding: 6px 6px 6px 16px; height: 60px; max-width: 640px;
  transition: box-shadow .15s ease;
}
.search:focus-within { box-shadow: inset 0 0 0 2px var(--ink); }
.search svg { width: 20px; height: 20px; color: var(--muted); flex: 0 0 auto; }
.search input {
  flex: 1 1 auto; min-width: 0; border: 0; background: transparent; outline: none;
  font: inherit; font-size: 16px; color: var(--ink); height: 100%;
}
.search input::placeholder { color: var(--faint); }
.search .btn { height: 48px; }
.search .btn-clear { display: none; width: 40px; height: 40px; background: transparent; color: var(--muted); }
.search.has-text .btn-clear { display: inline-flex; }

.cat-chips { margin-top: var(--sp-xs); }
.cat-chips .chip { height: 40px; padding: 0 14px 0 6px; gap: 8px; }
.cat-chips .chip .sq { width: 28px; height: 28px; font-size: 15px; background: var(--canvas); }
.cat-chips .chip[aria-pressed="true"] .sq { background: rgba(255,255,255,.18); }

/* ───────── Trilhos (vitrines com rolagem horizontal) ─────────
   O trilho ocupa a largura toda da tela; o recuo interno (--rail-pad)
   alinha o primeiro card à coluna de conteúdo e os demais sangram
   pela borda da tela em vez de serem cortados pela coluna. */
.rail {
  --rail-pad: max(var(--gutter), calc((100% - var(--w-max)) / 2 + var(--gutter)));
  display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory;
  width: 100%; padding: 2px var(--rail-pad) 6px; margin: 0;
  scroll-padding-left: var(--rail-pad); scroll-padding-right: var(--rail-pad);
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.rail::-webkit-scrollbar { display: none; }
.rail > .card { flex: 0 0 min(72vw, 250px); scroll-snap-align: start; }
@media (min-width: 768px) { .rail { gap: 16px; } .rail > .card { flex-basis: 260px; } }
.rail-note { margin-top: 8px; }

/* ───────── Categorias ───────── */
.cat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 640px) { .cat-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; } }
@media (min-width: 1024px) { .cat-grid { grid-template-columns: repeat(5, 1fr); } }
.cat-tile {
  display: flex; flex-direction: column; align-items: flex-start; gap: 14px;
  padding: 18px; min-height: 172px; text-align: left;
  background: var(--canvas-soft); border: 0; border-radius: var(--r-md); cursor: pointer;
  transition: background-color .15s ease;
}
.cat-tile:hover { background: var(--field); }
.cat-tile .sq { width: 56px; height: 56px; font-size: 28px; }
.cat-tile .cat-name { font-size: 18px; font-weight: 600; line-height: 1.2; }
.cat-tile .cat-blurb { color: var(--muted); font-size: 14px; line-height: 1.4; }
.cat-tile .cat-count { margin-top: auto; font-size: 12px; color: var(--muted); }
@media (min-width: 1024px) { .cat-tile { min-height: 200px; } }

/* ───────── Cards de produto ───────── */
.card {
  display: flex; flex-direction: column; gap: 10px;
  padding: 10px; background: var(--canvas);
  border: 1px solid var(--hair-soft); border-radius: var(--r-md);
  min-width: 0;
}
@media (min-width: 768px) { .card { padding: 12px; } }
.card-media {
  position: relative; aspect-ratio: 1 / 1; overflow: hidden;
  border-radius: var(--r-sm); background: var(--canvas-soft);
}
.card-media img { width: 100%; height: 100%; object-fit: contain; padding: 8%; background: #fff; }
.ph {
  height: 100%; display: grid; place-items: center; position: relative;
  background: radial-gradient(120% 90% at 30% 20%, #fff 0%, var(--ph) 55%, color-mix(in srgb, var(--ph) 80%, #141414 8%) 100%);
}
.ph-emoji { font-size: clamp(52px, 12vw, 76px); line-height: 1; filter: saturate(1.05); }
.ph-label { position: absolute; bottom: 10px; right: 10px; font-size: 10px; color: rgba(20,20,20,.5); }
.badges { position: absolute; top: 8px; left: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.badges-right { left: auto; right: 8px; }
.card-cat { position: absolute; left: 8px; bottom: 8px; }
.card-tools { position: absolute; top: 8px; right: 8px; display: flex; flex-direction: column; gap: 6px; }
.card-tools .btn { width: 34px; height: 34px; padding: 0; background: rgba(255,255,255,.92); border-color: transparent; color: var(--ink); }
.card-tools .btn svg { width: 16px; height: 16px; }
.card-tools .btn-fav.is-on { background: var(--ink); color: var(--on-primary); }
.card-tools .btn-fav.is-on svg { fill: currentColor; }

.card-body { display: flex; flex-direction: column; gap: 6px; padding: 0 2px; }
.card-title {
  font-size: 14px; font-weight: 600; line-height: 1.3; text-wrap: pretty;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: calc(2 * 1.3em);
}
@media (min-width: 768px) { .card-title { font-size: 15px; } }
.card-note {
  color: var(--muted); font-size: 12.5px; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.price-row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-top: 2px; font-variant-numeric: tabular-nums; }
.price { font-size: 19px; font-weight: 650; line-height: 1; }
.old-price { color: var(--faint); font-size: 13px; }
.price-note { color: var(--faint); font-size: 11px; line-height: 1.3; }
.card-actions { margin-top: auto; }
.card-actions .btn { height: 40px; font-size: 14px; width: 100%; }

.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(3, 1fr); gap: 16px; } }
@media (min-width: 1024px) { .grid { grid-template-columns: repeat(4, 1fr); } }

/* ───────── Catálogo e filtros ───────── */
.filters {
  position: sticky; top: calc(var(--nav-top) + var(--nav-h) + 8px); z-index: 40;
  background: var(--canvas); padding: 10px 0 10px;
  display: flex; flex-direction: column; gap: 8px;
  border-bottom: 1px solid var(--hair-soft);
  margin-bottom: var(--sp-md);
}
.filters-row2 { display: flex; align-items: center; gap: 8px; }
.filters-row2 .chip-row { flex: 1 1 auto; margin-right: 0; padding-right: 0; }
.select {
  position: relative; flex: 0 0 auto;
}
.select select {
  appearance: none; -webkit-appearance: none;
  height: 36px; padding: 0 34px 0 14px; border: 0; border-radius: var(--r-full);
  background: var(--canvas-soft); color: var(--ink);
  font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
.select::after {
  content: ""; position: absolute; right: 13px; top: 50%; width: 8px; height: 8px;
  border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink);
  transform: translateY(-70%) rotate(45deg); pointer-events: none;
}
.results-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: var(--sp-md); color: var(--muted); font-size: 14px; }
.results-bar b { color: var(--ink); font-weight: 600; }
.results-bar .btn { display: none; }
.results-bar.has-filters .btn { display: inline-flex; }

.empty {
  grid-column: 1 / -1; text-align: center;
  background: var(--canvas-soft); border-radius: var(--r-md);
  padding: var(--sp-xxl) var(--sp-lg);
  display: grid; gap: 12px; justify-items: center;
}
.empty .sq { width: 64px; height: 64px; background: var(--canvas); font-size: 30px; }
.empty h3 { font-size: 22px; }

/* ───────── FAQ ───────── */
.faq-list { display: grid; gap: 12px; max-width: 760px; }
.faq {
  background: var(--canvas-soft); border-radius: var(--r-sm); padding: 0 18px;
}
.faq summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 0; font-weight: 600; font-size: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; width: 9px; height: 9px; flex: 0 0 auto;
  border-right: 2px solid var(--ink); border-bottom: 2px solid var(--ink);
  transform: rotate(45deg); transition: transform .15s ease; margin-right: 4px;
}
.faq[open] summary::after { transform: rotate(-135deg); }
.faq p { color: var(--muted); padding: 0 0 18px; font-size: 15px; max-width: 62ch; }

/* ───────── Rodapé ───────── */
.footer {
  margin-top: var(--section);
  background: var(--ink); color: var(--on-primary);
  border-radius: var(--r-md) var(--r-md) 0 0;
  padding: clamp(40px, 7vw, 72px) 0 28px;
}
.footer-word { font-size: clamp(56px, 14vw, 128px); font-weight: 650; line-height: .95; letter-spacing: 0; }
.footer-tag { color: var(--faint); font-size: clamp(16px, 2vw, 20px); font-weight: 300; margin-top: 10px; }
.footer-cols { display: grid; gap: var(--sp-xl); margin-top: var(--sp-xxl); }
.footer h4 { font-size: 14px; font-weight: 600; color: var(--on-primary); margin-bottom: 14px; }
.footer-links { display: grid; gap: 8px; }
.footer-links a { color: var(--faint); text-decoration: none; font-size: 15px; }
.footer-links a:hover { color: var(--on-primary); }
.footer-legal { margin-top: var(--sp-xxl); padding-top: var(--sp-lg); border-top: 1px solid rgba(255,255,255,.12); display: grid; gap: 8px; color: var(--faint); font-size: 12px; line-height: 1.5; max-width: 760px; }
.footer-legal b { color: var(--on-primary); font-weight: 600; }

/* ───────── Toast ───────── */
.toast {
  position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 60;
  background: var(--canvas); color: var(--ink);
  border-radius: var(--r-md); padding: 12px 18px;
  font-size: 14px; font-weight: 600;
  box-shadow: 0 8px 24px rgba(20, 20, 20, .14);
  max-width: calc(100vw - 32px);
}

/* Voltar ao topo */
.to-top { position: fixed; right: 16px; bottom: 16px; z-index: 45; }
