/* === PART 1: Quick Buy Layout, Filter, Category === */


.matfury-video-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    top: 20px; 
    bottom: 20px;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.matfury-video-modal .modal-content {
    background: #fff;
    padding: 15px;
    border-radius: 10px;
    max-width: 600px;
    width: 90%;
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    position: relative;
}

.video-modal-close {
    position: absolute;
    top: -15px;
    right: -15px;
    font-size: 24px;
    color: white;
    background-color: red;
    border-radius: 50%;
    padding: 6px 10px;
    font-weight: bold;
    cursor: pointer;
    z-index: 99999;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
    transition: background-color 0.3s;
}

.video-modal-close:hover {
    background-color: darkred;
}


.video-button {
    margin-top: 8px;
    background-color: #0A6A3F;
    color: #fff;
    padding: 6px 10px;
    border-radius: 4px;
    font-size: 14px;
    border: none;
    cursor: pointer;
}

.video-button:hover {
    background-color: #074C2E;
}



/* Overlay (optional usage) */
.matfury-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1001;
    display: none;
    justify-content: center;
    align-items: center;
}

/* Filter Dropdown Styling */
.matfury-category-filter {
    margin: 20px 0;
    text-align: center;
}

.matfury-category-filter select {
   
    border-radius: 5px;
    border: 1px solid #ddd;
    font-size: 16px;
}

.matfury-category-filter button,
#clear-filter {
    padding: 10px 20px;
    border-radius: 5px;
    background-color: #0A6A3F; /* Dark Green */
    color: white;
    border: none;
    cursor: pointer;
    font-size: 16px;
    margin-left: 10px;
    transition: background-color 0.3s;
}

#clear-filter:hover,
.matfury-category-filter button:hover {
    background-color: #074C2E; /* Darker Green on hover */
}

/* Category Line & Label - MODIFIED: NO HORIZONTAL LINE */
.matfury-category-line {
    position: relative;
    width: 100%;
    height: 10px; /* Reduced height as there's no line */
    text-align: center;
    margin-bottom: 15px; /* Adjust margin as needed */
    margin-top: 25px; /* Adjust top margin to position the box */
}

.matfury-category-box {
    background-color: #0A6A3F; /* Dark Green */
    font-weight: bold;
    color: white;
    font-size: 18px;
    border-radius: 5px;
    /* REDUCED PADDING to decrease overall length of the box */
    padding: 5px 10px;
    text-transform: uppercase;
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.1);
    border: 1px solid #ddd;
    position: absolute;
    top: -10px; /* Adjusted to sit nicely without a line */
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    z-index: 2;
    /* Optional: Add a max-width if you want to strictly limit its size */
    max-width: 80%; /* Example: Limit to 80% of its parent's width */
}

/* === Cart Table & Item Styling (Now Card-Based) === */

.matfury-cart-table {
    width: 100%;
    margin: 20px 0;
    border: none;
    background-color: transparent;
}

/* Hide the table headers completely */
.matfury-cart-table thead {
    display: none;
}

.matfury-cart-table tr {
    border-bottom: none !important;
}

.matfury-cart-table tr td {
    border-bottom: none !important;
    padding: 0 !important;
}

/* NEW: Styles for the products grid container */
.matfury-products-grid {
    display: flex;
    flex-wrap: wrap; /* Allow items to wrap to the next line */
    /* INCREASED GAP for more space between product cards */
    gap: 30px; /* Increased from 20px */
    margin-top: 15px; /* Space between category heading and first row of products */
    /* INCREASED PADDING around the entire grid */
    padding: 20px; /* Increased from 10px */
}

/* Make each DIV (matfury-cart-item) a flex container (the "card") */
.matfury-cart-item {
    display: flex;
    flex-wrap: nowrap;
    align-items: flex-start;
    /* INCREASED BORDER THICKNESS */
    border: 2px solid #a3a3a3; /* Changed from 1px to 2px, and color slightly darker */
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    background-color: #fff;
    /* INCREASED PADDING for more space inside the card */
    padding: 20px; /* Increased from 15px */
    position: relative;
    box-sizing: border-box;

    /* Desktop: Two items per row with a gap (adjusted for new gap) */
    width: calc(50% - 15px); /* 50% width minus half of the new gap (30px total gap, so 15px per side) */
}

