/**
 * Location: /assets/css/stm-single-gallery.css
 * Purpose: Single Product gallery UX styling (safe + isolated, sharp full-size dark lightbox)
 * Related JS: /assets/js/stm-single-gallery.js
 * Linkage/Loader: Enqueued from /inc/features/woocommerce/single-product.php ONLY on is_product().
 * Notes: Keeps selectors tight to Woo gallery. No global overrides.
 */

/* Zoom icon top-right */
.single-product .woocommerce-product-gallery .woocommerce-product-gallery__trigger{
  top: 12px;
  right: 12px;
  left: auto;
  z-index: 5;
}

/* Make sure trigger stays above image */
.single-product .woocommerce-product-gallery{
  position: relative;
}


/* =====================================================
   2026-07-07 V1036 custom product image lightbox
   Purpose: feature image click opens a premium lightbox; outside click closes it; wheel zoom stays sharp.
===================================================== */
.single-product .woocommerce-product-gallery__image img,
.single-product .woocommerce-product-gallery .flex-control-nav img{
  filter:none!important;
  backdrop-filter:none!important;
  image-rendering:auto!important;
  transform:none;
}
.single-product .woocommerce-product-gallery__image a,
.single-product .woocommerce-product-gallery__image img{
  cursor:zoom-in;
}
.stm-gallery-lightbox{
  position:fixed;
  inset:0;
  z-index:999999;
  display:none;
  align-items:center;
  justify-content:center;
  padding:clamp(12px, 3vw, 30px);
  background:rgba(3,7,18,.94);
  opacity:0;
  transition:none;
  box-sizing:border-box;
}
.stm-gallery-lightbox.is-open{
  display:flex;
  opacity:1;
}
.stm-gallery-lightbox__stage{
  position:relative;
  display:flex;
  align-items:center;
  justify-content:center;
  width:100%;
  height:100%;
  overflow:hidden;
  cursor:zoom-out;
  touch-action:none;
}
.stm-gallery-lightbox__img{
  display:block;
  max-width:min(96vw, 1280px);
  max-height:92vh;
  width:auto;
  height:auto;
  object-fit:contain;
  filter:none!important;
  backdrop-filter:none!important;
  image-rendering:auto!important;
  transform-origin:center center;
  transition:transform .06s linear;
  will-change:transform;
  box-shadow:none!important;
  opacity:1!important;
  mix-blend-mode:normal!important;
  cursor:grab;
  user-select:none;
  -webkit-user-drag:none;
  touch-action:none!important;
}
.stm-gallery-lightbox__img:active{
  cursor:grabbing;
}
.stm-gallery-lightbox__close,
.stm-gallery-lightbox__nav{
  position:absolute;
  z-index:2;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:1px solid rgba(255,255,255,.20);
  background:rgba(15,23,42,.86);
  color:#fff;
  box-shadow:0 10px 30px rgba(0,0,0,.24);
  cursor:pointer;
  -webkit-tap-highlight-color:transparent;
}
.stm-gallery-lightbox__close{
  top:14px;
  right:14px;
  width:42px;
  height:42px;
  border-radius:999px;
  font-size:28px;
  line-height:1;
}
.stm-gallery-lightbox__nav{
  top:50%;
  width:44px;
  height:58px;
  border-radius:16px;
  transform:translateY(-50%);
  font-size:28px;
  line-height:1;
}
.stm-gallery-lightbox__nav--prev{left:14px;}
.stm-gallery-lightbox__nav--next{right:14px;}
.stm-gallery-lightbox__counter{
  position:absolute;
  left:50%;
  bottom:14px;
  transform:translateX(-50%);
  z-index:2;
  padding:7px 12px;
  border-radius:999px;
  background:rgba(15,23,42,.82);
  color:#fff;
  font-size:12px;
  font-weight:800;
  line-height:1;
}
body.stm-gallery-lightbox-open{
  overflow:hidden!important;
}

/* WooCommerce/PhotoSwipe fallback: keep official lightbox skin dark and sharp if a plugin triggers it. */
.single-product .pswp__bg{
  background:rgba(3,7,18,.96)!important;
  opacity:1!important;
}
.single-product .pswp__img{
  filter:none!important;
  -webkit-filter:none!important;
  image-rendering:auto!important;
  box-shadow:none!important;
}
@media (max-width:640px){
  .stm-gallery-lightbox{
    padding:10px;
  }
  .stm-gallery-lightbox__close{
    top:10px;
    right:10px;
    width:40px;
    height:40px;
  }
  .stm-gallery-lightbox__nav{
    width:38px;
    height:52px;
    border-radius:14px;
  }
  .stm-gallery-lightbox__nav--prev{left:8px;}
  .stm-gallery-lightbox__nav--next{right:8px;}
}
