/* =====================================
   CARTE PRODUIT
===================================== */

.ma-carte-produit {
    position: relative;
    overflow: hidden;
    padding: 15px;
    background: #fff;
    box-shadow: 0 3px 15px rgba(0,0,0,0.15);
    transition: transform .25s ease, box-shadow .25s ease;
}

.ma-carte-produit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.18);
}


/* =====================================
   IMAGE WRAP
===================================== */

.product-image-wrap {
    position: relative;
    width: 100%;
    display: block;
}


/* =====================================
   STACK IMAGES (NOUVEAU SYSTÈME)
===================================== */

.variation-images-stack {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #f3f3f3;
}


/* chaque couche image */
.variation-layer {
    position: absolute;
    inset: 0;

    background: #f3f3f3;

    display: flex;
    align-items: center;
    justify-content: center;

    opacity: 0;
    transition: opacity .35s ease;
}


/* image active */
.variation-layer[data-active="true"] {
    opacity: 1;
    z-index: 2;
}


/* images */
.variation-layer img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* IMPORTANT pour voir le fond gris */
    display: block;
    transition: transform .35s ease;
}


/* hover zoom léger */
.variation-images-stack:hover .variation-layer[data-active="true"] img {
    transform: scale(1.03);
}


/* =====================================
   LOGO MARQUE
===================================== */

.eael-brand-shortcode {
    position: absolute;
    top: 0px;
    left: 0px;

    width: 40px;
    height: 40px;

    background: #f3f3f3;

    display: flex;
    align-items: center;
    justify-content: center;

    z-index: 10;

    overflow: hidden;
}

.eael-brand-shortcode img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}


/* =====================================
   SWATCHES COULEURS
===================================== */

.colors-swatches-only {
    position: absolute;
    bottom: 8px;
    right: 8px;
    z-index: 20;
}

.color-swatches {
    display: flex;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.swatch-item {
    width: 20px;
    height: 20px;
    border-radius: 1%;
    cursor: pointer;
    border: 1px solid #ddd;
    transition: transform .2s ease, border .2s ease;
}

.swatch-item.active {
    border: 2px solid #78BE23;
    transform: scale(1.15);
}


/* =====================================
   INFOS PRODUIT
===================================== */

.product-details-wrap {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-direction: row-reverse;
    padding-top: 15px;
}

.price {
    font-family: "TeX-Gyre Adventor", sans-serif;
    font-weight: 800;
    font-size: 1.1em;
}

.woocommerce-loop-product__title {
    margin: 0;
    font-family: "TeX-Gyre Adventor", sans-serif;
    font-size: 1em !important;

    word-break: break-word;
    hyphens: auto;
}


/* brand name */
.eael-brandname-shortcode {
    font-family: "TeX-Gyre Adventor", sans-serif;
    font-size: 0.8em;
    font-weight: 700;
}


/* =====================================
   GRID PRODUITS
===================================== */

.woocommerce ul.products {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.woocommerce ul.products li.product {
    float: none !important;
    width: 100% !important;
    margin: 0 !important;
}


/* =====================================
   INFINITE SCROLL
===================================== */

.infinite-scroll-trigger {
    text-align: center;
    padding: 20px;
    font-size: 14px;
    color: #888;
}

.infinite-scroll-trigger.is-loading::after {
    content: "";
    display: inline-block;
    width: 18px;
    height: 18px;
    margin-left: 10px;

    border: 3px solid #ddd;
    border-top-color: #78BE23;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}


.ma-carte-produit:hover .variation-layer[data-image-type="main"] {
    opacity: 0;
    z-index: 1;
}

.ma-carte-produit:hover .variation-layer[data-image-type="secondary"] {
    opacity: 1;
    z-index: 2;
}