/* ===========================================================================
   Vitrine Claudy's Cortadores
   ---------------------------------------------------------------------------
   Duas linguagens que só esse negócio combina: precisão de fabricação digital
   (filamento, contorno de bico, camada por camada) e o calor de confeitaria
   feita à mão. A trilha tracejada que aparece em divisórias, bordas de
   destaque e no hover dos cards é o "trajeto do bico" — o contorno que a
   impressora percorre antes de depositar a primeira camada da peça. É a
   assinatura visual do sistema inteiro, catálogo e ERP.

   Sem framework e sem build step, igual ao resto do projeto — o que existe
   aqui é CSS moderno (grid, custom properties, aspect-ratio, backdrop-filter),
   que já é suportado em todo lugar que importa.

   Ordem do arquivo:
     1. tokens        6. cards
     2. base          7. detalhe do produto
     3. header        8. carrinho lateral
     4. hero          9. avisos (toast)
     5. filtros      10. rodapé, responsivo e portão
   =========================================================================== */

/* ---------------------------------------------------------- 1. tokens ---- */
:root {
  --brand: #D6007A;
  --brand-2: #FF63B0;
  --brand-dark: #97004F;
  --blush: #F7DCEA;

  --ink: #2A2420;
  --ink-2: #57493F;
  --ink-soft: #8A7A6E;

  --cream: #F6F1E7;
  --bg: var(--cream);
  --surface: #FFFEFB;
  --line: #E4D9C8;
  --line-forte: #D6C7AE;

  --whats: #25D366;
  --whats-dark: #1da851;

  --shadow-sm: 0 1px 3px rgba(42, 36, 32, .07), 0 1px 2px rgba(42, 36, 32, .05);
  --shadow: 0 4px 16px rgba(42, 36, 32, .09);
  --shadow-lg: 0 20px 50px rgba(42, 36, 32, .16);

  --r-sm: 8px;
  --r: 14px;
  --r-lg: 20px;
  --r-full: 999px;

  --serif: "Fraunces", Georgia, serif;
  --sans: "Work Sans", "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;

  /* Curva com leve "overshoot": é o que faz a interface parecer viva em vez
     de apenas rápida. */
  --mola: cubic-bezier(.34, 1.4, .64, 1);
  --suave: cubic-bezier(.4, 0, .2, 1);

  --topo-h: 68px;
}

/* Respeita quem pediu menos movimento no sistema. Animação decorativa é
   conforto para a maioria e enjoo para algumas pessoas. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ------------------------------------------------------------ 2. base ---- */
* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  font-family: var(--sans);
  color: var(--ink);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body.travado { overflow: hidden; }

img { display: block; max-width: 100%; }

button { font-family: inherit; cursor: pointer; }

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

/* Um anel de foco só quando a navegação é por teclado. */
:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: 4px;
}

.oculto-visual {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------------------------------------------------------- 3. header ---- */
.topo {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(246, 241, 231, .88);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s var(--suave), box-shadow .25s var(--suave);
}

.topo.encostado {
  border-bottom-color: var(--line);
  box-shadow: var(--shadow-sm);
}

.topo-int {
  height: var(--topo-h);
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo {
  display: flex;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
  color: inherit;
  flex: 0 0 auto;
}

.logo-marca {
  width: 38px; height: 38px;
  display: grid;
  place-items: center;
}

.logo-marca img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.logo-texto { display: flex; flex-direction: column; line-height: 1.1; }
.logo-nome { font-family: var(--serif); font-weight: 600; font-size: 1.1rem; }
.logo-tag {
  font-family: var(--mono);
  font-size: .58rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--brand);
}

/* Busca */
.busca {
  flex: 1 1 auto;
  max-width: 420px;
  margin: 0 auto;
  position: relative;
}

.busca i {
  position: absolute;
  left: .85rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-soft);
  font-size: .95rem;
  pointer-events: none;
}

.busca input {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line-forte);
  background: var(--surface);
  border-radius: var(--r-full);
  padding: 0 2.4rem 0 2.5rem;
  font-size: .9rem;
  color: var(--ink);
  transition: border-color .2s var(--suave), box-shadow .2s var(--suave);
}

