:root {
  --verde-escuro: #0e3b24;
  --verde: #1a6b3c;
  --vermelho: #b3282d;
  --dourado: #c9a227;
  --dourado-claro: #e6c964;
  --creme: #faf6ee;
  --papel: #ffffff;
  --tinta: #22301f;
  --tinta-suave: #5c6b58;
  --borda: #e5ddc9;
  --sombra: 0 8px 24px rgba(14, 59, 36, 0.12);
  --raio: 14px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Avenir Next', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--creme);
  color: var(--tinta);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Cabeçalho ---------- */

.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse 55% 45% at 50% 20%, rgba(201, 162, 39, 0.28), transparent),
    radial-gradient(ellipse 40% 50% at 12% 90%, rgba(179, 40, 45, 0.22), transparent),
    radial-gradient(ellipse 40% 50% at 88% 90%, rgba(76, 194, 122, 0.14), transparent),
    linear-gradient(170deg, #072716 0%, #14502f 55%, #0a331e 100%);
  color: var(--creme);
  text-align: center;
  padding: 4.5rem 1.25rem 3rem;
  border-bottom: 4px solid var(--dourado);
}

/* brilhos dourados espalhados no fundo (SVG embutido, sem download externo) */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cg fill='%23e6c964'%3E%3Ccircle cx='20' cy='30' r='1.4'/%3E%3Ccircle cx='90' cy='70' r='1'/%3E%3Ccircle cx='150' cy='25' r='1.2'/%3E%3Ccircle cx='60' cy='130' r='1'/%3E%3Ccircle cx='130' cy='160' r='1.5'/%3E%3Ccircle cx='165' cy='105' r='0.9'/%3E%3Cpath d='M40 85l1.6 3.6 3.6 1.6-3.6 1.6-1.6 3.6-1.6-3.6-3.6-1.6 3.6-1.6z'/%3E%3Cpath d='M110 15l1.4 3.2 3.2 1.4-3.2 1.4-1.4 3.2-1.4-3.2-3.2-1.4 3.2-1.4z'/%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.35;
}

/* ---------- Cordão de luzes pisca-pisca ---------- */

.luzes {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3rem;
  display: flex;
  justify-content: space-around;
  align-items: flex-start;
  padding-top: 0.85rem;
}

.luzes::before {
  content: '';
  position: absolute;
  top: 0.7rem;
  left: -2%;
  right: -2%;
  height: 2px;
  background: rgba(230, 201, 100, 0.4);
  border-radius: 2px;
}

.luzes i {
  width: 0.65rem;
  height: 0.95rem;
  border-radius: 50% 50% 50% 50% / 38% 38% 62% 62%;
  position: relative;
  animation: piscar 1.8s ease-in-out infinite alternate;
}

.luzes i::before {
  content: '';
  position: absolute;
  top: -0.3rem;
  left: 50%;
  transform: translateX(-50%);
  width: 0.28rem;
  height: 0.32rem;
  border-radius: 2px;
  background: #0a331e;
}

.luzes i:nth-child(4n + 1) {
  background: #e05b60;
  box-shadow: 0 0 12px 2px rgba(224, 91, 96, 0.8);
}

.luzes i:nth-child(4n + 2) {
  background: #f3dd8b;
  box-shadow: 0 0 12px 2px rgba(243, 221, 139, 0.8);
}

.luzes i:nth-child(4n + 3) {
  background: #56cf88;
  box-shadow: 0 0 12px 2px rgba(86, 207, 136, 0.8);
}

.luzes i:nth-child(4n + 4) {
  background: #fdf3d9;
  box-shadow: 0 0 12px 2px rgba(253, 243, 217, 0.8);
}

.luzes i:nth-child(2n) {
  animation-delay: 0.6s;
}

.luzes i:nth-child(3n) {
  animation-delay: 1.1s;
}

@keyframes piscar {
  from {
    opacity: 1;
    filter: brightness(1.15);
  }
  to {
    opacity: 0.45;
    filter: brightness(0.85);
  }
}

/* ---------- Neve caindo ---------- */

.neve span {
  position: absolute;
  top: -2.5rem;
  color: rgba(250, 246, 238, 0.75);
  animation: nevar linear infinite;
  pointer-events: none;
}

