/* Candy Cloud v2 critical fixes. Loaded after WordPress Additional CSS so old gallery experiments cannot break the new layout. */

/* Single product: one square 1:1 image stage. */
body.single-product .cc-product-gallery-card {
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
}
body.single-product .cc-product-gallery-card .woocommerce-product-gallery {
  width: 100% !important;
  height: auto !important;
  float: none !important;
  margin: 0 !important;
  padding: 0 !important;
  position: relative !important;
}
body.single-product .cc-product-gallery-card .woocommerce-product-gallery__wrapper,
body.single-product .cc-product-gallery-card .flex-viewport {
  width: 100% !important;
  aspect-ratio: 1 / 1 !important;
  height: auto !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  background: #fff !important;
  border-radius: 28px !important;
}
body.single-product .cc-product-gallery-card .woocommerce-product-gallery__image {
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  background: #fff !important;
  overflow: hidden !important;
}
body.single-product .cc-product-gallery-card .woocommerce-product-gallery__image > a {
  width: 100% !important;
  height: 100% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
}
body.single-product .cc-product-gallery-card .woocommerce-product-gallery__image > a > img:not(.zoomImg),
body.single-product .cc-product-gallery-card .woocommerce-product-gallery__image > img:not(.zoomImg) {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  aspect-ratio: 1 / 1 !important;
  object-fit: contain !important;
  object-position: 50% 50% !important;
  margin: 0 !important;
  padding: 0 !important;
  transform: none !important;
}
body.single-product .cc-product-gallery-card img.zoomImg {
  width: auto !important;
  height: auto !important;
  max-width: none !important;
  max-height: none !important;
  aspect-ratio: auto !important;
  object-fit: initial !important;
  transform: none !important;
}
body.single-product .cc-product-gallery-card .woocommerce-product-gallery__trigger {
  position: absolute !important;
  top: 14px !important;
  right: 14px !important;
  left: auto !important;
  z-index: 5 !important;
  margin: 0 !important;
}

/* Product card images are also 1:1; source art should follow IMAGE-SPECS.txt. */
.woocommerce ul.products li.product.cc-product-card a img,
.cc-product-image-link img {
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 1 / 1 !important;
  object-fit: contain !important;
  object-position: center !important;
}