.busca input::placeholder { color: var(--ink-soft); }

.busca input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(214, 0, 122, .12);
}

.busca .limpar {
  position: absolute;
  right: .5rem;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: none;
  color: var(--ink-soft);
  font-size: 1rem;
  padding: .25rem;
  line-height: 1;
  display: none;
}
.busca.tem-texto .limpar { display: block; }
.busca .limpar:hover { color: var(--brand); }

/* Botão do carrinho */
.btn-carrinho {
  position: relative;
  flex: 0 0 auto;
  width: 44px; height: 44px;
  border: 1.5px dashed var(--line-forte);
  background: var(--surface);
  border-radius: var(--r-full);
  color: var(--ink);
  font-size: 1.15rem;
  display: grid;
  place-items: center;
  transition: transform .2s var(--mola), border-color .2s, color .2s;
}

.btn-carrinho:hover {
  border-color: var(--brand);
  color: var(--brand);
  transform: translateY(-1px);
}

.selo-contagem {
  position: absolute;
  top: -4px; right: -4px;
  min-width: 21px; height: 21px;
  padding: 0 5px;
  border-radius: var(--r-full);
  background: var(--brand);
  color: #fff;
  font-family: var(--mono);
  font-size: .66rem;
  font-weight: 600;
  display: grid;
  place-items: center;
  border: 2px solid var(--surface);
  transform: scale(0);
  transition: transform .3s var(--mola);
}

.selo-contagem.visivel { transform: scale(1); }
.selo-contagem.pulsando { animation: pulso .45s var(--mola); }

@keyframes pulso {
  0%   { transform: scale(1); }
  45%  { transform: scale(1.35); }
  100% { transform: scale(1); }
}

/* ------------------------------------------------------------ 4. hero ---- */
.hero {
  position: relative;
  overflow: hidden;
  background: var(--bg);
  /* Sem padding embaixo: a faixa de benefícios encosta na base do hero.
     Com padding, sobrava uma tira do gradiente solta abaixo dela. */
  padding: 4.5rem 0 0;
  text-align: center;
}

/* Textura de mesa de corte — quadriculado bem discreto, referência direta ao
   tapete de corte de confeitaria e à mesa de impressão 3D ao mesmo tempo. */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 36px 36px;
  -webkit-mask-image: radial-gradient(60% 60% at 50% 20%, #000 0%, transparent 75%);
  mask-image: radial-gradient(60% 60% at 50% 20%, #000 0%, transparent 75%);
  opacity: .55;
  pointer-events: none;
}

.hero-selo {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  color: var(--brand-dark);
  border: 1.5px dashed var(--line-forte);
  border-radius: var(--r-full);
  padding: .35rem .95rem;
  font-family: var(--mono);
  font-size: .68rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 1.4rem;
}

.hero h1 {
  position: relative;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.2rem, 5.8vw, 3.6rem);
  line-height: 1.08;
  letter-spacing: -.01em;
  margin: 0 0 .9rem;
}

.hero h1 em {
  font-style: italic;
  font-weight: 500;
  color: var(--brand);
}

.hero p {
  position: relative;
  max-width: 520px;
  margin: 0 auto;
  color: var(--ink-2);
  font-weight: 400;
  font-size: clamp(.95rem, 2.4vw, 1.08rem);
}

/* Faixa de confiança. Numa loja pequena, isto responde as três dúvidas que
   travam a compra antes de a pessoa perguntar. */
.beneficios {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border-top: 1.5px dashed var(--line-forte);
  margin-top: 3.5rem;
}

.beneficio {
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  padding: 1rem .75rem;
  font-size: .82rem;
  color: var(--ink-2);
}

.beneficio i { color: var(--brand); font-size: 1.05rem; }
.beneficio strong { font-weight: 600; color: var(--ink); }

/* --------------------------------------------------------- 5. filtros ---- */
.barra-secao {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 2.75rem 0 1.1rem;
  flex-wrap: wrap;
}

