/* =========================================================================
   Site público: escolha da data, catálogo, carrinho e envio.
   A abertura é uma "mesa posta" feita só de formas: painel redondo,
   painel alto, trio de cilindros e arco de balões desconstruído.
   ========================================================================= */

/* Espaço pra barra do pedido não cobrir o rodapé. */
body.com-pedido {
  padding-bottom: calc(80px + env(safe-area-inset-bottom));
}

/* ---------- Topo ---------- */

.topo {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  background: var(--lavanda);
}

.topo__marca {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.topo__balao {
  flex: none;
  width: 30px;
  height: 38px;
}

.topo__nome {
  font-family: var(--fonte-titulo);
  font-size: 1.375rem;
  line-height: 1.1;
}

.topo__cidade {
  color: var(--uva-suave);
  font-size: 0.875rem;
}

.topo__whats {
  flex: none;
  min-height: 44px;
  padding: 8px 16px;
}

/* ---------- Palco (abertura) ---------- */

.palco {
  display: grid;
  justify-items: center;
  padding: 8px 16px 32px;
  background: var(--lavanda);
  overflow: hidden;
}

.cena {
  position: relative;
  width: min(100%, 440px);
  aspect-ratio: 1 / 0.9;
}

.cena > * {
  position: absolute;
}

.cena__arco {
  left: 1%;
  top: 20%;
  width: 31%;
  height: 76%;
  border-radius: 999px 999px 12px 12px;
  background: var(--piscina);
}

.cena__painel {
  left: 17%;
  top: 19%;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 66%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--chiclete);
  text-align: center;
}

.cena__painel h1 {
  max-width: 72%;
  color: var(--papel);
  font-size: clamp(2rem, 10.5vw, 3.1rem);
  line-height: 1;
}

.cena__cilindro {
  z-index: 2;
  bottom: 2%;
  border-radius: 50% / 10%;
  overflow: hidden;
}

.cena__cilindro::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 20%;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.35);
}

.cena__cilindro--1 {
  right: 20%;
  width: 13%;
  height: 27%;
  background: var(--papel);
  box-shadow: inset 0 0 0 3px var(--lilas);
}

.cena__cilindro--2 {
  right: 6%;
  width: 15%;
  height: 40%;
  background: var(--limao);
}

.cena__cilindro--3 {
  right: -4%;
  width: 11%;
  height: 20%;
  background: var(--laranja);
}

.cena__balao {
  z-index: 3;
  aspect-ratio: 1;
  border-radius: 50%;
  animation: balao-enche 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.cena__balao::after {
  /* brilho do balão */
  content: '';
  position: absolute;
  left: 22%;
  top: 18%;
  width: 22%;
  height: 28%;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.45);
  transform: rotate(-30deg);
}

.cena__balao--1 { left: 3%; top: 27%; width: 17%; background: var(--rosa); animation-delay: 0.05s; }
.cena__balao--2 { left: 12%; top: 14%; width: 13%; background: var(--limao); animation-delay: 0.1s; }
.cena__balao--3 { left: 22%; top: 4%; width: 16%; background: var(--piscina); animation-delay: 0.15s; }
.cena__balao--4 { left: 36%; top: 6%; width: 9%; background: var(--papel); box-shadow: inset 0 0 0 3px var(--lilas); animation-delay: 0.2s; }
.cena__balao--5 { left: 43%; top: 0; width: 15%; background: var(--rosa); animation-delay: 0.25s; }
.cena__balao--6 { left: 56%; top: 6%; width: 11%; background: var(--lilas); animation-delay: 0.3s; }
.cena__balao--7 { left: 64%; top: 10%; width: 17%; background: var(--limao); animation-delay: 0.35s; }
.cena__balao--8 { left: 78%; top: 21%; width: 12%; background: var(--piscina); animation-delay: 0.4s; }
.cena__balao--9 { left: 84%; top: 33%; width: 9%; background: var(--rosa); animation-delay: 0.45s; }
.cena__balao--10 { left: 31%; top: 16%; width: 6%; background: var(--laranja); animation-delay: 0.5s; }

@keyframes balao-enche {
  from {
    opacity: 0;
    transform: scale(0.4);
  }
}

/* A "mesa" na frente dos painéis: é onde fica o campo da data. */
.mesa {
  position: relative;
  z-index: 4;
  display: grid;
  gap: 8px;
  width: min(100%, 520px);
  margin-top: -10px;
  padding: 18px 16px 16px;
  border: 3px solid var(--uva);
  border-radius: var(--raio-grande);
  background: var(--papel);
}

