/* =====================================================================================
   Storefront motion — 2026-10-31. Merchant themes own the store's colours, so this file only
   adds behaviour: product cards answer hover/focus, nothing moves on its own, reduced motion is
   respected, and pasted code slots stay inside the page. See releases/2026-10-31/reports/.
   ===================================================================================== */
:root { --ease-out: cubic-bezier(.2, .7, .2, 1); }

/* =====================================================================================
   Product cards: the photo eases closer inside its frame and the
   wishlist button shows on hover or keyboard focus. On touch screens it simply stays visible.
   ===================================================================================== */
@media (hover: hover) and (pointer: fine) {
    .th-card .aspect-square img { transition: scale 600ms var(--ease-out), opacity 300ms ease; }
    .th-card:is(:hover, :focus-within) .aspect-square img { scale: 1.04; }
}
@media (hover: none) {
    .th-card .btn-icon.opacity-0 { opacity: 1; }
}

/* Pasted code slots (platform ads and the merchant's own above-footer HTML). */
.site-code-slot { display: flex; justify-content: center; max-width: 100%; overflow: hidden; margin: 1rem auto; padding-inline: 1rem; }
.site-code-slot > * { max-width: 100%; }

@media (prefers-reduced-motion: reduce) {
    .th-card .aspect-square img { transition: none; scale: 1 !important; }
}

/* Submit buttons while the order or form is on its way (sadu-motion.js sets aria-busy after 150ms):
   a spinner in the theme's own text colour, and no second click. */
:is(button, input[type="submit"])[aria-busy="true"] { cursor: progress; pointer-events: none; opacity: .85; }
button[aria-busy="true"]::before {
    content: ""; display: inline-block; width: .9em; height: .9em; margin-inline-end: .45em; vertical-align: -.12em;
    border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%; animation: store-spin .7s linear infinite;
}
@keyframes store-spin { to { rotate: 1turn; } }
@media (prefers-reduced-motion: reduce) { button[aria-busy="true"]::before { animation-duration: 2s; } }
