/* Keep product photography aligned without cropping the item itself. */
.product-rail .rail-card .productimg,
.products .productimg {
  width: 100%;
  height: 300px !important;
  min-height: 0 !important;
  aspect-ratio: 1 / 1;
  overflow: hidden !important;
  box-sizing: border-box;
  display: grid;
  place-items: center;
  background: #f5f4f2 !important;
}

.product-rail .rail-card .productimg img,
.products .productimg img {
  display: block;
  width: 100% !important;
  height: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  object-position: center center !important;
  padding: 14px !important;
  box-sizing: border-box;
  background: #f5f4f2 !important;
}

.hero-media {
  background: #f5f4f2 !important;
}

.hero-media > img {
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  object-position: center center !important;
  padding: 14px !important;
  box-sizing: border-box;
}

.quickview-image {
  background: #f5f4f2 !important;
}

.quickview-stage {
  width: 100%;
  min-width: 0;
  min-height: 0 !important;
  overflow: hidden;
}

.quickview-stage img {
  width: 100% !important;
  height: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  object-position: center center !important;
  padding: 12px !important;
  box-sizing: border-box;
  background: #f5f4f2 !important;
}

@media (max-width: 900px) {
  .product-rail .rail-card .productimg,
  .products .productimg {
    height: 260px !important;
  }
}

@media (max-width: 600px) {
  .product-rail .rail-card .productimg,
  .products .productimg {
    height: min(44vw, 220px) !important;
  }
  .product-rail .rail-card .productimg img,
  .products .productimg img {
    padding: 9px !important;
  }
}
