/* UI3D — optional hover / 3D layer (20-Oct-2026). Self-contained: style.css is untouched.
   To switch it off, remove the UI3D lines in includes/layout/header.php and footer.php (this file can stay or go).
   Only transform / opacity / box-shadow are animated (GPU, no layout work). Everything is off with "reduce motion". */

@media (prefers-reduced-motion: no-preference) {

  /* ---------- all devices ---------- */

  /* product cards and category tiles flip up in 3D when they scroll into view (classes added by ui3d.js only — without JS nothing is hidden) */
  .u3-reveal { opacity: 0; transform: perspective(800px) rotateX(14deg) translateY(28px) scale(.97); transform-origin: 50% 100%;
    transition: opacity .7s ease, transform .8s cubic-bezier(.2, .8, .2, 1); transition-delay: var(--u3-d, 0s); }
  .u3-reveal.u3-in { opacity: 1; transform: none; }

  /* hero text rises in when its slide shows */
  @keyframes u3-rise { from { opacity: 0; transform: perspective(600px) rotateX(-25deg) translateY(24px); } to { opacity: 1; transform: none; } }
  .hero-slide.is-active .hero-content > * > *, .hero-slide.is-active .hero-content > *:not(.container) { animation: u3-rise .9s cubic-bezier(.2, .8, .2, 1) both; }
  .hero-slide.is-active .hero-content > * > *:nth-child(2) { animation-delay: .12s; }
  .hero-slide.is-active .hero-content > * > *:nth-child(3) { animation-delay: .24s; }

  /* light sweep across buttons (on hover for all; on its own every few seconds for the dark buy buttons) */
  .btn { position: relative; overflow: hidden; }
  .btn::after {
    content: ""; position: absolute; top: 0; bottom: 0; left: -60%; width: 40%; pointer-events: none; opacity: 0;
    background: linear-gradient(105deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, .3), rgba(255, 255, 255, 0));
    transform: skewX(-20deg);
  }
  @keyframes u3-sweep { 0%, 70% { opacity: 0; transform: skewX(-20deg) translateX(0); } 72% { opacity: 1; } 100% { opacity: 1; transform: skewX(-20deg) translateX(420%); } }
  .btn-dark:not(:disabled)::after { animation: u3-sweep 4.5s ease-in-out infinite; }

  /* sheen layer used by the tilt (desktop hover and phone tap) */
  .product-card .card-media::after {
    content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none; opacity: 0; transition: opacity .35s;
    background: radial-gradient(circle at var(--u3-x, 50%) var(--u3-y, 30%), rgba(255, 255, 255, .38), rgba(255, 255, 255, 0) 55%);
  }
  .product-card .card-media, .category-tile img, .collection-tile, .insta-tile {
    transform: perspective(900px) rotateX(var(--u3-rx, 0deg)) rotateY(var(--u3-ry, 0deg));
    transition: transform .35s cubic-bezier(.2, .8, .2, 1), box-shadow .35s;
  }

  /* ---------- phones / touch: the card tilts toward the finger and springs back ---------- */
  @media (hover: none) {
    .u3-press .card-media, .category-tile.u3-press img, .collection-tile.u3-press, .insta-tile.u3-press {
      transform: perspective(700px) rotateX(var(--u3-rx, 0deg)) rotateY(var(--u3-ry, 0deg)) scale(.97);
      transition: transform .15s ease-out, box-shadow .2s;
      box-shadow: 0 14px 28px -16px rgba(77, 16, 16, .5);
    }
    .product-card.u3-press .card-media::after { opacity: 1; }
    .btn:active:not(:disabled) { transform: scale(.97); transition: transform .1s; }
    .wish-btn:active { transform: scale(.88); transition: transform .1s; }
  }

  /* ---------- desktop mouse: tilt toward the cursor + sheen + lift ---------- */
  @media (hover: hover) and (pointer: fine) {
    .product-card.u3-on .card-media { transition: transform .08s linear, box-shadow .35s; }
    .product-card:hover .card-media { box-shadow: 0 18px 34px -18px rgba(77, 16, 16, .45); }
    .product-card:hover .card-media::after { opacity: 1; }
    .product-card .card-title { transition: transform .3s; }
    .product-card:hover .card-title { transform: translateX(3px); }

    .category-tile.u3-on img, .collection-tile.u3-on, .insta-tile.u3-on { transition: transform .08s linear, box-shadow .35s; }
    .category-tile.u3-on img { transform: perspective(900px) rotateX(var(--u3-rx)) rotateY(var(--u3-ry)) scale(1.03); }
    .collection-tile:hover, .insta-tile:hover { box-shadow: 0 20px 36px -20px rgba(0, 0, 0, .45); }
    .category-tile span { transition: letter-spacing .3s; }
    .category-tile:hover span { letter-spacing: .14em; }

    .btn { transition: background .2s, color .2s, border-color .2s, transform .2s, box-shadow .2s; }
    .btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 8px 18px -10px rgba(77, 16, 16, .55); }
    .btn:hover:not(:disabled)::after { animation: none; opacity: 1; transform: skewX(-20deg) translateX(420%); transition: transform .7s ease, opacity .2s; }
    .btn:active:not(:disabled) { transform: translateY(0); box-shadow: none; }

    .wish-btn { transition: transform .2s; }
    .wish-btn:hover { transform: scale(1.12); }
    .wa-float { transition: transform .25s; }
    .wa-float:hover { transform: translateY(-3px) scale(1.05); }
  }
}

