/**
 * TG Hover 1.2.3 — Shared Shop/Work imagery.
 * CSS tokens may be overridden globally (Appearance → Customize → Additional CSS).
 * Scale is 94 -> 100%, compensated by overscan to maintain cover at rest.
 */
:root {
  --tg-hover-scale-rest: .94;
  --tg-hover-scale-active: 1;
  --tg-hover-image-overscan: 1.064;
  --tg-hover-drift: 9;
  --tg-hover-stiffness: .018;
  --tg-hover-damping: .84;
  --tg-hover-shade-opacity: .12;
  --tg-hover-icon-size: 48px;
  --tg-hover-icon-lag: .12;
}
/* .tg-loop-media is the existing custom product media frame.
   For Elementor Work cards, add tg-hover-tile to the image widget/container. */
.tg-loop-media.tg-hover-managed,
.tg-hover-tile.tg-hover-managed,
.tg-hover-tile .tg-hover-managed {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.tg-hover-managed img.tg-hover-image {
  transform-origin: center center;
  will-change: transform;
  backface-visibility: hidden;
}
.tg-hover-shade {
  position:absolute; inset:0; pointer-events:none;
  background:rgba(0,0,0,1);
  opacity:0;
  z-index:4;
  transition:opacity 450ms cubic-bezier(.2,.75,.2,1);
}
.tg-hover-managed.tg-hover-active .tg-hover-shade {
  opacity:var(--tg-hover-shade-opacity, .12);
}
.tg-hover-cursor {
  position:absolute; left:0; top:0;
  width:var(--tg-hover-icon-size,48px);
  height:var(--tg-hover-icon-size,48px);
  z-index:5;
  color:#fff; pointer-events:none;
  opacity:0;
  transform:translate3d(-100px,-100px,0) translate(-50%,-50%);
  transition:opacity 260ms ease;
  will-change:transform;
}
.tg-hover-cursor svg { display:block; width:100%; height:100%; overflow:visible; }
.tg-hover-managed.tg-hover-active .tg-hover-cursor { opacity:1; }
/* Fixed orange line stays above the shade and drifting image. */
.tg-loop-media.tg-hover-managed::after { z-index:6 !important; }
/* Never intercept clicks on card/product links. */
.tg-hover-managed .tg-hover-shade,
.tg-hover-managed .tg-hover-cursor { user-select:none; }
@media (hover:none), (pointer:coarse), (prefers-reduced-motion:reduce) {
 .tg-hover-shade,.tg-hover-cursor { display:none!important; }
 .tg-hover-managed img.tg-hover-image {will-change:auto;}
}

/* 1.3: Magnifier only for primary single-product gallery, not Shop/Work tiles. */
body.tg-shop ul.products .tg-hover-cursor, .tg-hover-tile .tg-hover-cursor { display:none !important; }
body.tg-shop div.product .woocommerce-product-gallery__image.tg-gallery-hover-main { position:relative; overflow:hidden; isolation:isolate; }
body.tg-shop div.product .woocommerce-product-gallery__image.tg-gallery-hover-main a { display:block; cursor:zoom-in; }
body.tg-shop div.product .woocommerce-product-gallery__image .tg-hover-cursor { z-index:15; }
body.tg-shop div.product .flex-control-thumbs li.tg-gallery-hover-thumb { overflow:hidden; position:relative; }
body.tg-shop div.product .flex-control-thumbs li.tg-gallery-hover-thumb img { transition:transform .6s cubic-bezier(.2,.75,.2,1); }
body.tg-shop div.product .flex-control-thumbs li.tg-gallery-hover-thumb:hover img { transform:scale(1.04) !important; }
/* Customize the image overlay per Work tile or globally. */
:root { --tg-hover-shade-color:0,0,0; }
.tg-hover-shade { background:rgb(var(--tg-hover-shade-color)); }
