/* KNK Apparel — product motion & style (inspired by the "premium" store video).
   Only touches product cards (home grid) and the product page. Colours, fonts,
   header, hero and everything else keep your existing style. Loaded after liquid.css. */

:root { --pv-ease: cubic-bezier(.22, 1, .36, 1); }

/* ---------- Home grid: clean, centred, calm ---------- */

.pcard { text-align: center; animation: none !important; transform: none !important; }
.pcard:hover { transform: none !important; }

/* Image: no morphing corners / glow / floating badge — just a slow, soft zoom + crossfade */
.pcard .pimg, .pcard:hover .pimg { animation: none !important; box-shadow: none !important; border-radius: .5rem; }
.pimg::after { display: none !important; }
.pcard .pimg .absolute.top-3 { animation: none !important; }
.pcard .pimg img { transition: opacity .7s var(--pv-ease), transform 1.4s var(--pv-ease) !important; }
.pcard:hover .pimg img:first-child { transform: scale(1.03); }

/* Text: calm but always readable (name 15px, price 16px on every screen; never below 14px except badges) */
.pcard h3 { font-size: .9375rem; line-height: 1.35; font-weight: 500; margin-top: .85rem !important; }
.pcard h3 a:hover { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.pcard > p.text-sm { display: none; }                      /* category line */
.pcard > p.mt-1 { font-size: 1rem; font-weight: 600; color: var(--ink); margin-top: .25rem !important; }
.pcard > p.mt-1 s { font-size: .875rem; font-weight: 400; color: var(--mute); }
.pcard > p.text-xs { font-size: .875rem; }                 /* stock line */
.pcard .btn { font-size: .875rem; line-height: 1.2; padding-left: .5rem; padding-right: .5rem; min-height: 40px; }
/* Phones: two columns are narrow, so stack the buttons instead of squeezing the labels */
@media (max-width: 479px) { .pcard > .flex.gap-2 { flex-direction: column; } .pcard .btn { width: 100%; } }

/* Buttons appear on hover (always visible on touch) */
.pcard > .flex.gap-2 { justify-content: center; opacity: 0; transform: translateY(6px); transition: opacity .35s var(--pv-ease), transform .35s var(--pv-ease); }
.pcard:hover > .flex.gap-2, .pcard:focus-within > .flex.gap-2 { opacity: 1; transform: none; }
@media (hover: none) { .pcard > .flex.gap-2 { opacity: 1; transform: none; } }

/* Scroll-in: images rise and fade, staggered per row (only when JS is running) */
.pv-js .pcard { opacity: 0; transform: translateY(28px) !important; transition: opacity .9s var(--pv-ease), transform .9s var(--pv-ease) !important; transition-delay: calc(var(--pv-i, 0) * 80ms); }
.pv-js .pcard.pv-in { opacity: 1; transform: none !important; }

/* ---------- Product page ---------- */
@media (min-width: 860px) {
  .product { align-items: start; }
  .product .info { position: sticky; top: 96px; align-self: start; }   /* details follow you while you look at photos */
}
.stage { overflow: hidden; }
.stage img#mainImg { transition: opacity .35s ease, transform 1.2s var(--pv-ease); }
@media (hover: hover) { .stage:hover img#mainImg { transform: scale(1.04); } }
.thumbs button { transition: opacity .3s ease, border-color .3s ease, transform .4s var(--pv-ease); opacity: .6; }
.thumbs button:hover, .thumbs button[aria-pressed="true"] { opacity: 1; }
.thumbs button:hover { transform: translateY(-2px); }

/* Sizes as clean squares, selected one filled (like the video) */
.size { border-radius: .375rem; min-width: 44px; transition: background-color .25s ease, color .25s ease, border-color .25s ease, transform .3s var(--pv-ease); }
.size:not(.out):hover { transform: translateY(-2px); }

/* Add to bag leads: full-width, "Buy now" underneath */
.actions { flex-direction: column; }
.actions .btn { flex: 1 1 100%; width: 100%; }
#btnAdd { order: 2; }
#btnBuy { order: 1; }

/* Entrance: photo fades in, then each detail line follows */
@keyframes pv-fade { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.pv-js .gallery { animation: pv-fade .9s var(--pv-ease) both; }
.pv-js .info > * { animation: pv-fade .8s var(--pv-ease) both; }
.pv-js .info > :nth-child(1) { animation-delay: .10s; } .pv-js .info > :nth-child(2) { animation-delay: .16s; }
.pv-js .info > :nth-child(3) { animation-delay: .22s; } .pv-js .info > :nth-child(4) { animation-delay: .28s; }
.pv-js .info > :nth-child(5) { animation-delay: .34s; } .pv-js .info > :nth-child(6) { animation-delay: .40s; }
.pv-js .info > :nth-child(n+7) { animation-delay: .46s; }
/* related products */
.more .card .ph img { transition: transform 1.2s var(--pv-ease); }
.more .card:hover .ph img { transform: scale(1.05); }
.more .card { text-align: center; }
.more .card h3 { font-size: .9375rem; font-weight: 500; }
.more .card p { font-size: 1rem; font-weight: 600; }
.more .card s { font-size: .875rem; font-weight: 400; }

@media (prefers-reduced-motion: reduce) {
  .pv-js .pcard { opacity: 1; transform: none !important; transition: none !important; }
  .pv-js .gallery, .pv-js .info > * { animation: none !important; }
}
