/* =========================================================
   animacoes.css — animações leves do cardápio (menu.html), em TODOS os temas
   Ligadas pelo js/animacoes.js. As cores vêm do tema (--primary); o
   Órbita troca as cores em css/tema-orbita.css (carregado depois).
   Com "reduzir movimento" ligado no aparelho, nada se mexe.
   ========================================================= */
body.menu { --an-mola: cubic-bezier(.34, 1.56, .64, 1); --an-suave: cubic-bezier(.16, 1, .3, 1); }

/* ---------- luz que segue o mouse/dedo nos cartões (posição em --mx/--my) ---------- */
body.menu .item,
body.menu .fcard { position: relative; isolation: isolate; }
body.menu .item::before,
body.menu .fcard::before {
  content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit; pointer-events: none;
  background: radial-gradient(300px circle at var(--mx, 50%) var(--my, 0%), color-mix(in srgb, var(--primary) 12%, transparent), transparent 60%);
  opacity: 0; transition: opacity .4s;
}
body.menu .item::after,
body.menu .fcard::after {
  content: ""; position: absolute; inset: -1px; z-index: 2; border-radius: inherit; pointer-events: none; padding: 1px;
  background: radial-gradient(180px circle at var(--mx, 50%) var(--my, 0%), color-mix(in srgb, var(--primary) 75%, transparent), transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
          mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); mask-composite: exclude;
  opacity: 0; transition: opacity .4s;
}
body.menu .fcard::after { inset: 0; }
body.menu .or-luz::before,
body.menu .or-luz::after { opacity: 1; }
body.menu .item.or-luz,
body.menu .fcard.or-luz { transition: transform .18s ease-out, border-color .15s, box-shadow .2s; }

/* ---------- marcador que desliza até a categoria (no lugar do sublinhado parado) ---------- */
body.menu .chip { position: relative; z-index: 1; }
body.menu .chips.or-com-ind .chip.active { border-bottom-color: transparent; }
body.menu .or-ind {
  position: absolute; left: 0; top: 0; z-index: 0; pointer-events: none;
  transition: transform .5s var(--an-mola), width .5s var(--an-mola), opacity .3s;
}
body.menu .or-ind::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px; border-radius: 3px; background: var(--primary); }
body.menu.tema-escuro .or-ind::after { background: var(--champ-4); }

/* ---------- "+": faíscas e produto voando até a sacola ---------- */
.or-voo {
  position: fixed; left: 0; top: 0; z-index: 90; pointer-events: none; overflow: hidden; border-radius: 16px;
  background: var(--primary); will-change: transform, opacity;
  box-shadow: 0 0 0 2px #fff, 0 12px 30px -6px rgba(0, 0, 0, .35);
}
.or-voo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.or-rastro, .or-faisca, .or-anel {
  position: fixed; left: 0; top: 0; z-index: 89; border-radius: 50%; pointer-events: none; will-change: transform, opacity;
}
.or-rastro { width: 12px; height: 12px; background: radial-gradient(circle, #fff 0%, color-mix(in srgb, var(--primary) 75%, #fff) 35%, transparent 70%); }
.or-faisca { width: 6px; height: 6px; background: var(--primary); box-shadow: 0 0 8px 1px color-mix(in srgb, var(--primary) 70%, transparent); }
.or-anel { border: 2px solid var(--primary); }

/* sacola: o número pula e a barra pulsa quando o produto chega */
body.menu .cart-bar .cb-count.or-pulo { animation: or-pulo .55s var(--an-mola); }
body.menu .cart-bar.or-recebe { animation: or-recebe .7s ease, bump .35s ease; }

/* ---------- entrada (só sem "reduzir movimento") ---------- */
@media (prefers-reduced-motion: no-preference) {
  /* cartões surgem ao rolar (o js põe "or-vivo" no body e "or-in" em cada um) */
  body.or-vivo .item:not(.or-in),
  body.or-vivo .fcard:not(.or-in) { opacity: 0; }
  body.or-vivo .item.or-in,
  body.or-vivo .fcard.or-in { animation: or-surge .9s var(--an-suave) var(--or-d, 0ms) backwards; }
  body.or-vivo .item.or-ja,
  body.or-vivo .fcard.or-ja { animation: or-aparece .3s ease backwards; }
  body.or-vivo .section h2::after { transform: scaleX(0); transform-origin: left center; transition: transform 1.2s var(--an-suave) .15s; }
  body.or-vivo .section.or-in h2::after { transform: scaleX(1); }
  /* barra da sacola entra subindo; foto do produto abre como um portal */
  body.menu .cart-bar.or-entra { animation: or-barra .8s var(--an-mola) backwards; }
  body.menu dialog[open] #pd-img { animation: or-portal .9s var(--an-suave) backwards; }
}

@keyframes or-pulo { 30% { transform: scale(1.4); } }
@keyframes or-recebe { 35% { box-shadow: 0 0 0 7px color-mix(in srgb, var(--primary) 22%, transparent), 0 14px 44px color-mix(in srgb, var(--primary) 60%, transparent); } }
@keyframes or-surge { from { opacity: 0; transform: perspective(900px) translateY(34px) rotateX(10deg) scale(.97); } }
@keyframes or-aparece { from { opacity: 0; } }
@keyframes or-barra { from { opacity: 0; transform: translateX(-50%) translateY(130%) scale(.85); } }
@keyframes or-portal { from { clip-path: circle(6% at 50% 55%); transform: scale(1.14); filter: brightness(1.25) saturate(.8); } to { clip-path: circle(72% at 50% 50%); } }