.neve span:nth-child(1) { left: 6%; font-size: 0.9rem; animation-duration: 9s; animation-delay: 0s; }
.neve span:nth-child(2) { left: 16%; font-size: 0.7rem; animation-duration: 12s; animation-delay: 3s; }
.neve span:nth-child(3) { left: 27%; font-size: 0.8rem; animation-duration: 10s; animation-delay: 6s; color: rgba(230, 201, 100, 0.7); }
.neve span:nth-child(4) { left: 37%; font-size: 1.05rem; animation-duration: 8s; animation-delay: 1.5s; }
.neve span:nth-child(5) { left: 48%; font-size: 0.75rem; animation-duration: 13s; animation-delay: 4.5s; }
.neve span:nth-child(6) { left: 58%; font-size: 0.8rem; animation-duration: 11s; animation-delay: 7s; color: rgba(230, 201, 100, 0.7); }
.neve span:nth-child(7) { left: 68%; font-size: 1rem; animation-duration: 9.5s; animation-delay: 2.5s; }
.neve span:nth-child(8) { left: 78%; font-size: 0.7rem; animation-duration: 12.5s; animation-delay: 5.5s; }
.neve span:nth-child(9) { left: 87%; font-size: 0.9rem; animation-duration: 10.5s; animation-delay: 0.8s; }
.neve span:nth-child(10) { left: 94%; font-size: 0.75rem; animation-duration: 11.5s; animation-delay: 8s; color: rgba(230, 201, 100, 0.7); }

@keyframes nevar {
  0% {
    transform: translateY(0) translateX(0) rotate(0deg);
    opacity: 0;
  }
  8% {
    opacity: 1;
  }
  100% {
    transform: translateY(30rem) translateX(2.5rem) rotate(300deg);
    opacity: 0.25;
  }
}

@media (prefers-reduced-motion: reduce) {
  .luzes i,
  .neve span {
    animation: none;
  }

  .neve {
    display: none;
  }
}

.hero-kicker {
  margin: 0 0 0.5rem;
  position: relative;
  color: var(--dourado-claro);
  letter-spacing: 0.35em;
  text-transform: uppercase;
  font-size: 0.78rem;
  text-shadow: 0 0 14px rgba(230, 201, 100, 0.55);
}

.hero-title {
  margin: 0;
  position: relative;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: clamp(2.3rem, 8vw, 3.6rem);
  font-weight: 700;
  letter-spacing: 0.02em;
  background: linear-gradient(180deg, #fffdf6 30%, #f0d98a 75%, #d9b23f 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 3px 10px rgba(0, 0, 0, 0.45));
}

.hero-ornamento {
  margin: 0.4rem 0 0;
  position: relative;
  color: var(--dourado);
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  opacity: 0.9;
}

.hero-slogan {
  position: relative;
  margin: 0.5rem auto 0;
  max-width: 32rem;
  font-style: italic;
  color: var(--dourado-claro);
  font-size: 1.05rem;
}

.hero-hint {
  position: relative;
  margin: 1.25rem auto 0;
  max-width: 30rem;
  font-size: 0.9rem;
  color: rgba(250, 246, 238, 0.85);
}

/* ---------- Catálogo ---------- */

main {
  max-width: 72rem;
  margin: 0 auto;
  padding: 2rem 1rem 6rem;
}

.catalogo {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(16.5rem, 1fr));
  gap: 1.5rem 1.25rem;
}

.carregando,
.erro {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--tinta-suave);
  padding: 3rem 1rem;
}

.cartao {
  background: var(--papel);
  border: 1px solid var(--borda);
  border-radius: var(--raio);
  box-shadow: var(--sombra);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* impede que textos largos (ex.: "Kit com 12" + preço) alarguem a
     coluna deste cartão e desalinhem as larguras da fileira */
  min-width: 0;
}

/* O alinhamento entre os cartões da mesma fileira é garantido por
   alturas fixas/reservadas em cada seção (foto, nome, descrição,
   preços, cores) — determinístico em qualquer navegador. */

.cartao-foto-caixa {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
  flex: none;
}

.foto-ampliar {
  position: absolute;
  right: 0.6rem;
  bottom: 0.6rem;
  background: rgba(14, 59, 36, 0.75);
  color: var(--creme);
  font-size: 0.72rem;
  border-radius: 999px;
  padding: 0.25rem 0.6rem;
  pointer-events: none;
}

.cartao-foto {
  /* altura fixa: garante fotos idênticas em todos os cartões,
     independentemente de variações de largura da coluna */
  width: 100%;
  height: 12.5rem;
  object-fit: cover;
  display: block;
  background: #eef2ea;
}

