/* ============================================================
   Anna's · Catálogo da cliente (página pública)
   ============================================================ */

#cat-topo {
  background: linear-gradient(140deg, var(--vinho), var(--vinho-escuro));
  color: #fff;
  padding: 22px 18px 18px;
  padding-top: calc(20px + env(safe-area-inset-top));
  text-align: center;
}
#cat-topo .marca { color: #fff; font-size: 2rem; }
#cat-topo .marca-sub { color: var(--ouro-claro); }
#cat-topo .logo-marca {
  width: 120px;
  margin-bottom: 4px;
  box-shadow: 0 0 0 1px rgba(240, 227, 205, .3), 0 6px 18px rgba(0, 0, 0, .3);
}
.cat-slogan { margin-top: 10px; font-size: .9rem; opacity: .9; }

#cat-conteudo {
  max-width: 680px;
  margin: 0 auto;
  padding: 14px 14px 110px;
}
#cat-busca { margin-bottom: 10px; }

.cat-grade {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}

.cat-card {
  background: var(--papel);
  border-radius: var(--raio);
  box-shadow: var(--sombra);
  overflow: hidden;
  cursor: pointer;
  position: relative;
  transition: transform .12s;
  -webkit-tap-highlight-color: transparent;
}
.cat-card:active { transform: scale(.97); }

.cat-foto {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  display: block;
  background: var(--creme-2);
}
.cat-foto-vazia {
  width: 100%;
  aspect-ratio: 3 / 4;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.4rem;
  background: linear-gradient(140deg, var(--vinho-claro), var(--creme-2));
}

.cat-info { padding: 10px 12px 12px; }
.cat-info strong { display: block; font-size: .9rem; line-height: 1.25; }
.cat-info small { color: var(--tinta-suave); font-size: .76rem; }
.cat-preco {
  font-family: var(--fonte-titulo);
  font-weight: 600;
  color: var(--vinho);
  font-size: 1.02rem;
  margin-top: 4px;
}

.cat-esgotado::after {
  content: "Esgotado 😔";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(247, 241, 232, .78);
  font-weight: 700;
  color: var(--alerta);
}

/* selo de quantidade na sacolinha */
.cat-no-carrinho {
  position: absolute;
  top: 8px; right: 8px;
  background: var(--vinho);
  color: #fff;
  font-weight: 700;
  font-size: .8rem;
  min-width: 26px; height: 26px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.25);
}

/* botão de ver as fotos da peça (fica por cima da capa) */
.cat-ver-fotos {
  position: absolute;
  top: 8px; left: 8px;
  z-index: 1;
  font: inherit;
  font-size: .75rem;
  font-weight: 700;
  color: #fff;
  background: rgba(0, 0, 0, .48);
  backdrop-filter: blur(3px);
  border: none;
  border-radius: 999px;
  padding: 5px 10px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.cat-ver-fotos:active { transform: scale(.94); }

/* galeria da peça em detalhe: rolagem horizontal com encaixe (swipe nativo) */
.cat-galeria {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  /* nada de scroll-behavior: smooth — junto com o scroll-snap mandatory ele
     faz a rolagem programática (setas/pontinhos) ser engolida e voltar ao
     começo. O salto direto é feio por meio segundo, mas funciona sempre. */
  border-radius: var(--raio);
  background: var(--creme-2);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.cat-galeria::-webkit-scrollbar { display: none; }
.cat-galeria img {
  flex: 0 0 100%;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: contain;
  scroll-snap-align: center;
}

/* setas: no computador não dá para arrastar, então elas são o caminho principal */
.cat-galeria-caixa { position: relative; }
.cat-seta {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px; height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-size: 1.7rem;
  line-height: 1;
  padding-bottom: 4px;
  color: var(--vinho);
  background: rgba(255, 255, 255, .92);
  border: none;
  border-radius: 999px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .22);
  cursor: pointer;
  transition: opacity .15s, transform .12s;
  -webkit-tap-highlight-color: transparent;
}
.cat-seta.esquerda { left: 8px; }
.cat-seta.direita { right: 8px; }
.cat-seta:active { transform: translateY(-50%) scale(.9); }
.cat-seta:disabled { opacity: .28; cursor: default; }

.cat-pontos {
  display: flex;
  justify-content: center;
  gap: 7px;
  margin: 10px 0 4px;
}
.cat-pontos button {
  width: 9px; height: 9px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: var(--vinho-claro);
  cursor: pointer;
  transition: background .15s, transform .15s;
}
.cat-pontos button.ativo { background: var(--vinho); transform: scale(1.35); }

.cat-peca-info { margin: 12px 0 16px; text-align: center; }
.cat-peca-info small { color: var(--tinta-suave); font-size: .82rem; }

/* barra flutuante da sacolinha */
#cat-sacola {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(14px + env(safe-area-inset-bottom));
  width: min(92vw, 640px);
  display: flex;
  align-items: center;
  gap: 10px;
  font: inherit;
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  background: linear-gradient(140deg, var(--vinho), var(--vinho-escuro));
  border: none;
  border-radius: 999px;
  padding: 15px 22px;
  box-shadow: 0 10px 30px rgba(124, 36, 68, .45);
  cursor: pointer;
  z-index: 40;
  animation: subirSacola .25s ease;
}
@keyframes subirSacola { from { transform: translate(-50%, 30px); opacity: 0; } }
#cat-sacola:active { transform: translateX(-50%) scale(.98); }
