/**
 * BB Product Gallery - Frontend Styles
 */

/* ── CSS Variables ── */
.bb-product-gallery {
    --bb-thumb-gap: 10px;
    --bb-thumb-columns: 4;
}

/* ── Main Gallery Container ── */
.bb-product-gallery {
    position: relative;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

/* ── Main Image Wrapper ── */
.bb-product-gallery__main-wrapper {
    position: relative;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* ── Main Image ── */
.bb-product-gallery__main-image {
    position: relative;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    cursor: pointer;
    background-color: #f8f8f8;
}

.bb-product-gallery__main-image img {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 600px;
    display: block;
    object-fit: contain;
    object-position: center;
    transition: opacity 0.3s ease;
}

/* ── Amazon-Style Zoom (Lens + Side Panel) ── */
.bb-product-gallery[data-enable-zoom="yes"] .bb-product-gallery__main-image {
    cursor: crosshair;
}

.bb-product-gallery__zoom-lens {
    display: none;
    position: absolute;
    z-index: 12;
    width: 150px;
    height: 150px;
    background: rgba(0, 120, 215, 0.15);
    border: 2px solid rgba(0, 120, 215, 0.4);
    pointer-events: none;
    box-sizing: border-box;
}

.bb-product-gallery__main-image.is-zooming .bb-product-gallery__zoom-lens {
    display: block;
}

.bb-product-gallery__zoom-result {
    display: none;
    position: absolute;
    top: 0;
    left: 100%;
    margin-left: 15px;
    width: 100%;
    height: 100%;
    background-color: #fff;
    background-repeat: no-repeat;
    border: 1px solid #e0e0e0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    z-index: 100;
    overflow: hidden;
    pointer-events: none;
}

.bb-product-gallery__main-wrapper.is-zooming .bb-product-gallery__zoom-result {
    display: block;
}

/* ── Flash Sale Badge ── */
.bb-product-gallery__flash-sale {
    position: absolute;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    line-height: 1;
    box-sizing: border-box;
}

.bb-product-gallery__flash-sale--left {
    left: 15px;
}

.bb-product-gallery__flash-sale--right {
    right: 15px;
}

/* ── Lightbox Icon Button ── */
.bb-product-gallery__lightbox-icon {
    position: absolute;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: opacity 0.3s ease, transform 0.3s ease;
    background: transparent;
    padding: 0;
}

.bb-product-gallery__lightbox-icon:hover {
    opacity: 0.8;
    transform: scale(1.1);
}

.bb-product-gallery__lightbox-icon svg {
    display: block;
}

.bb-product-gallery__lightbox-icon--top-right {
    top: 15px;
    right: 15px;
}

.bb-product-gallery__lightbox-icon--top-left {
    top: 15px;
    left: 15px;
}

.bb-product-gallery__lightbox-icon--bottom-right {
    bottom: 15px;
    right: 15px;
}

.bb-product-gallery__lightbox-icon--bottom-left {
    bottom: 15px;
    left: 15px;
}

/* ── Thumbnails — Grid ── */
.bb-product-gallery__thumbnails {
    display: flex;
    flex-wrap: wrap;
    gap: var(--bb-thumb-gap, 10px);
    margin-top: 10px;
}

.bb-product-gallery__thumbnails--grid {
    display: grid;
    grid-template-columns: repeat(var(--bb-thumb-columns, 4), 1fr);
    gap: var(--bb-thumb-gap, 10px);
}

/* ── Thumbnails — Slider ── */
.bb-product-gallery__thumbnails--slider {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-behavior: smooth;
    gap: var(--bb-thumb-gap, 10px);
}

.bb-product-gallery__thumbnails--slider::-webkit-scrollbar {
    height: 6px;
}

.bb-product-gallery__thumbnails--slider::-webkit-scrollbar-track {
    background: transparent;
}

.bb-product-gallery__thumbnails--slider::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.bb-product-gallery__thumbnails--slider .bb-product-gallery__thumbnail {
    flex: 0 0 auto;
    width: calc(100% / var(--bb-thumb-columns, 4) - (var(--bb-thumb-gap, 10px) / var(--bb-thumb-columns, 4)) * (var(--bb-thumb-columns, 4) - 1));
    min-width: 60px;
}

/* ── Individual Thumbnail ── */
.bb-product-gallery__thumbnail {
    position: relative;
    cursor: pointer;
    overflow: hidden;
    transition: opacity 0.3s ease;
}

.bb-product-gallery__thumbnail img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    aspect-ratio: 1;
    transition: border-color 0.3s ease, opacity 0.3s ease;
}

.bb-product-gallery__thumbnail:not(.is-active) img {
    opacity: 0.7;
}

.bb-product-gallery__thumbnail:hover img {
    opacity: 1;
}

.bb-product-gallery__thumbnail.is-active img {
    border: 2px solid #333;
    opacity: 1;
}

/* ── Custom Badges Container ── */
.bb-product-gallery__badges {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

/* ── Loading Spinner ── */
.bb-product-gallery__main-image.is-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid #f3f3f3;
    border-top-color: #333;
    border-radius: 50%;
    animation: bb-gallery-spin 0.8s linear infinite;
}

@keyframes bb-gallery-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ══════════════════════════════════════════
   Variation Gallery Strip (floating overlay)
   ══════════════════════════════════════════ */
.bb-product-gallery__variation-strip {
    position: absolute;
    z-index: 10;
    width: 50%;
    display: flex;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 6px;
    padding: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: opacity 0.3s ease;
    max-width: calc(100% - 20px);
    box-sizing: border-box;
}

/* Glass / frosted effect */
.bb-product-gallery__variation-strip.is-glass {
    background: rgba(255, 255, 255, 0.25);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* Strip positions */
.bb-product-gallery__variation-strip--bottom-right {
    bottom: 10px;
    right: 10px;
}

.bb-product-gallery__variation-strip--bottom-left {
    bottom: 10px;
    left: 10px;
}

/* ── Strip Navigation Arrows ── */
.bb-product-gallery__strip-arrow {
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    font-size: 18px;
    line-height: 1;
    color: #333;
    cursor: pointer;
    padding: 0;
    transition: background 0.2s ease, opacity 0.2s ease;
    z-index: 2;
}

.bb-product-gallery__strip-arrow:hover {
    background: rgba(255, 255, 255, 1);
}

.bb-product-gallery__strip-arrow--prev {
    margin-right: 4px;
}

.bb-product-gallery__strip-arrow--next {
    margin-left: 4px;
}

/* ── Strip Inner Container ── */
.bb-product-gallery__variation-strip-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.bb-product-gallery__variation-strip-inner.is-scrollable {
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-behavior: smooth;
}

/* Always hide native scrollbar on strip */
@supports (scrollbar-width: none) {
    .bb-product-gallery__variation-strip .bb-product-gallery__variation-strip-inner.is-scrollable {
        scrollbar-width: none;
    }
}

.bb-product-gallery__variation-strip .bb-product-gallery__variation-strip-inner.is-scrollable::-webkit-scrollbar {
    display: none;
}

/* Drag-to-scroll cursors */
.bb-product-gallery__variation-strip.is-draggable .bb-product-gallery__variation-strip-inner.is-scrollable {
    cursor: grab;
}

.bb-product-gallery__variation-strip.is-draggable .bb-product-gallery__variation-strip-inner.is-scrollable.is-dragging {
    cursor: grabbing;
    scroll-behavior: auto;
    -webkit-user-select: none;
    user-select: none;
}

/* ── Strip Thumbnails ── */
.bb-product-gallery__variation-strip-thumb {
    flex: 0 0 auto;
    width: 60px;
    height: 60px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: opacity 0.2s ease;
}

.bb-product-gallery__variation-strip-thumb img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    border-radius: 4px;
    border: 2px solid transparent;
    box-sizing: border-box;
    transition: border-color 0.2s ease, opacity 0.2s ease;
}

.bb-product-gallery__variation-strip-thumb:not(.is-active) img {
    opacity: 0.7;
}

.bb-product-gallery__variation-strip-thumb:hover img {
    opacity: 1;
}

.bb-product-gallery__variation-strip-thumb.is-active img {
    border-color: #333;
    opacity: 1;
}

/* ══════════════════════════════════════════
   Amazon Layout (Thumbnails Left)
   ══════════════════════════════════════════ */
.bb-product-gallery--amazon {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 12px;
}

.bb-product-gallery--amazon .bb-product-gallery__thumbnails {
    order: -1;
    display: flex !important;
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 8px;
    margin-top: 0;
    width: 64px;
    min-width: 64px;
    max-height: 600px;
    overflow-y: auto;
    overflow-x: hidden;
}

@supports (scrollbar-width: none) {
    .bb-product-gallery--amazon .bb-product-gallery__thumbnails {
        scrollbar-width: none;
    }
}

.bb-product-gallery--amazon .bb-product-gallery__thumbnails::-webkit-scrollbar {
    display: none;
}

.bb-product-gallery--amazon .bb-product-gallery__thumbnails .bb-product-gallery__thumbnail {
    width: 56px;
    min-width: 56px;
    flex: 0 0 auto;
}

.bb-product-gallery--amazon .bb-product-gallery__thumbnails .bb-product-gallery__thumbnail img {
    width: 56px;
    height: 56px;
    object-fit: cover;
    aspect-ratio: 1;
    border: 2px solid transparent;
    border-radius: 4px;
    box-sizing: border-box;
}

.bb-product-gallery--amazon .bb-product-gallery__thumbnail.is-active img {
    border-color: #e77600;
}

.bb-product-gallery--amazon .bb-product-gallery__thumbnail:hover img {
    border-color: #e77600;
    opacity: 1;
}

.bb-product-gallery--amazon .bb-product-gallery__main-wrapper {
    flex: 1;
    min-width: 0;
    max-width: none;
    margin: 0;
}

.bb-product-gallery--amazon .bb-product-gallery__zoom-result {
    margin-left: 20px;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .bb-product-gallery:not([style*="--bb-thumb-columns"]) {
        --bb-thumb-columns: 4;
    }

    .bb-product-gallery__flash-sale {
        font-size: 10px;
    }

    /* Disable zoom on tablet/mobile — no cursor */
    .bb-product-gallery__zoom-lens,
    .bb-product-gallery__zoom-result {
        display: none !important;
    }

    .bb-product-gallery[data-enable-zoom="yes"] .bb-product-gallery__main-image,
    .bb-product-gallery--default[data-enable-zoom="yes"] .bb-product-gallery__carousel {
        cursor: default;
    }

    /* Default Layout: always show arrows on tablet */
    .bb-product-gallery__carousel-arrow {
        opacity: 1;
    }

    /* Style 1 tablet: collapse vertical strip to overlay */
    .bb-product-gallery--style-1.bb-product-gallery--strip-vertical-right,
    .bb-product-gallery--style-1.bb-product-gallery--strip-vertical-left {
        display: block !important;
    }

    .bb-product-gallery--style-1.bb-product-gallery--strip-vertical-right .bb-product-gallery__main-wrapper,
    .bb-product-gallery--style-1.bb-product-gallery--strip-vertical-left .bb-product-gallery__main-wrapper {
        display: block;
    }

    .bb-product-gallery--style-1.bb-product-gallery--strip-vertical-right .bb-product-gallery__variation-strip,
    .bb-product-gallery--style-1.bb-product-gallery--strip-vertical-left .bb-product-gallery__variation-strip {
        position: absolute;
        bottom: 10px;
        right: 10px;
        left: auto;
        width: 50%;
        max-width: calc(100% - 20px);
        max-height: none;
        flex-direction: row;
        overflow: visible;
        min-width: unset;
    }

    .bb-product-gallery--style-1.bb-product-gallery--strip-vertical-right .bb-product-gallery__variation-strip-inner,
    .bb-product-gallery--style-1.bb-product-gallery--strip-vertical-left .bb-product-gallery__variation-strip-inner {
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
    }
}

@media (max-width: 480px) {
    .bb-product-gallery:not([style*="--bb-thumb-columns"]) {
        --bb-thumb-columns: 3;
    }

    .bb-product-gallery--amazon {
        flex-direction: column;
    }

    .bb-product-gallery--amazon .bb-product-gallery__thumbnails {
        order: 1;
        flex-direction: row;
        width: 100%;
        min-width: 0;
        max-height: none;
        overflow-x: auto;
        overflow-y: hidden;
    }

    .bb-product-gallery--amazon .bb-product-gallery__main-wrapper {
        max-width: 600px;
        margin-left: auto;
        margin-right: auto;
    }

    /* Default Layout: hide arrows on small screens, swipe only */
    .bb-product-gallery--default .bb-product-gallery__carousel-arrow {
        display: none;
    }

    /* Style 1: Collapse structural strip to overlay on mobile */
    .bb-product-gallery--style-1.bb-product-gallery--strip-vertical-right,
    .bb-product-gallery--style-1.bb-product-gallery--strip-vertical-left {
        display: block !important;
    }

    .bb-product-gallery--strip-vertical-right .bb-product-gallery__main-wrapper,
    .bb-product-gallery--strip-vertical-left .bb-product-gallery__main-wrapper {
        display: block;
    }

    .bb-product-gallery--strip-vertical-right .bb-product-gallery__main-image,
    .bb-product-gallery--strip-vertical-left .bb-product-gallery__main-image {
        flex: none;
        width: 100%;
    }

    .bb-product-gallery--strip-vertical-right .bb-product-gallery__variation-strip,
    .bb-product-gallery--strip-vertical-left .bb-product-gallery__variation-strip,
    .bb-product-gallery--strip-bottom-horizontal-left .bb-product-gallery__variation-strip,
    .bb-product-gallery--strip-bottom-horizontal-right .bb-product-gallery__variation-strip {
        position: absolute;
        bottom: 10px;
        right: 10px;
        left: auto;
        width: 50%;
        max-width: calc(100% - 20px);
        max-height: none;
        flex-direction: row;
        overflow: visible;
    }

    .bb-product-gallery--strip-vertical-right .bb-product-gallery__variation-strip-inner,
    .bb-product-gallery--strip-vertical-left .bb-product-gallery__variation-strip-inner {
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
    }

    .bb-product-gallery--strip-vertical-right .bb-product-gallery__strip-arrow,
    .bb-product-gallery--strip-vertical-left .bb-product-gallery__strip-arrow {
        margin: 0;
    }

    .bb-product-gallery--strip-vertical-right .bb-product-gallery__strip-arrow--prev,
    .bb-product-gallery--strip-vertical-left .bb-product-gallery__strip-arrow--prev {
        margin-right: 4px;
        margin-bottom: 0;
    }

    .bb-product-gallery--strip-vertical-right .bb-product-gallery__strip-arrow--next,
    .bb-product-gallery--strip-vertical-left .bb-product-gallery__strip-arrow--next {
        margin-left: 4px;
        margin-top: 0;
    }
}

/* ══════════════════════════════════════════
   Default Layout (Image Slider / Carousel)
   ══════════════════════════════════════════ */

/* Carousel container */
.bb-product-gallery__carousel {
    position: relative;
    width: 100%;
    overflow: hidden;
    background-color: #f8f8f8;
    cursor: pointer;
}

.bb-product-gallery--default .bb-product-gallery__main-image {
    display: none; /* Not used in carousel layout */
}

/* Default Layout: thumbnails always wrap, never scroll */
.bb-product-gallery--default .bb-product-gallery__thumbnails,
.bb-product-gallery--default .bb-product-gallery__thumbnails--slider {
    flex-wrap: wrap !important;
    overflow: hidden !important;
    scroll-behavior: auto !important;
}

/* Track - horizontal flexbox, moves via translateX */
.bb-product-gallery__carousel-track {
    display: flex;
    width: 100%;
    will-change: transform;
    /* transition set via inline style from PHP: transition: transform Xms ease; */
}

/* Disable transition during drag/swipe */
.bb-product-gallery__carousel-track.is-dragging {
    transition: none !important;
}

/* Individual slide */
.bb-product-gallery__carousel-slide {
    flex: 0 0 100%;
    width: 100%;
    min-width: 100%;
    position: relative;
}

.bb-product-gallery__carousel-slide img {
    width: 100%;
    height: auto;
    max-height: 600px;
    display: block;
    object-fit: contain;
    object-position: center;
}

/* Zoom lens inside carousel */
.bb-product-gallery--default .bb-product-gallery__carousel .bb-product-gallery__zoom-lens {
    display: none;
    position: absolute;
    z-index: 12;
    width: 150px;
    height: 150px;
    background: rgba(0, 120, 215, 0.15);
    border: 2px solid rgba(0, 120, 215, 0.4);
    pointer-events: none;
    box-sizing: border-box;
}

.bb-product-gallery--default .bb-product-gallery__carousel.is-zooming .bb-product-gallery__zoom-lens {
    display: block;
}

.bb-product-gallery--default[data-enable-zoom="yes"] .bb-product-gallery__carousel {
    cursor: crosshair;
}

/* Zoom result for carousel layout */
.bb-product-gallery--default .bb-product-gallery__zoom-result {
    display: none;
    position: absolute;
    top: 0;
    left: 100%;
    margin-left: 15px;
    width: 100%;
    height: 100%;
    background-color: #fff;
    background-repeat: no-repeat;
    border: 1px solid #e0e0e0;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    z-index: 100;
    overflow: hidden;
    pointer-events: none;
}

.bb-product-gallery--default .bb-product-gallery__main-wrapper.is-zooming .bb-product-gallery__zoom-result {
    display: block;
}

/* ── Carousel Arrow Buttons ── */
.bb-product-gallery__carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
    color: #333;
    cursor: pointer;
    padding: 0;
    transition: background 0.2s ease, opacity 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    opacity: 0;
}

