/**
 * WooCommerce Default Cart - ULTIMATE Responsive Design
 * Complete mobile-first responsive cart layout
 * 
 * @package Medacsi Care Child
 * @version 2.1.3 - Increased remove button size (38px) for better visibility
 */

/* ==========================================
   BASE CART FIXES (ALL DEVICES)
   ========================================== */

/* Prevent horizontal scroll */
.woocommerce-cart,
.woocommerce-cart .woocommerce,
.woocommerce-cart .site-content,
.woocommerce-cart .content-area {
    overflow-x: hidden !important;
    max-width: 100% !important;
}

/* Ensure images load properly */
.woocommerce-cart img {
    max-width: 100% !important;
    height: auto !important;
    display: block !important;
}

/* Hide SKU column completely (causing column misalignment) */
.woocommerce-cart table.cart thead th.product-sku,
.woocommerce-cart table.cart tbody td.product-sku,
.woocommerce-cart table.cart tfoot td.product-sku {
    display: none !important;
}

/* Remove button base styles - Clean circular design */
.woocommerce-cart table.cart td.product-remove a {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 38px !important;
    height: 38px !important;
    padding: 0 !important;
    background: #fff !important;
    border: 2px solid #e9ecef !important;
    border-radius: 50% !important;
    color: #e74c3c !important;
    font-size: 20px !important;
    line-height: 1 !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15) !important;
    position: static !important;
    transition: all 0.2s ease !important;
    text-decoration: none !important;
}
.woocommerce-cart table.cart td.product-remove a:hover {
    background: #fee !important;
    border-color: #e74c3c !important;
    color: #c0392b !important;
    transform: scale(1.1) !important;
}
.woocommerce-cart table.cart td.product-remove::before,
.woocommerce-cart table.cart td.product-remove::after,
.woocommerce-cart table.cart td.product-remove a::before,
.woocommerce-cart table.cart td.product-remove a::after {
    content: none !important;
    display: none !important;
}
.woocommerce-cart table.cart td.product-remove a svg,
.woocommerce-cart table.cart td.product-remove a i {
    display: none !important;
}

/* Overlay container for remove button when JS moves it into product-name */
.woocommerce-cart table.cart td.product-name .cart-remove-overlay {
    position: absolute !important;
    top: 12px !important;
    right: 12px !important;
    z-index: 9999 !important;
}
.woocommerce-cart table.cart td.product-name .cart-remove-overlay a.remove {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 38px !important;
    height: 38px !important;
    padding: 0 !important;
    background: #fff !important;
    border: 2px solid #e9ecef !important;
    border-radius: 50% !important;
    color: #e74c3c !important;
    font-size: 20px !important;
    line-height: 1 !important;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15) !important;
    text-decoration: none !important;
    transition: all 0.2s ease !important;
}
.woocommerce-cart table.cart td.product-name .cart-remove-overlay a.remove:hover {
    background: #fee !important;
    border-color: #e74c3c !important;
    transform: scale(1.1) !important;
}
.woocommerce-cart table.cart td.product-name .cart-remove-overlay a.remove::before,
.woocommerce-cart table.cart td.product-name .cart-remove-overlay a.remove::after {
    content: none !important;
    display: none !important;
}

/* ==========================================
   DESKTOP CART TABLE FIX (> 768px)
   ========================================== */

