/* --- Cadre + object-fit: contain sur l'image ciblée --- */
.elementor-element-0e512f8 img{
width:100%;
aspect-ratio:3 / 4; /* forme du cadre (portrait) — ajuste si besoin */
height:auto;
object-fit:contain; /* l'image tient entière, sans rognage */
object-position:center;
display:block;
background:#fff; /* couleur des bandes vides (optionnel) */
}/* --- Loupe --- */
.zoom-loupe-container{
position:relative;
display:block; /* important avec width:100% sur l'image */
line-height:0;
cursor:crosshair;
}
.zoom-loupe-glass{
position:absolute;
box-sizing:border-box;
width:180px;
height:180px;
border:2px solid #fff;
border-radius:50%;
box-shadow:0 0 14px rgba(0,0,0,.35);
background-repeat:no-repeat;
pointer-events:none;
opacity:0;
transition:opacity .12s ease;
z-index:9999;
}(function(){
var SELECTOR = ".elementor-element-0e512f8 img";
var ZOOM = 2.5;
var GLASS_SIZE = 180;function initLoupe(img){
if(!img || img.dataset.loupeReady) return;
img.dataset.loupeReady = "1";var container = document.createElement("div");
container.className = "zoom-loupe-container";
img.parentNode.insertBefore(container, img);
container.appendChild(img);var glass = document.createElement("div");
glass.className = "zoom-loupe-glass";
glass.style.width = GLASS_SIZE + "px";
glass.style.height = GLASS_SIZE + "px";
glass.style.backgroundImage = "url('" + img.src + "')";
container.appendChild(glass);var bw = 2, half = GLASS_SIZE / 2;function move(e){
e.preventDefault();
var rect = img.getBoundingClientRect(); // le cadre (bandes vides comprises)
var natW = img.naturalWidth, natH = img.naturalHeight;
if(!natW || !natH) return;// taille réelle de l'image affichée dans le cadre (object-fit: contain)
var scale = Math.min(rect.width / natW, rect.height / natH);
var dispW = natW * scale, dispH = natH * scale;
var offX = (rect.width - dispW) / 2; // marge horizontale
var offY = (rect.height - dispH) / 2; // marge verticalevar cx = e.clientX - rect.left; // curseur dans le cadre
var cy = e.clientY - rect.top;
var ix = cx - offX; // curseur dans l'image réelle
var iy = cy - offY;// curseur sur une bande vide → on cache la loupe
if(ix < 0 || iy dispW || iy > dispH){
glass.style.opacity = "0";
return;
}
glass.style.opacity = "1";var magW = dispW * ZOOM, magH = dispH * ZOOM;
glass.style.backgroundSize = magW + "px " + magH + "px";glass.style.left = (cx - half) + "px";
glass.style.top = (cy - half) + "px";var bgX = Math.max(0, Math.min(ix * ZOOM - half, magW - GLASS_SIZE));
var bgY = Math.max(0, Math.min(iy * ZOOM - half, magH - GLASS_SIZE));
glass.style.backgroundPosition = "-" + (bgX + bw) + "px -" + (bgY + bw) + "px";
}container.addEventListener("mousemove", move);
container.addEventListener("mouseleave", function(){ glass.style.opacity = "0"; });
}function run(){ initLoupe(document.querySelector(SELECTOR)); }
if(document.readyState === "loading"){
document.addEventListener("DOMContentLoaded", run);
} else { run(); }
})();