/* KungFist interactive product visuals — vanilla CSS, no dependencies.
   Works with the existing template classes (.card, .card-media, .card-img,
   .pd-m, .pd-img, .pd-thumbs, .trend-m, .trend-img, .trend-thumbs, .hero-g).
   Progressive enhancement: without JS nothing changes. */

/* --- 3D tilt (JS adds .kf-tilt to media wrappers) --- */
.kf-tilt{transform-style:preserve-3d;will-change:transform;transition:transform .18s ease-out,box-shadow .18s ease-out}
.card-media{position:relative}
.catc-m{position:relative}
.kf-tilt:not(img)::after{content:"";position:absolute;inset:0;border-radius:inherit;background:radial-gradient(circle at var(--mx,50%) var(--my,50%),rgba(255,255,255,.28),rgba(255,255,255,0) 55%);opacity:0;transition:opacity .2s ease-out;pointer-events:none;z-index:1}
.kf-tilt:not(img):hover::after{opacity:1}
.card{position:relative}
.pd-m{position:relative}

/* --- Press-and-hold squeeze (class goes on the <img> itself) --- */
img.kf-squeeze{touch-action:manipulation;-webkit-touch-callout:none;user-select:none;-webkit-user-select:none;cursor:pointer;transform-origin:50% 100%;transition:transform 1.4s cubic-bezier(.3,1.45,.4,1),filter .3s ease;will-change:transform,filter}
img.kf-squeeze.kf-squeezing{transform:scale(1.07,.78);filter:brightness(.96) saturate(1.05);transition-duration:.1s,.2s}
img.kf-squeeze.kf-crunchy{transition-duration:.35s}
img.kf-squeeze.kf-crunchy.kf-squeezing{transform:scale(1.08,.76);transition-duration:.07s,.15s;animation:kf-crack .22s ease-out}
@keyframes kf-crack{0%{transform:scale(1,1)}30%{transform:scale(1.1,.72) rotate(-.8deg)}60%{transform:scale(1.05,.8) rotate(.8deg)}100%{transform:scale(1.08,.76)}}

/* squeeze hint chip — always visible on product pages + trend; on cards only on hover/focus */
.kf-squeeze-hint{position:absolute;left:12px;bottom:12px;z-index:2;background:rgba(29,31,59,.88);color:#fff;font-size:.78rem;font-weight:700;padding:5px 10px;border-radius:999px;pointer-events:none;letter-spacing:.02em;white-space:nowrap}
.card-media .kf-squeeze-hint{opacity:0;transition:opacity .18s ease-out}
.card:hover .kf-squeeze-hint,.card:focus-within .kf-squeeze-hint{opacity:1}
@media (hover:none){.card-media .kf-squeeze-hint{opacity:1}}
.card-media,.pd-m,.trend-m{-webkit-touch-callout:none}
.pd-m .kf-squeeze-hint,.trend-m .kf-squeeze-hint{animation:kf-hint-bob 2.4s ease-in-out infinite}
@keyframes kf-hint-bob{0%,100%{transform:translateY(0)}50%{transform:translateY(-3px)}}

/* zoom button on cards (magnifier, top-right of the media tile) */
.kf-zoom-btn{position:absolute;top:10px;right:10px;z-index:3;width:38px;height:38px;border-radius:50%;border:1px solid var(--line,#ece4dc);background:rgba(255,255,255,.94);color:#1d1f3b;cursor:pointer;display:flex;align-items:center;justify-content:center;box-shadow:0 2px 8px rgba(0,0,0,.12);opacity:0;transition:opacity .18s ease-out;padding:0}
.card:hover .kf-zoom-btn,.card:focus-within .kf-zoom-btn{opacity:1}
.kf-zoom-btn svg{width:18px;height:18px}

/* --- Lightbox --- */
.kf-lb{position:fixed;inset:0;z-index:100;background:rgba(15,16,32,.92);display:none;align-items:center;justify-content:center;padding:16px}
.kf-lb.kf-open{display:flex}
.kf-lb figure{margin:0;max-width:min(920px,94vw);text-align:center}
.kf-lb-img-wrap{overflow:hidden;border-radius:10px;background:#111}
.kf-lb img{max-width:100%;max-height:76vh;width:auto;height:auto;margin:0 auto;cursor:zoom-in;transition:transform .25s ease-out;display:block}
.kf-lb img.kf-zoomed{transform:scale(1.8);cursor:zoom-out}
.kf-lb figcaption{color:#d9dbea;font-size:.9rem;margin-top:10px}
.kf-lb-count{position:absolute;left:16px;bottom:14px;color:#d9dbea;font-size:.85rem}
.kf-lb-btn{position:absolute;z-index:2;width:44px;height:44px;border-radius:50%;border:none;background:rgba(255,255,255,.94);color:#1d1f3b;font-size:1.25rem;font-weight:700;cursor:pointer;display:flex;align-items:center;justify-content:center;line-height:1}
.kf-lb-close{top:14px;right:14px}
.kf-lb-prev{left:12px;top:50%;transform:translateY(-50%)}
.kf-lb-next{right:12px;top:50%;transform:translateY(-50%)}

/* --- 360° spin viewer (only renders when [data-spin-frames] exists) --- */
.kf-spin{position:relative;cursor:grab;touch-action:pan-y;user-select:none;-webkit-user-select:none}
.kf-spin:active{cursor:grabbing}
.kf-spin-badge{position:absolute;top:12px;right:12px;z-index:2;background:#ffb627;color:#1d1f3b;font-weight:850;font-size:.75rem;letter-spacing:.06em;padding:3px 10px;border-radius:999px;pointer-events:none}

/* --- Video slot (only renders when [data-video] exists) --- */
.kf-video{width:100%;aspect-ratio:1;object-fit:cover;border-radius:10px;display:block;background:#fff8f2}

/* --- Gentle scroll parallax on hero images (JS sets translate) --- */
.kf-plx{will-change:transform}

/* --- Reduced motion: all of it off --- */
@media (prefers-reduced-motion:reduce){
  .kf-tilt,img.kf-squeeze,.kf-lb img{transition:none!important}
  .kf-squeeze-hint,img.kf-squeeze.kf-crunchy.kf-squeezing{animation:none!important}
}

/* Best-for line on cards and product pages: answers "does this fit my shop?" */
.bestfor{font-size:.85rem;color:#555872;margin:0}
.bestfor b{color:#1d1f3b}
/* Keyword filter chips on the squishies listing page */
.kf-filter{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 16px}
.kf-filter-chip{border:1px solid #ece4dc;background:#fff;border-radius:999px;padding:8px 14px;font:inherit;font-weight:700;font-size:.9rem;cursor:pointer;min-height:40px}
.kf-filter-chip[aria-pressed="true"]{background:#1d1f3b;color:#fff;border-color:#1d1f3b}
.kf-hidden{display:none!important}