.barra-secao h2 {
  font-family: var(--serif);
  font-size: 1.5rem;
  margin: 0;
  font-weight: 600;
}

.contagem { font-family: var(--mono); color: var(--ink-soft); font-size: .8rem; }

.filtros {
  display: flex;
  gap: .5rem;
  overflow-x: auto;
  padding-bottom: .5rem;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.filtros::-webkit-scrollbar { display: none; }

.chip {
  flex: 0 0 auto;
  border: 1.5px dashed var(--line-forte);
  background: var(--surface);
  color: var(--ink-2);
  border-radius: var(--r-full);
  padding: .45rem 1.05rem;
  font-size: .855rem;
  font-weight: 500;
  white-space: nowrap;
  transition: all .2s var(--suave);
}

.chip:hover { border-color: var(--brand); color: var(--brand); transform: translateY(-1px); }

.chip.ativo {
  background: var(--brand);
  border-style: solid;
  border-color: var(--brand);
  color: #fff;
  box-shadow: 0 4px 12px rgba(214, 0, 122, .22);
}

/* ----------------------------------------------------------- 6. cards ---- */
.grade {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 236px), 1fr));
  gap: 1.4rem;
  padding: 1.25rem 0 3rem;
}

.produto {
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  /* O card inteiro abre o detalhe. Ele já se levanta no hover como um objeto
     único; ter só a foto e o título clicáveis contradizia esse sinal. */
  cursor: pointer;
  transition: transform .3s var(--suave), box-shadow .3s var(--suave), border-color .2s, border-style .2s;
  /* Entrada escalonada: o atraso é definido inline, por índice. */
  animation: entrada .5s var(--suave) both;
}

@keyframes entrada {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* O "trajeto do bico": no hover, a borda vira o contorno tracejado que uma
   impressora percorre antes da primeira camada — a peça está "sendo
   traçada". */
.produto:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: var(--brand);
  border-style: dashed;
}

.midia {
  position: relative;
  aspect-ratio: 1;
  background: linear-gradient(135deg, var(--blush), var(--surface));
  overflow: hidden;
}

/* A zona de compra é a exceção: clicar em "Adicionar" ou no +/- não deve
   abrir o detalhe por trás. */
.acao { cursor: default; }

.midia img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .6s var(--suave), opacity .35s var(--suave);
}

.produto:hover .midia img.principal { transform: scale(1.07); }

/* Segunda foto revelada no hover — truque clássico de e-commerce, e aqui é
   útil de verdade: mostra o biscoito pronto sem exigir clique. */
.midia img.alternativa {
  position: absolute;
  inset: 0;
  opacity: 0;
}
.produto:hover .midia img.alternativa { opacity: 1; transform: scale(1.07); }

.sem-foto {
  width: 100%; height: 100%;
  display: grid;
  place-items: center;
  color: var(--brand-2);
  font-size: 2.6rem;
  opacity: .5;
}

.selos {
  position: absolute;
  top: .7rem; left: .7rem;
  display: flex;
  flex-direction: column;
  gap: .35rem;
  align-items: flex-start;
  pointer-events: none;
}

.selo {
  border-radius: var(--r-sm);
  padding: .2rem .55rem;
  font-family: var(--mono);
  font-size: .64rem;
  font-weight: 600;
  letter-spacing: .02em;
  backdrop-filter: blur(4px);
}

