/* ==========================================================================
   MASTER CART STYLESHEET (css-cart.css)
   Organized: Cart Totals, Primary Buttons, Table UI, & Mobile Cleanup
   ========================================================================== */

/* ==========================================================================
   MODULE 1: GLOBAL CART CONTAINER & NOTICES
   ========================================================================== */
.woocommerce-cart .entry-title, 
.woocommerce-cart .page-title { display: none !important; }

/* Override WP Gutenberg alignwide to restore padding */
.woocommerce-cart .inside-article,
.woocommerce-cart .wp-block-group.alignwide,
.cart-big-one { 
    max-width: 1400px !important;
    margin: 20px auto 0px auto !important; 
    padding-left: 0% !important; 
    padding-right: 0% !important; 
}

.woocommerce-notices-wrapper { width: 100% !important; max-width: 1400px !important; margin: 0 auto 20px auto !important; }
.woocommerce-message { background: #fdfdfd !important; border-top: 3px solid #8db73b !important; border-radius: 8px !important; box-shadow: 0 4px 15px rgba(0,0,0,0.05) !important; color: #333 !important; }

/* ==========================================================================
   MODULE 2: KILL THEME CLEARFIXES & WRAPPING FIX
   ========================================================================== */
.woocommerce-cart .woocommerce::before,
.woocommerce-cart .woocommerce::after { display: none !important; }

.woocommerce-cart .woocommerce {
    width: 100% !important;
    flex-wrap: wrap !important; 
}

.woocommerce-cart .woocommerce-notices-wrapper {
    flex: 0 0 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 0 20px 0 !important;
}

/* ==========================================================================
   MODULE 3: DESKTOP FLEX LAYOUT (SIDE-BY-SIDE)
   ========================================================================== */
@media (min-width: 1025px) {
    .woocommerce-cart .woocommerce {
        display: flex !important;
        flex-direction: row !important;
        justify-content: center !important;
        align-items: flex-start !important;
        gap: 40px !important;
    }
    .woocommerce-cart .woocommerce-cart-form {
        flex: 1 1 63% !important; 
        width: 63% !important;
        margin: 0 0 80px 0 !important;
    }
    .woocommerce-cart .cart-collaterals {
        flex: 0 0 32% !important;
        width: 32% !important;
        margin: 0 !important;
        float: none !important;
    }
}

/* ==========================================================================
   MODULE 4: PRODUCT TABLE STYLING
   ========================================================================== */
.woocommerce-cart .woocommerce-cart-form {
    background: #ffffff !important;
    border: 1px solid #eeeeee !important;
    border-top: 4px solid #8db73b !important; 
    padding: 25px 30px !important;
    border-radius: 15px !important;
    box-shadow: 0 5px 20px rgba(0,0,0,0.03) !important;
}
.woocommerce-cart table.shop_table { border: none !important; border-collapse: collapse !important; width: 100% !important; text-align: left !important; table-layout: auto !important; }
html[dir="rtl"] .woocommerce-cart table.shop_table { text-align: right !important; }

.woocommerce-cart table.shop_table thead th { background: transparent !important; border-bottom: 2px solid #eee !important; padding: 0 10px 15px 10px !important; text-transform: uppercase !important; font-size: 13px !important; font-weight: 800 !important; color: #444 !important; }
.woocommerce-cart table.shop_table tbody td { padding: 20px 10px !important; border-bottom: 1px solid #f9f9f9 !important; vertical-align: middle !important; }
.woocommerce-cart table.shop_table tr:last-child td { border-bottom: none !important; }

.woocommerce-cart table.shop_table td.product-remove { width: 45px !important; min-width: 45px !important; text-align: center !important; padding-right: 0 !important; }
html[dir="rtl"] .woocommerce-cart table.shop_table td.product-remove { padding-right: 10px !important; padding-left: 0 !important; }

.woocommerce-cart table.shop_table td.product-thumbnail { width: 80px !important; min-width: 80px !important; text-align: center !important; }
.woocommerce-cart table.shop_table td.product-thumbnail img { border-radius: 8px !important; border: 1px solid #eee !important; padding: 2px !important; width: 60px !important; max-width: 60px !important; height: auto !important; }

.woocommerce-cart td.product-name a { color: #333 !important; font-weight: 800 !important; text-decoration: none !important; font-size: 15px !important; display: block !important; line-height: 1.5 !important; }
.woocommerce-cart td.product-name a:hover { color: #8db73b !important; }
.woocommerce .quantity .qty { border: 1px solid #ddd !important; border-radius: 8px !important; padding: 10px !important; width: 70px !important; text-align: center !important; font-weight: 800 !important; height: 45px !important; }

/* Remove "X" Icon */
.woocommerce-cart .product-remove a.remove { 
    display: flex !important; 
    justify-content: center !important; 
    align-items: center !important; 
    width: 26px !important; 
    height: 26px !important; 
    font-size: 20px !important; 
    line-height: 0 !important; 
    padding-bottom: 2px !important; 
    border-radius: 50% !important; 
    color: #ff4444 !important; 
    border: 1px solid #ff4444 !important; 
    background: transparent !important; 
    margin: 0 auto !important; 
    text-decoration: none !important; 
}
.woocommerce-cart .product-remove a.remove:hover { background: #ff4444 !important; color: #fff !important; }

/* ==========================================================================
   MODULE 5: ACTIONS ROW (COUPON & UPDATE CART)
   ========================================================================== */
.woocommerce-cart table.shop_table td.actions { padding: 25px 0 0 0 !important; border-top: 1px solid #eee !important; background: transparent !important; }

@media (min-width: 769px) {
    .woocommerce-cart .coupon { float: left !important; display: flex !important; flex-direction: row !important; align-items: center !important; gap: 10px !important; }
    html[dir="rtl"] .woocommerce-cart .coupon { float: right !important; }
    .woocommerce-cart table.shop_table td.actions > button[name="update_cart"] { float: right !important; }
    html[dir="rtl"] .woocommerce-cart table.shop_table td.actions > button[name="update_cart"] { float: left !important; }
}

.woocommerce-cart .coupon input.input-text { width: 200px !important; min-width: 200px !important; height: 48px !important; border: 1px solid #ddd !important; border-radius: 8px !important; padding: 0 15px !important; margin: 0 !important; font-size: 14px !important; outline: none !important; box-shadow: inset 0 1px 3px rgba(0,0,0,0.02) !important; display: inline-block !important; }

.woocommerce-cart .coupon button.button {
    width: auto !important;
    height: 48px !important;
    background: #8db73b !important; 
    color: #ffffff !important;
    font-weight: 800 !important;
    border-radius: 8px !important;
    padding: 0 25px !important;
    text-transform: uppercase !important;
    transition: 0.3s !important;
    border: none !important;
    margin: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}
.woocommerce-cart .coupon button.button:hover { background: #222222 !important; color: #ffffff !important; }

.woocommerce-cart table.shop_table td.actions > button[name="update_cart"] { width: auto !important; height: 48px !important; background: #f5f5f5 !important; color: #333 !important; font-weight: 800 !important; border-radius: 8px !important; padding: 0 25px !important; text-transform: uppercase !important; transition: 0.3s !important; border: 1px solid #ddd !important; margin: 0 !important; display: inline-flex !important; align-items: center !important; justify-content: center !important; }
.woocommerce-cart button[name="update_cart"]:hover { background: #e0e0e0 !important; color: #8db73b !important; }
.woocommerce-cart button[name="update_cart"]:disabled { opacity: 0.5 !important; cursor: not-allowed !important; }

/* ==========================================================================
   MODULE 6: CART TOTALS STYLING
   ========================================================================== */
.woocommerce-cart .cart_totals {
    background: #ffffff !important;
    border: 1px solid #eeeeee !important;
    border-top: 4px solid #8db73b !important; 
    border-radius: 15px !important;
    padding: 25px !important; 
    box-shadow: 0 5px 20px rgba(0,0,0,0.03) !important;
    width: 100% !important;
    margin-bottom: 80px !important;
}
.woocommerce-cart .cart_totals h2 { font-size: 20px !important; font-weight: 800 !important; border-bottom: 2px solid #f5f5f5 !important; padding-bottom: 12px !important; margin-bottom: 15px !important; text-transform: uppercase !important; color: #8db73b !important; } 

.woocommerce-cart .cart_totals table { width: 100% !important; border-collapse: collapse !important; }

/* Remove Default Gray Backgrounds from Theme */
.woocommerce-cart .cart_totals table th,
.woocommerce-cart .cart_totals table td {
    background: transparent !important;
    background-color: transparent !important;
}

/* Better Spacing & Typography for Labels and Values */
.woocommerce-cart .cart_totals table th {
    width: 35% !important; 
    font-size: 14px !important;
    font-weight: 800 !important;
    color: #444444 !important;
    padding: 18px 0 !important;
    border-bottom: 1px solid #eee !important;
    text-transform: uppercase !important;
    text-align: left !important;
}
.woocommerce-cart .cart_totals table td {
    font-size: 15px !important;
    font-weight: 700 !important;
    color: #333333 !important;
    padding: 18px 0 !important;
    border-bottom: 1px solid #eee !important;
    text-align: right !important;
}

html[dir="rtl"] .woocommerce-cart .cart_totals table th { text-align: right !important; }
html[dir="rtl"] .woocommerce-cart .cart_totals table td { text-align: left !important; }

/* Make the Final Total Row Stand Out */
.woocommerce-cart .cart_totals table tr.order-total th, 
.woocommerce-cart .cart_totals table tr.order-total td {
    border-bottom: none !important;
    border-top: 2px solid #eeeeee !important; 
    padding-top: 25px !important;
    font-size: 22px !important;
    font-weight: 900 !important;
    color: #111111 !important;
}
.woocommerce-cart .cart_totals table tr.order-total th {
    font-size: 16px !important;
    vertical-align: middle !important;
}

.woocommerce-cart .wc-proceed-to-checkout { margin-top: 20px !important; }
.woocommerce-cart .wc-proceed-to-checkout a.checkout-button { background: #8db73b !important; color: #ffffff !important; border-radius: 50px !important; padding: 18px 20px !important; font-size: 16px !important; font-weight: 800 !important; text-transform: uppercase !important; display: flex !important; justify-content: center !important; align-items: center !important; text-align: center !important; box-shadow: 0 8px 20px rgba(141, 183, 59, 0.3) !important; transition: all 0.3s ease !important; width: 100% !important; }
.woocommerce-cart .wc-proceed-to-checkout a.checkout-button:hover { background: #222222 !important; box-shadow: 0 8px 20px rgba(0,0,0,0.2) !important; transform: translateY(-3px) !important; color: #fff !important; }

/* ==========================================================================
   MODULE 7: EMPTY CART STYLING
   ========================================================================== */
.woocommerce-cart .cart-empty.woocommerce-info { 
    background: #ffffff !important; 
    border: 1px solid #eeeeee !important; 
    border-top: 4px solid #8db73b !important; 
    padding: 50px 20px !important; 
    border-radius: 15px !important; 
    text-align: center !important; 
    font-size: 20px !important; 
    font-weight: 800 !important; 
    color: #333333 !important; 
    box-shadow: 0 10px 30px rgba(0,0,0,0.03) !important; 
    margin: 0 auto 30px auto !important; 
    width: 100% !important; 
    max-width: 800px !important; 
    display: block !important; 
}
.woocommerce-cart .cart-empty.woocommerce-info::before { display: none !important; }
.woocommerce-cart .return-to-shop { text-align: center !important; width: 100% !important; margin: 0 auto 50px auto !important; max-width: 800px !important; display: block !important; }
.woocommerce-cart .return-to-shop .button.wc-backward { background: #8db73b !important; color: #ffffff !important; border-radius: 50px !important; padding: 16px 40px !important; font-size: 16px !important; font-weight: 800 !important; text-transform: uppercase !important; border: none !important; box-shadow: 0 8px 20px rgba(141, 183, 59, 0.2) !important; transition: all 0.3s ease !important; display: inline-block !important; }
.woocommerce-cart .return-to-shop .button.wc-backward:hover { transform: translateY(-3px) !important; box-shadow: 0 12px 25px rgba(141, 183, 59, 0.4) !important; background: #222222 !important; }

/* ==========================================================================
   MODULE 8: MOBILE RESPONSIVE LAYOUT
   ========================================================================== */
@media (max-width: 768px) {
    .woocommerce-cart .inside-article,
    .woocommerce-cart .wp-block-group.alignwide,
    .cart-big-one { 
        padding-left: 5% !important; 
        padding-right: 5% !important; 
        margin-bottom: 60px !important; 
    }

    .woocommerce-cart .woocommerce-cart-form, .woocommerce-cart .cart_totals { padding: 20px !important; border-radius: 15px !important; }
    
    /* Actions & Coupon Area Fixes */
    .woocommerce-cart table.shop_table td.actions { background: transparent !important; display: flex !important; flex-direction: column !important; align-items: stretch !important; gap: 15px !important; padding: 20px 0 0 0 !important; }
    .woocommerce-cart .coupon { width: 100% !important; flex-direction: column !important; align-items: stretch !important; float: none !important; background: transparent !important; }
    
    /* Explicit margin added here for coupon input */
    .woocommerce-cart .coupon input.input-text { width: 100% !important; max-width: 100% !important; margin-bottom: 15px !important; }
    
    .woocommerce-cart .coupon button.button, .woocommerce-cart table.shop_table td.actions > button[name="update_cart"] { width: 100% !important; max-width: 100% !important; float: none !important; margin: 0 !important; }
    
    /* Responsive Table Cells */
    .woocommerce-cart table.shop_table_responsive tr { 
        position: relative !important; 
        padding-top: 45px !important; 
        padding-bottom: 20px !important; 
        margin-bottom: 20px !important; 
        border-bottom: 2px solid #eee !important; 
        display: block !important; 
    }
    
    .woocommerce-cart table.shop_table_responsive td { text-align: right !important; display: block !important; width: 100% !important; }
    html[dir="rtl"] .woocommerce-cart table.shop_table_responsive td { text-align: left !important; }
    .woocommerce-cart table.shop_table_responsive td::before { font-weight: 800 !important; text-transform: uppercase !important; color: #333 !important; }
    
    /* Pinned X Button */
    .woocommerce-cart table.shop_table_responsive td.product-remove { 
        position: absolute !important; 
        top: 15px !important; 
        right: 15px !important; 
        width: auto !important; 
        border: none !important; 
        padding: 0 !important; 
    }
    html[dir="rtl"] .woocommerce-cart table.shop_table_responsive td.product-remove { 
        right: auto !important; 
        left: 15px !important; 
    }
    
    /* Hide the colons */
    .woocommerce-cart table.shop_table_responsive td.product-remove::before,
    .woocommerce-cart table.shop_table_responsive td.product-thumbnail::before { display: none !important; }
    
    .woocommerce-cart table.shop_table_responsive td.product-thumbnail { text-align: center !important; padding-bottom: 15px !important; }
    .woocommerce-cart .product-remove a.remove { margin: 0 !important; }
}