/**
 * WBF Theme Customizations - Sticky Summary Container
 * 
 * Makes .summary-container sticky on desktop for products without associations.
 * Only activates when #productcca-block is NOT present on the page.
 * 
 * @author WBF
 * @version 1.0.0
 */

/* Desktop only - min-width 992px (Bootstrap lg breakpoint) */
@media (min-width: 992px) {
    
    /* Sticky summary container - activated via JS class */
    .summary-container.wbf-sticky-summary {
        position: sticky;
        top: 100px; /* Offset for header */
        z-index: 100;
        transition: top 0.3s ease;
        align-self: flex-start; /* Important for sticky in flex container */
    }
    
    /* When header is hidden on scroll, reduce top offset */
    .header-hidden .summary-container.wbf-sticky-summary {
        top: 20px;
    }
    
    /* Ensure parent container allows sticky positioning */
    .single-product-summary.wbf-sticky-summary-parent {
        display: flex;
        flex-direction: column;
        z-index: 1;
    }
    
    /* Smooth scrollbar for tall content */
    .summary-container.wbf-sticky-summary .product-information {
        max-height: calc(100vh - 150px);
        overflow-y: auto;
        scrollbar-width: thin;
        scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
    }
    
    .summary-container.wbf-sticky-summary .product-information::-webkit-scrollbar {
        width: 4px;
    }
    
    .summary-container.wbf-sticky-summary .product-information::-webkit-scrollbar-track {
        background: transparent;
    }
    
    .summary-container.wbf-sticky-summary .product-information::-webkit-scrollbar-thumb {
        background-color: rgba(0, 0, 0, 0.2);
        border-radius: 2px;
    }
    
    /* When sticky is stopped (reached boundary) */
    .summary-container.wbf-sticky-summary.wbf-sticky-stopped {
        position: relative;
        top: auto;
    }
}

/* Mobile - ensure no sticky behavior */
@media (max-width: 991px) {
    .summary-container.wbf-sticky-summary {
        position: static !important;
        top: auto !important;
    }
}