.selo.ultimas { background: rgba(255, 250, 235, .95); color: #8A6200; }
.selo.esgotado { background: rgba(42, 36, 32, .85); color: #fff; }

.conta-fotos {
  position: absolute;
  right: .7rem; bottom: .7rem;
  background: rgba(42, 36, 32, .65);
  color: #fff;
  border-radius: var(--r-full);
  padding: .18rem .6rem;
  font-size: .7rem;
  display: flex;
  align-items: center;
  gap: .3rem;
  backdrop-filter: blur(3px);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .25s, transform .25s;
  pointer-events: none; /* é rótulo, não alvo — não pode roubar o clique */
}
.produto:hover .conta-fotos { opacity: 1; transform: none; }

.corpo {
  padding: 1rem 1.1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: .3rem;
  flex: 1;
}

.categoria-tag {
  font-family: var(--mono);
  font-size: .64rem;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--brand);
  font-weight: 600;
}

.produto h3 {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.35;
  cursor: pointer;
  transition: color .2s;
}
.produto h3:hover { color: var(--brand); }

.resumo {
  font-size: .82rem;
  color: var(--ink-soft);
  font-weight: 400;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.preco {
  font-family: var(--mono);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--ink);
  margin-top: auto;
  padding-top: .5rem;
  letter-spacing: -.01em;
}

/* Botões */
.btn {
  border: none;
  border-radius: var(--r-full);
  padding: .68rem 1.1rem;
  font-weight: 600;
  font-size: .885rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  transition: transform .18s var(--mola), background .2s, box-shadow .2s;
  width: 100%;
}

.btn:active { transform: scale(.97); }

.btn-primario { background: var(--brand); color: #fff; }
.btn-primario:hover { background: var(--brand-dark); box-shadow: 0 6px 18px rgba(214, 0, 122, .28); }
.btn-primario:disabled { background: #E7DDCF; color: #9C8F7F; cursor: not-allowed; box-shadow: none; }

.btn-whats { background: var(--whats); color: #fff; }
.btn-whats:hover { background: var(--whats-dark); box-shadow: 0 6px 18px rgba(37, 211, 102, .32); }

.btn-fantasma {
  background: transparent;
  border: 1.5px dashed var(--line-forte);
  color: var(--ink-2);
}
.btn-fantasma:hover { border-color: var(--brand); color: var(--brand); }

/* Contador de quantidade */
.qtd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--blush);
  border-radius: var(--r-full);
  padding: .28rem;
  animation: aparece .28s var(--mola);
}

@keyframes aparece {
  from { opacity: 0; transform: scale(.92); }
  to   { opacity: 1; transform: none; }
}

.qtd button {
  border: none;
  background: var(--surface);
  color: var(--brand);
  width: 34px; height: 34px;
  border-radius: 50%;
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-sm);
  transition: transform .15s var(--mola), color .2s, background .2s;
}
.qtd button:hover:not(:disabled) { background: var(--brand); color: #fff; }
.qtd button:active:not(:disabled) { transform: scale(.9); }
.qtd button:disabled { color: #CFC2B3; cursor: not-allowed; box-shadow: none; }
.qtd .valor { font-family: var(--mono); font-weight: 600; font-variant-numeric: tabular-nums; }

.aviso-esgotado {
  font-size: .8rem;
  color: var(--ink-soft);
  font-style: italic;
  padding: .55rem 0;
  text-align: center;
}

/* Esqueleto de carregamento — melhor que a palavra "Carregando", porque já
   mostra a forma da página que vem. */
.esqueleto {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
}
.esqueleto .bloco { background: #ECE3D3; position: relative; overflow: hidden; }
.esqueleto .bloco::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .8), transparent);
  animation: brilho 1.4s infinite;
}
@keyframes brilho { 100% { transform: translateX(100%); } }
.esqueleto .capa { aspect-ratio: 1; }
.esqueleto .linha { height: 12px; border-radius: 6px; margin: .75rem 1.1rem 0; }
.esqueleto .linha.curta { width: 45%; }
.esqueleto .linha.media { width: 75%; }
.esqueleto .linha:last-child { margin-bottom: 1.3rem; }

/* Estados vazios */
.vazio {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4.5rem 1.5rem;
  color: var(--ink-soft);
}
.vazio i { font-size: 3.2rem; color: var(--brand-2); opacity: .55; display: block; margin-bottom: .9rem; }
.vazio h3 { font-family: var(--serif); color: var(--ink); font-size: 1.35rem; font-weight: 600; margin: 0 0 .4rem; }
.vazio p { margin: 0 auto; max-width: 340px; }

/* ------------------------------------------------- 7. detalhe do produto -- */
.veu {
  position: fixed;
  inset: 0;
  background: rgba(42, 36, 32, .5);
  backdrop-filter: blur(3px);
  z-index: 80;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s var(--suave);
}
.veu.aberto { opacity: 1; pointer-events: auto; }

.painel-detalhe {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 1rem;
  pointer-events: none;
  /* visibility: hidden tira o painel do teste de clique de vez. Só
     `pointer-events: none` no pai não basta: um filho com `auto` volta a
     receber eventos, e era exatamente isso que fazia o modal fechado —
     invisível, mas ocupando 880px no meio da tela — engolir os cliques nos
     cards atrás dele. */
  visibility: hidden;
}

.painel-detalhe.aberto {
  visibility: visible;
  pointer-events: auto;
}

.detalhe {
  background: var(--surface);
  border-radius: var(--r-lg);
  width: min(880px, 100%);
  max-height: 92vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(18px) scale(.97);
  transition: opacity .3s var(--suave), transform .35s var(--mola);
  pointer-events: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.painel-detalhe.aberto .detalhe {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.detalhe .fechar {
  position: absolute;
  top: .8rem; right: .8rem;
  z-index: 3;
  width: 36px; height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 254, 251, .92);
  color: var(--ink);
  font-size: 1.25rem;
  line-height: 1;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow-sm);
  transition: transform .2s var(--mola), background .2s;
}
.detalhe .fechar:hover { background: #fff; transform: rotate(90deg); }

.galeria { position: relative; background: var(--blush); }

.palco { position: relative; aspect-ratio: 1; }
.palco img { width: 100%; height: 100%; object-fit: cover; }

.seta {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px; height: 40px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 254, 251, .92);
  color: var(--ink);
  font-size: 1.3rem;
  line-height: 1;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow);
  transition: background .2s, transform .2s var(--mola);
}
.seta:hover { background: #fff; }
.seta.esq { left: .75rem; }
.seta.dir { right: .75rem; }
.seta.esq:hover { transform: translateY(-50%) translateX(-2px); }
.seta.dir:hover { transform: translateY(-50%) translateX(2px); }

.miniaturas {
  display: flex;
  gap: .5rem;
  padding: .75rem;
  overflow-x: auto;
  scrollbar-width: thin;
}
.miniaturas img {
  width: 58px; height: 58px;
  object-fit: cover;
  border-radius: var(--r-sm);
  cursor: pointer;
  border: 2px solid transparent;
  flex: 0 0 auto;
  opacity: .6;
  transition: opacity .2s, border-color .2s, transform .2s var(--mola);
}
.miniaturas img:hover { opacity: 1; transform: translateY(-2px); }
.miniaturas img.ativa { border-color: var(--brand); opacity: 1; }

.detalhe-info {
  padding: 2rem 1.9rem;
  display: flex;
  flex-direction: column;
  gap: .55rem;
}
.detalhe-info h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.75rem;
  line-height: 1.2;
  margin: 0;
}
.detalhe-info .descricao {
  color: var(--ink-2);
  font-weight: 400;
  white-space: pre-line;
  margin: .3rem 0 0;
}
.detalhe-info .preco-grande {
  font-family: var(--mono);
  font-size: 1.85rem;
  font-weight: 600;
  letter-spacing: -.01em;
  margin: .5rem 0 0;
}
.detalhe-info .estoque-info {
  font-size: .82rem;
  color: var(--ink-soft);
  display: flex;
  align-items: center;
  gap: .4rem;
}
.detalhe-info .estoque-info .ponto {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #35A66A;
}
.detalhe-info .estoque-info.zero .ponto { background: #C4483A; }
.detalhe-acao { margin-top: auto; padding-top: 1.1rem; }

.nota-checkout {
  margin-top: .8rem;
  font-size: .78rem;
  color: var(--ink-soft);
  display: flex;
  gap: .45rem;
  align-items: flex-start;
  line-height: 1.45;
}
.nota-checkout i { color: var(--whats); font-size: .95rem; margin-top: .1rem; }

/* Modais de texto longo (política de trocas, cuidados com as peças) —
   mesmo padrão do detalhe do produto: visibility (não só pointer-events)
   para o modal fechado não engolir clique nenhum. */
.painel-doc {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 1rem;
  pointer-events: none;
  visibility: hidden;
}

.painel-doc.aberto {
  visibility: visible;
  pointer-events: auto;
}

.doc {
  position: relative;
  background: var(--surface);
  border-radius: var(--r-lg);
  width: min(620px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  padding: 2.25rem 2rem 2rem;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(18px) scale(.97);
  transition: opacity .3s var(--suave), transform .35s var(--mola);
  pointer-events: none;
}

.painel-doc.aberto .doc {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

.doc .fechar {
  position: absolute;
  top: .8rem; right: .8rem;
  width: 36px; height: 36px;
  border: none;
  border-radius: 50%;
  background: var(--cream);
  color: var(--ink);
  font-size: 1.25rem;
  line-height: 1;
  display: grid;
  place-items: center;
  transition: transform .2s var(--mola), background .2s;
}
.doc .fechar:hover { background: var(--blush); transform: rotate(90deg); }

.doc h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.6rem;
  margin: 0 0 1.25rem;
  padding-bottom: .9rem;
  border-bottom: 1.5px dashed var(--line);
}

.doc h3 {
  font-family: var(--mono);
  font-size: .7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--brand);
  margin: 1.6rem 0 .4rem;
}
.doc h3:first-of-type { margin-top: 0; }

.doc p {
  margin: 0 0 .6rem;
  color: var(--ink-2);
  font-size: .92rem;
  line-height: 1.6;
}

.doc strong { color: var(--ink); font-weight: 600; }

.doc-intro {
  color: var(--ink-2);
  font-size: .95rem;
  padding-bottom: 1.2rem;
  margin-bottom: .4rem;
  border-bottom: 1.5px dashed var(--line);
}

.doc ul {
  margin: 0 0 .8rem;
  padding-left: 1.1rem;
  color: var(--ink-2);
  font-size: .92rem;
  line-height: 1.6;
}

.doc li { margin-bottom: .35rem; }

/* Marcador quadrado em vez de bolinha: ecoa a mesa de corte do resto da
   identidade, e destoa menos do tracejado. */
.doc li::marker { color: var(--brand); content: "▪  "; }

.doc-acao {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1.5px dashed var(--line);
}

.doc-acao .btn { text-decoration: none; }

.doc-nota {
  display: flex;
  gap: .5rem;
  align-items: flex-start;
  background: var(--cream);
  border-radius: var(--r-sm);
  padding: .8rem .9rem;
  margin: 0 0 1rem;
  font-size: .84rem;
  line-height: 1.5;
}

.doc-nota i { color: var(--brand); margin-top: .1rem; flex: none; }

/* ------------------------------------------------ 8. carrinho lateral ---- */
.carrinho {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(400px, 100%);
  background: var(--surface);
  z-index: 90;
  display: flex;
  flex-direction: column;
  box-shadow: -12px 0 40px rgba(42, 36, 32, .16);
  transform: translateX(100%);
  transition: transform .38s var(--suave);
}
.carrinho.aberto { transform: none; }

.carrinho-topo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.15rem 1.25rem;
  border-bottom: 1.5px dashed var(--line);
}
.carrinho-topo h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.25rem;
  margin: 0;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.carrinho-topo .fechar-lateral {
  border: none;
  background: none;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--ink-soft);
  padding: .25rem .4rem;
  border-radius: var(--r-sm);
  transition: color .2s, background .2s;
}
.carrinho-topo .fechar-lateral:hover { color: var(--ink); background: var(--bg); }

