:root {
  --fundo: #fffdf9;
  --creme: #f7f1e8;
  --rose: #efe7e6;
  --linha: #e9dfd2;
  --texto: #3a2f25;
  --suave: #8a7a68;
  --ouro: #a97a2f;
  --ouro-escuro: #8a6123;
  --ouro-grad: linear-gradient(135deg, #9c6d27 0%, #c9a75e 45%, #dcc68a 60%, #a97a2f 100%);
  --raio: 14px;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --sans: "Jost", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fundo);
  color: var(--texto);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
}
body.travado { overflow: hidden; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }
a { color: var(--ouro-escuro); }

/* ---------- Topo ---------- */
.topo {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
  background: rgba(255, 253, 249, .92);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--linha);
}
.topo-marca { display: flex; align-items: center; gap: 8px; text-decoration: none; }
.topo-marca img:first-child { height: 30px; width: auto; }
.topo-nome { height: 22px; width: auto; }
.botao-carrinho {
  position: relative; display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 50%;
  color: var(--ouro-escuro); background: var(--creme);
  border: 1px solid var(--linha);
}
.contador {
  position: absolute; top: -3px; right: -3px;
  min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
  background: var(--ouro-grad); color: #fff;
  font-size: 12px; font-weight: 500; line-height: 20px; text-align: center;
  box-shadow: 0 0 0 2px var(--fundo);
}
.contador.pulo { animation: pulo .35s ease; }
@keyframes pulo { 50% { transform: scale(1.3); } }

/* ---------- Capa ---------- */
.capa { text-align: center; padding: 28px 24px 8px; }
.capa-simbolo { width: 110px; height: auto; margin: 0 auto 6px; }
.capa h1 { margin: 0; }
.capa h1 img { width: min(300px, 78vw); height: auto; margin: 0 auto; }
.capa-sub {
  margin: 8px 0 0; font-family: var(--serif); font-size: 15px;
  letter-spacing: .38em; text-transform: uppercase; color: var(--ouro);
}
.capa-texto { max-width: 420px; margin: 14px auto 0; color: var(--suave); font-size: 14.5px; }

