/* Keep intrinsic image dimensions from expanding the configured gallery frame. */
.single-product .az-product-main-frame {
  width: 100%;
  aspect-ratio: var(--az-product-image-ratio, 1 / 1);
  min-width: 0;
  min-height: 0;
}
.single-product .az-product-main-frame .az-product-main-img {
  position: absolute;
  inset: 0;
  display: block;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: var(--az-child-product-image-fit, contain);
  object-position: center;
  padding: 0;
}
/* The lightbox retains the full artwork; keep the framed preview steady on hover. */
.single-product .az-product-main-frame .az-product-main-img:hover { transform: none; }
.single-product .az-product-main-frame--original .az-product-main-img {
  position: static;
  height: auto;
}

/* Slide controls exist only when the template has multiple valid images. */
.single-product .az-product-main-frame .az-product-gallery-nav { cursor: pointer; z-index: 2; }
.single-product .az-product-main-frame .az-product-gallery-zoom {
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.single-product .az-product-main-frame:is(:hover, :focus-within) .az-product-gallery-zoom {
  opacity: 1;
  pointer-events: auto;
}
@media (prefers-reduced-motion: reduce) {
  .single-product .az-product-main-frame .az-product-gallery-zoom { transition: none; }
}
.single-product .az-product-thumbs { display: flex; min-width: 0; max-width: 100%; }
.single-product .az-product-thumb { cursor: pointer; }
.single-product .az-product-thumb img { display: block; object-fit: contain; }
.single-product .az-product-gallery :is(.az-product-gallery-nav, .az-product-thumb):focus-visible { outline: 2px solid var(--az-color-primary, #bfa454); outline-offset: 2px; }

/* Catalogue, related and viewed cards share the detail gallery's saved ratio. */
.az-site :is(.az-shop-page, .az-product-related) .az-product-card .az-product-card__image.az-shop-card-img {
  aspect-ratio: var(--az-product-image-ratio, 1 / 1);
  height: auto;
  min-height: 0;
  flex-shrink: 0;
}
.az-site :is(.az-shop-page, .az-product-related) .az-product-card .az-product-card__image.az-shop-card-img img {
  position: var(--az-product-card-image-position, absolute);
  inset: 0;
  display: block;
  width: 100%;
  height: var(--az-product-card-image-height, 100%);
  max-width: none;
  max-height: none;
  object-fit: var(--az-child-product-image-fit, contain);
  object-position: center;
  transform: none;
  padding: 0;
}
