/**
 * THE DAB HUT: CART PAGE STYLING
 * Version: 2.0 - Performance Optimized
 * 
 * This file replaces inline CSS injection for better PageSpeed scores.
 * Upload to: /wp-content/themes/blocksy-child/css/cart.css
 */

/* =================================================================
   PAGE BACKGROUND
   ================================================================= */
body.woocommerce-cart,
.woocommerce-cart .site-content,
.woocommerce-cart .entry-content {
    background-color: #e8e8e8 !important;
}

/* =================================================================
   1. PRODUCT TABLE - PURPLE CARD WITH YELLOW BORDER
   ================================================================= */

/* Remove any outer wrapper borders */
.woocommerce-cart .woocommerce-cart-form,
.woocommerce-cart form.woocommerce-cart-form {
    background-color: transparent !important;
    border: none !important;
    padding: 0 !important;
}

.woocommerce-cart table.shop_table.cart,
.woocommerce-cart table.shop_table {
    background-color: #2E084D !important;
    border: 8px solid #F6C70A !important;
    border-radius: 30px !important;
    padding: 25px !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    overflow: hidden !important;
}

/* Table header row */
.woocommerce-cart table.shop_table thead th {
    background-color: transparent !important;
    color: #F6C70A !important;
    font-size: 22px !important;
    font-weight: bold !important;
    padding: 15px 20px !important;
    border-bottom: 2px solid rgba(246, 199, 10, 0.3) !important;
    text-transform: capitalize !important;
}

/* Table body cells */
.woocommerce-cart table.shop_table tbody td {
    background-color: transparent !important;
    color: #ffffff !important;
    padding: 20px !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    vertical-align: middle !important;
}

/* Product name link */
.woocommerce-cart table.shop_table td.product-name a {
    color: #ffffff !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    font-size: 16px !important;
}

.woocommerce-cart table.shop_table td.product-name a:hover {
    color: #F6C70A !important;
}

/* Stock status - YELLOW */
.woocommerce-cart .stock,
.woocommerce-cart .in-stock {
    color: #F6C70A !important;
    font-weight: bold !important;
}

/* Prices - Yellow */
.woocommerce-cart table.shop_table td.product-price,
.woocommerce-cart table.shop_table td.product-subtotal,
.woocommerce-cart table.shop_table .amount {
    color: #F6C70A !important;
    font-weight: bold !important;
    font-size: 18px !important;
}

/* Product thumbnail - white background rounded */
.woocommerce-cart table.shop_table td.product-thumbnail img {
    background-color: #ffffff !important;
    border-radius: 12px !important;
    padding: 5px !important;
    max-width: 80px !important;
    height: auto !important;
}

/* Remove button - YELLOW */
.woocommerce-cart table.shop_table td.product-remove a.remove {
    color: #F6C70A !important;
    background-color: rgba(255, 255, 255, 0.1) !important;
    border-radius: 50% !important;
    width: 30px !important;
    height: 30px !important;
    line-height: 28px !important;
    font-size: 20px !important;
    display: inline-block !important;
    text-align: center !important;
}

.woocommerce-cart table.shop_table td.product-remove a.remove:hover {
    background-color: #ff4444 !important;
    color: #ffffff !important;
}

/* Trash icon if using dashicons or SVG */
.woocommerce-cart td.product-remove a.remove svg,
.woocommerce-cart td.product-remove a.remove i {
    color: #F6C70A !important;
    fill: #F6C70A !important;
}

/* =================================================================
   2. QUANTITY INPUT STYLING
   ================================================================= */

/* HIDE DUPLICATE QUANTITY FIELDS */
.woocommerce-cart dl.variation,
.woocommerce-cart .variation,
.woocommerce-cart .wcsatt-options-product,
.woocommerce-cart .product-addon,
.woocommerce-cart [class*="edit-option"],
.woocommerce-cart .cart_item dl,
.woocommerce-cart td.product-name dl,
.woocommerce-cart .product-name dl.variation,
.woocommerce-cart dd.variation-quantity,
.woocommerce-cart dt:has(+ dd .quantity),
.woocommerce-cart dd:has(.quantity):not(.product-quantity) {
    display: none !important;
}

