.tp-product-badge img.product-label-icon{
    display:inline-block;
    width:40px;
    height:40px;
    object-fit:contain;
    border-radius:4px;
}

@media (max-width:480px){
    .tp-product-badge img.product-label-icon{width:32px;height:32px}
}

.tp-product-badge .product-label-fallback{
    display:inline-block;
    padding:6px 8px;
    border-radius:4px;
    font-size:13px;
    line-height:1;
}

/* Product gallery zoom overlay */
.bb-gallery-figure {
    position: relative;
    display: inline-block;
}

.bb-product-gallery-images {
    position: relative;
}

.bb-gallery-zoom {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 999;
    background: rgba(255,255,255,0.98);
    border-radius: 4px;
    padding: 4px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    font-size: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

/* Slightly more visible on hover */
.bb-gallery-anchor:hover .bb-gallery-zoom {
    background: rgba(255,255,255,1);
    transform: translateY(0);
}

@media (max-width: 480px) {
    .bb-gallery-zoom {
        top: 6px;
        right: 6px;
        width: 24px;
        height: 24px;
        padding: 3px;
        font-size: 11px;
    }
}

/* Force SVG icon to be small (override inline svg attrs) */
.bb-gallery-zoom svg { width: 12px !important; height: 12px !important; display: block; }
.bb-gallery-zoom { line-height: 0; }

/* Product Detail Page - Badge Wrapper using CSS Grid positioning */
.bb-product-gallery-wrapper {
    position: relative !important;
}

.bb-product-gallery {
    position: relative !important;
}

.bb-product-detail-badges-wrapper {
    position: absolute !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    z-index: 1001 !important;
    pointer-events: none !important;
    display: block !important;
}

/* For vertical layout - offset by thumbnail width */
.bb-product-gallery-vertical .bb-product-detail-badges-wrapper {
    left: 80px !important;
    padding-left: 10px !important;
}

/* For horizontal layout - no left offset */
.bb-product-gallery-horizontal .bb-product-detail-badges-wrapper {
    left: 0 !important;
    padding-left: 0 !important;
}

/* Mobile - full width */
@media (max-width: 767px) {
    .bb-product-gallery-vertical .bb-product-detail-badges-wrapper {
        left: 0 !important;
        padding-left: 0 !important;
    }
}

.bb-product-detail-badges-wrapper .tp-product-badges {
    position: relative !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 1001 !important;
    pointer-events: none !important;
    display: block !important;
}

/* Ensure all badges display */
.bb-product-detail-badges-wrapper .tp-product-badge {
    position: absolute !important;
    pointer-events: auto !important;
    display: flex !important;
    align-items: center !important;
    gap: 6px !important;
    z-index: 1001 !important;
    opacity: 1 !important;
    visibility: visible !important;
    transition: none !important;
    animation: none !important;
}

/* position helpers - adjusted to not overlap with zoom indicator */
.bb-product-detail-badges-wrapper .tp-product-badge.position-top-right {
    top: 8px !important;
    right: 50px !important;
}

.bb-product-detail-badges-wrapper .tp-product-badge.position-top-left {
    top: 8px !important;
    left: 8px !important;
}

.bb-product-detail-badges-wrapper .tp-product-badge.position-bottom-right {
    bottom: 8px !important;
    right: 8px !important;
}

.bb-product-detail-badges-wrapper .tp-product-badge.position-bottom-left {
    bottom: 8px !important;
    left: 8px !important;
}

/* Handle multiple badges in same position */
.bb-product-detail-badges-wrapper .tp-product-badge.position-top-left:nth-child(2) {
    top: 48px !important;
}

.bb-product-detail-badges-wrapper .tp-product-badge.position-top-right:nth-child(2) {
    top: 48px !important;
}

.tp-product-badge img.product-label-icon{
    display:block !important;
    width:28px !important;
    height:28px !important;
    object-fit:contain !important;
}

.tp-product-badge .product-label-fallback{
    display:inline-block !important;
    padding:4px 6px !important;
    font-size:12px !important;
}

@media (max-width: 480px) {
    /* Adjust badge positions on mobile to avoid zoom indicator */
    .tp-product-badge.position-top-right {
        top: 8px !important;
        right: 42px !important;
    }

    .tp-product-badge img.product-label-icon {
        width: 24px !important;
        height: 24px !important;
    }

    .tp-product-badge .product-label-fallback {
        padding: 3px 5px !important;
        font-size: 11px !important;
    }
}

/* Prevent slick slider from hiding badges */
.bb-product-gallery .tp-product-badges,
.bb-product-gallery .tp-product-badge {
    transition: none !important;
    animation: none !important;
}

.slick-slider .tp-product-badges,
.slick-list .tp-product-badges,
.slick-track .tp-product-badges {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}


/* Listing zoom button: smaller, top-right, visible */
.bb-zoom-btn {
    position: absolute; /* ensure placement inside the .image (position-relative) */
    top: 6px !important;
    right: 6px !important;
    z-index: 999 !important;
    width: 28px;
    height: 28px;
    padding: 4px;
    border-radius: 4px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.98);
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

/* make sure svg icons inside the button are shrunken */
.bb-zoom-btn svg { width: 12px !important; height: 12px !important; display: block; }

/* Allow clicks on the button to work */
.bb-zoom-btn { pointer-events: auto; }