.mesa__rotulo {
  font-family: var(--fonte-titulo);
  font-size: 1.375rem;
}

.mesa__linha {
  display: grid;
  gap: 10px;
}

.mesa__linha input {
  min-height: 56px;
  font-size: 1.125rem;
  font-weight: 700;
}

.mesa__linha .botao {
  min-height: 56px;
}

.mesa__dica {
  color: var(--uva-suave);
  font-size: 0.9375rem;
}

.mesa__dica--ok {
  color: var(--livre-texto);
  font-weight: 600;
}

/* ---------- Catálogo ---------- */

.catalogo {
  padding: 28px 16px 24px;
  max-width: 1120px;
  margin: 0 auto;
  outline: none;
}

.catalogo__cabeca {
  display: grid;
  gap: 6px;
  margin-bottom: 14px;
}

.catalogo__cabeca h2 {
  font-size: 1.875rem;
}

.catalogo__data {
  color: var(--uva-suave);
}

.catalogo__data strong {
  color: var(--uva);
}

.catalogo__trocar {
  margin-left: 4px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--chiclete-escuro);
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

.abas {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  gap: 8px;
  margin: 0 -16px 16px;
  padding: 10px 16px;
  overflow-x: auto;
  background: rgb(255 255 255 / 0.96);
  scrollbar-width: none;
}

.abas::-webkit-scrollbar {
  display: none;
}

.aba {
  flex: none;
  min-height: 44px;
  padding: 8px 18px;
  border: 2px solid var(--borda);
  border-radius: var(--raio-pilula);
  background: var(--papel);
  font-weight: 700;
  cursor: pointer;
}

.aba[aria-selected='true'] {
  border-color: var(--uva);
  background: var(--uva);
  color: var(--papel);
}

.faixa-fechada {
  margin-bottom: 16px;
  padding: 14px 16px;
  border-radius: var(--raio-medio);
  background: var(--ocupado-fundo);
  color: var(--uva);
  font-weight: 700;
}

.vitrine {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(156px, 1fr));
  gap: 12px;
}

.vitrine--kits {
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.vitrine__vazia {
  grid-column: 1 / -1;
  padding: 32px 16px;
  border: 2px dashed var(--borda);
  border-radius: var(--raio-grande);
  color: var(--uva-suave);
  text-align: center;
}

/* ---------- Cartões ---------- */

.cartao {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 2px solid var(--borda);
  border-radius: var(--raio-grande);
  background: var(--papel);
}

.cartao--escolhido {
  border-color: var(--chiclete);
}

.cartao--indisponivel .cartao__foto img {
  filter: grayscale(0.7);
  opacity: 0.6;
}

.cartao__foto {
  position: relative;
  aspect-ratio: 1;
  background: var(--lavanda);
}

.vitrine--kits .cartao__foto {
  aspect-ratio: 4 / 3;
}

.cartao__foto img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cartao__corpo {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
}

.cartao__nome {
  font-family: var(--fonte-texto);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.25;
}

.vitrine--kits .cartao__nome {
  font-family: var(--fonte-titulo);
  font-size: 1.5rem;
  font-weight: 400;
}

.cartao__descricao {
  color: var(--uva-suave);
  font-size: 0.875rem;
  line-height: 1.4;
}

.cartao__pecas {
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--raio-medio);
  background: var(--lavanda);
  font-size: 0.9375rem;
  list-style: none;
}

.cartao__pecas li + li {
  margin-top: 2px;
}

.cartao__pecas-titulo {
  margin-bottom: 4px;
  font-weight: 700;
}

.cartao__extra {
  color: var(--uva-suave);
  font-size: 0.8125rem;
}

.cartao__base {
  display: grid;
  gap: 8px;
  margin-top: auto;
}

.cartao__preco {
  font-family: var(--fonte-titulo);
  font-size: 1.375rem;
  line-height: 1;
}

.cartao .selo {
  justify-self: start;
  white-space: normal;
}

.cartao .botao {
  width: 100%;
  min-height: 44px;
  padding: 8px 12px;
}

/* Quantidade no cartão e no carrinho */
.contador {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  border: 2px solid var(--chiclete);
  border-radius: var(--raio-pilula);
  overflow: hidden;
}

.contador button {
  height: 40px;
  border: 0;
  background: transparent;
  color: var(--chiclete-escuro);
  font-size: 1.375rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.contador button:disabled {
  color: #c9b9d3;
  cursor: not-allowed;
}

.contador output {
  text-align: center;
  font-weight: 800;
}

/* ---------- Barra do pedido ---------- */

.barra-pedido {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--uva);
  color: var(--papel);
}

