/* =========================================================
   Pizzaria Brasil — animações do site
   Criasiteweb

   Tudo que se mexe na página fica aqui, por cima do estilo.css.
   Quem pediu menos movimento no celular (prefers-reduced-motion)
   vê a página parada: o bloco do fim desliga tudo.
   ========================================================= */

/* ---------- faixa verde, amarela e vermelha embaixo do topo ---------- */
.topo { position: sticky; }
.topo::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 3px; pointer-events: none;
  background: linear-gradient(90deg, #1E9E4A, #F7C823, #E3262E, #1E9E4A, #F7C823, #E3262E, #1E9E4A);
  background-size: 200% 100%; animation: faixa-corre 6s linear infinite;
}
@keyframes faixa-corre { to { background-position: -200% 0; } }

/* ---------- capa: zoom lento na foto ---------- */
.capa-foto img { animation: capa-zoom 22s ease-in-out infinite alternate; transform-origin: 60% 40%; }
@keyframes capa-zoom { from { transform: scale(1.02); } to { transform: scale(1.14) translate(-1.5%, 1%); } }

/* ingredientes que flutuam na capa (desenhados pelo animacoes.js) */
.ingredientes { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.ingrediente {
  position: absolute; top: 105%; width: var(--tam, 38px); height: auto; opacity: 0;
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, .55));
  animation: ingrediente-sobe var(--dur, 14s) linear var(--atraso, 0s) infinite;
}
.ingrediente.longe { filter: blur(2px) drop-shadow(0 4px 8px rgba(0, 0, 0, .5)); }
@keyframes ingrediente-sobe {
  0%   { transform: translate(0, 0) rotate(0deg); opacity: 0; }
  10%  { opacity: var(--op, .9); }
  50%  { transform: translate(var(--balanco, 30px), -60vh) rotate(calc(var(--giro, 200deg) / 2)); }
  90%  { opacity: var(--op, .9); }
  100% { transform: translate(0, -125vh) rotate(var(--giro, 200deg)); opacity: 0; }
}

/* ---------- logo do chef ---------- */
.logo-palco {
  animation: logo-chega 1.1s cubic-bezier(.18, .9, .32, 1.25) both, logo-flutua 5s ease-in-out 1.2s infinite !important;
  perspective: 900px;
}
.logo-tilt { position: relative; transform-style: preserve-3d; transition: transform .25s ease-out; will-change: transform; }
@keyframes logo-chega {
  0%   { opacity: 0; transform: translateY(-60px) scale(.6) rotate(-8deg); }
  55%  { opacity: 1; transform: translateY(8px) scale(1.06) rotate(2deg); }
  75%  { transform: translateY(-4px) scale(.98) rotate(-1deg); }
  100% { opacity: 1; transform: none; }
}
/* brilho passando por cima, recortado no formato da logo */
.logo-palco .logo-brilho {
  -webkit-mask: url(../img/logo-base.webp) center / 100% 100% no-repeat;
          mask: url(../img/logo-base.webp) center / 100% 100% no-repeat;
  background: linear-gradient(105deg, transparent 38%, rgba(255, 255, 255, .85) 48%, rgba(255, 240, 160, .6) 52%, transparent 62%) no-repeat;
  background-size: 300% 100%; background-position: 130% 0; mix-blend-mode: screen;
  animation: brilho 5s ease-in-out 1.6s infinite;
}
/* vapor saindo da pizza que o chef segura */
.vapor { position: absolute; left: 42%; top: 6%; width: 30%; height: 34%; pointer-events: none; }
.vapor i {
  position: absolute; bottom: 0; width: 40%; height: 70%; border-radius: 50% 50% 45% 45%;
  background: radial-gradient(closest-side, rgba(255, 255, 255, .9), rgba(235, 235, 235, .35) 60%, rgba(255, 255, 255, 0));
  filter: blur(5px) drop-shadow(0 0 6px rgba(0, 0, 0, .35)); opacity: 0; animation: vapor 3.6s ease-out infinite;
}
.vapor i:nth-child(1) { left: 6%;  animation-delay: 1.4s; }
.vapor i:nth-child(2) { left: 36%; animation-delay: 2.6s; }
.vapor i:nth-child(3) { left: 64%; animation-delay: 3.8s; }
@keyframes vapor {
  0%   { opacity: 0; transform: translateY(20%) scale(.6, .8); }
  25%  { opacity: .9; }
  100% { opacity: 0; transform: translateY(-120%) translateX(-12%) scale(1.3, 1.6) skewX(-8deg); }
}
/* faísca no "ok" da mão do chef */
.faisca { position: absolute; left: 27%; top: 3%; width: 9%; aspect-ratio: 1; pointer-events: none; }
.faisca::before, .faisca::after {
  content: ""; position: absolute; inset: 0; margin: auto;
  background: radial-gradient(closest-side, #fff, rgba(255, 238, 140, .9) 40%, rgba(255, 238, 140, 0));
  clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%);
  transform: scale(0); animation: faisca 4.5s ease-in-out 2s infinite;
}
.faisca::after { inset: auto; left: 70%; top: -30%; width: 55%; height: 55%; animation-delay: 2.25s; }
@keyframes faisca {
  0%, 60%, 100% { transform: scale(0) rotate(0deg); opacity: 0; }
  68% { transform: scale(1.15) rotate(45deg); opacity: 1; }
  80% { transform: scale(.7) rotate(90deg); opacity: .8; }
  88% { transform: scale(0) rotate(120deg); opacity: 0; }
}

