/* V198 — full product photography, sharp edges, no inset image padding.
   Scope to product cards: category artwork, badges and PDP galleries stay separate. */
:root { --rm-product-media-ratio: 1 / 1; }
:root[data-rm-brand-product-shape="portrait"] { --rm-product-media-ratio: 3 / 4; }
:root[data-rm-brand-product-shape="landscape"] { --rm-product-media-ratio: 4 / 3; }

body :is(.card[data-product-card], .mobile-shop-product-card[data-product-card], .rm-ymal-card) {
  border-radius: 0 !important;
  box-shadow: none !important;
  min-width: 0;
}
body :is(.card[data-product-card], .mobile-shop-product-card[data-product-card], .rm-ymal-card) :is(.rm-card-media-link, .card-body, .mobile-shop-product-copy, .rm-ymal-card-copy) {
  border-radius: 0 !important;
}
body .card[data-product-card] > .rm-card-media-link {
  display: block;
  padding: 0 !important;
  margin: 0;
  line-height: 0;
}

/* Explicitly beat the legacy fixed-height desktop and padded-carousel rules. */
html body :is(.card[data-product-card] .card-img, .mobile-shop-product-card[data-product-card] .mobile-shop-product-media, .rm-ymal-card .rm-ymal-card-media) {
  position: relative;
  display: grid;
  place-items: center;
  line-height: 1.2;
  box-sizing: border-box;
  width: 100%;
  height: auto !important;
  min-height: 0 !important;
  max-height: none !important;
  aspect-ratio: var(--rm-product-media-ratio) !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  overflow: hidden;
  background: var(--rm-brand-surface, #f5f5f2) !important;
}
html body .mobile-shop-product-card[data-product-card] .mobile-shop-product-media > .product-transition-source {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
}

/* Full image, without stretching or zoom-on-hover. Exclude the Rosie badge artwork. */
html body :is(.card[data-product-card] .card-img > img:not(.rosie-approved-sticker), .mobile-shop-product-card[data-product-card] .product-transition-source > img, .rm-ymal-card .rm-ymal-card-media > img) {
  position: absolute !important;
  inset: 0 !important;
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  max-width: 100% !important;
  max-height: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  object-fit: contain !important;
  object-position: center !important;
  transform: none !important;
}
html body .mobile-shop-product-card[data-product-card] .mobile-product-fallback {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
}