/* Specifically target "Edit option field" text and its quantity */
.woocommerce-cart td.product-name > dl,
.woocommerce-cart .cart_item .product-name dl {
    display: none !important;
}

/* Keep only the main cart quantity field visible */
.woocommerce-cart td.product-quantity .quantity,
.woocommerce-cart .product-quantity > .quantity {
    display: inline-flex !important;
}

.woocommerce-cart table.shop_table .quantity {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    background-color: #ffffff !important;
    border: 2px solid #F6C70A !important;
    border-radius: 8px !important;
    padding: 5px 10px !important;
}

.woocommerce-cart table.shop_table .quantity input.qty {
    background-color: #ffffff !important;
    color: #2E084D !important;
    border: none !important;
    width: 50px !important;
    height: 35px !important;
    text-align: center !important;
    font-size: 16px !important;
    font-weight: bold !important;
    -moz-appearance: textfield !important;
    padding: 0 !important;
    margin: 0 !important;
}

.woocommerce-cart table.shop_table .quantity input.qty::-webkit-outer-spin-button,
.woocommerce-cart table.shop_table .quantity input.qty::-webkit-inner-spin-button {
    -webkit-appearance: none !important;
    margin: 0 !important;
}

/* Plus/Minus buttons styling */
.woocommerce-cart .quantity .minus,
.woocommerce-cart .quantity .plus,
.woocommerce-cart .quantity button {
    background-color: #F6C70A !important;
    color: #2E084D !important;
    border: none !important;
    width: 30px !important;
    height: 30px !important;
    border-radius: 6px !important;
    cursor: pointer !important;
    font-size: 18px !important;
    font-weight: bold !important;
    line-height: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.woocommerce-cart .quantity .minus:hover,
.woocommerce-cart .quantity .plus:hover,
.woocommerce-cart .quantity button:hover {
    background-color: #fd7200 !important;
    color: #ffffff !important;
}

/* Fix for Blocksy quantity wrapper */
.woocommerce-cart .ct-qty-container,
.woocommerce-cart .quantity-wrapper {
    display: inline-flex !important;
    align-items: center !important;
    background-color: #ffffff !important;
    border: 2px solid #F6C70A !important;
    border-radius: 8px !important;
    overflow: hidden !important;
}

.woocommerce-cart .ct-qty-container input,
.woocommerce-cart .quantity-wrapper input {
    border: none !important;
    background: transparent !important;
}

/* =================================================================
   3. COUPON SECTION - PURPLE CARD
   ================================================================= */
.woocommerce-cart .coupon,
.woocommerce-cart td.actions {
    background-color: #2E084D !important;
    padding: 0 !important;
}

/* Wrapper for coupon area */
.woocommerce-cart td.actions {
    border-bottom: none !important;
    padding-top: 25px !important;
}

/* Coupon input container - create card effect */
.woocommerce-cart .coupon {
    display: inline-flex !important;
    align-items: center !important;
    gap: 12px !important;
    background-color: #2E084D !important;
    border: 5px solid #F6C70A !important;
    border-radius: 20px !important;
    padding: 20px 25px !important;
    margin-top: 10px !important;
}

/* Coupon input field */
.woocommerce-cart .coupon input#coupon_code,
.woocommerce-cart .coupon input[name="coupon_code"] {
    background-color: #ffffff !important;
    color: #2E084D !important;
    border: 3px solid #F6C70A !important;
    border-radius: 25px !important;
    padding: 12px 20px !important;
    font-size: 16px !important;
    min-width: 200px !important;
    height: auto !important;
}

.woocommerce-cart .coupon input#coupon_code::placeholder {
    color: #888888 !important;
}

/* Apply Coupon Button - Orange */
.woocommerce-cart .coupon button,
.woocommerce-cart .coupon input[type="submit"],
.woocommerce-cart button[name="apply_coupon"] {
    background-color: #fd7200 !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 25px !important;
    padding: 14px 30px !important;
    font-size: 16px !important;
    font-weight: bold !important;
    cursor: pointer !important;
    text-transform: none !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2) !important;
    transition: all 0.3s ease !important;
}

