/* ================================================================
   CORES E MEDIDAS — mude aqui para trocar o visual inteiro
   ================================================================ */
:root {
  --dourado: #d9b56c;
  --dourado-escuro: #b8934a;
  --preto: #0d0d0d;
  --cartao: #121212;
  --borda: #2c2c2c;
  --fundo: #ffffff;
  --texto-claro: #f5f5f5;
  --texto-suave: #a7a7a7;
  --verde-whats: #25d366;
  --altura-topo: 128px;
  --altura-rodape: 84px;
  --largura-max: 560px;
  --fonte: "Poppins", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--fundo);
  color: #111;
  font-family: var(--fonte);
}
button { font: inherit; cursor: pointer; }
img { display: block; }

/* ---------- TOPO FIXO ---------- */
.topo {
  position: fixed; inset: 0 0 auto 0; z-index: 20;
  height: var(--altura-topo);
  background: var(--preto);
}
.topo-dentro { position: relative; height: 100%; max-width: var(--largura-max); margin: 0 auto; }
.categorias {
  display: flex; gap: 6px;
  height: 100%;
  padding: 10px 10px 0;
  overflow-x: auto; scrollbar-width: none;
  scroll-snap-type: x proximity;
}
.categorias::-webkit-scrollbar { display: none; }
/* setas das categorias (aparecem quando tem mais categorias para o lado) */
.seta-cat {
  position: absolute; top: 34px; z-index: 2;
  width: 32px; height: 32px; border-radius: 50%; border: 0; padding: 0;
  display: grid; place-items: center; cursor: pointer;
  background: var(--dourado); color: #111;
  box-shadow: 0 0 0 4px rgba(13,13,13,.85), 0 2px 10px rgba(0,0,0,.6);
}
.seta-cat[hidden] { display: none; }
.seta-cat svg { width: 22px; height: 22px; }
.seta-cat::after { content: ""; position: absolute; inset: -6px; }
.seta-cat-esq { left: 6px; }
.seta-cat-dir { right: 6px; }
.seta-cat:hover { background: #e8c886; }
@media (hover: none) { .seta-cat { display: none !important; } } /* no celular se arrasta com o dedo */
.cat {
  flex: 0 0 auto; width: 88px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  background: none; border: 0; padding: 0;
  color: var(--texto-claro); text-decoration: none;
  scroll-snap-align: start;
  position: relative;
}
.cat-foto {
  width: 76px; height: 76px; border-radius: 50%;
  background: #2b2b2b; overflow: hidden;
  border: 2px solid #3a3a3a;
  transition: border-color .2s, background .2s;
}
.cat-foto img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; }
.cat-nome {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .02em;
  text-align: center; line-height: 1.15; max-width: 88px;
}
.cat.ativa .cat-foto { border-color: var(--dourado); background: var(--dourado); }
.cat.ativa::after {
  content: ""; position: absolute; bottom: 4px; left: 50%; transform: translateX(-50%);
  width: 34px; height: 4px; border-radius: 4px; background: var(--dourado);
}

