:root {
    --primary-color: #F3BAFD; /* Updated to Purple */
    --primary-light: #fdf5ff;
    --text-dark: #1c1c1c;
    --text-light: #666;
    --background-color: #f5f7fd;
    --card-background: #ffffff;
    --border-color: #e0e0e0;
}

body.woocommerce-cart { background-color: var(--background-color); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; margin: 0; padding: 0; }
.woocommerce-cart .entry-header, .woocommerce-cart .woocommerce-notices-wrapper { display: none; }

/* Wrapper */
.rahi-cart-page-wrapper {
    max-width: 600px; margin: 0 auto; padding: 0 0 160px 0; /* Padding for footer */
}

/* 1. Header & Delivery Banner */
.rahi-blinkit-header { background: #fff; padding: 15px; position: sticky; top: 0; z-index: 99; border-bottom: 1px solid #f0f0f0; }
.rahi-blinkit-delivery-card {
    background: #fff; border: 1px solid #eee; border-radius: 12px; padding: 12px; display: flex; align-items: center; gap: 12px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
}
.rahi-bd-icon { background: var(--primary-light); padding: 8px; border-radius: 8px; display: flex; align-items: center; justify-content: center; }
.rahi-bd-text { display: flex; flex-direction: column; }
.rahi-bd-text strong { font-size: 14px; color: var(--text-dark); }
.rahi-bd-text span { font-size: 11px; color: var(--text-light); }

/* 2. Items List */
.rahi-cart-card { background-color: var(--card-background); border-radius: 0; margin-top: 10px; padding: 0 15px; }
.rahi-cart-item {
    display: flex; align-items: flex-start; gap: 12px; padding: 15px 0; border-bottom: 1px solid #f5f5f5; position: relative;
}
.rahi-cart-item:last-child { border-bottom: none; }

/* Thumbnail */
.product-thumbnail img {
    width: 60px; height: 60px; border-radius: 8px; border: 1px solid #f0f0f0; object-fit: contain;
}

/* Details */
.product-details { flex-grow: 1; display: flex; flex-direction: column; justify-content: center; }
.product-details .product-name { margin: 0 0 4px 0; font-weight: 500; font-size: 13px; color: var(--text-dark); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-details .product-weight { font-size: 11px; color: #999; margin-bottom: 4px; }
.product-details .product-price { font-size: 14px; color: var(--text-dark); font-weight: 700; }

/* 3. Quantity Selector (Updated Purple) */
.product-quantity { display: flex; align-items: center; }
.quantity-selector {
    display: flex; align-items: center; justify-content: space-between;
    background: var(--primary-color); border-radius: 6px; color: #333; /* Darker text for light purple background */
    width: 75px; height: 32px; box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.quantity-selector .qty-btn {
    background-color: transparent; border: none; color: #333; font-size: 18px; font-weight: 700;
    cursor: pointer; width: 25px; height: 100%; display: flex; align-items: center; justify-content: center; padding: 0;
}
.quantity-selector .qty-display { font-weight: 600; font-size: 13px; }

/* 4. Bill Details */
.bill-details-card { margin-top: 15px; padding: 20px 15px; border-radius: 12px; }
.bill-details-card h4 { margin: 0 0 15px 0; font-size: 13px; font-weight: 700; color: var(--text-dark); }
.bill-row { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 12px; color: var(--text-light); }
.bill-row span:last-child { color: var(--text-dark); }
.bill-row.savings { color: var(--text-dark); } /* Changed from green */
.bill-row.savings span { color: #d187db; } /* A slightly darker shade of purple for text visibility */
.bill-details-card hr { border: 0; border-top: 1px solid #f0f0f0; margin: 10px 0; }
.bill-row.grand-total { font-weight: 700; font-size: 14px; color: #000; margin-top: 5px; }

/* Cancellation Text */
.rahi-cancellation-text { background: #f0f2f5; padding: 15px; margin: 15px; border-radius: 8px; font-size: 11px; color: #777; line-height: 1.5; }
.rahi-cancellation-text strong { display: block; margin-bottom: 4px; color: #555; }

/* 5. Sticky Footer */
.rahi-cart-footer {
    position: fixed; bottom: 0; left: 0; right: 0; background: #fff;
    box-shadow: 0 -4px 15px rgba(0,0,0,0.08); z-index: 1000; padding: 12px 15px;
    border-radius: 16px 16px 0 0;
}

/* Address Strip */
.rahi-footer-address-strip {
    display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
}
.rf-icon { background: #f0f2f5; padding: 6px; border-radius: 6px; font-size: 16px; }
.rf-text { flex-grow: 1; display: flex; flex-direction: column; }
.rf-text strong { font-size: 12px; color: #000; }
.rf-text span { font-size: 11px; color: #777; }
.rf-change { font-size: 12px; color: #d187db; font-weight: 700; text-decoration: none; text-transform: uppercase; }

/* Purple Checkout Button */
.rahi-blinkit-checkout-btn {
    background-color: var(--primary-color); color: #333; width: 100%; border: none; border-radius: 12px;
    padding: 12px 16px; display: flex; justify-content: space-between; align-items: center;
    cursor: pointer; box-shadow: 0 4px 10px rgba(243, 186, 253, 0.4);
}
.rb-left { display: flex; flex-direction: column; align-items: flex-start; }
.rb-left span:first-child { font-size: 15px; font-weight: 700; line-height: 1.1; }
.rb-left .rb-label { font-size: 10px; opacity: 0.8; font-weight: 600; letter-spacing: 0.5px; }
.rb-right { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 5px; }

/* Loader */
.rahi-cart-loader-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(255, 255, 255, 0.7); z-index: 99999; justify-content: center; align-items: center; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.rahi-cart-spinner { border: 4px solid #fdf5ff; border-top: 4px solid var(--primary-color); border-radius: 50%; width: 40px; height: 40px; animation: spin 0.8s linear infinite; }

/* Empty Cart */
.rahi-cart-empty-container { text-align: center; padding: 50px 20px; }
.rahi-cart-empty-container p { font-size: 18px; font-weight: 600; margin: 20px 0; }