.bb-product-gallery__main-wrapper:hover .bb-product-gallery__carousel-arrow {
    opacity: 1;
}

.bb-product-gallery__carousel-arrow:hover {
    background: #fff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}

.bb-product-gallery__carousel-arrow--prev {
    left: 10px;
}

.bb-product-gallery__carousel-arrow--next {
    right: 10px;
}

/* ── Dot Pagination ── */
.bb-product-gallery__carousel-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 12px 0 4px;
    flex-wrap: wrap;
}

.bb-product-gallery__carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: none;
    background: #ccc;
    cursor: pointer;
    padding: 0;
    transition: background 0.3s ease, transform 0.3s ease;
    flex: 0 0 auto;
}

.bb-product-gallery__carousel-dot:hover {
    background: #999;
}

.bb-product-gallery__carousel-dot.is-active {
    background: #333;
    transform: scale(1.3);
}

/* ══════════════════════════════════════════
   Layout Style 1 — Structural Gallery Strip
   ══════════════════════════════════════════ */

/* ── Vertical Strip (Right / Left) ── */
.bb-product-gallery--strip-vertical-right .bb-product-gallery__main-wrapper,
.bb-product-gallery--strip-vertical-left .bb-product-gallery__main-wrapper {
    display: flex;
    align-items: stretch;
    max-width: none;
}

