/* ==========================================================================
   // Frequently Bought Together (FBT) Custom Styles
   ========================================================================== */

.mf-product-fbt {
    border: 1px solid #e1e1e1 !important;
    padding: 30px !important;
    margin-bottom: 60px !important;
    background: #fff !important;
    clear: both !important;
}

.mf-product-fbt .fbt-title {
    margin: 0 0 20px !important;
    font-size: 18px !important;
    font-weight: 700 !important;
    color: #000 !important;
    text-transform: none !important;
}

/* Flex Container for Products list */
.woocommerce .mf-product-fbt ul.products {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 0 !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    float: none !important;
}

/* Individual Product block */
.woocommerce .mf-product-fbt ul.products li.product {
    flex: 0 0 20% !important;
    max-width: 20% !important;
    display: block !important;
    float: none !important;
    box-sizing: border-box !important;
    padding: 0 20px !important;
    margin-bottom: 0px !important;
    position: relative !important;
    background: none !important;
    border: none !important;
}

.mf-product-fbt ul.products li.product.out-of-stock,
.mf-product-fbt ul.products li.product.un-active {
    opacity: 0.3 !important;
}

.mf-product-fbt ul.products li.product.un-active select {
    pointer-events: none !important;
}

/* Product Content */
.mf-product-fbt ul.products .product-content {
    position: relative !important;
    padding-right: 0 !important;
    width: 100% !important;
}

.mf-product-fbt ul.products .product-content .thumbnail {
    position: relative !important;
    display: block !important;
    margin-bottom: 10px !important;
}

.mf-product-fbt ul.products .product-content .thumbnail img {
    max-width: 85% !important;
    margin: 0 auto !important;
    display: block !important;
}

/* Plus Symbol between products */
.mf-product-fbt ul.products li.product .thumbnail::after {
    position: absolute !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    left: -20px !important;
    content: "+" !important;
    display: inline-block !important;
    font-weight: 700 !important;
    font-size: 28px !important;
    color: #000 !important;
    font-family: var(--font-family, sans-serif) !important;
}

/* Hide plus sign on the very first product */
.mf-product-fbt ul.products li.product:first-child .thumbnail::after,
.mf-product-fbt ul.products li.product.product-primary .thumbnail::after {
    display: none !important;
}

/* Product Title */
.mf-product-fbt ul.products .product-content h2 {
    font-size: 14px !important;
    font-weight: 500 !important;
    line-height: 1.4 !important;
    margin: 10px 0 !important;
    height: 40px !important; /* Fixed height to keep titles aligned */
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
}

.mf-product-fbt ul.products .product-content h2 a {
    color: #0066cc !important;
    text-decoration: none !important;
}

.mf-product-fbt ul.products .product-content h2 a:hover {
    color: #ff5722 !important;
}

/* Price styling */
.mf-product-fbt ul.products .product-content .price {
    font-size: 15px !important;
    color: #111 !important;
    font-weight: 600 !important;
    margin-top: 5px !important;
}

.mf-product-fbt ul.products .product-content .price del {
    color: #999 !important;
    font-weight: 400 !important;
    margin-right: 5px !important;
    font-size: 13px !important;
}

.mf-product-fbt ul.products .product-content .price ins {
    text-decoration: none !important;
    color: #ff0000 !important;
}

/* Variations Form adjustments inside FBT list */
.mf-product-fbt ul.products li.product form.cart {
    margin: 10px 0 0 !important;
    padding: 0 !important;
}

.mf-product-fbt ul.products li.product form.cart table.variations select {
    width: 100% !important;
    height: 32px !important;
    border: 1px solid #ddd !important;
    border-radius: 3px !important;
    font-size: 12px !important;
    padding: 2px 5px !important;
    background-color: #fafafa !important;
}

/* Button & Summary Column Block (5th item in the row) */
.woocommerce .mf-product-fbt ul.products li.product.product-buttons {
    flex: 0 0 20% !important;
    max-width: 20% !important;
    padding: 0 20px !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    margin-left: auto !important;
}

/* Individual price rows */
.mf-product-fbt .product-buttons .price-box {
    margin-bottom: 6px !important;
    font-size: 13px !important;
    color: #666 !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
}

.mf-product-fbt .product-buttons .price-box .s-price {
    color: #222 !important;
    font-weight: 600 !important;
}

