@media (hover: hover) and (pointer: fine) {
  .woocommerce-product-gallery__image { overflow: hidden; }
  .woocommerce-product-gallery__image > a > img {
    cursor: zoom-in;
    transition: transform .18s ease;
    will-change: transform, transform-origin;
  }
  .woocommerce-product-gallery__image.karoba-magnifying > a > img { transform: scale(1.65); }
}

.karoba-zoom-modal[hidden] { display: none !important; }
.karoba-zoom-modal {
  position: fixed; inset: 0; z-index: 999999;
  display: grid; grid-template-rows: auto 1fr auto;
  background: rgba(0,0,0,.92); color: #fff;
}
.karoba-zoom-modal__top {
  display: flex; justify-content: flex-end; gap: 8px;
  padding: max(10px, env(safe-area-inset-top)) 12px 8px;
}
.karoba-zoom-modal button {
  border: 1px solid rgba(255,255,255,.65); border-radius: 999px;
  width: 44px; height: 44px; padding: 0;
  background: rgba(20,20,20,.75); color: #fff;
  font-size: 24px; line-height: 1; cursor: pointer;
}
.karoba-zoom-modal__stage {
  min-height: 0; overflow: auto; display: grid; place-items: center;
  touch-action: pinch-zoom; overscroll-behavior: contain;
}
.karoba-zoom-modal__image {
  display: block; max-width: 94vw; max-height: 82vh; width: auto; height: auto;
  object-fit: contain; transform-origin: center; transition: transform .15s ease;
  user-select: none; -webkit-user-drag: none;
}
.karoba-zoom-modal__bottom {
  display: flex; align-items: center; justify-content: center; gap: 18px;
  padding: 8px 12px max(12px, env(safe-area-inset-bottom));
}
.karoba-zoom-modal__counter { min-width: 68px; text-align: center; font-size: 15px; }
body.karoba-zoom-open { overflow: hidden; }
@media (max-width: 600px) {
  .karoba-zoom-modal__image { max-width: 98vw; max-height: 78vh; }
}