@media only screen and (min-width: 768px) {
    
    /* Ensure proper table layout on desktop */
    .woocommerce-cart table.cart {
        width: 100% !important;
        table-layout: fixed !important;
        border-collapse: collapse !important;
    }
    
    /* Fix table headers alignment - Ensure all columns have matching headers */
    .woocommerce-cart table.cart thead th {
        text-align: center !important;
        padding: 15px 10px !important;
        font-weight: 600 !important;
        background: #f8f9fa !important;
        border-bottom: 2px solid #e9ecef !important;
    }
    
    /* Column widths must match thead and tbody */
    .woocommerce-cart table.cart thead th.product-remove,
    .woocommerce-cart table.cart tbody td.product-remove {
        width: 50px !important;
        min-width: 50px !important;
        max-width: 50px !important;
        text-align: center !important;
    }
    
    .woocommerce-cart table.cart thead th.product-thumbnail,
    .woocommerce-cart table.cart tbody td.product-thumbnail {
        width: 100px !important;
        min-width: 100px !important;
        max-width: 100px !important;
        text-align: center !important;
    }
    
    .woocommerce-cart table.cart thead th.product-name,
    .woocommerce-cart table.cart tbody td.product-name {
        width: auto !important;
        min-width: 200px !important;
        text-align: left !important;
    }
    
    .woocommerce-cart table.cart thead th.product-price,
    .woocommerce-cart table.cart tbody td.product-price {
        width: 120px !important;
        min-width: 120px !important;
        max-width: 120px !important;
        text-align: center !important;
    }
    
    .woocommerce-cart table.cart thead th.product-quantity,
    .woocommerce-cart table.cart tbody td.product-quantity {
        width: 150px !important;
        min-width: 150px !important;
        max-width: 150px !important;
        text-align: center !important;
    }
    
    .woocommerce-cart table.cart thead th.product-subtotal,
    .woocommerce-cart table.cart tbody td.product-subtotal {
        width: 120px !important;
        min-width: 120px !important;
        max-width: 120px !important;
        text-align: center !important;
    }
    
    /* Fix table body cells alignment */
    .woocommerce-cart table.cart tbody td {
        padding: 15px 10px !important;
        vertical-align: middle !important;
        border-bottom: 1px solid #e9ecef !important;
    }
    
    .woocommerce-cart table.cart tbody td.product-thumbnail img {
        width: 80px !important;
        height: 80px !important;
        object-fit: cover !important;
        border-radius: 8px !important;
        border: 1px solid #e9ecef !important;
        margin: 0 auto !important;
        display: block !important;
    }
    
    .woocommerce-cart table.cart tbody td.product-name a {
        font-weight: 600 !important;
        color: #2d3748 !important;
        text-decoration: none !important;
    }
    
    .woocommerce-cart table.cart tbody td.product-name .cart-sku-moved {
        display: block !important;
        font-size: 13px !important;
        color: #718096 !important;
        margin-top: 5px !important;
        font-weight: normal !important;
    }
    
    .woocommerce-cart table.cart tbody td.product-price .amount {
        font-weight: 600 !important;
        color: #3AB8AE !important;
    }
    
    .woocommerce-cart table.cart tbody td.product-quantity .quantity {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 8px !important;
    }
    
    .woocommerce-cart table.cart tbody td.product-quantity input.qty {
        width: 60px !important;
        text-align: center !important;
        padding: 8px !important;
        border: 2px solid #e9ecef !important;
        border-radius: 6px !important;
    }
    
    .woocommerce-cart table.cart tbody td.product-subtotal .amount {
        font-weight: 700 !important;
        color: #3AB8AE !important;
        font-size: 16px !important;
    }
    
    /* Desktop remove button styling */
    .woocommerce-cart table.cart tbody td.product-remove a {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 38px !important;
        height: 38px !important;
        margin: 0 auto !important;
        background: #fff !important;
        border: 2px solid #e9ecef !important;
        border-radius: 50% !important;
        color: #e74c3c !important;
        font-size: 20px !important;
        font-weight: 600 !important;
        text-decoration: none !important;
        box-shadow: 0 2px 6px rgba(0,0,0,0.15) !important;
        transition: all 0.2s ease !important;
    }
    
    .woocommerce-cart table.cart tbody td.product-remove a:hover {
        background: #fee !important;
        border-color: #e74c3c !important;
        transform: scale(1.15) !important;
        box-shadow: 0 3px 8px rgba(231,76,60,0.3) !important;
    }
    
    /* Cart actions row */
    .woocommerce-cart table.cart tbody td.actions {
        padding: 20px !important;
        background: #f8f9fa !important;
    }
    
    .woocommerce-cart table.cart .actions {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        gap: 20px !important;
    }
    
    .woocommerce-cart table.cart .actions .coupon {
        display: flex !important;
        gap: 10px !important;
        flex: 1 !important;
        max-width: 400px !important;
    }
    
    .woocommerce-cart table.cart .actions .coupon input {
        flex: 1 !important;
        height: 46px !important;
        padding: 0 15px !important;
        border: 2px solid #e9ecef !important;
        border-radius: 6px !important;
    }
    
    .woocommerce-cart table.cart .actions .coupon button {
        height: 46px !important;
        padding: 0 30px !important;
        background: #3AB8AE !important;
        color: #fff !important;
        border: none !important;
        border-radius: 6px !important;
        font-weight: 600 !important;
        cursor: pointer !important;
    }
    
    .woocommerce-cart table.cart .actions button[name="update_cart"] {
        height: 46px !important;
        padding: 0 30px !important;
        background: #2d3748 !important;
        color: #fff !important;
        border: none !important;
        border-radius: 6px !important;
        font-weight: 600 !important;
        cursor: pointer !important;
    }
}

