
/*
 * AVBA — Galerie des pièces v1.1
 * Aucun changement d’URL, de contenu SEO ou de donnée produit.
 */

/* --- Galerie sous l’image principale --- */
body.single-avba_piece .avba-piece-single__image {
    overflow: hidden;
    position: relative;
}

body.single-avba_piece .avba-piece-single__image > a[data-avba-lightbox] {
    position: relative;
    display: block;
    cursor: zoom-in;
}

body.single-avba_piece .avba-piece-single__image > a[data-avba-lightbox] > img {
    display: block;
    transition: opacity .16s ease;
}

body.single-avba_piece .avba-piece-single__image.is-avba-switching > a[data-avba-lightbox] > img {
    opacity: .35;
}

body.single-avba_piece .avba-piece-content .gallery.avba-gallery-source-hidden,
body.single-avba_piece .avba-piece-content .wp-block-gallery.avba-gallery-source-hidden {
    display: none !important;
}

.avba-product-gallery {
    position: relative;
    z-index: 3;
    padding: 12px;
    border-top: 1px solid rgba(198,161,91,.28);
    background: rgba(24,19,16,.035);
}

.avba-product-gallery__strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(68px, 1fr));
    gap: 9px;
}

.avba-product-gallery__thumb {
    position: relative;
    min-width: 0;
    padding: 0;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border: 1px solid rgba(59,48,42,.20);
    background: #f3ede2;
    cursor: pointer;
    transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.avba-product-gallery__thumb:hover {
    transform: translateY(-1px);
    border-color: rgba(198,161,91,.78);
}

.avba-product-gallery__thumb.is-active {
    border-color: #c6a15b;
    box-shadow: 0 0 0 1px #c6a15b inset;
}

body.single-avba_piece .avba-product-gallery__thumb img {
    display: block;
    width: 100% !important;
    height: 100% !important;
    max-height: none !important;
    object-fit: cover !important;
    object-position: center center !important;
}

.avba-product-gallery__nav {
    position: absolute;
    z-index: 6;
    top: calc(50% - 54px);
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(255,255,255,.62);
    border-radius: 50%;
    background: rgba(24,19,16,.70);
    color: #fff;
    font-size: 25px;
    line-height: 1;
    cursor: pointer;
    backdrop-filter: blur(4px);
    box-shadow: 0 8px 26px rgba(0,0,0,.20);
    transition: background .18s ease, transform .18s ease;
}

.avba-product-gallery__nav:hover {
    background: rgba(24,19,16,.90);
    transform: translateY(-1px);
}

.avba-product-gallery__nav--prev { left: 18px; }
.avba-product-gallery__nav--next { right: 18px; }

.avba-product-gallery__counter {
    margin-top: 8px;
    color: rgba(59,48,42,.62);
    font-size: .72rem;
    text-align: right;
}

/* --- Bouton indicateur zoom --- */
.avba-zoom-hint {
    position: absolute;
    z-index: 8;
    right: 14px;
    bottom: 14px;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 10px;
    border: 1px solid rgba(255,255,255,.55);
    border-radius: 999px;
    background: rgba(24,19,16,.72);
    color: #fff;
    font-size: .72rem;
    line-height: 1;
    pointer-events: none;
    backdrop-filter: blur(4px);
}

/* --- Lightbox / zoom plein écran --- */
.avba-zoom-modal {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    background: rgba(8,7,6,.96);
    color: #fff;
}

.avba-zoom-modal.is-open {
    display: block;
}

body.avba-zoom-open {
    overflow: hidden !important;
}

.avba-zoom-modal__stage {
    position: absolute;
    inset: 0;
    overflow: hidden;
    touch-action: none;
    cursor: zoom-in;
}

.avba-zoom-modal.is-zoomed .avba-zoom-modal__stage {
    cursor: grab;
}

.avba-zoom-modal.is-dragging .avba-zoom-modal__stage {
    cursor: grabbing;
}

.avba-zoom-modal__image {
    position: absolute;
    left: 50%;
    top: 50%;
    max-width: min(92vw, 1800px);
    max-height: 86vh;
    width: auto;
    height: auto;
    user-select: none;
    -webkit-user-drag: none;
    transform-origin: center center;
    will-change: transform;
    transition: transform .12s ease;
}

.avba-zoom-modal.is-dragging .avba-zoom-modal__image {
    transition: none;
}

.avba-zoom-modal__topbar {
    position: absolute;
    z-index: 10;
    top: 14px;
    left: 14px;
    right: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    pointer-events: none;
}

.avba-zoom-modal__counter {
    padding: 8px 11px;
    border: 1px solid rgba(255,255,255,.20);
    border-radius: 999px;
    background: rgba(24,19,16,.68);
    font-size: .78rem;
    backdrop-filter: blur(4px);
}

.avba-zoom-modal__controls {
    display: flex;
    gap: 7px;
    pointer-events: auto;
}

.avba-zoom-modal__button {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(255,255,255,.35);
    border-radius: 50%;
    background: rgba(24,19,16,.72);
    color: #fff;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: background .15s ease, border-color .15s ease;
}

.avba-zoom-modal__button:hover {
    background: rgba(198,161,91,.90);
    border-color: rgba(198,161,91,.95);
}

.avba-zoom-modal__arrow {
    position: absolute;
    z-index: 10;
    top: 50%;
    width: 48px;
    height: 48px;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(255,255,255,.34);
    border-radius: 50%;
    background: rgba(24,19,16,.68);
    color: #fff;
    font-size: 30px;
    cursor: pointer;
    backdrop-filter: blur(4px);
}

.avba-zoom-modal__arrow--prev { left: 16px; }
.avba-zoom-modal__arrow--next { right: 16px; }

.avba-zoom-modal__help {
    position: absolute;
    z-index: 10;
    left: 50%;
    bottom: 15px;
    transform: translateX(-50%);
    max-width: calc(100vw - 30px);
    padding: 7px 11px;
    border-radius: 999px;
    background: rgba(24,19,16,.65);
    color: rgba(255,255,255,.82);
    font-size: .72rem;
    white-space: nowrap;
    pointer-events: none;
}

@media (max-width: 760px) {
    .avba-product-gallery {
        padding: 9px;
    }

    .avba-product-gallery__strip {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        padding-bottom: 3px;
        scrollbar-width: thin;
        scroll-snap-type: x proximity;
    }

    .avba-product-gallery__thumb {
        flex: 0 0 72px;
        scroll-snap-align: start;
    }

    body.single-avba_piece .avba-product-gallery__thumb img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        object-position: center center !important;
    }

    .avba-product-gallery__nav {
        top: calc(50% - 45px);
        width: 38px;
        height: 38px;
        font-size: 22px;
    }

    .avba-product-gallery__nav--prev { left: 10px; }
    .avba-product-gallery__nav--next { right: 10px; }

    .avba-zoom-hint {
        right: 9px;
        bottom: 9px;
        padding: 7px 9px;
        font-size: .66rem;
    }

    .avba-zoom-modal__arrow {
        width: 42px;
        height: 42px;
        font-size: 26px;
    }

    .avba-zoom-modal__arrow--prev { left: 8px; }
    .avba-zoom-modal__arrow--next { right: 8px; }

    .avba-zoom-modal__button {
        width: 40px;
        height: 40px;
    }

    .avba-zoom-modal__help {
        bottom: 9px;
        font-size: .64rem;
    }
}
