/* ==========================================================
   FC2 — ALTUGLAS — CART THUMBS — V1.0.1 (2026-02-20)
   Objectif:
   ✅ Panier + mini-panier : afficher la vignette entière (pas de crop)
   ✅ Centrer l'image + empêcher cover/absolute
   ✅ Ne cible QUE les images FC2 (altuglas)
========================================================== */

/* ---------- Helpers: cible uniquement nos fichiers (upload + tmp) ---------- */
img[src*="fc2alt_"],
img[src*="fc2alt-prev"],
img[src*="fc2alt_prev"],
img[src*="fc2alt-final"],
img[src*="fc2alt_final"],
img[src*="img/funeralcustomizer2/tmp/fc2alt_"],
img[src*="/upload/fc2alt_"],
img[data-src*="fc2alt_"],
img[data-original*="fc2alt_"]{
  object-fit: contain !important;
  object-position: center center !important;

  /* Empêche les thèmes de forcer des trucs bizarres */
  position: relative !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;

  transform: none !important;
  max-width: 100% !important;
  max-height: 100% !important;

  background: #fff !important;
}

/* ---------- PANIER (page cart) ---------- */
/* cas PrestaShop classique */
.cart-container img[src*="fc2alt_"],
.cart-item img[src*="fc2alt_"],
.product-line-grid img[src*="fc2alt_"],
.product-image img[src*="fc2alt_"],
.cart-overview img[src*="fc2alt_"]{
  width: 100% !important;
  height: 100% !important;         /* important pour que object-fit marche */
  display: block !important;
}

/* si le thème met l’image en absolute dans le wrapper */
.cart-container .product-image,
.cart-item .product-image,
.product-line-grid .product-image{
  overflow: hidden !important;      /* propre */
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* ---------- MINI-PANIER (blockcart / dropdown) ---------- */
.blockcart img[src*="fc2alt_"],
.blockcart .cart-products img[src*="fc2alt_"],
.blockcart .cart-item img[src*="fc2alt_"],
.blockcart .product-image img[src*="fc2alt_"],
#_desktop_cart img[src*="fc2alt_"],
#_mobile_cart img[src*="fc2alt_"]{
  width: 100% !important;
  height: 100% !important;          /* sinon object-fit ne fait rien */
  display: block !important;
}

/* sécurise le conteneur vignette mini-panier */
.blockcart .cart-products .product-image,
.blockcart .cart-item .product-image,
#_desktop_cart .product-image,
#_mobile_cart .product-image{
  overflow: hidden !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

/* ---------- ULTRA-SECURITE : certains thèmes mettent un width/height inline ---------- */
.blockcart img[src*="fc2alt_"][width],
.blockcart img[src*="fc2alt_"][height],
.cart-container img[src*="fc2alt_"][width],
.cart-container img[src*="fc2alt_"][height]{
  object-fit: contain !important;
  object-position: center center !important;
}

/* ---------- Si le thème utilise <picture> ---------- */
picture img[src*="fc2alt_"]{
  object-fit: contain !important;
  object-position: center center !important;
}