/* ---------- set 2 (20-Oct-2026): hero zoom, scroll progress, section reveals, header shadow ---------- */
@media (prefers-reduced-motion: no-preference) {
  /* hero photo slowly settles (Ken Burns) while its slide shows */
  @keyframes u3-kb { from { transform: scale(1.08); } to { transform: scale(1); } }
  .hero-slide.is-active img { animation: u3-kb 9s ease-out both; }

  /* thin maroon reading-progress line at the very top (pure CSS, browsers without scroll timelines just skip it) */
  @supports (animation-timeline: scroll()) {
    @keyframes u3-prog { from { transform: scaleX(0); } to { transform: scaleX(1); } }
    body::after { content: ""; position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 200; pointer-events: none;
      background: linear-gradient(90deg, #8a2b2b, var(--ink, #4d1010)); transform-origin: 0 50%; transform: scaleX(0);
      animation: u3-prog linear both; animation-timeline: scroll(root); }
  }

  /* section titles: fade up + a short accent line draws in underneath */
  .section-head-center h2 { position: relative; padding-bottom: 12px; }
  .section-head-center h2::after { content: ""; position: absolute; left: 50%; bottom: 0; width: 38px; height: 2px; margin-left: -19px;
    background: currentColor; opacity: .55; transform: scaleX(1); transition: transform .8s cubic-bezier(.2, .8, .2, 1) .25s; }
  .u3-rh { opacity: 0; transform: translateY(16px); transition: opacity .7s ease, transform .7s cubic-bezier(.2, .8, .2, 1); }
  .u3-rh h2::after { transform: scaleX(0); }
  .u3-rh.u3-in { opacity: 1; transform: none; }
  .u3-rh.u3-in h2::after { transform: scaleX(1); }

  /* reviews and trust badges rise in one after another */
  .u3-rs { opacity: 0; transform: translateY(20px) scale(.98); transition: opacity .6s ease, transform .7s cubic-bezier(.2, .8, .2, 1); transition-delay: var(--u3-d, 0s); }
  .u3-rs.u3-in { opacity: 1; transform: none; }
  .trust-ico { transition: transform .35s cubic-bezier(.2, .8, .2, 1); }

  /* header lifts off the page once you scroll */
  .site-header { transition: box-shadow .3s; }
  .site-header.u3-scrolled { box-shadow: 0 8px 22px -14px rgba(77, 16, 16, .4); }

  @media (hover: hover) and (pointer: fine) {
    .collection-overlay > * { transition: transform .45s cubic-bezier(.2, .8, .2, 1); }
    .collection-tile:hover .collection-overlay > * { transform: translateY(-6px); }
    .trust-grid > *:hover .trust-ico { transform: translateY(-4px) scale(1.08); }
  }
}
