/* Product Gallery Mobile - Zero Spacing Fix */

@media (max-width: 767px) {
    /* Force column layout */
    .bb-product-gallery,
    .bb-product-gallery-vertical,
    .bb-product-gallery-horizontal {
        display: flex !important;
        flex-direction: column !important;
        gap: 0 !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    /* Remove ALL wrapper spacing */
    .tp-product-details-thumb-wrapper,
    .bb-product-gallery-wrapper {
        margin: 0 !important;
        padding: 0 !important;
        line-height: 0 !important;
    }
    
    /* Main images - absolutely no spacing */
    .bb-product-gallery-images {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        margin: 0 !important;
        line-height: 0 !important;
        height: auto !important;
        max-height: 340px !important;
        overflow: hidden !important;
        order: 1;
    }
    
    .bb-product-gallery-images .slick-list {
        width: 100% !important;
        height: 100% !important;
        max-height: 340px !important;
        margin: 0 !important;
        padding: 0 !important;
        line-height: 0 !important;
        overflow: hidden !important;
    }
    
    .bb-product-gallery-images .slick-track {
        width: 100% !important;
        height: 100% !important;
        max-height: 340px !important;
        margin: 0 !important;
        padding: 0 !important;
        line-height: 0 !important;
        overflow: hidden !important;
    }
    
    .bb-product-gallery-images .slick-slide {
        height: auto !important;
        max-height: 340px !important;
        margin: 0 !important;
        padding: 0 !important;
        line-height: 0 !important;
        opacity: 0 !important;
        visibility: hidden !important;
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        z-index: 1 !important;
        transition: opacity 0.3s ease !important;
    }
    
    .bb-product-gallery-images .slick-slide.slick-active,
    .bb-product-gallery-images .slick-slide.slick-current {
        opacity: 1 !important;
        visibility: visible !important;
        z-index: 2 !important;
        position: relative !important;
    }
    
    .bb-product-gallery-images .slick-slide a {
        display: block !important;
        width: 100% !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        line-height: 0 !important;
    }
    
    .bb-product-gallery-images img {
        display: block !important;
        width: 100% !important;
        height: auto !important;
        max-height: 340px !important;
        object-fit: contain !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    /* Thumbnails - right below with no gap */
    .bb-product-gallery-thumbnails {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 100% !important;
        height: auto !important;
        padding: 0 40px !important;
        margin: 0 !important;
        margin-top: 10px !important;
        order: 2;
    }
    
    /* Override Slick's vertical mode inline styles */
    .bb-product-gallery-thumbnails .slick-list {
        width: 100% !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    .bb-product-gallery-thumbnails .slick-track {
        width: auto !important;
        height: auto !important;
        transform: translate3d(0px, 0px, 0px) !important;
        display: flex !important;
        flex-direction: row !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    
    /* Force thumbnail sizes */
    .bb-product-gallery-thumbnails .slick-slide {
        width: 80px !important;
        height: 80px !important;
        min-width: 80px !important;
        max-width: 80px !important;
        margin: 0 5px !important;
        display: block !important;
        float: none !important;
        cursor: pointer !important;
    }
    
    .bb-product-gallery-thumbnails .slick-slide > div {
        width: 80px !important;
        height: 80px !important;
        margin: 0 !important;
        padding: 0 !important;
        cursor: pointer !important;
        pointer-events: auto !important;
    }
    
    .bb-product-gallery-thumbnails .slick-slide img {
        width: 100% !important;
        height: 100% !important;
        object-fit: cover;
        display: block !important;
        margin: 0 !important;
        padding: 0 !important;
        cursor: pointer !important;
        pointer-events: auto !important;
    }
    
    /* Ensure thumbnails are always clickable */
    .bb-product-gallery-thumbnails,
    .bb-product-gallery-thumbnails * {
        pointer-events: auto !important;
        cursor: pointer !important;
    }
    
    /* Arrows positioning */
    .bb-product-gallery-thumbnails .slick-arrow {
        position: absolute;
        top: 50% !important;
        transform: translateY(-50%) !important;
        bottom: auto !important;
        left: auto !important;
        right: auto !important;
    }
    
    .bb-product-gallery-thumbnails .slick-prev {
        left: 0 !important;
    }
    
    .bb-product-gallery-thumbnails .slick-next {
        right: 0 !important;
    }
    
    /* Product details stacking */
    .tp-product-details-top .row {
        display: flex;
        flex-direction: column;
    }
    
    .tp-product-details-top .col-lg-6 {
        width: 100%;
        max-width: 100%;
        margin-bottom: 20px;
    }
    
    .tp-product-details-wrapper.has-sticky {
        position: relative !important;
        top: auto !important;
    }
}