/* ---------- Busca e categorias ---------- */
.vitrine { max-width: 1080px; margin: 0 auto; padding: 18px 14px 40px; }
.busca {
  display: flex; align-items: center; gap: 8px;
  padding: 0 14px; height: 46px; border-radius: 23px;
  background: #fff; border: 1px solid var(--linha); color: var(--suave);
}
.busca:focus-within { border-color: var(--ouro); }
.busca input {
  flex: 1; border: 0; outline: 0; background: transparent;
  font: inherit; font-size: 16px; color: var(--texto); min-width: 0;
}
.categorias {
  display: flex; gap: 8px; overflow-x: auto; padding: 14px 2px 6px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.categorias::-webkit-scrollbar { display: none; }
.chip {
  flex: none; padding: 8px 16px; border-radius: 20px;
  border: 1px solid var(--linha); background: #fff;
  font-size: 14px; color: var(--texto); white-space: nowrap;
}
.chip[aria-selected="true"] { background: var(--texto); border-color: var(--texto); color: #fff; }
.aviso-vazio { text-align: center; color: var(--suave); padding: 30px 0; }

/* ---------- Grade ---------- */
.grade {
  display: grid; gap: 12px; margin-top: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
@media (min-width: 640px) { .grade { grid-template-columns: repeat(3, 1fr); gap: 18px; } }
@media (min-width: 960px) { .grade { grid-template-columns: repeat(4, 1fr); } }

.card {
  display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--linha); border-radius: var(--raio);
  overflow: hidden;
}
.card-foto {
  position: relative; display: block; width: 100%; padding: 0; border: 0;
  aspect-ratio: 1; background: var(--creme);
}
.card-foto img { width: 100%; height: 100%; object-fit: cover; }
.card-corpo { display: flex; flex-direction: column; flex: 1; padding: 10px 10px 12px; }
.card-nome {
  margin: 0; font-family: var(--serif); font-weight: 600; font-size: 18px; line-height: 1.15;
  background: none; border: 0; padding: 0; text-align: left;
}
.card-cod { font-size: 11.5px; color: var(--suave); letter-spacing: .04em; margin-top: 2px; }
.preco { font-weight: 500; color: var(--ouro-escuro); margin: 6px 0 10px; }
.preco.consulte { color: var(--suave); font-style: italic; font-weight: 400; }
.card .botao { margin-top: auto; padding: 10px 4px; font-size: 13px; letter-spacing: 0; white-space: nowrap; }
@media (min-width: 400px) { .card .botao { font-size: 14px; } }
.esgotado .card-foto img { filter: grayscale(.7); opacity: .6; }
.selo {
  position: absolute; top: 8px; left: 8px;
  padding: 3px 10px; border-radius: 12px;
  background: rgba(58, 47, 37, .85); color: #fff;
  font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase;
}
.selo-fotos {
  position: absolute; bottom: 8px; right: 8px;
  padding: 2px 8px; border-radius: 10px; background: rgba(255,255,255,.88);
  font-size: 11px; color: var(--suave);
}

/* ---------- Botões ---------- */
.botao {
  display: block; width: 100%; padding: 11px 10px; border-radius: 24px;
  border: 0; background: var(--ouro-grad); color: #fff;
  font-size: 14.5px; font-weight: 500; letter-spacing: .02em; text-align: center; text-decoration: none;
  box-shadow: 0 2px 8px rgba(169, 122, 47, .25);
}
.botao:active { transform: scale(.98); }
.botao.contorno { background: #fff; color: var(--ouro-escuro); border: 1px solid var(--ouro); box-shadow: none; }
.botao.grande { padding: 15px; font-size: 16px; }
.botao[disabled] { background: #d9d2c8; box-shadow: none; cursor: default; }
.indisponivel-txt { text-align: center; color: var(--suave); font-size: 13.5px; padding: 10px 0 2px; margin-top: auto; }

/* ---------- Painéis (detalhe e carrinho) ---------- */
.painel { position: fixed; inset: 0; z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.painel-fundo { position: absolute; inset: 0; background: rgba(40, 30, 20, .45); animation: aparece .2s ease; }
.painel-caixa {
  position: relative; width: 100%; max-width: 560px; max-height: 92vh; max-height: 92dvh;
  overflow-y: auto; overscroll-behavior: contain;
  background: var(--fundo); border-radius: 20px 20px 0 0;
  padding-bottom: env(safe-area-inset-bottom);
  animation: sobe .25s ease;
}
@media (min-width: 700px) {
  .painel { align-items: center; }
  .painel-caixa { border-radius: 20px; max-height: 88vh; }
}
@keyframes aparece { from { opacity: 0; } }
@keyframes sobe { from { transform: translateY(40px); opacity: 0; } }
.fechar {
  position: absolute; top: 10px; right: 10px; z-index: 3;
  width: 40px; height: 40px; border-radius: 50%; border: 0;
  background: rgba(255,255,255,.92); font-size: 26px; line-height: 1; color: var(--texto);
  box-shadow: 0 1px 6px rgba(0,0,0,.12);
}

/* Detalhe */
.galeria {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
  scrollbar-width: none; background: var(--creme); aspect-ratio: 1;
}
.galeria::-webkit-scrollbar { display: none; }
.galeria button { flex: none; width: 100%; height: 100%; padding: 0; border: 0; scroll-snap-align: center; background: none; cursor: zoom-in; }
.galeria img { width: 100%; height: 100%; object-fit: contain; }
.pontos { display: flex; justify-content: center; gap: 6px; padding: 10px 0 0; min-height: 8px; }
.pontos span { width: 7px; height: 7px; border-radius: 50%; background: var(--linha); transition: background .2s; }
.pontos span.ativo { background: var(--ouro); }
.detalhe-info { padding: 8px 20px 24px; }
.detalhe-cat { margin: 0; font-size: 12px; letter-spacing: .2em; text-transform: uppercase; color: var(--ouro); }
.detalhe-info h2 { margin: 4px 0 2px; font-family: var(--serif); font-weight: 600; font-size: 28px; line-height: 1.1; }
.detalhe-preco { font-size: 20px; font-weight: 500; color: var(--ouro-escuro); margin: 6px 0 12px; }
.detalhe-preco.consulte { color: var(--suave); font-style: italic; font-weight: 400; font-size: 17px; }
.detalhe-desc { margin: 0 0 12px; color: #5b4d40; white-space: pre-line; }
.detalhe-ficha { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0 0 18px; font-size: 14.5px; }
.detalhe-ficha dt { color: var(--suave); }
.detalhe-ficha dd { margin: 0; }
.detalhe .selo { position: static; display: inline-block; margin-bottom: 10px; }

/* Zoom */
.zoom { position: fixed; inset: 0; z-index: 60; background: #fff; display: flex; flex-direction: column; }
.zoom-area { flex: 1; overflow: auto; display: flex; -webkit-overflow-scrolling: touch; }
.zoom-area img { margin: auto; width: 100%; max-width: 900px; cursor: zoom-in; touch-action: manipulation; }
.zoom-area.perto img { width: 240%; max-width: none; cursor: zoom-out; }
.zoom-dica { margin: 0; padding: 10px 0 max(10px, env(safe-area-inset-bottom)); text-align: center; font-size: 13px; color: var(--suave); }

/* Carrinho */
.carrinho { padding: 22px 18px 20px; }
.carrinho h2 { margin: 0 0 14px; font-family: var(--serif); font-weight: 600; font-size: 26px; }
.item { display: grid; grid-template-columns: 64px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--linha); }
.item img { width: 64px; height: 64px; object-fit: cover; border-radius: 10px; background: var(--creme); }
.item-nome { font-family: var(--serif); font-weight: 600; font-size: 17px; line-height: 1.15; }
.item-cod { font-size: 12px; color: var(--suave); }
.item-linha { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; gap: 8px; }
.qtd { display: inline-flex; align-items: center; border: 1px solid var(--linha); border-radius: 20px; background: #fff; }
.qtd button { width: 36px; height: 34px; border: 0; background: none; font-size: 19px; color: var(--ouro-escuro); }
.qtd span { min-width: 22px; text-align: center; font-weight: 500; }
.item-preco { font-weight: 500; color: var(--ouro-escuro); white-space: nowrap; }
.item-preco.consulte { color: var(--suave); font-style: italic; font-weight: 400; }
.remover { border: 0; background: none; padding: 4px 0; font-size: 13px; color: var(--suave); text-decoration: underline; }
.total { display: flex; justify-content: space-between; align-items: baseline; padding: 16px 0 4px; font-size: 18px; }
.total strong { font-size: 22px; color: var(--ouro-escuro); font-weight: 500; text-align: right; }
.total small { display: block; font-size: 13px; color: var(--suave); font-weight: 400; }
.nota { font-size: 13px; color: var(--suave); margin: 2px 0 14px; }
.carrinho-vazio { text-align: center; padding: 20px 0 8px; color: var(--suave); }
.carrinho-vazio img { width: 70px; margin: 0 auto 10px; opacity: .8; }

.form { display: grid; gap: 12px; margin-top: 4px; }
.form label { display: grid; gap: 5px; font-size: 14px; color: var(--suave); }
.form input, .form textarea {
  width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--linha);
  background: #fff; font: inherit; font-size: 16px; color: var(--texto); resize: vertical;
}
.form input:focus, .form textarea:focus { outline: 0; border-color: var(--ouro); }
.form .erro { border-color: #b4463b; }
.msg-erro { color: #b4463b; font-size: 13px; }
.voltar { border: 0; background: none; color: var(--suave); text-decoration: underline; padding: 8px; font-size: 14px; }
.enviado { text-align: center; padding: 10px 0; }
.enviado p { color: #5b4d40; }
.acoes { display: grid; gap: 10px; margin-top: 14px; }

/* Aviso rápido */
.aviso {
  position: fixed; left: 50%; bottom: max(20px, env(safe-area-inset-bottom)); z-index: 80;
  transform: translate(-50%, 30px); opacity: 0; pointer-events: none;
  padding: 11px 18px; border-radius: 24px; background: var(--texto); color: #fff;
  font-size: 14px; white-space: nowrap; transition: .25s ease;
}
.aviso.mostra { transform: translate(-50%, 0); opacity: 1; }

/* Rodapé */
.rodape { text-align: center; padding: 26px 16px 40px; border-top: 1px solid var(--linha); color: var(--suave); font-size: 14px; }
.rodape img { width: 44px; height: auto; margin: 0 auto 6px; }
.rodape p { margin: 4px 0; }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