.cartao-nome {
  margin: 1rem 1rem 0.5rem;
  font-family: Georgia, serif;
  font-size: 1.15rem;
  color: var(--verde-escuro);
  /* reserva exatamente 2 linhas para o nome */
  line-height: 1.3;
  min-height: calc(2 * 1.3em);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.cartao-descricao {
  margin: 0 1rem 0.85rem;
  font-size: 0.875rem;
  color: var(--tinta-suave);
  /* reserva exatamente 4 linhas para a descrição */
  min-height: calc(4 * 1.5em);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
}

.grupo-cores {
  margin: 0 1rem 0.85rem;
  /* reserva espaço para o rótulo + 2 fileiras de chips de cor */
  min-height: 5.35rem;
}

/* Preços */

.precos {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0 1rem 0.85rem;
  /* reserva espaço para até 3 opções (unidade + 2 kits) */
  min-height: 11.1rem;
}

.opcao-preco {
  /* linha 1: radio + nome + preço alinhados; linha 2 (kits): selo de economia */
  display: grid;
  grid-template-columns: auto 1fr auto;
  column-gap: 0.5rem;
  row-gap: 0.4rem;
  align-items: center;
  border: 1.5px solid var(--borda);
  border-radius: 10px;
  padding: 0.45rem 0.65rem;
  cursor: pointer;
  font-size: 0.9rem;
  background: #fffdf8;
  transition: border-color 0.15s, background 0.15s;
}

.opcao-preco input {
  accent-color: var(--verde);
  margin: 0;
  grid-row: 1;
  grid-column: 1;
}

.opcao-nome {
  white-space: nowrap;
  grid-row: 1;
  grid-column: 2;
}

.selo-economia {
  grid-row: 2;
  grid-column: 2 / -1;
  justify-self: start;
}

.opcao-preco.selecionada {
  border-color: var(--verde);
  background: #f0f7ef;
}

.opcao-preco .valor {
  margin-left: auto;
  font-weight: 700;
  color: var(--verde-escuro);
  white-space: nowrap;
}

.selo-economia {
  background: var(--vermelho);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.1rem 0.5rem;
  white-space: nowrap;
}

/* Cores */

.grupo-rotulo {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--tinta-suave);
  margin: 0 0 0.35rem;
}

.chips-cores {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chip-cor {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1.5px solid var(--borda);
  background: #fffdf8;
  border-radius: 999px;
  padding: 0.25rem 0.7rem 0.25rem 0.3rem;
  font-size: 0.8rem;
  cursor: pointer;
  color: var(--tinta);
  transition: border-color 0.15s, background 0.15s;
}

.chip-cor .bolinha {
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.15);
  flex: none;
}

.chip-cor.selecionada {
  border-color: var(--verde);
  background: #f0f7ef;
  font-weight: 600;
}

/* Quantidade + adicionar */

.cartao-acoes {
  /* margin-top auto empurra os botões para o pé do cartão no flex
     (fallback) e para o pé da última linha no subgrid */
  margin: auto 1rem 1.15rem;
  display: flex;
  gap: 0.6rem;
  align-items: stretch;
}

.controle-qtd {
  display: inline-flex;
  align-items: center;
  border: 1.5px solid var(--borda);
  border-radius: 10px;
  overflow: hidden;
  background: #fffdf8;
}

.controle-qtd button {
  border: 0;
  background: transparent;
  width: 2.1rem;
  height: 2.6rem;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--verde-escuro);
}

.controle-qtd button:active {
  background: #f0f7ef;
}

.controle-qtd .qtd {
  min-width: 1.6rem;
  text-align: center;
  font-weight: 700;
}

.botao-adicionar {
  flex: 1;
  border: 0;
  border-radius: 10px;
  background: var(--verde);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  padding: 0 0.75rem;
  transition: background 0.15s, transform 0.1s;
}

.botao-adicionar:hover {
  background: var(--verde-escuro);
}

.botao-adicionar:active {
  transform: scale(0.98);
}

.botao-adicionar.confirmado {
  background: var(--dourado);
  color: var(--verde-escuro);
}

/* ---------- Botão flutuante do carrinho ---------- */

.carrinho-flutuante {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  border: 0;
  border-radius: 999px;
  background: var(--vermelho);
  color: #fff;
  padding: 0.6rem 1.1rem 0.6rem 0.85rem;
  font-size: 0.85rem;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(179, 40, 45, 0.4);
  transition: transform 0.15s;
}

.carrinho-flutuante:hover {
  transform: translateY(-2px);
}