/* Product Thumbnail - INCREASED SIZE */
.matfury-cart-item .product-thumbnail {
    width: 100px; /* Increased from 80px */
    height: 100px; /* Added explicit height to make it more square */
    flex-shrink: 0;
    margin-right: 15px;
    text-align: center;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    /* Optional: Add object-fit to control image scaling within the new size */
    overflow: hidden; /* Ensure image doesn't overflow if larger than container */
}

.matfury-cart-item .product-thumbnail img {
    max-width: 100%; /* Ensure image scales within its parent .product-thumbnail */
    max-height: 100%; /* Ensure image scales within its parent .product-thumbnail */
    height: auto;
    border-radius: 3px;
    object-fit: contain; /* or 'cover' depending on desired cropping/scaling */
}

/* Wrapper DIV for Product Details (matfury-cart-item-details) */
.matfury-cart-item-details {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    /* Adjusted gap between individual detail lines */
    gap: 8px; /* Slightly increased for more visual separation */
}

/* Individual Product Details (name, price, quantity, subtotal) - UNIVERSAL Labels */
.matfury-cart-item .product-name,
.matfury-cart-item .product-price,
.matfury-cart-item .product-quantity,
.matfury-cart-item .woo-product-subtotal {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    width: 100%;
    font-size: 14px;
    /* INCREASED VERTICAL PADDING for space with dotted line */
    padding: 8px 0; /* Increased from 5px */
    border-bottom: 1px dotted #ccc;
}

/* Remove border from the last item in details to avoid double border or unwanted border */
.matfury-cart-item .matfury-cart-item-details > div:last-of-type {
    border-bottom: none;
}

/* Labels for all views */
.matfury-cart-item .product-price::before {
    content: "Price: ";
    font-weight: normal;
    color: #666;
    margin-right: 5px;
    display: inline-block;
}
.matfury-cart-item .product-quantity::before {
    content: "Qty: ";
    font-weight: normal;
    color: #666;
    margin-right: 5px;
    display: inline-block;
}
.matfury-cart-item .woo-product-subtotal::before {
    content: "Subtotal: ";
    font-weight: normal;
    color: #666;
    margin-right: 5px;
    display: inline-block;
}

/* Adjust font size and weight for actual product name value */
.matfury-cart-item .product-name {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    justify-content: flex-start;
    padding-left: 0;
}

/* Prices */
.regular-price {
    text-decoration: line-through;
    color: #999;
    margin-right: 10px;
    font-size: 13px;
}

.sale-price {
    color: #0A6A3F;
    font-weight: bold;
    font-size: 15px;
}

/* Quantity Box - Universal Styling */
.quantity-wrapper {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    /* INCREASED HEIGHT for the wrapper */
    height: 40px; /* Increased from 30px */
    font-size: 14px;
    /* INCREASED MAX-WIDTH for the wrapper */
    max-width: 160px; /* Increased from 120px */
}

/* Quantity Buttons */
.qty-btn {
    background-color: #0A6A3F;
    color: white;
    border: none;
    border-radius: 3px;
    /* INCREASED SIZE FOR BUTTONS */
    width: 35px; /* Increased from 25px */
    height: 35px; /* Increased from 25px */
    font-size: 18px; /* Increased from 16px */
    font-weight: bold;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background-color 0.3s;
}

.qty-btn:hover {
    background-color: #074C2E;
}

/* Quantity Input Field */
.qty {
    text-align: center;
    padding: 0;
    /* INCREASED SIZE FOR INPUT */
    font-size: 16px; /* Increased from 14px */
    width: 60px; /* Increased from 40px */
    height: 39px; /* Increased from 25px, matching button height */
    margin: 0 8px; /* Increased horizontal margin for more space */
    border: 1px solid #ddd;
    border-radius: 3px;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.05);
    transition: border-color 0.3s;
}

.qty:focus {
    border-color: #0A6A3F;
    outline: none;
}

/* === Cart Total Bar === */
.matfury-cart-totals {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background-color: #f9f9f9;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
    padding: 20px;
    border-radius: 10px 10px 0 0;
    z-index: 1000;
    text-align: center;
}

.matfury-cart-summary {
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
    flex-wrap: wrap;
    gap: 20px;
     z-index: 100000;
}

