/* Product image popup (productimage.php iframe) layout fixes. */

/* Reduce the gap between the main image and the thumbnail strip. */
.product-image-popup-carousel {
  margin-top: 0.75rem !important;
  padding: 0.65rem 0.75rem !important;
}

/* Enable pan/scroll when the user zooms the image. */
.product-image-popup-shell .product-image-popup-frame {
  overflow: auto !important;
  -webkit-overflow-scrolling: touch;
}

.product-image-popup-shell .product-image-popup-frame .ProductZoomImage img {
  cursor: zoom-in;
}

.product-image-popup-shell .product-image-popup-frame.is-zoomed .ProductZoomImage img {
  cursor: zoom-out;
}

/* The popup uses a horizontal scroller; force a horizontal row (not a grid). */
.product-image-popup-carousel .product-thumb-list ul {
  display: flex !important;
  align-items: center;
  gap: 0.6rem !important;
  width: auto !important;
}

.product-image-popup-carousel .product-thumb-tiny-item {
  flex: 0 0 auto !important;
  width: auto !important;
}

/* Ensure arrows can be shown when JS decides to show them. */
.product-image-popup-carousel .product-thumb-arrow {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  border: 1px solid rgba(103, 232, 249, 0.18);
  background: rgba(2, 6, 23, 0.7);
  color: #e2e8f0;
}

.product-image-popup-carousel .product-thumb-arrow.disabled {
  opacity: 0.35;
  pointer-events: none;
}

@media (max-width: 820px) {
  /* The default min-height/padding makes a big empty band on phones. */
  .product-image-popup-frame .ProductZoomImage {
    min-height: 0 !important;
    padding: 0 !important;
  }

  .product-image-popup-carousel {
    margin-top: 0.5rem !important;
    padding: 0.55rem 0.6rem !important;
  }

  /* Bigger thumbnails in the popup on mobile. */
  .product-image-popup-carousel .product-thumb-tiny-inner {
    width: 5.75rem !important;
    height: 5.75rem !important;
    border-radius: 0.9rem;
    overflow: hidden;
  }

  .product-image-popup-carousel .product-thumb-tiny-link {
    padding: 0.4rem !important;
    border-radius: 0.9rem;
  }

  .product-image-popup-carousel .product-thumb-tiny-image {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
  }

  /* Mobile: rely on finger swipe instead of arrows/indicators. */
  .product-image-popup-carousel #ImageScrollPrev,
  .product-image-popup-carousel #ImageScrollNext,
  .product-image-popup-carousel .product-thumb-arrow,
  .product-image-popup-nav {
    display: none !important;
  }
}
