/**
 * Storefront — product photos fill their image wells (object-fit: cover).
 * Brand fallbacks and lightbox zoom stay contain.
 */

/* ── Legacy / grid product cards ── */
.product-img-wrap img:not(.product-brand-fallback) {
  object-fit: cover !important;
  object-position: center center !important;
  padding: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
}

.product-img-wrap img.product-brand-fallback {
  object-fit: contain !important;
  width: 72% !important;
  height: 72% !important;
  margin: auto;
  padding: 4px !important;
}

/* ── Catalog v4 gallery ── */
body.catalog-v4-active .pc-v4-main-wrap {
  padding: 0 !important;
  background-color: #ffffff !important;
  background-size: cover !important;
  background-position: center center !important;
}

body.catalog-v4-active .pc-v4-main-wrap img,
body.catalog-v4-active .pc-v4-main-wrap .pc-v4-main-img {
  object-fit: contain !important;
  object-position: center center !important;
  padding: 12px !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  box-sizing: border-box !important;
}

body.catalog-v4-active .pc-v4-thumb img {
  object-fit: cover !important;
  object-position: center center !important;
  padding: 0 !important;
}

/* ── Top selling (oem-rec-card) — catalog/cart use cover; home #topParts shows full product ── */
body.is-home-page #topParts .oem-rec-card__media img:not(.product-brand-fallback),
body.is-home-page #topParts .oem-rec-card .top-selling-img-wrap img:not(.product-brand-fallback) {
  object-fit: contain !important;
  object-position: center center !important;
  padding: 0 !important;
  max-height: none !important;
  transform: none !important;
  filter: none !important;
  background: transparent !important;
}

body.is-home-page #topParts .oem-rec-card:hover .oem-rec-card__media img:not(.product-brand-fallback),
body.is-home-page #topParts .oem-rec-card:hover .top-selling-img-wrap img:not(.product-brand-fallback) {
  transform: none !important;
}

.oem-rec-card__media img:not(.product-brand-fallback),
.oem-rec-card .top-selling-img-wrap img:not(.product-brand-fallback) {
  object-fit: cover !important;
  object-position: center center !important;
  padding: 0 !important;
  max-height: none !important;
  transform: none !important;
}

.oem-rec-card:hover .oem-rec-card__media img:not(.product-brand-fallback),
.oem-rec-card:hover .top-selling-img-wrap img:not(.product-brand-fallback) {
  transform: scale(1.03) !important;
}

.oem-rec-card__media .product-brand-fallback,
.oem-rec-card .top-selling-img-wrap .product-brand-fallback {
  object-fit: contain !important;
  width: 72% !important;
  height: 72% !important;
}

/* ── Product detail gallery (modal + full page) ── */
.pd-main-img img:not(.product-brand-fallback),
.pd-main-photo:not(.product-brand-fallback),
#productPage .pd-main-img img:not(.product-brand-fallback),
#productPage .pd-main-wrap img:not(.product-brand-fallback),
#productPage .product-page-gallery img:not(.product-brand-fallback),
#pdModal .pd-main-img img:not(.product-brand-fallback),
#pdModal .pd-gallery img:not(.product-brand-fallback) {
  object-fit: cover !important;
  object-position: center center !important;
  padding: 0 !important;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
}

.pd-thumb img:not(.product-brand-fallback),
#productPage .pd-thumb img:not(.product-brand-fallback),
#pdModal .pd-thumb img:not(.product-brand-fallback) {
  object-fit: cover !important;
  object-position: center center !important;
  padding: 0 !important;
}

.pd-main-img,
#productPage .pd-main-img {
  padding: 0;
}

#productPage .product-page-related-img {
  padding: 0 !important;
}

#productPage .product-page-related-img img {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: cover !important;
  object-position: center center !important;
  padding: 0 !important;
}

/* Lightbox — keep full product visible when zooming */
.pd-lightbox-img,
.pd-lightbox img {
  object-fit: contain !important;
}

/* ── Cart ── */
.cart-item-img img:not(.cart-brand-fallback):not(.product-brand-fallback) {
  object-fit: cover !important;
  object-position: center center !important;
  padding: 0 !important;
}

.cart-item-img img.cart-brand-fallback,
.cart-item-img img.product-brand-fallback {
  object-fit: contain !important;
  padding: 4px !important;
}

/* ── Account favorites ── */
.account-fav-card img {
  object-fit: cover !important;
  object-position: center center !important;
  padding: 0 !important;
}

/* ── Brand page related product chips ── */
.brand-page-related-chip img {
  object-fit: cover !important;
  object-position: center center !important;
}