/* ==========================================
   MOBILE RESPONSIVE - ULTIMATE CART DESIGN
   ========================================== */

@media only screen and (max-width: 767px) {
    
    /* Container padding */
    .woocommerce-cart .woocommerce {
        padding: 15px 10px !important;
    }
    
    /* Hide default table structure */
    .woocommerce-cart table.cart thead {
        display: none !important;
    }
    
    .woocommerce-cart table.cart {
        border: none !important;
        margin: 0 !important;
    }
    
    .woocommerce-cart table.cart tbody {
        display: block !important;
    }
    
    /* Transform each row into a card */
    .woocommerce-cart table.cart tr.cart_item,
    .woocommerce-cart table.cart tr.woocommerce-cart-form__cart-item {
        display: grid !important;
        grid-template-columns: 85px 1fr !important;
        grid-template-rows: auto auto auto 1fr auto !important;
        column-gap: 12px !important;
        row-gap: 8px !important;
        margin-bottom: 15px !important;
        padding: 15px 52px 15px 15px !important; /* reserve space for circular remove button */
        background: #fff !important;
        border: 1px solid #ddd !important;
        border-radius: 10px !important;
        position: relative !important;
        overflow: visible !important;
        box-shadow: 0 2px 5px rgba(0,0,0,0.05) !important;
    }
    
    .woocommerce-cart table.cart td {
        border: none !important;
        padding: 0 !important;
        text-align: left !important;
    }
    
    /* Product Remove Button - Top Right of Card */
    .woocommerce-cart table.cart td.product-remove {
        position: absolute !important; /* force top-right */
        top: 12px !important;
        right: 12px !important;
        padding: 0 !important;
        width: 38px !important;
        height: 38px !important;
        z-index: 99 !important;
        order: -1 !important;
        margin: 0 !important;
    }
    
    .woocommerce-cart table.cart td.product-remove a {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 38px !important;
        height: 38px !important;
        padding: 0 !important;
        background: #fff !important;
        border: 2px solid #e9ecef !important;
        border-radius: 50% !important;
        color: #e74c3c !important;
        font-size: 20px !important;
        font-weight: 600 !important;
        text-decoration: none !important;
        line-height: 1 !important;
        box-shadow: 0 2px 6px rgba(0,0,0,0.15) !important;
        vertical-align: top !important;
        transition: all 0.2s ease !important;
    }
    /* Remove any theme-provided icon/pseudo duplicates */
    .woocommerce-cart table.cart td.product-remove a::before,
    .woocommerce-cart table.cart td.product-remove a::after {
        content: none !important;
        display: none !important;
    }
    .woocommerce-cart table.cart td.product-remove a svg,
    .woocommerce-cart table.cart td.product-remove a i {
        display: none !important;
    }
    
    .woocommerce-cart table.cart td.product-remove a:hover {
        background: #fee !important;
        border-color: #e74c3c !important;
        color: #c0392b !important;
        transform: scale(1.15) !important;
        box-shadow: 0 3px 8px rgba(231,76,60,0.3) !important;
    }
    
    /* Product Thumbnail - Grid Position: Row 1 ONLY, Column 1 */
    .woocommerce-cart table.cart td.product-thumbnail {
        grid-column: 1 / 2 !important;
        grid-row: 1 / 2 !important;
        width: 80px !important;
        min-width: 80px !important;
        max-width: 80px !important;
        height: 80px !important;
        padding: 0 !important;
        overflow: hidden !important;
        align-self: start !important;
        font-size: 0 !important;            /* Hide stray text nodes */
        line-height: 0 !important;          /* Prevent text line height from showing */
    }
    
    /* Hide any text/SKU that appears in thumbnail td */
    .woocommerce-cart table.cart td.product-thumbnail dl,
    .woocommerce-cart table.cart td.product-thumbnail .variation,
    .woocommerce-cart table.cart td.product-thumbnail .wc-item-meta,
    .woocommerce-cart table.cart td.product-thumbnail p,
    .woocommerce-cart table.cart td.product-thumbnail span:not(.woocommerce-Price-amount) {
        display: none !important;
    }
    
    .woocommerce-cart table.cart td.product-thumbnail a {
        display: block !important;
        width: 80px !important;
        height: 80px !important;
        min-width: 80px !important;
        max-width: 80px !important;
        overflow: hidden !important;
    }
    /* Ensure anchor shows only the image */
    .woocommerce-cart table.cart td.product-thumbnail a > *:not(img) {
        display: none !important;
    }
    
    .woocommerce-cart table.cart td.product-thumbnail img {
        width: 80px !important;
        min-width: 80px !important;
        max-width: 80px !important;
        height: 80px !important;
        min-height: 80px !important;
        max-height: 80px !important;
        object-fit: cover !important;
        border-radius: 8px !important;
        border: 1px solid #e9ecef !important;
        display: block !important;
    }
    
    /* Product Name - Grid Position: Row 1, Column 2 */
    .woocommerce-cart table.cart td.product-name {
        grid-column: 2 / 3 !important;
        grid-row: 1 / 2 !important;
        font-size: 15px !important;
        font-weight: 700 !important;
        padding-right: 48px !important; /* leave room for circular remove button */
        line-height: 1.4 !important;
        align-self: start !important;
        z-index: 10 !important;
        position: relative !important;
        background: transparent !important;
        min-height: 40px !important;
    }
    
    .woocommerce-cart table.cart td.product-name a {
        color: #2d3748 !important;
        text-decoration: none !important;
        display: block !important;
        position: relative !important;
        z-index: 10 !important;
    }
    
    /* SKU/Product Meta in product name */
    .woocommerce-cart table.cart td.product-name dl,
    .woocommerce-cart table.cart td.product-name .variation,
    .woocommerce-cart table.cart td.product-name .wc-item-meta {
        font-size: 13px !important;
        color: #718096 !important;
        margin-top: 5px !important;
        position: relative !important;
        z-index: 10 !important;
    }
    
    /* Product Price - Grid Position: Row 2, Column 2 */
    .woocommerce-cart table.cart td.product-price {
        grid-column: 2 / 3 !important;
        grid-row: 2 / 3 !important;
        display: flex !important;
        gap: 10px !important;
        align-items: center !important;
        font-size: 14px !important;
        z-index: 1 !important;
    }
    
    .woocommerce-cart table.cart td.product-price::before {
        content: "Price:" !important;
        font-weight: 600 !important;
        color: #718096 !important;
        font-size: 14px !important;
    }
    
    .woocommerce-cart table.cart td.product-price .amount {
        color: #3AB8AE !important;
        font-weight: 700 !important;
        font-size: 15px !important;
    }
    
    /* Product Quantity - Grid Position: Row 3, Column 1-2 */
    .woocommerce-cart table.cart td.product-quantity {
        grid-column: 1 / -1 !important;
        grid-row: 4 !important;
        display: flex !important;
        align-items: center !important;
        gap: 15px !important;
        padding-top: 10px !important;
        border-top: 1px solid #e9ecef !important;
    }
    
    .woocommerce-cart table.cart td.product-quantity::before {
        content: "Quantity:" !important;
        font-weight: 600 !important;
        color: #718096 !important;
        font-size: 14px !important;
    }
    
    .woocommerce-cart table.cart td.product-quantity .quantity {
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
    }
    
    .woocommerce-cart table.cart td.product-quantity input.qty {
        width: 50px !important;
        height: 36px !important;
        text-align: center !important;
        padding: 5px !important;
        border: 2px solid #e9ecef !important;
        border-radius: 6px !important;
        font-size: 15px !important;
        font-weight: 600 !important;
    }
    
    /* Quantity +/- buttons if present */
    .woocommerce-cart table.cart td.product-quantity .qty-btn {
        width: 32px !important;
        height: 32px !important;
        padding: 0 !important;
        border: 1px solid #ddd !important;
        background: #f8f9fa !important;
        border-radius: 4px !important;
        font-size: 16px !important;
        cursor: pointer !important;
    }
    
    /* Product Subtotal - Grid Position: Row 4, Column 1-2 */
    .woocommerce-cart table.cart td.product-subtotal {
        grid-column: 1 / -1 !important;
        grid-row: 5 !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 10px 0 !important;
        border-top: 2px solid #e9ecef !important;
        margin-top: 8px !important;
    }
    
    .woocommerce-cart table.cart td.product-subtotal::before {
        content: "Subtotal:" !important;
        font-weight: 600 !important;
        color: #718096 !important;
        font-size: 14px !important;
    }
    
    .woocommerce-cart table.cart td.product-subtotal .amount {
        color: #3AB8AE !important;
        font-weight: 700 !important;
        font-size: 18px !important;
    }
    
    /* Actions Row - Mobile Optimized */
    .woocommerce-cart table.cart td.actions {
        width: 100% !important;
        padding: 0 !important;
        margin-top: 15px !important;
    }
    
    .woocommerce-cart .actions {
        display: flex !important;
        flex-direction: column !important;
        gap: 12px !important;
        padding: 15px !important;
        background: #f8f9fa !important;
        border-radius: 8px !important;
    }
    
    /* Coupon Section */
    .woocommerce-cart .actions .coupon {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
        margin: 0 !important;
    }
    
    .woocommerce-cart .actions .coupon input#coupon_code {
        width: 100% !important;
        height: 46px !important;
        padding: 0 15px !important;
        border: 2px solid #e9ecef !important;
        border-radius: 6px !important;
        font-size: 15px !important;
    }
    
    .woocommerce-cart .actions .coupon button.button {
        width: 100% !important;
        height: 46px !important;
        padding: 0 20px !important;
        background: #3AB8AE !important;
        color: #fff !important;
        border: none !important;
        border-radius: 6px !important;
        font-weight: 700 !important;
        font-size: 15px !important;
        cursor: pointer !important;
    }
    
    /* Update Cart Button */
    .woocommerce-cart .actions button[name="update_cart"] {
        width: 100% !important;
        height: 46px !important;
        padding: 0 20px !important;
        background: #fff !important;
        color: #2d3748 !important;
        border: 2px solid #e9ecef !important;
        border-radius: 6px !important;
        font-weight: 700 !important;
        font-size: 15px !important;
        cursor: pointer !important;
    }
    
    .woocommerce-cart .actions button[name="update_cart"]:hover {
        background: #f8f9fa !important;
        border-color: #3AB8AE !important;
    }
    
    /* Cart Totals - Mobile Optimized - FORCE FULL WIDTH */
    .cart-collaterals {
        width: 100% !important;
        max-width: 100% !important;
        float: none !important;
        margin-top: 20px !important;
        clear: both !important;
        padding: 0 !important;
        box-sizing: border-box !important;
    }
    
    .cart_totals {
        width: 100% !important;
        max-width: 100% !important;
        padding: 20px 15px !important;
        background: #fff !important;
        border: 1px solid #e9ecef !important;
        border-radius: 10px !important;
        box-shadow: 0 2px 5px rgba(0,0,0,0.05) !important;
        box-sizing: border-box !important;
        display: block !important;
    }
    
    .cart_totals h2 {
        font-size: 18px !important;
        margin-bottom: 20px !important;
        color: #2d3748 !important;
        font-weight: 700 !important;
    }
    
    .cart_totals table {
        width: 100% !important;
        max-width: none !important;           /* allow expansion */
        min-width: 100% !important;
        margin-bottom: 0 !important;
        table-layout: fixed !important;
        border-collapse: collapse !important;
        display: block !important;
        box-sizing: border-box !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    .cart_totals table tbody {
        display: block !important;
        width: 100% !important;
    }
    
    /* Hide thead and tfoot to prevent duplicates */
    .cart_totals table thead,
    .cart_totals table tfoot {
        display: none !important;
    }
    
    .cart_totals table tbody tr {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 12px 0 !important;
        border-bottom: 1px solid #f0f0f0 !important;
        width: 100% !important;
        min-width: 100% !important;
    }
    
    /* Hide any duplicate rows */
    .cart_totals table thead tr,
    .cart_totals table tfoot tr {
        display: none !important;
    }
    
    .cart_totals table tbody tr:last-child {
        border-bottom: none !important;
    }
    
    .cart_totals table tbody th,
    .cart_totals table tbody td {
        padding: 0 !important;
        font-size: 15px !important;
        border: none !important;
    }
    
    /* Hide thead/tfoot cells */
    .cart_totals table thead th,
    .cart_totals table thead td,
    .cart_totals table tfoot th,
    .cart_totals table tfoot td {
        display: none !important;
    }
    
    .cart_totals table tbody th {
        display: inline-block !important;
        text-align: left !important;
        font-weight: 600 !important;
        color: #718096 !important;
        white-space: nowrap !important;
        padding: 0 !important;
        padding-right: 30px !important;
        flex: 0 0 auto !important;
        min-width: 80px !important;
        font-size: 15px !important; /* Restore normal font size */
    }
    
    /* Remove any pseudo labels to prevent duplication */
    .cart_totals .cart-subtotal th::after,
    .cart_totals .order-total th::after {
        content: none !important;
    }
    
    .cart_totals table tbody td {
        display: inline-block !important;
        text-align: right !important;
        font-weight: 600 !important;
        color: #2d3748 !important;
        white-space: nowrap !important;
        padding: 0 !important;
        padding-left: 30px !important;
        flex: 1 1 auto !important;
        text-align: right !important;
    }
    
    /* Disable WooCommerce mobile labels injected via td:before */
    .woocommerce-cart .cart_totals table td:before,
    .woocommerce-cart .cart_totals table tbody td:before,
    .woocommerce-cart .shop_table_responsive tr td:before {
        content: none !important;
        display: none !important;
    }
    
    /* Ensure only price is visible inside td */
    .cart_totals .cart-subtotal td > *:not(.woocommerce-Price-amount):not(.amount),
    .cart_totals .order-total td > *:not(.woocommerce-Price-amount):not(.amount) {
        display: none !important;
    }
    
    /* Order Total Row */
    .cart_totals .order-total {
        border-top: 2px solid #3AB8AE !important;
        margin-top: 10px !important;
        padding-top: 15px !important;
    }
    
    .cart_totals .order-total th,
    .cart_totals .order-total td {
        font-size: 20px !important;
        font-weight: 700 !important;
        color: #3AB8AE !important;
    }
    
    /* Checkout Button */
    .wc-proceed-to-checkout {
        padding: 0 !important;
        margin-top: 20px !important;
    }
    
    .wc-proceed-to-checkout .checkout-button {
        width: 100% !important;
        height: 50px !important;
        padding: 0 20px !important;
        background: linear-gradient(135deg, #3AB8AE 0%, #2a9d8f 100%) !important;
        color: #ffffff !important;
        border: none !important;
        border-radius: 8px !important;
        font-size: 17px !important;
        font-weight: 700 !important;
        text-align: center !important;
        text-decoration: none !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-shadow: 0 4px 10px rgba(58, 184, 174, 0.25) !important;
        transition: all 0.3s ease !important;
        cursor: pointer !important;
    }
    
    .wc-proceed-to-checkout .checkout-button:hover {
        background: linear-gradient(135deg, #2a9d8f 0%, #3AB8AE 100%) !important;
        transform: translateY(-2px) !important;
        box-shadow: 0 6px 12px rgba(58, 184, 174, 0.35) !important;
    }
}

/* ==========================================
   SMALL MOBILE SCREENS (< 480px)
   ========================================== */

@media only screen and (max-width: 480px) {
    
    .woocommerce-cart .woocommerce {
        padding: 10px 5px !important;
    }
    
    /* Adjust grid for smaller screens */
    .woocommerce-cart table.cart tr.cart_item,
    .woocommerce-cart table.cart tr.woocommerce-cart-form__cart-item {
        grid-template-columns: 70px 1fr !important;
        padding: 12px !important;
        gap: 8px !important;
    }
    
    .woocommerce-cart table.cart td.product-thumbnail {
        width: 70px !important;
    }
    
    .woocommerce-cart table.cart td.product-thumbnail a {
        width: 70px !important;
        height: 70px !important;
    }
    
    .woocommerce-cart table.cart td.product-thumbnail img {
        width: 70px !important;
        height: 70px !important;
    }
    
    .woocommerce-cart table.cart td.product-name {
        font-size: 14px !important;
        padding-right: 48px !important;
    }
    
    .cart_totals {
        padding: 15px 12px !important;
    }
    
    .cart_totals h2 {
        font-size: 16px !important;
    }
    
    .cart_totals table th,
    .cart_totals table td {
        font-size: 14px !important;
    }
    
    .cart_totals .order-total th,
    .cart_totals .order-total td {
        font-size: 18px !important;
    }

    /* Fallback: absolute thumbnail + row left padding (no overlap, ever) */
    .woocommerce-cart table.cart tr.cart_item,
    .woocommerce-cart table.cart tr.woocommerce-cart-form__cart-item {
        display: block !important; /* override grid */
        position: relative !important;
        min-height: 86px !important; /* 70 image + padding */
        padding: 12px 52px 12px 96px !important; /* extra right padding for circular remove button */
        box-sizing: border-box !important;
    }
    .woocommerce-cart table.cart tr.cart_item > td,
    .woocommerce-cart table.cart tr.woocommerce-cart-form__cart-item > td {
        display: block !important;
        width: 100% !important;
    }
    .woocommerce-cart table.cart td.product-thumbnail {
        position: absolute !important;
        left: 12px !important;
        top: 12px !important;
        width: 70px !important;
        height: 70px !important;
        margin: 0 !important;
        z-index: 1 !important;
        float: none !important;
    }
    .woocommerce-cart table.cart td.product-thumbnail a,
    .woocommerce-cart table.cart td.product-thumbnail img {
        width: 70px !important;
        height: 70px !important;
    }

    /* Keep the remove button fixed at top-right above everything */
    .woocommerce-cart table.cart td.product-remove {
        position: absolute !important;
        top: 12px !important;
        right: 12px !important;
        padding: 0 !important;
        width: 38px !important;
        height: 38px !important;
        z-index: 99 !important;
    }
    .woocommerce-cart table.cart td.product-remove a {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 38px !important;
        height: 38px !important;
        padding: 0 !important;
        background: #fff !important;
        border: 2px solid #e9ecef !important;
        border-radius: 50% !important;
        color: #e74c3c !important;
        font-size: 20px !important;
        font-weight: 600 !important;
        line-height: 1 !important;
        box-shadow: 0 2px 6px rgba(0,0,0,0.15) !important;
        transition: all 0.2s ease !important;
    }
    .woocommerce-cart table.cart td.product-remove a:hover {
        background: #fee !important;
        border-color: #e74c3c !important;
        transform: scale(1.15) !important;
        box-shadow: 0 3px 8px rgba(231,76,60,0.3) !important;
    }
    .woocommerce-cart table.cart td.product-remove a::before,
    .woocommerce-cart table.cart td.product-remove a::after {
        content: none !important;
        display: none !important;
    }
    .woocommerce-cart table.cart td.product-remove a svg,
    .woocommerce-cart table.cart td.product-remove a i {
        display: none !important;
    }
    .woocommerce-cart table.cart td.product-name,
    .woocommerce-cart table.cart td.product-price,
    .woocommerce-cart table.cart td.product-quantity,
    .woocommerce-cart table.cart td.product-subtotal {
        margin-left: 0 !important; /* content uses row padding-left */
        position: relative !important;
        z-index: 2 !important;
        overflow: visible !important;
    }
    .woocommerce-cart table.cart td.product-name {
        overflow-wrap: anywhere !important;
        word-break: break-word !important;
    }

    /* Overlay remove button styling (when JS moves it into product-name) */
    .woocommerce-cart table.cart td.product-name .cart-remove-overlay a.remove {
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 38px !important;
        height: 38px !important;
        padding: 0 !important;
        background: #fff !important;
        border: 2px solid #e9ecef !important;
        border-radius: 50% !important;
        color: #e74c3c !important;
        font-size: 20px !important;
        font-weight: 600 !important;
        line-height: 1 !important;
        box-shadow: 0 2px 6px rgba(0,0,0,0.15) !important;
        text-decoration: none !important;
        transition: all 0.2s ease !important;
    }
    .woocommerce-cart table.cart td.product-name .cart-remove-overlay a.remove:hover {
        background: #fee !important;
        border-color: #e74c3c !important;
        transform: scale(1.15) !important;
        box-shadow: 0 3px 8px rgba(231,76,60,0.3) !important;
    }
    .woocommerce-cart table.cart td.product-name .cart-remove-overlay a.remove::before,
    .woocommerce-cart table.cart td.product-name .cart-remove-overlay a.remove::after {
        content: none !important;
        display: none !important;
    }
}
