/* Cuddlefish Cuts artwork containment hardening v0.19.1 */

/* Product artwork cards used on the Homepage, Shop, Artist profiles, and related products. */
.product-card__art > .product-image {
  min-width: 0;
  min-height: 0;
  max-width: calc(100% - 16px);
  max-height: calc(100% - 16px);
  object-fit: contain;
  object-position: center;
}

/* Preserve the complete artwork instead of enlarging it into the clipping frame. */
.product-card--shop:hover .product-card__art > .product-image,
.product-card--shop:focus-within .product-card__art > .product-image {
  transform: none;
}

/* Product page gallery, thumbnails, and expanded viewer. */
.product-gallery__stage > [data-gallery-main-image] {
  min-width: 0;
  min-height: 0;
  max-width: calc(100% - 24px);
  max-height: calc(100% - 24px);
  object-fit: contain;
  object-position: center;
}

.product-gallery__thumbnail img,
.gallery-dialog__image-wrap img {
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
}

/* Cart thumbnails, including unusually tall or wide variant images. */
.cart-line__image {
  display: grid;
  place-items: center;
  overflow: hidden;
}

.cart-line__image > img {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
}

/* Shared Design cards used by the Design Directory and Artist profiles. */
.design-card__media > img,
.artist-design-card__media > img {
  min-width: 0;
  min-height: 0;
  max-width: calc(100% - 20px);
  max-height: calc(100% - 20px);
  object-fit: contain;
  object-position: center;
}

.design-card:hover .design-card__media > img,
.design-card:focus-within .design-card__media > img,
.artist-design-card:hover .artist-design-card__media > img,
.artist-design-card:focus-within .artist-design-card__media > img {
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .product-card__art > .product-image,
  .design-card__media > img,
  .artist-design-card__media > img {
    transition: none;
    transform: none;
  }
}