.carrinho-icone {
  font-size: 1.3rem;
}

.carrinho-resumo {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  line-height: 1.2;
  font-family: inherit;
}

.carrinho-resumo strong {
  font-size: 1rem;
}

/* ---------- Painel do pedido ---------- */

.painel-fundo {
  position: fixed;
  inset: 0;
  background: rgba(14, 59, 36, 0.55);
  z-index: 40;
}

.painel-carrinho {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(26rem, 100%);
  background: var(--creme);
  z-index: 50;
  display: flex;
  flex-direction: column;
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.25);
}

.painel-cabecalho {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  background: var(--verde-escuro);
  color: var(--creme);
  border-bottom: 3px solid var(--dourado);
}

.painel-cabecalho h2 {
  margin: 0;
  font-family: Georgia, serif;
  font-size: 1.2rem;
}

.painel-fechar {
  border: 0;
  background: transparent;
  color: var(--creme);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
}

.painel-itens {
  list-style: none;
  margin: 0;
  padding: 1rem 1.25rem;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.item-pedido {
  background: var(--papel);
  border: 1px solid var(--borda);
  border-radius: 10px;
  padding: 0.75rem;
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
}

.item-info {
  flex: 1;
}

.item-nome {
  margin: 0;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--verde-escuro);
}

.item-detalhe {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
  color: var(--tinta-suave);
}

.item-preco {
  font-weight: 700;
  white-space: nowrap;
  color: var(--verde-escuro);
  font-size: 0.9rem;
}

.item-remover {
  border: 0;
  background: transparent;
  color: var(--vermelho);
  cursor: pointer;
  font-size: 0.95rem;
  padding: 0 0.2rem;
}

.painel-vazio {
  padding: 2rem 1.5rem;
  text-align: center;
  color: var(--tinta-suave);
}

.painel-rodape {
  padding: 1rem 1.25rem 1.25rem;
  border-top: 1px solid var(--borda);
  background: var(--papel);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.painel-total-linha {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 1rem;
}

.painel-total-linha strong {
  font-size: 1.35rem;
  color: var(--verde-escuro);
}

.botao-whatsapp {
  border: 0;
  border-radius: 12px;
  background: #25d366;
  color: #073d1c;
  font-weight: 800;
  font-size: 1rem;
  padding: 0.85rem 1rem;
  cursor: pointer;
  transition: filter 0.15s;
}

.botao-whatsapp:hover {
  filter: brightness(0.95);
}

.botao-whatsapp:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.botao-limpar {
  border: 0;
  background: transparent;
  color: var(--tinta-suave);
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: underline;
}

/* ---------- Lightbox (foto ampliada) ---------- */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(10, 25, 16, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-conteudo {
  margin: 0;
  max-width: min(92vw, 60rem);
  text-align: center;
}

.lightbox-conteudo img {
  max-width: 100%;
  max-height: 80vh;
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  background: var(--creme);
}

.lightbox-rodape {
  margin-top: 0.75rem;
  color: var(--creme);
  display: flex;
  justify-content: center;
  gap: 1rem;
  font-size: 0.95rem;
}

.lightbox-rodape #lightbox-contador {
  color: var(--dourado-claro);
}

.lightbox-fechar {
  position: absolute;
  top: 1rem;
  right: 1rem;
  border: 0;
  background: rgba(250, 246, 238, 0.15);
  color: var(--creme);
  font-size: 1.2rem;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  cursor: pointer;
}

.lightbox-seta {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: rgba(250, 246, 238, 0.15);
  color: var(--creme);
  font-size: 2rem;
  line-height: 1;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  cursor: pointer;
}

.lightbox-seta:hover,
.lightbox-fechar:hover {
  background: rgba(250, 246, 238, 0.3);
}

.lightbox-anterior {
  left: 0.75rem;
}

.lightbox-proxima {
  right: 0.75rem;
}

/* ---------- Rodapé ---------- */

.rodape {
  background: var(--verde-escuro);
  color: rgba(250, 246, 238, 0.85);
  text-align: center;
  padding: 2rem 1.25rem 5.5rem;
  font-size: 0.85rem;
}

.rodape .assinatura {
  color: var(--dourado-claro);
  font-family: Georgia, serif;
  font-style: italic;
}

/* ---------- Utilidades ---------- */

.escondido {
  display: none !important;
}

@media (max-width: 480px) {
  .catalogo {
    grid-template-columns: 1fr;
  }
}
