/* Match square artwork to the existing surface without scaling the furniture out of its reviewed framing. */
html img[data-square-product-photo] {
  object-fit: cover !important;
  object-position: var(--product-photo-position, 50% 50%) !important;
  transform: none !important;
}

#grid.pgrid > .pcard:not(.collection-card) > .pph > img[data-square-product-photo],
.card .ph > img[data-square-product-photo],
.ef-model-image > img[data-square-product-photo] {
  inline-size: 100%;
  block-size: 100%;
}

.pp-wrap .g-main:has(.g-open img.on[data-square-product-photo]) {
  aspect-ratio: 1;
}

.pp-wrap .g-open:has(img.on[data-square-product-photo]) {
  height: 100%;
}

.pp-wrap .g-open img.on[data-square-product-photo],
html .pde-scene-frame img[data-square-product-photo] {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  aspect-ratio: 1;
  max-height: none !important;
}

html .pde-story .pde-scene-frame:has(img[data-square-product-photo]) {
  position: relative;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  aspect-ratio: 1 !important;
  transform: none !important;
  overflow: hidden;
}

html .pde-story-wide .pde-scene:has(img[data-square-product-photo]) {
  max-width: min(100%, 820px);
  margin-inline: auto;
}

.zoom-stage:not(.is-enlarged) img[data-square-product-photo] {
  width: min(100%, 58vh);
  height: auto;
  aspect-ratio: 1;
  max-height: none;
}

.site-search-result:not(.site-search-result--collection) img[data-square-product-photo] {
  aspect-ratio: 1;
}

.card .ph:has(> img[data-square-product-photo]),
.ef-model-image:has(> img[data-square-product-photo]) {
  aspect-ratio: 1;
}