.woocommerce-cart .coupon button:hover,
.woocommerce-cart button[name="apply_coupon"]:hover {
    background-color: #e66500 !important;
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.3) !important;
}

/* Update Cart Button - Orange */
.woocommerce-cart button[name="update_cart"],
.woocommerce-cart input[name="update_cart"] {
    background-color: #fd7200 !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 25px !important;
    padding: 14px 30px !important;
    font-size: 16px !important;
    font-weight: bold !important;
    cursor: pointer !important;
    float: right !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2) !important;
    transition: all 0.3s ease !important;
}

.woocommerce-cart button[name="update_cart"]:hover {
    background-color: #e66500 !important;
    transform: translateY(-2px) !important;
}

.woocommerce-cart button[name="update_cart"]:disabled {
    background-color: #999999 !important;
    cursor: not-allowed !important;
    opacity: 0.7 !important;
}

/* =================================================================
   4. CART TOTALS - PURPLE CARD WITH YELLOW BORDER
   ================================================================= */
.woocommerce-cart .cart_totals,
.woocommerce-cart .cart-collaterals .cart_totals {
    background-color: #2E084D !important;
    border: 8px solid #F6C70A !important;
    border-radius: 30px !important;
    padding: 30px !important;
    margin-top: 30px !important;
}

/* Cart Totals heading */
.woocommerce-cart .cart_totals h2,
.woocommerce-cart .cart_totals > h2 {
    color: #F6C70A !important;
    font-size: 26px !important;
    font-weight: bold !important;
    margin-bottom: 20px !important;
    padding-bottom: 15px !important;
    border-bottom: 2px solid rgba(246, 199, 10, 0.3) !important;
}

/* Cart totals table */
.woocommerce-cart .cart_totals table {
    background-color: transparent !important;
    border: none !important;
}

.woocommerce-cart .cart_totals table th,
.woocommerce-cart .cart_totals table td {
    background-color: transparent !important;
    color: #ffffff !important;
    padding: 12px 0 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1) !important;
    font-size: 16px !important;
}

.woocommerce-cart .cart_totals table th {
    font-weight: 600 !important;
    text-align: left !important;
}

/* Amounts in cart totals - Yellow */
.woocommerce-cart .cart_totals .amount,
.woocommerce-cart .cart_totals bdi {
    color: #F6C70A !important;
    font-weight: bold !important;
    font-size: 18px !important;
}

/* Coupon discount line - YELLOW */
.woocommerce-cart .cart_totals .cart-discount td,
.woocommerce-cart .cart_totals .cart-discount .amount {
    color: #F6C70A !important;
}

/* Remove coupon link */
.woocommerce-cart .cart_totals .woocommerce-remove-coupon {
    color: #F6C70A !important;
    margin-left: 10px !important;
}

/* Shipping section */
.woocommerce-cart .cart_totals .shipping th,
.woocommerce-cart .cart_totals .woocommerce-shipping-totals th {
    color: #ffffff !important;
}

.woocommerce-cart .cart_totals .shipping td,
.woocommerce-cart .cart_totals .woocommerce-shipping-totals td {
    color: #ffffff !important;
}

