/* === Cart Page Container & General Styling === */
#cart-container {
    max-width: 900px;
    margin: 2rem auto; /* Added top/bottom margin for breathing room */
    background: #ffffff;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); /* Lighter, modern shadow */
}

/* --- Cart Item Grid Layout --- */

/* Base grid styles for desktop */
.cart-header,
.cart-row {
    /* Image | Product (2fr) | Price (1fr) | Quantity (1.5fr) | Subtotal/Remove (1.5fr) */
    display: grid;
    grid-template-columns: 80px 2fr 1fr 1.5fr 1.5fr;
    align-items: center;
    gap: 15px; /* Increased gap for better spacing */
    padding: 15px 0;
    border-bottom: 1px solid #eee;
    font-size: 0.95rem;
}

.cart-header {
    font-weight: 700;
    font-size: 1rem;
    color: #333;
    border-bottom: 2px solid #0077ff; /* Primary color separator */
    margin-bottom: 5px;
    padding-bottom: 10px;
}

/* Image Styling */
.cart-img img {
    width: 70px; /* Slightly larger image */
    height: 70px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.cart-name {
    font-weight: 600;
    color: #333;
}

.cart-price,
.cart-subtotal {
    text-align: right;
    color: #555;
}

/* Quantity Controls Styling */
.cart-quantity {
    display: flex;
    align-items: center;
    justify-content: flex-end; /* Align controls to the right of the column */
    gap: 5px;
}

.cart-quantity input {
    width: 45px;
    padding: 6px;
    font-size: 0.9rem;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 4px;
}

.qty-increase,
.qty-decrease {
    padding: 6px 10px;
    font-size: 0.9rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    background: #0077ff;
    color: #fff;
    transition: background 0.2s;
}

.qty-increase:hover,
.qty-decrease:hover {
    background: #005bbb;
}

.remove-btn {
    background: #e74c3c; /* A slightly softer red */
    color: #fff;
    padding: 6px 10px;
    margin-left: 10px; /* Space from quantity controls */
    border-radius: 4px;
    transition: background 0.2s;
    white-space: nowrap; /* Prevent button text from wrapping */
}

.remove-btn:hover {
    background: #c0392b;
}

/* --- Total Section --- */
#cart-total {
    font-weight: 700;
    font-size: 1.4rem;
    text-align: right;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 2px solid #eee;
    color: #000 !important; /* ✅ Ensures total is visible on white */
}

/* === Checkout Form Styling === */
#checkout-form {
    margin: 30px auto 0; /* Centered and spaced from total */
    padding: 25px;
    border-radius: 12px;
    background-color: #f9f9f9;
    max-width: 500px; /* Kept form width constrained for readability */
}

#checkout-form h3 {
    margin-bottom: 20px;
    font-size: 1.5rem;
    color: #0077ff;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
}

#checkout-form label {
    display: block;
    margin-bottom: 15px;
    font-size: 0.95rem;
    font-weight: 500;
}

#form-checkout input,
#form-checkout textarea,
#form-checkout select {
    width: 100%;
    padding: 12px;
    margin-top: 5px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
    box-sizing: border-box;
}

#form-checkout button[type="submit"] {
    margin-top: 20px;
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 8px;
    background: #2ecc71; /* A friendly green for checkout */
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.3s;
}

#form-checkout button[type="submit"]:hover {
    background: #27ae60;
}

/* --- Mobile Responsiveness (Adjusting columns for smaller screens) --- */
@media (max-width: 768px) {
    #cart-container {
        padding: 1rem;
        margin: 1rem auto;
    }

    .cart-header,
    .cart-row {
        grid-template-columns: 80px 1fr; 
        gap: 5px 10px;
        padding: 15px 0;
    }

    .cart-name {
        grid-column: 2 / 3;
        grid-row: 1 / 2;
        font-size: 1rem;
    }

    .cart-img {
        grid-column: 1 / 2;
        grid-row: 1 / 4;
    }

    .cart-price,
    .cart-subtotal {
        grid-column: 2 / 3;
        text-align: left;
        font-size: 0.95rem;
        margin-top: 5px;
    }

    .cart-quantity {
        grid-column: 2 / 3;
        justify-content: flex-start;
        margin-top: 10px;
    }
    
    .remove-btn {
        grid-column: 1 / 3;
        margin-left: 0;
        margin-top: 10px;
        width: 100%; 
    }

    #cart-total {
        text-align: left;
    }
}

/* === ✅ FIXES === */

/* 1. Make form text visible on white background */
#checkout-form input,
#checkout-form select,
#checkout-form textarea {
    color: #000 !important;
    background-color: #fff !important;
    border: 1px solid #ccc;
}

#checkout-form input::placeholder,
#checkout-form textarea::placeholder {
    color: #666 !important;
}

#checkout-form label {
    color: #000 !important;
}

/* 2. ✅ Ensure cart total text is visible even if theme scripts override it */
#cart-total,
#cart-total * {
    color: #000 !important;
}

/* === Terms & Conditions Styling Fix === */
.terms-box {
    display: flex;
    align-items: center;
    gap: 8px; /* Small gap between checkbox and text */
    font-size: 0.95rem;
    margin-top: 10px;
    flex-wrap: wrap; /* Prevent text from overflowing */
}

.terms-box input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0; /* Remove default spacing */
    vertical-align: middle;
    accent-color: #ff5b00; /* checkbox color for modern browsers */
}

.terms-box label {
    margin: 0; 
    line-height: 1.4; /* keep text vertically aligned with checkbox */
    color: #000 !important;
}

.terms-box label a {
    color: #0077ff;
    text-decoration: underline;
    font-weight: 500;
}