/* ---------- CATÁLOGO ---------- */
.catalogo {
  max-width: var(--largura-max); margin: 0 auto;
  padding: calc(var(--altura-topo) + 8px) 6px calc(var(--altura-rodape) + 20px);
}
.carregando { text-align: center; color: #777; padding: 40px 0; }
.secao { scroll-margin-top: calc(var(--altura-topo) + 4px); }
.secao-titulo {
  margin: 12px 0 8px; text-align: center;
  font-size: 17px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase;
}

/* ---------- CARTÃO DO PRODUTO (compacto) ---------- */
.produto {
  --foto: 92px; /* largura da foto do produto: aumente para fotos maiores */
  display: grid; grid-template-columns: var(--foto) 1fr; grid-template-rows: auto 1fr; gap: 0 10px;
  background: var(--cartao); color: var(--texto-claro);
  border-radius: 12px; padding: 7px;
  margin-bottom: 7px;
}
@media (min-width: 520px) { .produto { --foto: 120px; } }
.galeria { grid-row: 1 / span 2; position: relative; align-self: start; }
.fotos {
  display: flex; overflow-x: auto; scroll-snap-type: x mandatory;
  border-radius: 8px; background: #fff;
  aspect-ratio: 4 / 5;
  scrollbar-width: none;
}
.fotos::-webkit-scrollbar { display: none; }
.fotos img {
  flex: 0 0 100%; width: 100%; height: 100%; object-fit: cover;
  scroll-snap-align: center; cursor: zoom-in;
}
.pontos {
  position: absolute; left: 0; right: 0; bottom: 5px;
  display: flex; justify-content: center; gap: 4px; pointer-events: none;
}
.pontos i { width: 5px; height: 5px; border-radius: 50%; background: rgba(255,255,255,.75); box-shadow: 0 0 2px rgba(0,0,0,.6); transition: background .2s; }
.pontos i.on { background: var(--dourado); }
/* setas para passar as fotos */
.seta {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 22px; height: 22px; border-radius: 50%; border: 0; padding: 0;
  display: grid; place-items: center;
  background: rgba(255,255,255,.88); color: #111;
  box-shadow: 0 1px 4px rgba(0,0,0,.35);
}
.seta[hidden] { display: none; }
.seta svg { width: 18px; height: 18px; }
.seta::after { content: ""; position: absolute; inset: -8px; } /* área de toque maior */
.seta-esq { left: 3px; }
.seta-dir { right: 3px; animation: cutucar 1.1s ease-in-out .8s 2; }
@keyframes cutucar { 0%, 100% { transform: translate(0, -50%); } 50% { transform: translate(4px, -50%); } }
.moldura { position: relative; }
.baixar-fotos {
  margin-top: 5px; width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 4px;
  background: var(--dourado); color: #111;
  border: 0; border-radius: 7px; padding: 5px 0;
  font: 700 11px var(--fonte); white-space: nowrap;
  touch-action: manipulation;
}
.baixar-fotos:disabled { opacity: .6; }

/* Aviso "Baixe as fotos aqui" (aparece uma vez, no 1º produto) */
.produto { position: relative; }
.dica-fotos {
  position: absolute; z-index: 5; left: calc(var(--foto) + 22px); bottom: 2px; width: min(225px, calc(100% - var(--foto) - 26px));
  background: #fff; color: #111; border-radius: 12px; padding: 10px 12px;
  box-shadow: 0 6px 22px rgba(0,0,0,.4); font-size: 12.5px; line-height: 1.35;
  animation: aparecer .3s ease-out;
}
.dica-fotos::before { content: ""; position: absolute; left: -7px; bottom: 12px; border: 7px solid transparent; border-left: 0; border-right-color: #fff; }
.dica-fotos strong { display: block; font-size: 13px; margin-bottom: 2px; }
.dica-fotos button { margin-top: 7px; background: #111; color: var(--dourado); border: 0; border-radius: 8px; padding: 6px 14px; font: 700 12px var(--fonte); }
.produto.com-dica .baixar-fotos { box-shadow: 0 0 0 3px rgba(217,181,108,.45); }
@keyframes aparecer { from { opacity: 0; transform: translateX(-6px); } }

.info { grid-column: 2; min-width: 0; }
.rotulo { font-size: 9px; letter-spacing: .12em; text-transform: uppercase; color: var(--texto-suave); line-height: 1.3; }
.nome {
  margin: 0; font-size: 13px; line-height: 1.2; font-weight: 700; text-transform: uppercase;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.preco { color: var(--dourado); font-weight: 700; font-size: 16px; line-height: 1.2; margin: 2px 0 6px; }
.preco small { font-size: 11px; margin-right: 2px; }
.preco s { color: var(--texto-suave); font-size: 11px; font-weight: 500; margin-left: 5px; }

/* Tamanhos */
.variacoes { grid-column: 2; align-self: end; min-width: 0; }
.grupo-var { font-size: 10px; font-weight: 600; color: var(--dourado); text-transform: uppercase; letter-spacing: .06em; margin: 5px 0 3px; }
.grupo-var:first-child { margin-top: 0; }
.tamanhos {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: 4px;
}
.tam {
  border: 1px solid var(--borda); border-radius: 6px;
  padding: 3px 1px 4px; text-align: center;
}
.tam.tem { border-color: var(--dourado); background: rgba(217,181,108,.1); }
.tam-nome { font-size: 11px; font-weight: 600; display: block; margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 2px; }
.passo { display: flex; align-items: center; justify-content: center; gap: 1px; }
.passo button {
  position: relative;
  width: 19px; height: 19px; border-radius: 50%; border: 0; padding: 0;
  font-weight: 800; font-size: 14px; line-height: 19px;
  display: grid; place-items: center;
  touch-action: manipulation;
}
.passo button::after { content: ""; position: absolute; inset: -5px -3px; } /* área de toque maior */
.passo .menos { background: #3a3a3a; color: #fff; }
.passo .mais { background: var(--dourado); color: #111; }
.passo input {
  width: 18px; height: 18px; padding: 0; border: 0; border-radius: 4px;
  background: #fff; color: #111; text-align: center; font: 600 12px var(--fonte);
  -moz-appearance: textfield;
}
.passo input::-webkit-outer-spin-button,
.passo input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.tam.esgotado { opacity: .38; }
.tam.esgotado .tam-nome { text-decoration: line-through; }
.tam.esgotado .passo { font-size: 9px; color: var(--texto-suave); height: 19px; }

/* ---------- RODAPÉ FIXO: carrinho ---------- */
.rodape {
  position: fixed; inset: auto 0 0 0; z-index: 20;
  background: var(--preto);
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
}
.barra-carrinho {
  display: flex; align-items: center; gap: 14px;
  width: 100%; max-width: var(--largura-max); margin: 0 auto;
  height: calc(var(--altura-rodape) - 16px);
  background: var(--dourado); color: #111;
  border: 0; border-radius: 14px; padding: 0 16px 0 22px;
}
.carrinho-icone { position: relative; display: grid; }
.contador {
  position: absolute; top: -8px; right: -10px;
  min-width: 22px; height: 22px; border-radius: 11px; padding: 0 5px;
  background: #111; color: #fff; font-size: 12px; font-weight: 700;
  display: grid; place-items: center;
}
.contador.pulo { animation: pulo .35s; }
@keyframes pulo { 50% { transform: scale(1.35); } }
.barra-texto { font-size: 13px; font-weight: 700; text-transform: uppercase; flex: 1; text-align: left; }
.barra-total {
  display: flex; align-items: center; gap: 4px;
  font-size: 18px; font-weight: 800; white-space: nowrap;
  border-left: 1px solid rgba(0,0,0,.35); padding-left: 16px;
}

/* ---------- PAINEL DE CONFERÊNCIA ---------- */
.painel { position: fixed; inset: 0; z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.painel[hidden] { display: none; }
.painel-fundo { position: absolute; inset: 0; background: rgba(0,0,0,.6); }
.painel-caixa {
  position: relative; width: 100%; max-width: var(--largura-max);
  max-height: 92vh; max-height: 92dvh;
  background: #fff; border-radius: 18px 18px 0 0;
  display: flex; flex-direction: column;
  animation: sobe .25s ease-out;
}
@keyframes sobe { from { transform: translateY(40px); opacity: 0; } }
.painel-topo { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px 8px; border-bottom: 1px solid #eee; }
.painel-topo h2 { margin: 0; font-size: 18px; }
.fechar { border: 0; background: #f1f1f1; width: 34px; height: 34px; border-radius: 50%; font-size: 15px; }
.painel-itens { overflow-y: auto; padding: 4px 14px; flex: 1; min-height: 80px; }
.vazio { text-align: center; color: #888; padding: 30px 0; }
.item { display: grid; grid-template-columns: 52px 1fr auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid #f0f0f0; }
.item img { width: 52px; height: 65px; object-fit: cover; border-radius: 8px; background: #eee; }
.item-nome { font-size: 13px; font-weight: 600; line-height: 1.2; }
.item-det { font-size: 12px; color: #666; margin-top: 3px; }
.item-dir { text-align: right; }
.item-sub { font-weight: 700; font-size: 14px; }
.item .passo { margin-top: 5px; justify-content: flex-end; gap: 3px; }
.item .passo button { width: 26px; height: 26px; font-size: 16px; line-height: 26px; }
.item .passo .menos { background: #e3e3e3; color: #111; }
.item .passo input { width: 30px; height: 24px; font-size: 14px; border: 1px solid #ccc; }
.painel-form { padding: 8px 14px 0; display: grid; gap: 8px; border-top: 1px solid #eee; }
.painel-form label { font-size: 12px; font-weight: 600; color: #444; display: grid; gap: 3px; }
.painel-form input, .painel-form textarea {
  font: 15px var(--fonte); padding: 9px 11px; border: 1px solid #d5d5d5; border-radius: 10px; resize: vertical;
}
.painel-form input:focus, .painel-form textarea:focus { outline: 2px solid var(--dourado); border-color: transparent; }
.painel-rodape { padding: 10px 14px calc(12px + env(safe-area-inset-bottom)); }
.painel-resumo { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.painel-resumo strong { font-size: 22px; }
.aviso { margin: 0 0 8px; padding: 8px 10px; background: #fff4e0; border-radius: 8px; font-size: 13px; color: #7a4b00; }
.botao-whats {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--verde-whats); color: #fff; border: 0; border-radius: 12px;
  padding: 14px; font-size: 16px; font-weight: 700;
}
.botao-whats:disabled { opacity: .55; }
.botao-limpar { width: 100%; margin-top: 6px; background: none; border: 0; color: #999; font-size: 13px; padding: 6px; text-decoration: underline; }

/* ---------- FOTO AMPLIADA ---------- */
.zoom { position: fixed; inset: 0; z-index: 50; background: #000; display: flex; flex-direction: column; }
.zoom[hidden] { display: none; }
.zoom .fechar { position: absolute; top: 12px; right: 12px; z-index: 2; background: rgba(255,255,255,.15); color: #fff; }
.zoom-fotos { flex: 1; display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.zoom-fotos::-webkit-scrollbar { display: none; }
.zoom-fotos img { flex: 0 0 100%; width: 100%; height: 100%; object-fit: contain; scroll-snap-align: center; }
.zoom-rodape { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); color: #ccc; font-size: 14px; }
.botao-baixar { background: var(--dourado); color: #111; border: 0; border-radius: 999px; padding: 10px 18px; font-weight: 700; }

/* ---------- AVISO RÁPIDO ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--altura-rodape) + 14px); transform: translateX(-50%);
  z-index: 60; background: #111; color: #fff; padding: 10px 16px; border-radius: 10px;
  font-size: 14px; max-width: calc(100% - 32px); text-align: center;
  box-shadow: 0 6px 20px rgba(0,0,0,.3);
}
.toast[hidden] { display: none; }

/* Telas muito estreitas */
@media (max-width: 370px) {
  .produto { --foto: 84px; gap: 8px; }
  .tamanhos { grid-template-columns: repeat(auto-fill, minmax(54px, 1fr)); }
  .barra-texto { font-size: 11px; }
}
