/* Aria v31 - Product gallery slider and fully contained lightbox */
.product-gallery-slider {
    min-width: 0;
}

.product-gallery-stage {
    position: relative;
    min-width: 0;
}

.product-gallery-main-button {
    width: 100%;
}

.product-gallery-main-button img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    object-position: center center !important;
}

.product-gallery-arrow,
.product-gallery-lightbox-arrow {
    position: absolute;
    z-index: 6;
    display: grid;
    place-items: center;
    border: 1px solid rgba(16, 37, 26, .12);
    border-radius: 999px;
    background: rgba(255, 253, 248, .96);
    color: #0a6b46;
    box-shadow: 0 10px 26px rgba(0, 0, 0, .14);
    cursor: pointer;
    transition: transform .2s ease, background .2s ease, color .2s ease;
}

.product-gallery-arrow:hover,
.product-gallery-lightbox-arrow:hover {
    transform: translateY(-50%) scale(1.06);
    background: #0a6b46;
    color: #fff;
}

.product-gallery-arrow {
    top: 50%;
    width: 44px;
    height: 44px;
    transform: translateY(-50%);
}

.product-gallery-arrow-prev {
    left: 14px;
}

.product-gallery-arrow-next {
    right: 14px;
}

.product-gallery-counter {
    position: absolute;
    right: 16px;
    top: 16px;
    z-index: 5;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    min-width: 52px;
    justify-content: center;
    padding: 8px 11px;
    border-radius: 999px;
    background: rgba(255, 253, 248, .95);
    color: #173328;
    border: 1px solid rgba(16, 37, 26, .10);
    box-shadow: 0 8px 20px rgba(0, 0, 0, .10);
    font-size: 12px;
    font-weight: 800;
}

.product-gallery-thumbs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 10px 2px 4px;
    scrollbar-width: none;
    scroll-snap-type: x proximity;
}

.product-gallery-thumbs::-webkit-scrollbar {
    display: none;
}

.product-gallery-thumbs button {
    flex: 0 0 84px;
    width: 84px;
    height: 84px;
    padding: 4px !important;
    border: 2px solid transparent !important;
    border-radius: 14px !important;
    background: #fffdf8 !important;
    overflow: hidden;
    cursor: pointer;
    scroll-snap-align: start;
    transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.product-gallery-thumbs button.active {
    border-color: #0a6b46 !important;
    box-shadow: 0 8px 18px rgba(10, 107, 70, .16);
}

.product-gallery-thumbs button:hover {
    transform: translateY(-2px);
}

.product-gallery-thumbs img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    object-position: center center !important;
    border-radius: 10px !important;
    background: #fffdf8;
}

.product-gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 7000;
    display: grid;
    place-items: center;
    padding: clamp(10px, 2vw, 28px);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .2s ease, visibility .2s ease;
}

.product-gallery-lightbox.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.product-gallery-lightbox-backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    background: rgba(2, 12, 8, .76);
    backdrop-filter: blur(7px);
    -webkit-backdrop-filter: blur(7px);
    cursor: zoom-out;
}

.product-gallery-lightbox-dialog {
    position: relative;
    z-index: 2;
    width: min(96vw, 1120px);
    height: min(92dvh, 980px);
    max-width: 1120px;
    max-height: 92dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(10px, 1.6vw, 18px);
    border: 1px solid rgba(214, 173, 75, .32);
    border-radius: 24px;
    background: #fffdf8;
    box-shadow: 0 28px 80px rgba(0, 0, 0, .34);
    overflow: hidden;
}

.product-gallery-lightbox-frame {
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 16px;
    background: #fffdf8;
    touch-action: pan-y;
}

.product-gallery-lightbox-frame img {
    display: block;
    width: auto !important;
    height: auto !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    object-position: center center !important;
    border-radius: 14px !important;
    box-shadow: none !important;
    background: transparent !important;
    user-select: none;
    -webkit-user-drag: none;
}

.product-gallery-lightbox-close {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 8;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(16, 37, 26, .10);
    border-radius: 50%;
    background: rgba(255, 253, 248, .98);
    color: #0a6b46;
    box-shadow: 0 10px 28px rgba(0, 0, 0, .16);
    cursor: pointer;
}

.product-gallery-lightbox-arrow {
    top: 50%;
    width: 50px;
    height: 50px;
    transform: translateY(-50%);
}

.product-gallery-lightbox-prev {
    left: 16px;
}

.product-gallery-lightbox-next {
    right: 16px;
}

.product-gallery-lightbox-counter {
    position: absolute;
    left: 50%;
    bottom: 14px;
    z-index: 7;
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    gap: 3px;
    min-width: 54px;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 253, 248, .96);
    color: #173328;
    border: 1px solid rgba(16, 37, 26, .10);
    box-shadow: 0 8px 20px rgba(0, 0, 0, .10);
    font-size: 12px;
    font-weight: 800;
}

body.product-gallery-lightbox-open {
    overflow: hidden !important;
}

@media (max-width: 760px) {
    .product-gallery-arrow {
        width: 40px;
        height: 40px;
    }

    .product-gallery-arrow-prev {
        left: 8px;
    }

    .product-gallery-arrow-next {
        right: 8px;
    }

    .product-gallery-thumbs button {
        flex-basis: 72px;
        width: 72px;
        height: 72px;
    }

    .product-gallery-lightbox {
        padding: 8px;
    }

    .product-gallery-lightbox-dialog {
        width: 96vw;
        height: 88dvh;
        max-height: 88dvh;
        padding: 8px;
        border-radius: 18px;
    }

    .product-gallery-lightbox-frame {
        border-radius: 12px;
    }

    .product-gallery-lightbox-frame img {
        border-radius: 10px !important;
    }

    .product-gallery-lightbox-close {
        top: 8px;
        right: 8px;
        width: 40px;
        height: 40px;
    }

    .product-gallery-lightbox-arrow {
        width: 42px;
        height: 42px;
    }

    .product-gallery-lightbox-prev {
        left: 10px;
    }

    .product-gallery-lightbox-next {
        right: 10px;
    }

    .product-gallery-lightbox-counter {
        bottom: 10px;
    }
}

/* Aria V37 - remove dark/default borders around product gallery */
.product-gallery-slider,
.product-gallery-stage,
.product-gallery-main-button,
.main-product-image,
.product-gallery-main-button:focus,
.product-gallery-main-button:focus-visible {
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
}

.product-gallery-main-button,
.main-product-image {
    padding: 0 !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    background: transparent !important;
}

.product-gallery-stage {
    overflow: hidden;
    border-radius: 24px;
    background: #f7f5ed !important;
}

.product-gallery-main-button img {
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
}