.woocommerce-cart .cart_totals .shipping ul {
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

.woocommerce-cart .cart_totals .shipping li label {
    color: #ffffff !important;
}

.woocommerce-cart .cart_totals .shipping .amount {
    color: #F6C70A !important;
}

/* Shipping destination / Change address link */
.woocommerce-cart .cart_totals .woocommerce-shipping-destination,
.woocommerce-cart .cart_totals .shipping-calculator-button {
    color: #F6C70A !important;
    font-size: 14px !important;
}

/* Order total row */
.woocommerce-cart .cart_totals .order-total th,
.woocommerce-cart .cart_totals .order-total td {
    border-top: 2px solid rgba(246, 199, 10, 0.3) !important;
    border-bottom: none !important;
    padding-top: 20px !important;
    font-size: 20px !important;
}

.woocommerce-cart .cart_totals .order-total .amount {
    font-size: 24px !important;
    color: #F6C70A !important;
}

/* =================================================================
   5. PROCEED TO CHECKOUT BUTTON
   ================================================================= */
.woocommerce-cart .wc-proceed-to-checkout,
.woocommerce-cart .cart_totals .wc-proceed-to-checkout {
    padding-top: 25px !important;
}

.woocommerce-cart .wc-proceed-to-checkout a.checkout-button,
.woocommerce-cart a.checkout-button {
    background-color: #fd7200 !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 25px !important;
    padding: 18px 40px !important;
    font-size: 20px !important;
    font-weight: bold !important;
    text-transform: none !important;
    display: block !important;
    text-align: center !important;
    text-decoration: none !important;
    box-shadow: 0 6px 15px rgba(253, 114, 0, 0.4) !important;
    transition: all 0.3s ease !important;
    outline: none !important;
}

.woocommerce-cart .wc-proceed-to-checkout a.checkout-button:hover {
    background-color: #e66500 !important;
    transform: translateY(-3px) !important;
    box-shadow: 0 8px 20px rgba(253, 114, 0, 0.5) !important;
    border: none !important;
    outline: none !important;
}

.woocommerce-cart .wc-proceed-to-checkout a.checkout-button:focus {
    border: none !important;
    outline: none !important;
}

/* Remove any wrapper borders around checkout button */
.woocommerce-cart .wc-proceed-to-checkout {
    border: none !important;
    background: transparent !important;
}

/* =================================================================
   6. SEZZLE WIDGET STYLING
   ================================================================= */

/* Main container */
.woocommerce-cart .cart_totals .sezzle-checkout-button-wrapper,
.woocommerce-cart .cart_totals div[class*="sezzle-checkout-button-wrapper"] {
    background-color: #1a1a2e !important;
    border: 3px solid #F6C70A !important;
    border-radius: 12px !important;
    padding: 15px 20px !important;
    margin: 15px 0 !important;
    display: block !important;
    cursor: pointer !important;
}

/* The text container */
.woocommerce-cart .cart_totals .sezzle-button-text,
.woocommerce-cart .cart_totals .sezzle-button-text.szl-light,
.woocommerce-cart .cart_totals .szl-light,
.woocommerce-cart .cart_totals div.sezzle-button-text {
    color: #F6C70A !important;
    -webkit-text-fill-color: #F6C70A !important;
}

/* The price amount span */
.woocommerce-cart .cart_totals .sezzle-payment-amount,
.woocommerce-cart .cart_totals span.sezzle-payment-amount {
    color: #F6C70A !important;
    -webkit-text-fill-color: #F6C70A !important;
    font-weight: bold !important;
}

/* The info icon */
.woocommerce-cart .cart_totals .sezzle-info-icon {
    color: #F6C70A !important;
    -webkit-text-fill-color: #F6C70A !important;
}

/* The Sezzle logo - filter to make it yellow/gold */
.woocommerce-cart .cart_totals .sezzle-logo,
.woocommerce-cart .cart_totals img.sezzle-logo,
.woocommerce-cart .cart_totals .szl-light-image,
.woocommerce-cart .cart_totals img[class*="sezzle"] {
    filter: brightness(0) saturate(100%) invert(80%) sepia(60%) saturate(500%) hue-rotate(5deg) brightness(105%) contrast(95%) !important;
}

/* =================================================================
   7. EMPTY CART MESSAGE
   ================================================================= */
.woocommerce-cart .cart-empty,
.woocommerce-cart .wc-empty-cart-message {
    background-color: #2E084D !important;
    color: #ffffff !important;
    border: 5px solid #F6C70A !important;
    border-radius: 20px !important;
    padding: 40px !important;
    text-align: center !important;
    font-size: 18px !important;
}

.woocommerce-cart .return-to-shop a {
    background-color: #fd7200 !important;
    color: #ffffff !important;
    border-radius: 25px !important;
    padding: 15px 35px !important;
    font-weight: bold !important;
    display: inline-block !important;
    margin-top: 20px !important;
}

/* =================================================================
   8. DELIVERY DATES / ESTIMATED SHIPPING
   ================================================================= */
.woocommerce-cart .shipping-estimated-date,
.woocommerce-cart [class*="delivery-date"],
.woocommerce-cart [class*="estimated"] {
    background-color: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
    border-radius: 8px !important;
    padding: 8px 12px !important;
    font-size: 13px !important;
    margin-top: 8px !important;
    display: inline-block !important;
}

/* =================================================================
   9. CROSS-SELLS SECTION
   ================================================================= */
.woocommerce-cart .cross-sells {
    background-color: #2E084D !important;
    border: 5px solid #F6C70A !important;
    border-radius: 20px !important;
    padding: 25px !important;
    margin-top: 30px !important;
}

.woocommerce-cart .cross-sells h2 {
    color: #F6C70A !important;
    font-size: 22px !important;
    margin-bottom: 20px !important;
}

.woocommerce-cart .cross-sells .product {
    background-color: rgba(255, 255, 255, 0.05) !important;
    border-radius: 15px !important;
    padding: 15px !important;
}

.woocommerce-cart .cross-sells .product .woocommerce-loop-product__title {
    color: #ffffff !important;
}

.woocommerce-cart .cross-sells .product .price {
    color: #F6C70A !important;
}

/* =================================================================
   10. MOBILE RESPONSIVENESS
   ================================================================= */
@media only screen and (max-width: 768px) {
    /* Product table adjustments */
    .woocommerce-cart table.shop_table.cart,
    .woocommerce-cart table.shop_table {
        border: 5px solid #F6C70A !important;
        padding: 15px !important;
        border-radius: 20px !important;
    }

    .woocommerce-cart table.shop_table thead {
        display: none !important;
    }

    .woocommerce-cart table.shop_table tbody td {
        display: block !important;
        width: 100% !important;
        padding: 10px 15px !important;
        text-align: left !important;
        border-bottom: none !important;
    }

    .woocommerce-cart table.shop_table tbody tr {
        display: block !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.2) !important;
        padding: 15px 0 !important;
        margin-bottom: 15px !important;
    }

    .woocommerce-cart table.shop_table tbody tr:last-child {
        border-bottom: none !important;
    }

    /* Mobile: Show labels before content */
    .woocommerce-cart table.shop_table td.product-name::before {
        content: "Product: " !important;
        font-weight: bold !important;
        color: #F6C70A !important;
    }

    .woocommerce-cart table.shop_table td.product-price::before {
        content: "Price: " !important;
        font-weight: bold !important;
        color: #F6C70A !important;
    }

    .woocommerce-cart table.shop_table td.product-quantity::before {
        content: "Qty: " !important;
        font-weight: bold !important;
        color: #F6C70A !important;
    }

    .woocommerce-cart table.shop_table td.product-subtotal::before {
        content: "Subtotal: " !important;
        font-weight: bold !important;
        color: #F6C70A !important;
    }

    /* Mobile thumbnail */
    .woocommerce-cart table.shop_table td.product-thumbnail {
        text-align: center !important;
        padding-bottom: 15px !important;
    }

    .woocommerce-cart table.shop_table td.product-thumbnail img {
        max-width: 100px !important;
    }

    /* Mobile quantity */
    .woocommerce-cart table.shop_table .quantity {
        justify-content: flex-start !important;
    }

    /* Mobile coupon section */
    .woocommerce-cart .coupon {
        flex-direction: column !important;
        width: 100% !important;
        padding: 15px !important;
        gap: 10px !important;
    }

    .woocommerce-cart .coupon input#coupon_code {
        width: 100% !important;
        min-width: 100% !important;
    }

    .woocommerce-cart .coupon button {
        width: 100% !important;
    }

    /* Mobile update cart button */
    .woocommerce-cart button[name="update_cart"] {
        width: 100% !important;
        float: none !important;
        margin-top: 15px !important;
    }

    /* Mobile cart totals */
    .woocommerce-cart .cart_totals {
        border: 5px solid #F6C70A !important;
        padding: 20px !important;
        border-radius: 20px !important;
        margin-top: 20px !important;
    }

    .woocommerce-cart .cart_totals h2 {
        font-size: 22px !important;
    }

    /* Mobile checkout button */
    .woocommerce-cart .wc-proceed-to-checkout a.checkout-button {
        padding: 15px 25px !important;
        font-size: 18px !important;
    }

    /* Actions cell - full width on mobile */
    .woocommerce-cart td.actions {
        display: block !important;
        width: 100% !important;
    }

    .woocommerce-cart td.actions::before {
        display: none !important;
    }
    
    /* MOBILE: Trash can / Remove icon - YELLOW */
    .woocommerce-cart table.shop_table td.product-remove a.remove,
    .woocommerce-cart td.product-remove a,
    .woocommerce-cart .product-remove a.remove,
    .woocommerce-cart a.remove {
        color: #F6C70A !important;
        -webkit-text-fill-color: #F6C70A !important;
    }
    
    .woocommerce-cart td.product-remove a.remove svg,
    .woocommerce-cart td.product-remove a.remove i,
    .woocommerce-cart .product-remove svg,
    .woocommerce-cart .product-remove i,
    .woocommerce-cart a.remove svg,
    .woocommerce-cart a.remove i {
        color: #F6C70A !important;
        fill: #F6C70A !important;
    }
    
    /* Blocksy specific mobile remove button */
    .woocommerce-cart .ct-cart-item .product-remove a,
    .woocommerce-cart [class*="ct-"] .product-remove a,
    .woocommerce-cart [class*="ct-"] a.remove {
        color: #F6C70A !important;
        -webkit-text-fill-color: #F6C70A !important;
    }
    
    /* MOBILE: Hide ALL duplicate quantity fields */
    .woocommerce-cart dl.variation,
    .woocommerce-cart dl,
    .woocommerce-cart .variation,
    .woocommerce-cart .variation-quantity,
    .woocommerce-cart .wcsatt-options-product,
    .woocommerce-cart [class*="edit-option"],
    .woocommerce-cart .product-addon,
    .woocommerce-cart td.product-name dl,
    .woocommerce-cart .cart_item dl,
    .woocommerce-cart dd:has(.quantity) {
        display: none !important;
    }
    
    /* Only show the main Qty field */
    .woocommerce-cart td.product-quantity,
    .woocommerce-cart td.product-quantity .quantity {
        display: block !important;
    }
    
    .woocommerce-cart td.product-quantity > .quantity {
        display: inline-flex !important;
    }
}

