
/* ========================================
   MAE — GALERIE PRODUIT V2
   ======================================== */

.mae-gallery {
    width: 100%;
    min-width: 0;
}

/* IMAGE PRINCIPALE */

.mae-gallery-main {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    height: clamp(300px, 50vh, 520px);

    aspect-ratio: auto;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;

    overflow: hidden;
    box-sizing: border-box;
}

.mae-gallery .mae-gallery-image {
    display: block;
    width: 100%;
    height: 100%;
    max-height: none;

    object-fit: contain;
    object-position: center;

    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

/* ========================================
   NAVIGATION
   ======================================== */

.mae-gallery-nav {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 12px;

    width: 100%;
    min-height: 48px;
    margin-top: 12px;
}

/* BARRES DE NAVIGATION */

.mae-gallery .mae-gallery-thumbs {
    grid-column: 2;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    min-width: 0;
    max-width: min(380px, 55vw);
    padding: 0;
    overflow-x: auto;
}

.mae-gallery .mae-gallery-thumb {
    display: flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 54px;
    width: 54px;
    height: 44px;
    min-height: 44px;

    padding: 0;
    margin: 0;

    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;

    cursor: pointer;
}

/* Miniatures masquées visuellement */

.mae-gallery .mae-gallery-thumb img {
    display: none;
}

/* Barre horizontale */

.mae-gallery .mae-gallery-thumb::before {
    content: "";
    display: block;

    width: 54px;
    height: 5px;

    background: #D0D0D0;
    transition: background-color 0.2s ease;
}

/* Barre active */

.mae-gallery .mae-gallery-thumb[aria-pressed="true"] {
    background: transparent;
    border: 0;
}

.mae-gallery .mae-gallery-thumb[aria-pressed="true"]::before {
    background: #252525;
}

/* Survol */

.mae-gallery .mae-gallery-thumb:hover {
    background: transparent;
    border: 0;
}

.mae-gallery .mae-gallery-thumb:hover::before {
    background: #888888;
}

.mae-gallery .mae-gallery-thumb[aria-pressed="true"]:hover::before {
    background: #252525;
}

/* ========================================
   FLÈCHES PRÉCÉDENT / SUIVANT
   ======================================== */

.mae-gallery-arrows {
    grid-column: 3;
    justify-self: end;

    display: flex;
    align-items: center;
    gap: 4px;
}

.mae-gallery .mae-gallery-arrow {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 38px;
    height: 38px;
    padding: 0;

    background: #E5E5E5;
    color: #252525;

    border: none;
    border-radius: 0;
    box-shadow: none;

    font-size: 23px;
    font-weight: 400;
    line-height: 1;

    cursor: pointer;
    transition: background-color 0.2s ease;
}

/* Flèche suivante : bleu MAE */

.mae-gallery .mae-gallery-next {
    background: #1966BB;
    color: #FFFFFF;
}

/* Bouton inactif */

.mae-gallery .mae-gallery-arrow:disabled {
    opacity: 0.4;
    cursor: default;
}

/* Survol */

.mae-gallery .mae-gallery-arrow:not(:disabled):hover {
    filter: brightness(0.9);
}

/* ACCESSIBILITÉ */

.mae-gallery .mae-gallery-thumb:focus-visible,
.mae-gallery .mae-gallery-arrow:focus-visible,
.mae-gallery-main:focus-visible {
    outline: 3px solid #1966BB;
    outline-offset: 3px;
}

/* ========================================
   ÉTATS ET ACCESSIBILITÉ
   ======================================== */

.mae-gallery-empty {
    padding: 48px 16px;
    text-align: center;
    color: #666;
    background: #F6F6F6;
}

.mae-gallery .screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ========================================
   TABLETTE ET MOBILE
   ======================================== */

@media (max-width: 1024px) {

    .mae-gallery-main {
        height: clamp(230px, 72vw, 390px);
    }

    .mae-gallery-sticky {
        position: static !important;
        top: auto !important;
    }

    .mae-gallery-nav {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px;
    }

    .mae-gallery .mae-gallery-thumbs {
        grid-column: 1;
        justify-content: flex-start;
        max-width: 100%;
    }

    .mae-gallery-arrows {
        grid-column: 2;
    }

    .mae-gallery .mae-gallery-thumb {
        flex-basis: 44px;
        width: 44px;
    }

    .mae-gallery .mae-gallery-thumb::before {
        width: 40px;
    }
}

/* ========================================
   STICKY
   ======================================== */

/*
Le Sticky du titre et de la galerie
reste géré par le conteneur Elementor
PRODUIT IMAGE.

Ne pas ajouter un deuxième Sticky ici.
*/
