/* v565 — Preserve the visual fidelity of offer and campaign cover images.
   Goals:
   - request/use higher-resolution product derivatives (controllers use large_default),
   - never crop text-bearing square covers in cards,
   - remove the Expo desaturation/dark overlay that dulled uploaded artwork,
   - avoid hover transforms that can make fine typography look soft. */

/* Product / offer card media: display the complete cover instead of cropping it. */
.pmp-product-card > a.pmp-product-thumb,
.pmp-offer-card > a.pmp-offer-thumb,
.pmp-product-card a.pmp-offer-thumb,
.pmp-offer-card a.pmp-product-thumb {
  display:block !important;
  width:100% !important;
  height:auto !important;
  aspect-ratio:1 / 1 !important;
  overflow:hidden !important;
  background:#f6f7f8 !important;
}

.pmp-product-card > a.pmp-product-thumb > img,
.pmp-offer-card > a.pmp-offer-thumb > img,
.pmp-product-card a.pmp-offer-thumb img,
.pmp-offer-card a.pmp-product-thumb img {
  display:block !important;
  width:100% !important;
  height:100% !important;
  min-height:0 !important;
  max-height:none !important;
  object-fit:contain !important;
  object-position:center center !important;
  filter:none !important;
  opacity:1 !important;
  transform:none !important;
  image-rendering:auto !important;
}

/* Cards where the image itself is the media element (supplier/shop/legacy fragments). */
.pmp-product-card > img.pmp-product-thumb,
.pmp-product-card > img.pmp-offer-thumb,
.pmp-product-card > img.card-img-top,
.pmp-offer-card > img.pmp-product-thumb,
.pmp-offer-card > img.pmp-offer-thumb,
.pmp-offer-card > img.card-img-top {
  display:block !important;
  width:100% !important;
  height:auto !important;
  aspect-ratio:1 / 1 !important;
  min-height:0 !important;
  max-height:none !important;
  object-fit:contain !important;
  object-position:center center !important;
  background:#f6f7f8 !important;
  filter:none !important;
  opacity:1 !important;
  transform:none !important;
  image-rendering:auto !important;
}

/* Public campaign carousel/listing: square, uncropped covers so embedded typography remains readable. */
.pmp-public-campaigns .pmp-rail-slide .pmp-campaign-card {
  grid-template-rows:auto minmax(330px,1fr) auto !important;
}
body .pmp-public-campaigns .pmp-rail-slide .pmp-campaign-thumb,
body .pmp-public-campaigns .pmp-campaign-thumb,
body .pmp-public-campaigns a.pmp-campaign-thumb {
  display:block !important;
  width:100% !important;
  height:auto !important;
  min-height:0 !important;
  aspect-ratio:1 / 1 !important;
  overflow:hidden !important;
  background:#f6f7f8 !important;
}
body .pmp-public-campaigns .pmp-rail-slide .pmp-campaign-thumb img,
body .pmp-public-campaigns .pmp-campaign-thumb img,
body .pmp-public-campaigns .pmp-campaign-card .pmp-campaign-thumb img {
  display:block !important;
  width:100% !important;
  height:100% !important;
  min-height:0 !important;
  max-height:none !important;
  object-fit:contain !important;
  object-position:center center !important;
  background:#f6f7f8 !important;
  filter:none !important;
  opacity:1 !important;
  transform:none !important;
  image-rendering:auto !important;
}

/* Expo edition offer/campaign cards: undo deliberate desaturation and dark overlay. */
body .pmp-card-carousel-section .pmp-manual-slide > .card > .pmp-card-media a,
body .pmp-card-carousel-section .pmp-card-media a,
body .pmp-card-media a {
  display:block !important;
  width:100% !important;
  height:auto !important;
  aspect-ratio:1 / 1 !important;
  overflow:hidden !important;
  background:#f6f7f8 !important;
}
body .pmp-card-carousel-section .pmp-manual-slide > .card > .pmp-card-media img,
body .pmp-card-carousel-section .pmp-card-media img,
body .pmp-card-media img {
  display:block !important;
  width:100% !important;
  height:100% !important;
  min-height:0 !important;
  max-height:none !important;
  object-fit:contain !important;
  object-position:center center !important;
  background:#f6f7f8 !important;
  filter:none !important;
  opacity:1 !important;
  transform:none !important;
  transition:none !important;
  image-rendering:auto !important;
}
body .pmp-card-media a:hover img {
  filter:none !important;
  transform:none !important;
}
body .pmp-card-media a::after {
  content:none !important;
  display:none !important;
  background:none !important;
  box-shadow:none !important;
}

/* Expo catalog/popups: preserve the full artwork instead of cropping it. */
.pmp-catalog-card__media {
  background:#f6f7f8 !important;
}
.pmp-catalog-card__media img,
.pmp-popup-catalog-media img {
  width:100% !important;
  height:100% !important;
  object-fit:contain !important;
  object-position:center center !important;
  background:#f6f7f8 !important;
  filter:none !important;
  opacity:1 !important;
  transform:none !important;
  image-rendering:auto !important;
}

/* Detail pages already use large visuals; keep them neutral and crisp. */
.pmp-camp-hero img,
.pmp-gallery-main img,
.pmp-gallery-img,
.pmp-lightbox-img,
.pmp-thumb img {
  filter:none !important;
  opacity:1 !important;
  image-rendering:auto !important;
}
.pmp-thumb img { object-fit:contain !important; background:#f6f7f8 !important; }

/* Seller campaign table thumbnails: do not crop labels/artwork. */
.pmp-campaign-thumb-link img {
  object-fit:contain !important;
  object-position:center center !important;
  background:#f6f7f8 !important;
  filter:none !important;
  opacity:1 !important;
}

@media (max-width:767.98px) {
  .pmp-product-card > a.pmp-product-thumb,
  .pmp-offer-card > a.pmp-offer-thumb,
  .pmp-public-campaigns .pmp-campaign-thumb,
  .pmp-card-media a {
    aspect-ratio:1 / 1 !important;
  }
}

/* v565 — responsive static derivatives, six-card desktop layout preserved.
   The browser gets 360/720/1080w candidates and chooses the right source for
   the actual CSS width / device pixel ratio. No CSS sharpening filter is used. */
body#module-pratiniumpreorder-marketplaceoffers .pmp-products-grid,
body#module-pratiniumpreorder-marketplace .pmp-products-grid,
body#module-pratiniumpreorder-marketplacesupplier .pmp-products-grid,
body#module-pratiniumpreorder-shop .pmp-products-grid {
  gap:12px !important;
}

.pmp-product-card img,
.pmp-offer-card img,
.pmp-public-campaigns .pmp-campaign-thumb img,
.pmp-card-media img,
.pmp-catalog-card__media img,
.pmp-popup-catalog-media img {
  /* Prevent inherited animation/scale/filter rules from forcing a second
     compositing pass which can soften one-pixel lettering. */
  transform:none !important;
  filter:none !important;
  opacity:1 !important;
  will-change:auto !important;
  backface-visibility:visible !important;
  image-rendering:auto !important;
}

/* On engines that expose the legacy high-contrast downscaler, use it only for
   catalogue thumbnails. Unsupported browsers simply retain image-rendering:auto. */
@supports (image-rendering: -webkit-optimize-contrast) {
  .pmp-product-card img,
  .pmp-offer-card img,
  .pmp-public-campaigns .pmp-campaign-thumb img,
  .pmp-card-media img,
  .pmp-catalog-card__media img,
  .pmp-popup-catalog-media img {
    image-rendering:-webkit-optimize-contrast !important;
  }
}