.matfury-cart-summary .product-count-number,
.matfury-cart-summary .woocommerce-Price-amount {
    font-size: 18px;
    color: #333;
}

.matfury-cart-summary .checkout,
.matfury-cart-summary #clear-filter {
    background-color: #1A4C3A;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    margin-left: 10px;
    cursor: pointer;
}

.matfury-cart-summary .checkout:hover,
.matfury-cart-summary #clear-filter:hover {
    background-color: #0F2E22;
}

/* Modal View for Image Zoom */
.matfury-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    border-radius: 10px;
    max-width: 90%;
    width: 400px;
    overflow: hidden;
}

.modal-content {
    text-align: center;
    padding: 10px;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 35px;
    color: white;
    background-color: red;
    padding: 5px 10px;
    font-weight: bold;
    cursor: pointer;
    z-index: 10001;
    border-radius: 50%;
    transition: background-color 0.3s ease;
}

.modal-close:hover {
    background-color: darkred;
}

/* --- Media Queries for MOBILE Responsiveness (Adjustments for Card Layout) --- */
@media (max-width: 768px) {
    /* Products Grid: On mobile, make it a single column */
    .matfury-products-grid {
        gap: 15px; /* Adjust gap for mobile */
        padding: 10px; /* Adjust padding for mobile */
    }

    /* Adjustments for the card on smaller screens */
    .matfury-cart-item {
        flex-wrap: wrap; /* Allow wrapping on mobile */
        padding: 15px; /* Slightly less padding on mobile cards */
        width: 100%; /* Take full width on mobile */
        border: 1.5px solid #a3a3a3; /* Slightly thicker border for mobile too */
    }

    /* Product Thumbnail for mobile - INCREASED SIZE */
    .matfury-cart-item .product-thumbnail {
        width: 80px; /* Increased from 60px */
        height: 80px; /* Added explicit height for mobile */
        max-width: 80px;
        margin-right: 10px;
        overflow: hidden;
    }

    .matfury-cart-item .product-thumbnail img {
        max-width: 100%;
        max-height: 100%;
        height: auto;
        object-fit: contain; /* or 'cover' */
    }

    .matfury-cart-item-details {
        gap: 5px; /* Slightly less gap between lines on mobile */
    }

    /* Smaller text for labels and values on mobile */
    .matfury-cart-item .product-name,
    .matfury-cart-item .product-price,
    .matfury-cart-item .product-quantity,
    .matfury-cart-item .woo-product-subtotal {
        font-size: 13px;
        padding: 5px 0; /* Adjust vertical padding for mobile */
    }

    .matfury-cart-item .product-name {
        font-size: 15px; /* Keep product name slightly larger */
        justify-content: flex-start;
    }

    .matfury-cart-item .product-price::before,
    .matfury-cart-item .product-quantity::before,
    .matfury-cart-item .woo-product-subtotal::before {
        font-size: 12px; /* Smaller labels on mobile */
    }

    /* Quantity box and buttons on mobile */
    .quantity-wrapper {
        height: 30px; /* Increased from 25px */
        font-size: 12px; /* Adjusted for larger controls */
        max-width: 120px; /* Adjusted for larger controls */
    }

    .qty {
        width: 50px; /* Increased from 30px */
        font-size: 16px; /* Increased from 12px */
        height: 28px; /* Adjusted for mobile button height */
        margin: 0 5px;
    }

    .qty-btn {
        width: 32px; /* Increased from 20px */
        height: 32px; /* Increased from 20px */
        font-size: 18px; /* Increased from 14px */
    }

    /* Category label on mobile */
    .matfury-category-box {
        font-size: 14px;
        padding: 4px 8px;
        top: -10px;
    }

    /* Totals bar on bottom (sticky) */
    .matfury-cart-totals {
        padding: 15px;
    }

    .matfury-cart-summary {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }

    .matfury-cart-summary .checkout,
    .matfury-cart-summary #clear-filter {
        width: 100%;
        font-size: 16px;
        padding: 12px;
        margin-left: 0;
    }

    /* Filter dropdown */
    .matfury-category-filter select {
        width: 80%;
        font-size: 14px;
    }

    /* Modal image responsive */
    .matfury-modal img {
        max-width: 100%;
        height: auto;
    }

    .modal-close {
        font-size: 28px;
        padding: 3px 8px;
        top: 10px;
        right: 10px;
    }
}