/* Shared product framing: the complete source remains inside its own surface. */
:root body .yl-product-fit-box,
:root body .yl78-product-media,
:root body .yl96-product-remote-media,
:root body .product-main-image,
:root body .yl-managed-image-stage,
:root body .selected-product-crop {
  position:relative!important;
  overflow:hidden!important;
  min-width:0!important;
  box-sizing:border-box!important;
  --yl-media-inset:clamp(12px,2vw,24px);
}
:root body .yl-product-fit-box>img.yl-product-fit,
:root body .yl78-product-media>img,
:root body .yl96-product-remote-media>img,
:root body .product-main-image>img,
:root body .yl-managed-image-stage>img,
:root body .selected-product-crop>img,
:root body #ylPurchaseImage.yl-product-fit,
:root body #ylSummaryImage.yl-product-fit {
  position:absolute!important;
  inset:var(--yl-media-inset)!important;
  display:block!important;
  width:calc(100% - var(--yl-media-inset) - var(--yl-media-inset))!important;
  height:calc(100% - var(--yl-media-inset) - var(--yl-media-inset))!important;
  min-width:0!important;
  min-height:0!important;
  max-width:none!important;
  max-height:none!important;
  margin:0!important;
  padding:0!important;
  box-sizing:border-box!important;
  object-fit:contain!important;
  object-position:var(--yl-media-position,50% 50%)!important;
  transform:scale(var(--yl-media-safe-scale,1))!important;
  transform-origin:var(--yl-media-position,50% 50%)!important;
  transition:none!important;
}
:root body .yl-product-fit-box,
:root body .yl78-product-media,
:root body .yl96-product-remote-media {
  min-height:0!important;
  max-height:calc(100vh - 96px)!important;
  max-height:calc(100svh - 96px)!important;
}
:root body .product-main-image,
:root body.page-product-detail .product-main-image {
  position:relative!important;
  display:flex!important;
  flex-direction:column;
  min-height:0!important;
  padding:clamp(12px,2vw,26px)!important;
  aspect-ratio:1/1!important;
  max-height:calc(100vh - 112px)!important;
  max-height:calc(100svh - 112px)!important;
}
:root body .product-main-image .yl-managed-image-stage {
  width:100%!important;
  height:auto!important;
  flex:1 1 0%;
  min-height:0!important;
  padding:0!important;
  aspect-ratio:auto;
  --yl-media-inset:6px;
}
:root body .product-main-image .yl-managed-gallery {
  flex-shrink:0;
}
:root body .selected-product-crop {
  min-height:0!important;
  max-height:calc(100vh - 96px)!important;
  max-height:calc(100svh - 96px)!important;
}
:root body .yl99-cart-media,
:root body .cart-item-media,
:root body .favorite-account-media,
:root body .summary-product-media,
:root body .order-item-media,
:root body .preview-variant-frame {
  --yl-media-inset:6px;
}

/* Reserve visible geometry even before the normalizer or image decode runs. */
:root body .yl78-product-media>img,
:root body .yl96-product-remote-media>img,
:root body .product-main-image img,
:root body .selected-product-crop>img {
  object-fit:contain!important;
}