.bb-product-gallery--strip-vertical-right .bb-product-gallery__main-wrapper {
    flex-direction: row;
}

.bb-product-gallery--strip-vertical-left .bb-product-gallery__main-wrapper {
    flex-direction: row-reverse;
}

.bb-product-gallery--strip-vertical-right .bb-product-gallery__main-image,
.bb-product-gallery--strip-vertical-left .bb-product-gallery__main-image {
    flex: 1;
    min-width: 0;
}

/* Structural strip in vertical mode */
.bb-product-gallery--strip-vertical-right .bb-product-gallery__variation-strip,
.bb-product-gallery--strip-vertical-left .bb-product-gallery__variation-strip {
    position: relative;
    bottom: auto;
    left: auto;
    right: auto;
    width: 80px;
    min-width: 80px;
    max-width: 80px;
    flex-direction: column;
    max-height: 600px;
    overflow: hidden;
    border-radius: 6px;
    margin: 0;
}

.bb-product-gallery--strip-vertical-right .bb-product-gallery__variation-strip {
    margin-left: 8px;
}

.bb-product-gallery--strip-vertical-left .bb-product-gallery__variation-strip {
    margin-right: 8px;
}

/* Vertical strip inner: scrolls vertically */
.bb-product-gallery--strip-vertical-right .bb-product-gallery__variation-strip-inner,
.bb-product-gallery--strip-vertical-left .bb-product-gallery__variation-strip-inner {
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
}

