/* MAKE PIZZA 24 — Premium Motion (grafica wow realistica)
 * Pizza Builder tilt · flash prezzo · menu stagger/parallax · transizioni live
 * Dopo app-premium-interactions.css · zero WebGL (2,5D CSS)
 */

/* ── 1. BUILDER — stage tilt 3D al tocco ── */
.builder-hero__stage {
  perspective: 900px;
  transform-style: preserve-3d;
}
.builder-hero__stage .pizza-compose,
.builder-hero__stage .web-compose-mount,
.builder-hero__stage [data-web-builder-mount],
.builder-hero__stage .builder-plate-empty {
  transform-style: preserve-3d;
  transition: transform 180ms ease-out;
  will-change: transform;
}
.builder-hero__stage.is-tilting .pizza-compose,
.builder-hero__stage.is-tilting .web-compose-mount,
.builder-hero__stage.is-tilting [data-web-builder-mount],
.builder-hero__stage.is-tilting .builder-plate-empty {
  transition: transform 60ms linear;
}

/* ── 2. FLASH PREZZO al cambio ── */
@keyframes mp24-price-flash {
  0%   { transform: scale(1); color: inherit; }
  35%  { transform: scale(1.12); color: #f97316; text-shadow: 0 0 18px rgba(249, 115, 22, 0.45); }
  100% { transform: scale(1); color: inherit; text-shadow: none; }
}
.mp24-price-flash {
  animation: mp24-price-flash 420ms cubic-bezier(0.34, 1.56, 0.64, 1);
  display: inline-block;
}

/* ── 3. MENU — entrata tile a onda ── */
@keyframes mp24-tile-rise {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.mp24-stagger-item {
  opacity: 0;
}
.mp24-stagger-item.is-in {
  animation: mp24-tile-rise 480ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
  animation-delay: var(--stagger-delay, 0ms);
}

/* Produzione Next.js + hub condiviso (sito/sala/totem) — stagger CSS nativo */
.menu-hub-root--premium > .menu-hub-hero,
.menu-hub-body > .menu-hub-hero,
.menu-hub-root--premium > .menu-hub-combo-row,
.menu-hub-body > .menu-hub-combo-row,
.menu-hub-grid > a,
.menu-hub-grid > .menu-hub-card,
.menu-section-item,
.famous-pizza-tile,
.kiosk-menu-hub .menu-hub-hero,
.kiosk-menu-hub .menu-hub-card {
  animation: mp24-tile-rise 480ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
.menu-hub-root--premium > .menu-hub-hero,
.menu-hub-body > .menu-hub-hero,
.kiosk-menu-hub .menu-hub-hero { animation-delay: 0ms; }
.menu-hub-root--premium > .menu-hub-combo-row,
.menu-hub-body > .menu-hub-combo-row { animation-delay: 60ms; }
.menu-hub-grid > a:nth-child(1),
.menu-hub-grid > .menu-hub-card:nth-child(1) { animation-delay: 100ms; }
.menu-hub-grid > a:nth-child(2),
.menu-hub-grid > .menu-hub-card:nth-child(2) { animation-delay: 145ms; }
.menu-hub-grid > a:nth-child(3),
.menu-hub-grid > .menu-hub-card:nth-child(3) { animation-delay: 190ms; }
.menu-hub-grid > a:nth-child(4),
.menu-hub-grid > .menu-hub-card:nth-child(4) { animation-delay: 235ms; }
.menu-hub-grid > a:nth-child(5),
.menu-hub-grid > .menu-hub-card:nth-child(5) { animation-delay: 280ms; }
.menu-hub-grid > a:nth-child(6),
.menu-hub-grid > .menu-hub-card:nth-child(6) { animation-delay: 325ms; }
.menu-section-item:nth-child(1), .famous-pizza-tile:nth-child(1) { animation-delay: 40ms; }
.menu-section-item:nth-child(2), .famous-pizza-tile:nth-child(2) { animation-delay: 80ms; }
.menu-section-item:nth-child(3), .famous-pizza-tile:nth-child(3) { animation-delay: 120ms; }
.menu-section-item:nth-child(4), .famous-pizza-tile:nth-child(4) { animation-delay: 160ms; }
.menu-section-item:nth-child(5), .famous-pizza-tile:nth-child(5) { animation-delay: 200ms; }
.menu-section-item:nth-child(6), .famous-pizza-tile:nth-child(6) { animation-delay: 240ms; }
.menu-section-item:nth-child(n+7), .famous-pizza-tile:nth-child(n+7) { animation-delay: 280ms; }

/* ── 4. FOTO — parallax leggero ── */
.mp24-parallax-photo {
  overflow: hidden;
  isolation: isolate;
}
.mp24-parallax-photo img,
.mp24-parallax-photo .menu-tile__img,
.mp24-parallax-photo .menu-hub-tile__photo,
.mp24-parallax-photo [style*="background-image"] {
  transition: transform 400ms cubic-bezier(0.22, 1, 0.36, 1);
  transform: scale(1.04) translate3d(var(--px, 0), var(--py, 0), 0);
  will-change: transform;
}
.mp24-parallax-photo:active img,
.mp24-parallax-photo:hover img {
  transform: scale(1.08) translate3d(var(--px, 0), var(--py, 0), 0);
}

/* ── 5. LIVE VIEW — transizione schermata ── */
.mp24-live .screen-card.is-live-on .device-phone,
.mp24-live .screen-card.is-live-on .device-desktop {
  animation: mp24-screen-enter 380ms cubic-bezier(0.22, 1, 0.36, 1) both;
}
@keyframes mp24-screen-enter {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}
.mp24-live .screen-card.is-live-leaving .device-phone,
.mp24-live .screen-card.is-live-leaving .device-desktop {
  animation: mp24-screen-leave 220ms ease-in both;
}
@keyframes mp24-screen-leave {
  to {
    opacity: 0;
    transform: translateY(-10px) scale(0.99);
  }
}

/* ── 6. HERO BUILDER — alone ambient più ricco ── */
.device-phone--premium [data-web-builder] .builder-hero {
  background:
    radial-gradient(ellipse at 50% 22%, rgba(247, 127, 0, 0.18), transparent 58%),
    radial-gradient(ellipse at 50% 80%, rgba(45, 106, 79, 0.06), transparent 50%);
}

/* ── Reduce motion ── */
@media (prefers-reduced-motion: reduce) {
  .mp24-stagger-item,
  .mp24-stagger-item.is-in,
  .mp24-price-flash,
  .mp24-live .screen-card.is-live-on .device-phone,
  .mp24-live .screen-card.is-live-on .device-desktop,
  .pizza-compose.has-toppings::before,
  .pizza-compose.has-toppings::after,
  .pizza-compose__glow,
  .menu-hub-root--premium > .menu-hub-hero,
  .menu-hub-body > .menu-hub-hero,
  .menu-hub-root--premium > .menu-hub-combo-row,
  .menu-hub-body > .menu-hub-combo-row,
  .menu-hub-grid > a,
  .menu-hub-grid > .menu-hub-card,
  .menu-section-item,
  .famous-pizza-tile,
  .kiosk-menu-hub .menu-hub-hero,
  .kiosk-menu-hub .menu-hub-card {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .builder-hero__stage .pizza-compose,
  .builder-hero__stage .web-compose-mount {
    transition: none !important;
  }
}