.barra-pedido__resumo {
  display: grid;
}

.barra-pedido__total {
  font-family: var(--fonte-titulo);
  font-size: 1.5rem;
  line-height: 1.1;
}

.barra-pedido__qtd {
  font-size: 0.875rem;
  opacity: 0.85;
}

.barra-pedido__botao {
  background: var(--limao);
  color: var(--uva);
}

.barra-pedido__botao:hover {
  background: #ffd76b;
}

.barra-pedido--pulo {
  animation: pulo 0.35s ease-out;
}

@keyframes pulo {
  40% {
    transform: translateY(-6px);
  }
}

/* ---------- Folha do pedido (janela) ---------- */

.folha {
  width: 100%;
  max-width: 100%;
  max-height: 94dvh;
  margin: auto 0 0;
  padding: 0;
  border: 0;
  border-radius: var(--raio-grande) var(--raio-grande) 0 0;
  background: var(--papel);
  color: var(--uva);
  overflow: auto;
  overscroll-behavior: contain;
}

.folha::backdrop {
  background: rgb(53 19 79 / 0.5);
}

.folha[open] {
  animation: folha-sobe 0.25s ease-out;
}

@keyframes folha-sobe {
  from {
    transform: translateY(40px);
    opacity: 0;
  }
}

.folha__cabeca {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 12px;
  background: var(--papel);
  border-bottom: 2px solid var(--lavanda);
}

.folha__cabeca h2 {
  font-size: 1.75rem;
}

.folha__corpo {
  display: grid;
  gap: 16px;
  padding: 16px 16px calc(24px + env(safe-area-inset-bottom));
}

.folha__data {
  padding: 10px 14px;
  border-radius: var(--raio-medio);
  background: var(--lavanda);
  font-weight: 700;
}

.linhas {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.linha {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--lavanda);
}

.linha__nome {
  font-weight: 700;
}

.linha__preco {
  color: var(--uva-suave);
  font-size: 0.875rem;
}

.linha__subtotal {
  font-weight: 800;
  text-align: right;
}

.linha__acoes {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.linha__acoes .contador {
  width: 150px;
}

.linha__tirar {
  min-height: 44px;
  padding: 6px 12px;
  border: 0;
  background: none;
  color: var(--erro-texto);
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
}

.linha--problema {
  border-bottom-color: #f3b8cd;
}

.linha .mensagem-erro {
  margin-top: 6px;
  padding: 8px 10px;
  font-size: 0.875rem;
}

.folha__total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 1.125rem;
}

.folha__total strong {
  font-family: var(--fonte-titulo);
  font-size: 2rem;
  font-weight: 400;
}

.formulario {
  display: grid;
  gap: 16px;
  padding-top: 8px;
}

.formulario__titulo {
  font-size: 1.375rem;
}

.formulario__dupla {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.formulario__nota {
  color: var(--uva-suave);
  font-size: 0.875rem;
  text-align: center;
}

.opcional {
  color: var(--uva-suave);
  font-weight: 400;
}

.campo-isca {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.folha__sucesso {
  justify-items: center;
  text-align: center;
  padding-top: 28px;
}

.sucesso__numero {
  font-family: var(--fonte-titulo);
  font-size: 2rem;
  line-height: 1.1;
}

/* ---------- Rodapé ---------- */

.rodape {
  display: grid;
  gap: 8px;
  padding: 24px 16px 32px;
  background: var(--lavanda);
  text-align: center;
  font-size: 0.9375rem;
}

.rodape__privacidade {
  max-width: 52ch;
  margin: 0 auto;
}

.rodape__loja {
  color: var(--uva-suave);
}

/* ---------- Telas maiores ---------- */

@media (min-width: 720px) {
  .formulario__dupla {
    gap: 16px;
  }

  .folha {
    max-width: 560px;
    margin: auto;
    border-radius: var(--raio-grande);
  }

  .mesa__linha {
    grid-template-columns: 1fr auto;
  }
}

@media (min-width: 960px) {
  .topo {
    padding: 16px 32px;
  }

  .palco {
    grid-template-columns: minmax(0, 460px) minmax(0, 440px);
    justify-content: center;
    align-items: center;
    column-gap: 56px;
    padding: 16px 32px 48px;
  }

  .mesa {
    margin-top: 0;
  }

  .cena__painel h1 {
    font-size: 3.1rem;
  }

  .catalogo {
    padding: 40px 32px;
  }

  .abas {
    margin: 0 0 20px;
    padding: 10px 0;
  }

  .vitrine {
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 16px;
  }

  .vitrine--kits {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  }
}