/* ---------- capa: textos entram em sequência ---------- */
.capa-conteudo > :not(.logo-palco) { animation: entra-sobe .7s cubic-bezier(.2, .8, .3, 1) both; }
.capa-conteudo > .chamada { animation-delay: .55s; }
.capa-conteudo > h1 { animation-delay: .7s; }
.capa-conteudo > .sub { animation-delay: .9s; }
.capa-conteudo > .selos { animation-delay: 1.05s; }
.capa-conteudo > .capa-botoes { animation-delay: 1.2s; }
.capa-conteudo > .link-capa, .capa-conteudo > .capa-horario { animation-delay: 1.35s; }
.capa h1 em { display: inline-block; animation: em-pisca 1s cubic-bezier(.2, .9, .3, 1.3) 1.1s both; }
@keyframes entra-sobe { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
@keyframes em-pisca { from { opacity: 0; transform: scale(.6) rotate(-3deg); } to { opacity: 1; transform: none; } }

/* botão dourado: um reflexo passa de tempos em tempos */
.botao.ouro { position: relative; overflow: hidden; isolation: isolate; }
.botao.ouro::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 45%; z-index: -1; pointer-events: none;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .65), transparent);
  transform: skewX(-20deg); animation: reflexo 4.2s ease-in-out 2s infinite;
}
.capa-botoes .botao.ouro { animation: chama 2.8s ease-in-out 2.4s infinite; }
@keyframes reflexo { 0%, 70% { left: -60%; } 100% { left: 130%; } }
@keyframes chama { 0%, 100% { box-shadow: 0 0 0 0 rgba(227, 38, 46, .45); } 50% { box-shadow: 0 0 0 12px rgba(227, 38, 46, 0); } }

/* ---------- faixa de informações e títulos: aparecem ao rolar ---------- */
.revela { opacity: 0; transform: translateY(28px); transition: opacity .6s ease, transform .6s cubic-bezier(.2, .8, .3, 1); transition-delay: var(--atraso, 0s); }
.revela.visivel { opacity: 1; transform: none; }

/* ---------- cartões do cardápio ---------- */
.item { transition: border-color .2s, box-shadow .25s, transform .25s cubic-bezier(.2, .8, .3, 1) !important; }
.item-foto { overflow: hidden; }
.item-foto img { transition: transform .5s cubic-bezier(.2, .8, .3, 1); }
.item:hover .item-foto img, .item:focus-visible .item-foto img { transform: scale(1.08) rotate(-1deg); }
.item:hover .item-mais { transform: rotate(90deg) scale(1.08); }
.item-mais { transition: transform .3s cubic-bezier(.2, .9, .3, 1.4); }
.item.chega { animation: cartao-chega .55s cubic-bezier(.2, .8, .3, 1) both; animation-delay: var(--atraso, 0s); }
@keyframes cartao-chega { from { opacity: 0; transform: translateY(24px) scale(.97); } to { opacity: 1; transform: none; } }

/* ---------- janela da pizza ---------- */
.modal-foto { animation: foto-chega .5s cubic-bezier(.2, .8, .3, 1) both; }
@keyframes foto-chega { from { transform: scale(1.12); filter: brightness(.6); } to { transform: none; filter: none; } }
.tam input:checked + .tam-corpo { animation: escolhe .3s cubic-bezier(.2, .9, .3, 1.5); }
@keyframes escolhe { 50% { transform: scale(1.05); } }
.pula { animation: pula .35s cubic-bezier(.2, .9, .3, 1.6); display: inline-block; }
@keyframes pula { 40% { transform: scale(1.22); } }

/* ---------- a pizza voando para o carrinho ---------- */
.voando {
  position: fixed; z-index: 9999; pointer-events: none; object-fit: cover; border-radius: 50%;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .6), 0 0 0 3px var(--ouro);
}
.btn-carrinho.recebeu { animation: carrinho-recebe .5s cubic-bezier(.2, .9, .3, 1.5); }
@keyframes carrinho-recebe { 30% { transform: scale(1.25) rotate(-8deg); } 60% { transform: scale(.92) rotate(5deg); } }

/* ---------- menos movimento: desliga tudo ---------- */
@media (prefers-reduced-motion: reduce) {
  .ingredientes, .vapor, .faisca, .logo-palco .logo-brilho, .botao.ouro::after { display: none !important; }
  .revela { opacity: 1 !important; transform: none !important; }
}
