
/* Base Styles */
body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: #f8f9fa;
    padding-bottom: 120px; /* Space for fixed total */
}

.cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid #eee;
}

.cart-title {
    font-weight: 700;
    color: #2d3436;
    margin: 0;
}

/* Cart Items */
.cart-item {
    background: white;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    transition: transform 0.2s;
}

.cart-item:hover {
    transform: translateY(-2px);
}

.product-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
}

.product-name {
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: #2d3436;
    font-size: 1rem;
}

.product-meta {
    font-size: 0.9rem;
    color: #636e72;
}

.price {
    color: #00b894;
    font-weight: 600;
}

/* Quantity Controls */
.quantity-controls {
    display: inline-flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 2px;
}

.quantity-btn {
    border: none;
    background: none;
    width: 28px;
    height: 28px;
    font-size: 1.2rem;
    color: #636e72;
    cursor: pointer;
    transition: all 0.2s;
}

.quantity-btn:hover {
    background: #f8f9fa;
}

.quantity-input {
    width: 40px;
    border: none;
    text-align: center;
    font-weight: 500;
    pointer-events: none;
}

/* Delete Button */
.delete-btn {
    color: #ff7675;
    cursor: pointer;
    font-size: 1.5rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
}

.delete-btn:hover {
    color: #d63031;
}

/* Total Section */
.total-section {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    padding: 0.5rem;
    box-shadow: 0 -4px 20px rgba(0,0,0,0.1);
    border-radius: 16px 16px 0 0;
    z-index: 1000;
}

.total-line {
    font-size: 0.95rem;
    color: #555;
    margin: 0.5rem 0;
}

#delivery-charge {
    color: #00b894;
    font-weight: 500;
}

/* Coupon Section */
.coupon-section {
    background: #f0fff7;
    border: 1px solid #d1fae5;
    border-radius: 10px;
    padding: 0.75rem;
    margin: 1rem 0;
}

#show-coupons {
    color: #10b981 !important;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    display: block;
    text-decoration: none !important;
}

.coupon-item {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 0.75rem;
    margin: 0.5rem 0;
    transition: all 0.2s;
}

.apply-coupon {
    background: #10b981 !important;
    border: none !important;
    padding: 0.35rem 1rem !important;
    border-radius: 20px !important;
    font-size: 0.85rem !important;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Process to Pay Button */
#process-to-pay {
    background: #ff6b81;
    color: white !important;
    border: none;
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 700;
    width: 100%;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.total-amount {
    font-size: 1.25rem;
    font-weight: 800;
    color: #2d3436;
    margin: 1rem 0;
}

/* Address Section Adjustments */
#address-section {
    margin-bottom: 180px; /* Prevent overlap */
}

.address-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem;
    margin: 1rem 0;
}

.address-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 0.5rem;
    font-size: 0.9rem;
    color: #4a5568;
}

#edit-address-btn {
    background: #fff;
    border: 2px solid #ff6b81;
    color: #ff6b81;
    padding: 0.75rem;
    margin-top: 1rem;
    border-radius: 8px;
    font-weight: 600;
    width: 100%;
    transition: all 0.2s;
}

@media (max-width: 576px) {
    .total-section {
        padding: 1rem 0.75rem;
    }
    
    .total-amount {
        font-size: 1.1rem;
    }
    
    #process-to-pay {
        padding: 0.9rem;
        font-size: 0.95rem;
    }
    
    .address-details {
        grid-template-columns: 1fr;
    }
}

    /* Modal Styles */
    .modal {
        display: none;
        position: fixed;
        z-index: 1000;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        overflow: auto;
        background-color: rgba(0, 0, 0, 0.5);
        z-index:2000;
    }

    .modal-content {
        background-color: #fff;
        margin: 10% auto;
        padding: 20px;
        border: 1px solid #ddd;
        width: 90%;
        max-width: 600px;
        border-radius: 8px;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    }

    .close-modal {
        color: #aaa;
        float: right;
        font-size: 28px;
        font-weight: bold;
        cursor: pointer;
    }

    .close-modal:hover {
        color: #000;
    }

    /* Error Product Styles */
    .error-product {
        display: flex;
        align-items: center;
        margin-bottom: 15px;
        padding: 10px;
        border: 1px solid #eee;
        border-radius: 8px;
        background-color: #f9f9f9;
    }

    .modal-product-img {
        width: 60px;
        height: 60px;
        object-fit: cover;
        border-radius: 4px;
        margin-right: 15px;
    }

    .product-details {
        flex: 1;
    }

    .product-details .product-name {
        margin: 0;
        font-size: 16px;
        font-weight: 500;
        color: #333;
    }

    .product-details .quantity-info {
        margin: 5px 0;
        font-size: 14px;
        color: #666;
    }

    .action-buttons {
        display: flex;
        gap: 10px;
    }

    .action-buttons button {
        padding: 8px 12px;
        border: none;
        border-radius: 4px;
        cursor: pointer;
        font-size: 14px;
        transition: background-color 0.3s ease;
    }

    .remove-product-btn {
        background-color: #ff4d4d;
        color: #fff;
    }

    .remove-product-btn:hover {
        background-color: #e60000;
    }

    .edit-product-btn {
        background-color: #4CAF50;
        color: #fff;
    }

    .edit-product-btn:hover {
        background-color: #45a049;
    }

    /* Responsive Styles */
    @media (max-width: 600px) {
        .error-product {
            flex-direction: column;
            align-items: flex-start;
        }

        .modal-product-img {
            margin-bottom: 10px;
        }

        .action-buttons {
            width: 100%;
            justify-content: space-between;
        }

        .action-buttons button {
            width: 48%;
        }
    }