/* =================================================================
   11. BLOCKSY/WOOCOMMERCE COMPATIBILITY FIXES
   ================================================================= */

/* Override any Blocksy defaults - NO BORDERS on wrappers */
.woocommerce-cart .ct-container,
.woocommerce-cart .ct-cart-form {
    background-color: transparent !important;
    border: none !important;
}

/* Ensure cart form wrapper doesn't have borders */
.woocommerce-cart form.woocommerce-cart-form {
    background-color: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* Only the table itself should have the yellow border */
.woocommerce-cart table.shop_table {
    border: 8px solid #F6C70A !important;
}

/* Fix any table border issues */
.woocommerce-cart table.shop_table th,
.woocommerce-cart table.shop_table td {
    border-left: none !important;
    border-right: none !important;
}

/* WooCommerce notices styling */
.woocommerce-cart .woocommerce-message,
.woocommerce-cart .woocommerce-info {
    background-color: #2E084D !important;
    color: #ffffff !important;
    border-left: 5px solid #F6C70A !important;
    border-radius: 10px !important;
}

.woocommerce-cart .woocommerce-error {
    background-color: #2E084D !important;
    color: #ffffff !important;
    border-left: 5px solid #ff4444 !important;
    border-radius: 10px !important;
}

/* Remove any Blocksy-specific cart styling that might add borders */
.woocommerce-cart .ct-cart-items,
.woocommerce-cart [class*="ct-cart"] {
    border: none !important;
    background: transparent !important;
}