.bb-product-gallery--strip-vertical-right .bb-product-gallery__variation-strip-inner.is-scrollable,
.bb-product-gallery--strip-vertical-left .bb-product-gallery__variation-strip-inner.is-scrollable {
    flex-wrap: nowrap;
    overflow-y: auto;
    overflow-x: hidden;
}

@supports (scrollbar-width: none) {
    .bb-product-gallery--strip-vertical-right .bb-product-gallery__variation-strip-inner,
    .bb-product-gallery--strip-vertical-left .bb-product-gallery__variation-strip-inner {
        scrollbar-width: none;
    }
}

.bb-product-gallery--strip-vertical-right .bb-product-gallery__variation-strip-inner::-webkit-scrollbar,
.bb-product-gallery--strip-vertical-left .bb-product-gallery__variation-strip-inner::-webkit-scrollbar {
    display: none;
}

/* Vertical strip arrows: stacked vertically */
.bb-product-gallery--strip-vertical-right .bb-product-gallery__strip-arrow,
.bb-product-gallery--strip-vertical-left .bb-product-gallery__strip-arrow {
    margin: 0;
    flex: 0 0 auto;
}

.bb-product-gallery--strip-vertical-right .bb-product-gallery__strip-arrow--prev,
.bb-product-gallery--strip-vertical-left .bb-product-gallery__strip-arrow--prev {
    margin-bottom: 4px;
    margin-right: 0;
}

