/* General styles */
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
background-color: #f9f9f9;
}

main {
padding: 20px;
max-width: 1200px;
margin: 0 auto;
}

.cart-title {
text-align: center;
color: #dc3545;
font-size: 28px;
font-weight: bold;
margin-bottom: 20px;
text-transform: uppercase;
}

#cart-container {
background: #fff;
padding: 20px;
box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.1);
border-radius: 8px;
}

/* Flex container for items and summary */
.cart-content {
display: flex;
flex-wrap: wrap;
gap: 20px;
}

/* Cart Items Area */
.cart-items-area {
flex: 2 1 600px;
}

.cart-items {
display: flex;
flex-direction: column;
gap: 15px;
}

.cart-item {
border-bottom: 1px solid #ddd;
padding-bottom: 10px;
}

.item-row {
display: flex;
align-items: center;
gap: 20px;
flex-wrap: wrap;
}

/* Image styling */
.item-image {
width: 50px;
height: 50px;
object-fit: cover;
border-radius: 5px;
}

/* Product Name */
.item-name {
font-size: 16px;
font-weight: bold;
color: #333;
flex: 1;
}

/* Quantity Controls */
.item-quantity-control {
display: flex;
align-items: center;
gap: 5px;
}

.quantity-btn {
background: none;
border: 1px solid #dc3545;
color: #dc3545;
font-size: 20px;
font-weight: bold;
padding: 2px 8px;
cursor: pointer;
border-radius: 4px;
}

.item-quantity {
font-size: 16px;
font-weight: bold;
color: #333;
width: 30px;
text-align: center;
}

/* Fixed width for subtotal */
.item-total {
font-size: 16px;
font-weight: bold;
color: #333;
flex: 0 0 100px;
text-align: right;
}

/* Right-side Summary Area */
.cart-summary-right {
flex: 1 1 300px;
padding: 20px;
border: 1px solid #ddd;
border-radius: 8px;
height: fit-content;
}

.cart-summary-right .summary-box,
.cart-summary-right .shipping-box,
.cart-summary-right .final-total-box,
.cart-summary-right .discount-box {
margin-bottom: 20px;
}

.cart-summary-right .summary-title,
.cart-summary-right .final-title {
font-size: 16px;
font-weight: bold;
color: #333;
margin-bottom: 5px;
}

.cart-summary-right .summary-total,
.cart-summary-right .final-total {
font-size: 20px;
font-weight: bold;
color: #dc3545;
}

.shipping-box .summary-title {
font-size: 16px;
font-weight: bold;
color: #333;
margin-bottom: 5px;
}

.shipping-cost {
font-size: 18px;
font-weight: bold;
color: #333;
}

/* Free shipping style */
.shipping-cost.free {
color: #28a745;
}

.shipping-cost.free del {
color: #dc3545;
margin-right: 5px;
}

/* Discount Box */
.discount-box {
background-color: #f8d7da;
border: 1px solid #f5c6cb;
padding: 10px;
border-radius: 4px;
text-align: center;
display: none;
}
.discount-box .discount-amount {
font-size: 20px;
font-weight: bold;
color: #c82333;
}

/* Bonus Points Box */
.bonus-points-box {
background-color: #f1f1f1;
border: 1px dashed #dc3545;
padding: 10px;
margin-bottom: 20px;
text-align: center;
}
.bonus-points-box p:first-child {
font-size: 16px;
font-weight: bold;
margin-bottom: 5px;
}
.bonus-points-box p:last-child {
font-size: 18px;
font-weight: bold;
color: #28a745;
}

/* Checkout Button */
.checkout-button {
display: inline-block;
padding: 12px 24px;
font-size: 18px;
color: #fff;
background-color: #28a745;
border: none;
border-radius: 4px;
text-decoration: none;
text-align: center;
width: 100%;
}

.checkout-button:hover {
background-color: #218838;
}

/* Empty Cart Message */
.empty-cart {
text-align: center;
font-size: 16px;
color: #555;
}

/* Responsive Styles */
@media (max-width: 768px) {
.cart-content {
flex-direction: column;
}

.item-row {
flex-direction: column;
align-items: flex-start;
}

.item-quantity-control {
margin-top: 10px;
}

.item-total {
align-self: flex-end;
margin-top: 10px;
}
}

/************************************************


POPUP OVERLAY FOR "CART UPDATING" (Add below) ************************************************/ #cart-updating-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 9999; opacity: 0; pointer-events: none; transition: opacity 0.3s ease; }

#cart-updating-overlay.active {
opacity: 1;
pointer-events: auto;
}

#cart-updating-overlay .overlay-content {
background-color: #fff;
padding: 20px 30px;
border-radius: 8px;
text-align: center;
color: #333;
font-size: 18px;
}

#cart-updating-overlay .spinner {
margin: 10px auto 0;
width: 40px;
height: 40px;
border: 4px solid #999;
border-top: 4px solid #dc3545;
border-radius: 50%;
animation: spin 1s linear infinite;
}

@keyframes spin {
100% {
transform: rotate(360deg);
}
}