/**
 * WC Hover Image Swap — wchis.css v1.0.1
 * Le CSS gere uniquement le positionnement et l'overlay.
 * Les transitions opacity/transform sont pilotees par le JS en inline
 * pour eviter tout conflit avec les themes.
 */

/* Wrapper cree par le JS autour de l'image principale */
.wchis-wrap {
    position: relative !important;
    overflow: hidden !important;
    display: block !important;
    line-height: 0; /* supprime l'espace sous l'img (baseline) */
}

/* Image principale — le JS pilote opacity et transform */
.wchis-primary {
    display: block;
    width: 100%;
    height: auto;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Image hover — positionnee en absolu, cachee par defaut */
.wchis-secondary {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    opacity: 0;
    pointer-events: none;
    display: block;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Overlay optionnel */
.wchis-overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    top: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 14px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 10;
    background: rgba(0, 0, 0, 0);
    transition: opacity 0.3s ease, background 0.3s ease;
}

.wchis-wrap:hover .wchis-overlay {
    opacity: 1;
    background: rgba(0, 0, 0, 0.07);
}

.wchis-overlay span {
    background: rgba(255, 255, 255, 0.93);
    color: #111;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 5px 13px;
    border-radius: 100px;
    line-height: 1;
}

/* Evite le double affichage sur certains themes
   qui clonent l'image pour le lazy-load */
.wchis-wrap img:not(.wchis-primary):not(.wchis-secondary):not([class*="wchis"]) {
    display: none !important;
}