.carrinho-itens {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.item {
  display: grid;
  grid-template-columns: 68px 1fr;
  gap: .85rem;
  animation: entrada .3s var(--suave) both;
}

.item .foto-item {
  width: 68px; height: 68px;
  border-radius: var(--r-sm);
  object-fit: cover;
  background: var(--blush);
}
.item .foto-item.vazia { display: grid; place-items: center; color: var(--brand-2); }

.item-info { display: flex; flex-direction: column; gap: .3rem; min-width: 0; }
.item-info .nome { font-size: .9rem; font-weight: 600; line-height: 1.3; }
.item-info .unitario { font-family: var(--mono); font-size: .76rem; color: var(--ink-soft); }
.item-linha { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }

.qtd-mini {
  display: inline-flex;
  align-items: center;
  gap: .1rem;
  border: 1px solid var(--line-forte);
  border-radius: var(--r-sm);
  overflow: hidden;
}
.qtd-mini button {
  border: none;
  background: var(--surface);
  width: 28px; height: 28px;
  color: var(--brand);
  font-size: 1rem;
  line-height: 1;
  transition: background .15s;
}
.qtd-mini button:hover:not(:disabled) { background: var(--blush); }
.qtd-mini button:disabled { color: #CFC2B3; cursor: not-allowed; }
.qtd-mini .valor {
  min-width: 26px;
  text-align: center;
  font-family: var(--mono);
  font-size: .82rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.item-total { font-family: var(--mono); font-weight: 600; font-size: .9rem; }

.remover-item {
  border: none;
  background: none;
  color: var(--ink-soft);
  font-size: .95rem;
  padding: .2rem;
  transition: color .2s;
}
.remover-item:hover { color: #C4483A; }

.carrinho-rodape {
  border-top: 1.5px dashed var(--line);
  padding: 1.15rem 1.25rem 1.35rem;
  background: var(--surface);
}
.linha-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: .3rem;
}
.linha-total .rotulo { color: var(--ink-2); font-size: .9rem; }
.linha-total .valor { font-family: var(--mono); font-size: 1.4rem; font-weight: 600; letter-spacing: -.01em; }
.aviso-frete {
  font-size: .78rem;
  color: var(--ink-soft);
  margin: 0 0 .9rem;
  display: flex;
  gap: .4rem;
  align-items: flex-start;
  line-height: 1.45;
}
.aviso-frete i { color: var(--brand); margin-top: .1rem; }

.carrinho-vazio {
  flex: 1;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 2rem;
  color: var(--ink-soft);
}
.carrinho-vazio i { font-size: 3rem; color: var(--blush); display: block; margin-bottom: .8rem; }

/* Barra fixa no mobile — atalho para o carrinho sem subir a página. */
.barra-mobile {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 70;
  background: var(--surface);
  border-top: 1.5px dashed var(--line);
  box-shadow: 0 -6px 24px rgba(42, 36, 32, .1);
  padding: .7rem 1rem;
  display: none;
  align-items: center;
  gap: .9rem;
  transform: translateY(110%);
  transition: transform .35s var(--mola);
}
.barra-mobile.visivel { transform: none; }
.barra-mobile .info { flex: 1; min-width: 0; }
.barra-mobile .qtd-itens { font-size: .74rem; color: var(--ink-soft); }
.barra-mobile .total { font-family: var(--mono); font-size: 1.1rem; font-weight: 600; }
.barra-mobile .btn { width: auto; padding: .68rem 1.15rem; }

/* --------------------------------------------------------- 9. avisos ---- */
.avisos {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 120;
  display: flex;
  flex-direction: column;
  gap: .5rem;
  align-items: center;
  pointer-events: none;
  width: max-content;
  max-width: calc(100vw - 2rem);
}

.aviso {
  background: var(--ink);
  color: #fff;
  border-radius: var(--r-full);
  padding: .65rem 1.15rem;
  font-size: .865rem;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: .55rem;
  box-shadow: var(--shadow-lg);
  animation: sobe .35s var(--mola) both;
}
.aviso.saindo { animation: desce .25s var(--suave) forwards; }
.aviso i { color: var(--brand-2); font-size: 1rem; }

@keyframes sobe { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes desce { to { opacity: 0; transform: translateY(10px); } }

/* -------------------------------------------- 10. rodapé, responsivo e portão ---- */
.rodape {
  background: var(--surface);
  border-top: 1.5px dashed var(--line);
  margin-top: 2rem;
  padding: 2.75rem 0 1.75rem;
}

.rodape-grade {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2rem;
  padding-bottom: 2rem;
}

.rodape h4 {
  font-family: var(--mono);
  font-size: .68rem;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--ink-soft);
  margin: 0 0 .85rem;
  font-weight: 500;
}

.rodape p { color: var(--ink-2); font-size: .88rem; font-weight: 400; margin: 0; max-width: 300px; }
.rodape ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.rodape a {
  color: var(--ink-2);
  text-decoration: none;
  font-size: .88rem;
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  transition: color .2s;
}
.rodape a:hover { color: var(--brand); }

.rodape-base {
  border-top: 1px solid var(--line);
  padding-top: 1.25rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: .74rem;
  color: var(--ink-soft);
}

@media (max-width: 860px) {
  .detalhe { grid-template-columns: 1fr; }
  .detalhe-info { padding: 1.35rem 1.25rem 1.6rem; }
  .rodape-grade { grid-template-columns: 1fr; gap: 1.75rem; }
}

@media (max-width: 720px) {
  :root { --topo-h: 62px; }
  body { padding-bottom: 5rem; }

  /* No celular a busca ganha a própria linha: espremida ao lado do logo,
     ela vira um campo de 80px que ninguém usa. */
  .topo-int { flex-wrap: wrap; height: auto; padding: .7rem 0 .8rem; gap: .7rem; }
  .logo { flex: 1; }
  .busca { order: 3; flex-basis: 100%; max-width: none; margin: 0; }

  /* Mantém o padding-bottom zerado: a faixa de benefícios continua encostada
     na base do hero, como no desktop. */
  .hero { padding: 3rem 0 0; }
  .beneficios { grid-template-columns: 1fr; margin-top: 2rem; }
  .beneficio { justify-content: flex-start; padding: .7rem 1.25rem; }

  .grade { grid-template-columns: repeat(auto-fill, minmax(min(100%, 158px), 1fr)); gap: .9rem; }
  .corpo { padding: .8rem .85rem 1rem; }
  .produto h3 { font-size: .92rem; }
  .resumo { display: none; }
  .preco { font-size: 1.05rem; }

  .barra-mobile { display: flex; }
  .avisos { bottom: 5.5rem; }
}

/* --------------------------------------------------- portão de senha ---- */
/* [hidden] é atributo, não classe — sem essa regra o `display: flex` abaixo
   teria a mesma especificidade e venceria por vir depois no cascade, e
   `gate.hidden = true` no JS não escondia nada na prática. */
.gate[hidden] { display: none; }

.gate {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  color: #fff;
  background:
    radial-gradient(circle at 25% 15%, rgba(255,255,255,.10), transparent 45%),
    linear-gradient(160deg, var(--ink) 0%, var(--brand-dark) 55%, var(--brand) 100%);
  overflow: hidden;
}

.gate::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 34px 34px;
  pointer-events: none;
}

.gate-caixa {
  position: relative;
  width: 100%;
  max-width: 340px;
  text-align: center;
}

.gate-logo {
  width: 84px;
  margin: 0 auto 1.1rem;
  filter: drop-shadow(0 8px 20px rgba(0,0,0,.15));
}

.gate-caixa h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.6rem;
  margin: 0 0 .5rem;
}

.gate-caixa p {
  opacity: .9;
  font-size: .9rem;
  margin: 0 0 1.5rem;
}

#gateForm {
  display: flex;
  gap: .5rem;
}

#gateSenha {
  flex: 1;
  border: none;
  border-radius: var(--r-full);
  padding: .68rem 1rem;
  font-size: .9rem;
  background: rgba(255, 255, 255, .94);
  color: var(--ink);
}

#gateBotao { width: auto; padding: .68rem 1.3rem; }

.gate-erro {
  position: relative;
  min-height: 1.2em;
  margin: .75rem 0 0;
  font-size: .82rem;
  color: #FFE1EC;
}