.bb-product-gallery--strip-vertical-right .bb-product-gallery__strip-arrow--next,
.bb-product-gallery--strip-vertical-left .bb-product-gallery__strip-arrow--next {
    margin-top: 4px;
    margin-left: 0;
}

/* Vertical strip thumbs */
.bb-product-gallery--strip-vertical-right .bb-product-gallery__variation-strip-thumb,
.bb-product-gallery--strip-vertical-left .bb-product-gallery__variation-strip-thumb {
    width: 60px;
    height: 60px;
    flex: 0 0 auto;
}

/* ── Bottom Horizontal Strip (Left / Right) ── */
.bb-product-gallery--strip-bottom-horizontal-left .bb-product-gallery__main-wrapper,
.bb-product-gallery--strip-bottom-horizontal-right .bb-product-gallery__main-wrapper {
    display: flex;
    flex-direction: column;
    max-width: none;
}

.bb-product-gallery--strip-bottom-horizontal-left .bb-product-gallery__variation-strip,
.bb-product-gallery--strip-bottom-horizontal-right .bb-product-gallery__variation-strip {
    position: relative;
    bottom: auto;
    left: auto;
    right: auto;
    width: 100%;
    max-width: 100%;
    flex-direction: row;
    border-radius: 6px;
    margin-top: 8px;
}