.mf-product-fbt .product-buttons .price-box__save .s-price {
    color: #2e7d32 !important; /* Green color for savings amount */
}

/* Prominent Total Price Block */
.mf-product-fbt .product-buttons .price-box__total {
    margin-top: 10px !important;
    margin-bottom: 15px !important;
    border-top: 1px solid #eee !important;
    padding-top: 10px !important;
    display: block !important;
}

.mf-product-fbt .product-buttons .price-box__total .label {
    font-size: 13px !important;
    color: #333 !important;
    font-weight: 600 !important;
    display: block !important;
    margin-bottom: 3px !important;
    text-align: left !important;
}

.mf-product-fbt .product-buttons .price-box__total .s-price {
    font-size: 24px !important;
    font-weight: 700 !important;
    color: #ff0000 !important;
    display: block !important;
    line-height: 1.1 !important;
    text-align: left !important;
}


/* Styled primary Add All To Cart button */
.mf-product-fbt .btn-primary-small.mf_add_to_cart_button {
    background-color: var(--color-primary, #fcb800) !important;
    color: #000 !important;
    height: 40px !important;
    line-height: 40px !important;
    padding: 0 15px !important;
    border: none !important;
    border-radius: 3px !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    text-align: center !important;
    cursor: pointer !important;
    transition: background-color 0.2s ease, opacity 0.2s ease !important;
    display: block !important;
    width: 100% !important;
    text-decoration: none !important;
}

.mf-product-fbt .btn-primary-small.mf_add_to_cart_button:hover {
    background-color: var(--color-primary-hover, #e5a700) !important;
}

.mf-product-fbt .btn-primary-small.mf_add_to_cart_button.disabled {
    background-color: #eaeaea !important;
    color: #999 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
}

/* Checkbox Products list at the bottom */
.mf-product-fbt .products-list {
    margin: 20px 0 0 !important;
    padding: 20px 0 0 0 !important;
    list-style: none !important;
    border-top: 1px dashed #eaeaea !important;
    clear: both !important;
}

.mf-product-fbt .products-list li {
    margin-bottom: 12px !important;
    font-size: 14px !important;
}

.mf-product-fbt .products-list li a {
    color: #666 !important;
    display: inline !important;
    text-decoration: none !important;
}

.mf-product-fbt .products-list li a:hover {
    color: #ff5722 !important;
}

.mf-product-fbt .products-list li a strong {
    color: #000 !important;
    font-weight: 600 !important;
    margin-right: 5px !important;
}

.mf-product-fbt .products-list li .s-price {
    color: #ff0000 !important;
    font-weight: 600 !important;
    margin-left: 5px !important;
}

/* Custom styled checkbox indicators */
.mf-product-fbt .products-list li.products-list__item {
    display: flex !important;
    align-items: center !important;
}

.mf-product-fbt .products-list li.products-list__item input[type="checkbox"] {
    width: 18px !important;
    height: 18px !important;
    margin-right: 12px !important;
    cursor: pointer !important;
}

/* Responsive Overrides */
@media (max-width: 991px) {
    .woocommerce .mf-product-fbt ul.products {
        padding-left: 0 !important;
    }
    
    .woocommerce .mf-product-fbt ul.products li.product {
        flex: 0 0 50% !important;
        max-width: 50% !important;
    }
    
    .woocommerce .mf-product-fbt ul.products li.product .product-content {
        padding-right: 0 !important;
    }
    
    .mf-product-fbt ul.products li.product .thumbnail::after {
        display: none !important;
    }
    
    .woocommerce .mf-product-fbt ul.products li.product.product-buttons {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        margin-top: 20px !important;
        align-items: center !important;
    }
    
    .mf-product-fbt .product-buttons .product-buttons-content {
        align-items: center !important;
        width: 100% !important;
        max-width: 300px !important;
    }
}

/* Hide helper fields and double prices */
.hidden {
    display: none !important;
}

/* Visual feedback for unchecked items in the list */
.mf-product-fbt .products-list li.products-list__item.un-active a {
    opacity: 0.5 !important;
    text-decoration: line-through !important;
}
.mf-product-fbt .products-list li.products-list__item.un-active .s-price {
    opacity: 0.5 !important;
}