/* Alinhavo: loja de exemplo. Linho claro, texto quase preto, verde-musgo de acento. */

@font-face {
  font-family: 'Cormorant';
  src: url('/assets/fonts/cormorant-garamond-latin-wght-normal.woff2') format('woff2');
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Cormorant';
  src: url('/assets/fonts/cormorant-garamond-latin-wght-italic.woff2') format('woff2');
  font-weight: 300 700;
  font-style: italic;
  font-display: swap;
}
@font-face {
  font-family: 'DM Sans';
  src: url('/assets/fonts/dm-sans-latin-wght-normal.woff2') format('woff2');
  font-weight: 100 1000;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Reenie Beanie';
  src: url('/assets/fonts/reenie-beanie-latin-400-normal.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

:root {
  --fundo: #f7f4ee;
  --superficie: #ede8de;
  --cartao: #ffffff;
  --texto: #23211e;
  --texto-2: #6b665d;
  --acento: #4f5d45;
  --linha: #d9d3c6;
  --zap: #1f8a4c;
  --zap-hover: #17703d;
  --esgotado: #9a948a;
  --erro: #b3402f;
  --linha-vermelha: #9e3b32;
  --serifa: 'Cormorant', 'Cormorant Garamond', Georgia, serif;
  --sans: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mao: 'Reenie Beanie', 'Segoe Print', cursive;
  --raio: 14px;
  --max: 1080px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  background: var(--fundo);
  color: var(--texto);
  font: 400 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--serifa); font-weight: 500; letter-spacing: -0.01em; margin: 0; }
h1 { font-size: 38px; line-height: 1.04; }
h2 { font-size: 28px; line-height: 1.12; }
h3 { font-size: 24px; line-height: 1.15; }
p { margin: 0; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--acento); outline-offset: 2px; border-radius: 6px; }
[hidden] { display: none !important; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---------- Desenho das peças ---------- */
.peca { display: block; width: 100%; height: auto; overflow: visible; }
.pf { fill: var(--peca, #d8cbb2); transition: fill 0.35s ease; }
.pt { fill: #000; filter: url(#trama); opacity: 0.1; }
.pk { fill: url(#ponto-trico); }
.pk2 { fill: url(#ponto-croche); }
.pc { fill: none; stroke: var(--contorno, rgba(35, 33, 30, 0.7)); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.pd { fill: none; stroke: var(--dobra, #b5aa95); stroke-width: 1.5; stroke-linecap: round; transition: stroke 0.35s ease; }
.ps { fill: none; stroke: var(--ponto, rgba(35, 33, 30, 0.45)); stroke-width: 1; stroke-dasharray: 3 3; stroke-linecap: round; }
.pb { fill: var(--ponto, rgba(35, 33, 30, 0.55)); }
.pr { fill: var(--dobra, #b5aa95); opacity: 0.6; transition: fill 0.35s ease; }
.ph { fill: none; stroke: #8a847a; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.alca { fill: none; stroke: var(--dobra, #b5aa95); stroke-width: 7; stroke-linecap: round; }
.sombra { fill: rgba(35, 33, 30, 0.08); }

/* ---------- Topo ---------- */
.aviso-demo {
  background: var(--superficie);
  color: var(--texto-2);
  font-size: 12.5px;
  text-align: center;
  padding: 6px 16px;
}
.topo {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: rgba(247, 244, 238, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--linha);
}
.marca { font-family: var(--serifa); font-style: italic; font-weight: 600; font-size: 26px; text-decoration: none; letter-spacing: 0.01em; }
.botao-sacola {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--linha);
  background: var(--cartao);
  border-radius: 999px;
  padding: 7px 12px 7px 10px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
}
.botao-sacola svg { width: 20px; height: 20px; fill: none; stroke: var(--texto); stroke-width: 1.6; stroke-linejoin: round; }
.contador {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--acento);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: inline-grid;
  place-items: center;
  font-variant-numeric: tabular-nums;
}
.contador.pulo { animation: pulo 0.45s ease; }
@keyframes pulo { 40% { transform: scale(1.3); } }

main, .rodape { max-width: var(--max); margin: 0 auto; padding: 0 20px; }

/* ---------- Hero ---------- */
.hero { display: grid; gap: 8px; padding: 28px 0 8px; }
.sobretitulo { font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--texto-2); margin-bottom: 10px; }
.hero h1 { max-width: 13ch; }
.hero-sub { color: var(--texto-2); margin: 14px 0 22px; max-width: 36ch; }
.hero-peca { position: relative; margin: 8px 0 0; width: 100%; max-width: 380px; }
.hero-peca .peca { width: 70%; }
.nota {
  font-family: var(--mao);
  color: var(--acento);
  font-size: 25px;
  line-height: 1.05;
  transform: rotate(-4deg);
}
.nota span { display: block; font-size: 21px; margin-top: 2px; padding-left: 1.2em; }
.nota-hero { position: absolute; right: 0; top: 22%; width: 34%; font-size: clamp(22px, 6.6vw, 28px); line-height: 1.1; text-align: left; }
.nota-hero::before {
  content: '';
  position: absolute;
  left: -30px;
  top: 30px;
  width: 26px;
  height: 22px;
  border-bottom: 1.5px solid var(--acento);
  border-left: 1.5px solid var(--acento);
  border-bottom-left-radius: 24px;
  transform: rotate(-12deg) scaleX(-1);
}

.botao {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  border: 1.5px solid var(--texto);
  background: transparent;
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.15s;
}
.botao:hover { background: var(--texto); color: var(--fundo); }
.botao:active { transform: scale(0.98); }
.botao-cheio { background: var(--texto); color: var(--fundo); width: 100%; }
.botao-cheio:hover { background: #000; }
.botao-cheio:disabled { background: var(--esgotado); border-color: var(--esgotado); cursor: not-allowed; }
.botao-zap { background: var(--zap); border-color: var(--zap); color: #fff; width: 100%; }
.botao-zap:hover { background: var(--zap-hover); border-color: var(--zap-hover); color: #fff; }

.tiragem {
  margin: 24px 0 8px;
  padding: 12px 0;
  border-top: 1px solid var(--linha);
  border-bottom: 1px solid var(--linha);
  font-size: 14.5px;
  color: var(--texto-2);
  text-align: center;
}
.tiragem strong { color: var(--texto); font-variant-numeric: tabular-nums; }

/* ---------- Vitrine ---------- */
.vitrine { padding: 32px 0 8px; }
.vitrine h2 { margin-bottom: 16px; }
.filtros {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 0 -20px 18px;
  padding: 2px 20px 6px;
  scrollbar-width: none;
}
.filtros::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  border: 1px solid var(--linha);
  background: var(--cartao);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
}
.chip[aria-pressed='true'] { background: var(--texto); border-color: var(--texto); color: var(--fundo); }

.grade { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.cartao {
  width: 100%;
  text-align: left;
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
  display: grid;
  gap: 8px;
}
.cartao-figura {
  position: relative;
  aspect-ratio: 4 / 5;
  background: var(--superficie);
  border-radius: var(--raio);
  padding: 8% 10% 4%;
  display: grid;
  place-items: center;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.cartao:hover .cartao-figura { transform: translateY(-3px); box-shadow: 0 10px 24px -16px rgba(35, 33, 30, 0.45); }
.cartao-figura .peca { height: 100%; width: auto; max-width: 100%; }
.selo {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--cartao);
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 600;
}
.selo-esgotado { color: var(--esgotado); text-decoration: line-through; }
.cartao-nome { font-size: 15px; font-weight: 500; line-height: 1.3; }
.cartao-linha { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.preco { font-weight: 700; font-size: 16px; font-variant-numeric: tabular-nums; }
.bolinhas { display: inline-flex; gap: 4px; }
.bolinhas span { width: 12px; height: 12px; border-radius: 50%; background: var(--cor); box-shadow: inset 0 0 0 1px rgba(35, 33, 30, 0.25); }
.cartao.esgotado .cartao-figura { opacity: 0.6; }

/* ---------- Seções de texto ---------- */
.como, .quem, .perguntas { padding: 48px 0 8px; }
.como h2, .quem h2, .perguntas h2 { margin-bottom: 18px; }
.passos { list-style: none; counter-reset: passo; margin: 0; padding: 0; display: grid; gap: 16px; }
.passos li { counter-increment: passo; display: grid; grid-template-columns: 40px 1fr; gap: 12px; color: var(--texto-2); }
.passos li::before {
  content: counter(passo);
  font-family: var(--serifa);
  font-size: 34px;
  line-height: 1;
  color: var(--acento);
  font-variant-numeric: lining-nums;
}
.passos strong { color: var(--texto); font-weight: 600; }

.agulha { width: 100%; max-width: 320px; height: 40px; display: block; margin: -6px 0 14px; }
.agulha-linha { fill: none; stroke: var(--linha-vermelha); stroke-width: 1.6; stroke-linecap: round; }
.agulha-corpo { fill: none; stroke: #8a847a; stroke-width: 2.4; stroke-linecap: round; }
.agulha-olho { fill: var(--fundo); stroke: #8a847a; stroke-width: 1; }

.pessoas { display: grid; gap: 14px; }
.etiqueta {
  position: relative;
  background: var(--cartao);
  border-radius: var(--raio);
  padding: 24px 22px 18px 22px;
  outline: 1px dashed var(--linha);
  outline-offset: -8px;
}
.etiqueta::before {
  content: '';
  position: absolute;
  top: 14px;
  right: 18px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid var(--linha);
  background: var(--fundo);
}
.papel { color: var(--texto-2); font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; margin: 2px 0 12px; }
.etiqueta p + p { margin-top: 10px; }
.assinatura { font-family: var(--mao); color: var(--acento); font-size: 30px; line-height: 1; text-align: right; transform: rotate(-3deg); }

.perguntas details { border-bottom: 1px solid var(--linha); }
.perguntas summary {
  cursor: pointer;
  list-style: none;
  padding: 16px 28px 16px 0;
  font-weight: 500;
  position: relative;
}
.perguntas summary::-webkit-details-marker { display: none; }
.perguntas summary::after { content: '+'; position: absolute; right: 2px; top: 12px; font-size: 22px; color: var(--acento); transition: transform 0.2s; }
.perguntas details[open] summary::after { transform: rotate(45deg); }
.perguntas details p { color: var(--texto-2); padding: 0 0 16px; max-width: 60ch; }

.rodape { padding-top: 48px; padding-bottom: 40px; margin-top: 40px; border-top: 1px solid var(--linha); color: var(--texto-2); font-size: 14px; display: grid; gap: 6px; }
.rodape .marca { color: var(--texto); }
.rodape-demo, .credito { font-size: 12.5px; }

/* ---------- Folhas (dialog) ---------- */
dialog.folha {
  border: 0;
  padding: 22px 20px calc(24px + env(safe-area-inset-bottom));
  background: var(--fundo);
  color: var(--texto);
  width: 100%;
  max-width: 100%;
  max-height: 92dvh;
  margin: auto 0 0;
  border-radius: 22px 22px 0 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}
dialog.folha[open] { animation: sobe 0.32s cubic-bezier(0.2, 0.8, 0.2, 1); }
dialog.folha::backdrop { background: rgba(35, 33, 30, 0.42); }
@keyframes sobe { from { transform: translateY(40px); opacity: 0; } }
.fechar-form { position: sticky; top: 0; height: 0; display: flex; justify-content: flex-end; z-index: 2; }
.fechar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--linha);
  background: var(--cartao);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  transform: translate(6px, -8px);
}

.peca-detalhe { display: grid; gap: 18px; }
.peca-grande {
  margin: 0;
  background: var(--superficie);
  border-radius: var(--raio);
  padding: 6% 16% 2%;
  aspect-ratio: 4 / 5;
  max-height: 46dvh;
  justify-self: center;
  width: 100%;
  max-width: calc(46dvh * 0.8);
  display: grid;
  place-items: center;
}
.medidas td { white-space: nowrap; }
.peca-grande .peca { height: 100%; width: auto; }
.peca-info { display: grid; gap: 12px; align-content: start; }
.peca-info h2 { padding-right: 44px; }
.peca-info > p:not(.preco):not(.restam):not(.feedback) { color: var(--texto-2); }
.escolha { border: 0; margin: 4px 0 0; padding: 0; }
.escolha legend { font-size: 14px; font-weight: 600; margin-bottom: 8px; padding: 0; }
.escolha legend span { font-weight: 400; color: var(--texto-2); }
.cores, .tamanhos { display: flex; flex-wrap: wrap; gap: 8px; }
.cores input, .tamanhos input, #entregas input { position: absolute; opacity: 0; pointer-events: none; }
.cores label {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--cor);
  box-shadow: inset 0 0 0 1px rgba(35, 33, 30, 0.25);
  cursor: pointer;
  position: relative;
}
.cores input:checked + label { box-shadow: inset 0 0 0 1px rgba(35, 33, 30, 0.25), 0 0 0 2px var(--fundo), 0 0 0 4px var(--acento); }
.cores input:focus-visible + label, .tamanhos input:focus-visible + label, #entregas input:focus-visible + label { outline: 2px solid var(--acento); outline-offset: 3px; }
.tamanhos label {
  min-width: 48px;
  height: 42px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--linha);
  background: var(--cartao);
  display: grid;
  place-items: center;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
}
.tamanhos input:checked + label { background: var(--texto); border-color: var(--texto); color: var(--fundo); }
.tamanhos input:disabled + label { color: var(--esgotado); text-decoration: line-through; background: transparent; cursor: not-allowed; }
.restam { font-size: 14px; color: var(--acento); font-weight: 500; min-height: 1.4em; }
.feedback { font-size: 14px; color: var(--zap); min-height: 1.3em; }
.medidas { border-top: 1px solid var(--linha); padding-top: 4px; }
.medidas summary { cursor: pointer; padding: 10px 0; font-weight: 600; font-size: 15px; }
.medidas table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
.medidas th, .medidas td { text-align: left; padding: 7px 6px; border-bottom: 1px solid var(--linha); }
.medidas th { font-weight: 600; color: var(--texto-2); font-size: 12.5px; }
.medidas-nota { font-size: 13px; color: var(--texto-2); margin-top: 8px; }
.nota-medidas { margin: 12px 0 6px 6px; font-size: 23px; }
.medidas > p { color: var(--texto-2); }

/* ---------- Sacola ---------- */
.folha-sacola h2 { margin-bottom: 14px; padding-right: 44px; }
.vazia { color: var(--texto-2); font-family: var(--mao); font-size: 26px; color: var(--acento); padding: 24px 0; transform: rotate(-2deg); }
.itens { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 10px; }
.item { display: grid; grid-template-columns: 58px 1fr auto; gap: 12px; align-items: center; background: var(--cartao); border-radius: 12px; padding: 10px; }
.item-figura { background: var(--superficie); border-radius: 8px; aspect-ratio: 4 / 5; padding: 4px; }
.item-nome { display: block; font-weight: 600; font-size: 14.5px; line-height: 1.25; }
.item-detalhe { display: block; font-size: 13px; color: var(--texto-2); }
.item-direita { display: grid; justify-items: end; gap: 6px; }
.qtd { display: inline-flex; align-items: center; border: 1px solid var(--linha); border-radius: 999px; }
.qtd button { width: 32px; height: 32px; border: 0; background: none; cursor: pointer; font-size: 18px; line-height: 1; }
.qtd button:disabled { color: var(--esgotado); cursor: not-allowed; }
.qtd span { min-width: 18px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }
.total { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 0 2px; border-top: 1px solid var(--linha); font-size: 15px; }
.total strong { font-size: 22px; font-variant-numeric: tabular-nums; }
.total-nota { font-size: 13px; color: var(--texto-2); margin-bottom: 16px; }
.dados { display: grid; gap: 8px; }
.dados label, .dados legend { font-size: 14px; font-weight: 600; padding: 0; }
.dados fieldset { border: 0; margin: 6px 0 2px; padding: 0; }
.dados input, .dados textarea {
  width: 100%;
  font: inherit;
  padding: 11px 12px;
  border: 1px solid var(--linha);
  border-radius: 10px;
  background: var(--cartao);
  color: var(--texto);
}
.dados input[aria-invalid='true'] { border-color: var(--erro); }
.dados textarea { resize: vertical; }
#entregas { display: grid; gap: 6px; margin-top: 8px; }
#entregas label {
  display: block;
  font-weight: 400;
  padding: 11px 12px 11px 38px;
  border: 1px solid var(--linha);
  border-radius: 10px;
  background: var(--cartao);
  cursor: pointer;
  position: relative;
}
#entregas label::before {
  content: '';
  position: absolute;
  left: 12px;
  top: 50%;
  width: 16px;
  height: 16px;
  margin-top: -8px;
  border-radius: 50%;
  border: 1.5px solid var(--texto-2);
}
#entregas input:checked + label { border-color: var(--acento); }
#entregas input:checked + label::before { border: 5px solid var(--acento); }
.erro { color: var(--erro); font-size: 14px; min-height: 1.2em; }
.privacidade { font-size: 12.5px; color: var(--texto-2); }
.pix { margin-top: 18px; padding: 16px; background: var(--cartao); border-radius: var(--raio); display: grid; gap: 10px; }
.pix h3 { font-size: 22px; }
.pix p { font-size: 14px; color: var(--texto-2); }
.pix .pix-demo { color: var(--erro); font-weight: 600; }
.pix textarea { width: 100%; font: 12px/1.4 ui-monospace, Consolas, monospace; padding: 10px; border: 1px solid var(--linha); border-radius: 10px; background: var(--fundo); resize: none; word-break: break-all; }
.link { background: none; border: 0; color: var(--texto-2); text-decoration: underline; font-size: 13.5px; cursor: pointer; padding: 14px 0 0; }

/* ---------- Prévia do WhatsApp (modo demonstração) ---------- */
.folha-previa h2 { padding-right: 44px; margin-bottom: 16px; font-size: 26px; }
.celular {
  width: min(100%, 330px);
  margin: 0 auto;
  border-radius: 28px;
  overflow: hidden;
  border: 7px solid #1d1c1a;
  background: #e9e2d6;
}
.celular-topo { display: flex; align-items: center; gap: 10px; background: #1f5c4a; color: #fff; padding: 12px 14px; }
.celular-topo strong { display: block; font-size: 15px; }
.celular-topo small { opacity: 0.8; font-size: 12px; }
.celular-avatar { width: 34px; height: 34px; border-radius: 50%; background: #d9e7df; color: #1f5c4a; display: grid; place-items: center; font-weight: 700; }
.celular-chat { padding: 16px 12px 22px; min-height: 260px; }
.balao {
  background: #fff;
  border-radius: 4px 14px 14px 14px;
  padding: 10px 12px 18px;
  font-size: 15.5px;
  line-height: 1.45;
  white-space: pre-wrap;
  max-width: 94%;
  position: relative;
  box-shadow: 0 1px 1px rgba(0, 0, 0, 0.12);
  animation: chega 0.5s ease 0.15s both;
}
.balao::after { content: attr(data-hora); position: absolute; right: 10px; bottom: 4px; font-size: 11px; color: #8a8a8a; }
@keyframes chega { from { opacity: 0; transform: translateY(10px) scale(0.97); } }
.previa-nota { font-size: 13px; color: var(--texto-2); text-align: center; margin: 16px auto 0; max-width: 36ch; }

/* ---------- Telas maiores ---------- */
@media (min-width: 720px) {
  h1 { font-size: 58px; }
  h2 { font-size: 34px; }
  .topo { padding: 14px 32px; }
  main, .rodape { padding: 0 32px; }
  .hero { grid-template-columns: 1.1fr 0.9fr; align-items: center; padding: 56px 0 24px; }
  .hero-peca { width: min(100%, 360px); }
  .grade { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
  .filtros { margin: 0 0 22px; padding: 2px 0 6px; flex-wrap: wrap; }
  .passos { grid-template-columns: repeat(3, 1fr); gap: 24px; }
  .passos li { grid-template-columns: 1fr; }
  .pessoas { grid-template-columns: 1fr 1fr; }
  dialog.folha { margin: auto; border-radius: 22px; max-width: 880px; max-height: 88dvh; padding: 28px; }
  .peca-detalhe { grid-template-columns: 1fr 1fr; gap: 28px; }
  .peca-grande { max-height: none; max-width: none; }
  dialog.folha-sacola { margin: 0 0 0 auto; height: 100dvh; max-height: 100dvh; max-width: 440px; border-radius: 22px 0 0 22px; }
  dialog.folha-sacola[open] { animation: entra 0.32s cubic-bezier(0.2, 0.8, 0.2, 1); }
  dialog.folha-previa { max-width: 460px; }
}
@media (min-width: 1000px) {
  .grade { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@keyframes entra { from { transform: translateX(40px); opacity: 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- 404 ---------- */
.pagina-404 { padding: 72px 20px 96px; display: grid; gap: 18px; justify-items: start; }
.pagina-404 p { color: var(--texto-2); }