.bb-product-gallery--strip-bottom-horizontal-left .bb-product-gallery__variation-strip {
    justify-content: flex-start;
}

.bb-product-gallery--strip-bottom-horizontal-right .bb-product-gallery__variation-strip {
    justify-content: flex-end;
}

/* Bottom strip: wrap thumbnails, no scrolling */
.bb-product-gallery--strip-bottom-horizontal-left .bb-product-gallery__variation-strip-inner,
.bb-product-gallery--strip-bottom-horizontal-right .bb-product-gallery__variation-strip-inner {
    flex-wrap: wrap;
    overflow: hidden;
}

.bb-product-gallery--strip-bottom-horizontal-left .bb-product-gallery__variation-strip-inner.is-scrollable,
.bb-product-gallery--strip-bottom-horizontal-right .bb-product-gallery__variation-strip-inner.is-scrollable {
    flex-wrap: wrap;
    overflow: hidden;
    scroll-behavior: auto;
}

/* Hide arrows for bottom strip since no scroll */
.bb-product-gallery--strip-bottom-horizontal-left .bb-product-gallery__strip-arrow,
.bb-product-gallery--strip-bottom-horizontal-right .bb-product-gallery__strip-arrow {
    display: none;
}

/* ── Overlay Strip Positions (bottom-right / bottom-left) ── */
/* These keep the absolute floating behaviour from the base strip styles */
.bb-product-gallery--strip-bottom-right .bb-product-gallery__variation-strip {
    /* Uses base absolute styles + --bottom-right modifier already defined */
}

