/* Overlay */
#side-cart-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0,0,0,0.5);
  display: none;
  z-index: 9998;
}

/* Cart drawer */
.side-cart {
  position: fixed;
  top: 0; right: -400px;
  width: 400px; height: 100%;
  background: #fff;
  box-shadow: -2px 0 10px rgba(0,0,0,0.2);
  display: flex;
  flex-direction: column;
  z-index: 9999;
  transition: right 0.3s ease;
}

.side-cart.open { right: 0; }
#side-cart-overlay.open { display: block; }

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

.side-cart-contents {
  flex: 1; overflow-y: auto; padding: 15px;
}

.side-cart-footer {
  border-top: 1px solid #ddd;
  padding: 15px;
  background: #fff;
  position: sticky;
  bottom: 0;
}

.side-cart-footer .btn {
  display: block;
  text-align: center;
  margin-top: 10px;
  padding: 12px;
  border-radius: 4px;
  font-weight: bold;
}
.checkout-btn { background: #000; color: #fff; }
.cart-btn { background: #f4f4f4; color: #000; }

/* Quantity buttons */
.qty-wrap {
  display: flex;
  align-items: center;
  border: 1px solid #ddd;
  border-radius: 4px;
  width: 100px;
}
.qty-wrap button {
  width: 30px; height: 30px;
  background: #f4f4f4;
  border: none;
  cursor: pointer;
  font-size: 18px;
}
.qty-wrap input {
  width: 40px;
  text-align: center;
  border: none;
}


/* Cart item row */
.cart-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 12px 10px;
  border-bottom: 1px solid #eee;
  font-family: Arial, sans-serif;
}

/* Product image */
.cart-item img {
  width: 60px;
  height: auto;
  border-radius: 6px;
  flex-shrink: 0;
}

/* Item details */
.cart-item .item-details {
  flex: 1;
  min-width: 0;
}

.cart-item h4 {
  font-size: 14px;
  font-weight: 500;
  margin: 0 0 6px;
  color: #333;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Qty wrap */
.qty-wrap {
  display: flex;
  align-items: center;
  gap: 5px;
}

.qty-wrap input.qty {
  width: 40px;
  text-align: center;
  border: 1px solid #ddd;
  border-radius: 4px;
  height: 28px;
  font-size: 14px;
}

.qty-btn {
  width: 28px;
  height: 28px;
  border: 1px solid #ddd;
  border-radius: 4px;
  background: #f8f8f8;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.2s;
}
.qty-btn:hover {
  background: #eaeaea;
}

/* Price */
.cart-item .price {
  font-size: 15px;
  font-weight: 600;
  color: #222;
  margin-left: 12px;
  white-space: nowrap;
}

/* Remove item button */
.cart-item .remove-item {
  margin-left: 10px;
  flex-shrink: 0;
}
.cart-item .remove-item img {
  width: 18px;
  height: 18px;
  opacity: 0.7;
  transition: opacity 0.2s;
}
.cart-item .remove-item:hover img {
  opacity: 1;
}
.cart-loader {
  display: none;
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(255,255,255,0.7);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
}

.cart-loader .spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #000;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Side-cart actions */
.side-cart-actions {
    display: flex;
    flex-direction: column;
    gap: 10px; /* 10px space between buttons */
}

.side-cart-actions .button.checkout {
    background: #000 !important; /* Black background */
    color: #fff !important;      /* White text */
    width: 100%;                 /* Full width */
    text-align: center;
    padding: 12px;
    border-radius: 4px;
}

.side-cart-actions .button.view-cart {
    background: #ccc !important; /* Light grey background */
    color: #222 !important;      /* Dark text */
    width: 100%;                 /* Full width */
    text-align: center;
    padding: 12px;
    border-radius: 4px;
}