.bb-avi-gallery-container {
    width: 100%;
    max-width: 800px; /* Adjust as needed */
    margin: 0 auto;
    position: relative;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.bb-avi-gallery-widget {
    width: 100%;
    height: auto;
    position: relative;
    border-radius: var(--bb-avi-border-radius, 0px);
    overflow: hidden;
}

.bb-avi-gallery-widget .swiper-slide {
    text-align: center;
    font-size: 18px;
    background: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
}

.bb-avi-gallery-widget .swiper-slide img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: var(--bb-avi-border-radius, 0px);
}

/* Thumbs Slider */
.bb-avi-gallery-thumbs {
    box-sizing: border-box;
    padding: 0;
}

.bb-avi-gallery-thumbs .swiper-slide {
    width: 25%;
    height: 100%;
    opacity: 0.4;
    cursor: pointer;
    border-radius: var(--bb-avi-border-radius, 0px);
    overflow: hidden;
}

.bb-avi-gallery-thumbs .swiper-slide-thumb-active {
    opacity: 1;
    border: 2px solid #000; /* Highlight active thumb */
}

.bb-avi-gallery-thumbs .swiper-slide img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Navigation Buttons */
.swiper-button-next, .swiper-button-prev {
    color: #fff;
    background: rgba(0, 0, 0, 0.3);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.swiper-button-next:after, .swiper-button-prev:after {
    font-size: 18px;
    font-weight: bold;
}

/* Loading Overlay */
.bb-avi-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.7);
    z-index: 10;
    display: none;
    justify-content: center;
    align-items: center;
}

.bb-avi-loader {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Layouts */

/* Bottom (Default) */
.bb-avi-layout-bottom {
    flex-direction: column;
}
.bb-avi-layout-bottom .bb-avi-gallery-widget {
    width: 100%;
}
.bb-avi-layout-bottom .bb-avi-gallery-thumbs {
    width: 100%;
    height: 100px; /* Adjust height */
    margin-top: 10px;
}

/* Top */
.bb-avi-layout-top {
    flex-direction: column-reverse;
}
.bb-avi-layout-top .bb-avi-gallery-widget {
    width: 100%;
}
.bb-avi-layout-top .bb-avi-gallery-thumbs {
    width: 100%;
    height: 100px;
    margin-bottom: 10px;
}

/* Left */
.bb-avi-layout-left {
    flex-direction: row-reverse;
    align-items: flex-start;
}
.bb-avi-layout-left .bb-avi-gallery-widget {
    width: 80%;
}
.bb-avi-layout-left .bb-avi-gallery-thumbs {
    width: 18%;
    height: 400px; /* Fixed height for vertical */
}
.bb-avi-layout-left .bb-avi-gallery-thumbs .swiper-slide {
    width: 100%;
    height: auto;
    margin-bottom: 10px;
}

/* Right */
.bb-avi-layout-right {
    flex-direction: row;
    align-items: flex-start;
}
.bb-avi-layout-right .bb-avi-gallery-widget {
    width: 80%;
}
.bb-avi-layout-right .bb-avi-gallery-thumbs {
    width: 18%;
    height: 400px;
}
.bb-avi-layout-right .bb-avi-gallery-thumbs .swiper-slide {
    width: 100%;
    height: auto;
    margin-bottom: 10px;
}

/* Mobile Responsive Overrides */
@media (max-width: 768px) {
    .bb-avi-mobile-layout-bottom {
        flex-direction: column !important;
    }
    .bb-avi-mobile-layout-bottom .bb-avi-gallery-widget {
        width: 100% !important;
    }
    .bb-avi-mobile-layout-bottom .bb-avi-gallery-thumbs {
        width: 100% !important;
        height: 80px !important;
        margin-top: 10px !important;
        margin-bottom: 0 !important;
    }

    .bb-avi-mobile-layout-top {
        flex-direction: column-reverse !important;
    }
    .bb-avi-mobile-layout-top .bb-avi-gallery-widget {
        width: 100% !important;
    }
    .bb-avi-mobile-layout-top .bb-avi-gallery-thumbs {
        width: 100% !important;
        height: 80px !important;
        margin-bottom: 10px !important;
        margin-top: 0 !important;
    }
}