.bb-product-gallery--strip-bottom-left .bb-product-gallery__variation-strip {
    /* Uses base absolute styles + --bottom-left modifier already defined */
}

/* ── Zoom result adjustment for structural layouts ── */
.bb-product-gallery--strip-vertical-right .bb-product-gallery__zoom-result {
    left: auto;
    right: 0;
    transform: translateX(calc(100% + 15px));
    margin-left: 0;
}

.bb-product-gallery--strip-vertical-left .bb-product-gallery__zoom-result {
    left: 100%;
    margin-left: 15px;
}

/* ── Style 1 Layout (Fullwidth with Structural Strip) ── */
.bb-product-gallery--style-1 .bb-product-gallery__main-wrapper {
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.bb-product-gallery--style-1 .bb-product-gallery__main-image {
    max-width: 100% !important;
}

.bb-product-gallery--style-1 .bb-product-gallery__main-image img {
    max-height: 100% !important;
}

/* Style 1 with vertical strip: main-wrapper handles the side-by-side via its own flex */
.bb-product-gallery--style-1.bb-product-gallery--strip-vertical-left,
.bb-product-gallery--style-1.bb-product-gallery--strip-vertical-right {
    display: block;
}

.bb-product-gallery--style-1.bb-product-gallery--strip-vertical-left .bb-product-gallery__main-wrapper,
.bb-product-gallery--style-1.bb-product-gallery--strip-vertical-right .bb-product-gallery__main-wrapper {
    max-width: 100% !important;
}

/* ── Image Rendering ── */
.bb-product-gallery img {
    -ms-interpolation-mode: bicubic;
    image-rendering: -webkit-optimize-contrast;
}

/* ── Elementor Container Constraints ── */
.elementor-widget-bb-product-gallery {
    max-width: 100%;
    overflow: hidden;
}

.elementor-widget-bb-product-gallery .elementor-widget-container {
    max-width: 100%;
}

/* ── PhotoSwipe Compatibility ── */
.bb-product-gallery .pswp-gallery__item {
    cursor: zoom-in;
}

/* ── Variation Image Indicator ── */
.bb-product-gallery__thumbnail[data-variation-image="true"]::before {
    content: '';
    position: absolute;
    top: 2px;
    right: 2px;
    width: 8px;
    height: 8px;
    background: #4caf50;
    border-radius: 50%;
    z-index: 2;
}
