/* Cart Modal Styles */
#cartModal.modal {
  position: fixed;
  inset: 0;
  display: none;
  z-index: 1050;
}

#cartModal.modal.show { 
  display: block; 
}

/* Backdrop via pseudo-element */
#cartModal.modal::before {
  content: "";
  position: absolute; 
  inset: 0;
  background: rgba(0,0,0,0.45);
}

/* Right-side panel */
#cartModal .modal-content {
  position: absolute;
  top: 0; 
  right: 0; 
  height: 100%;
  width: 380px; 
  max-width: 90vw;
  background: #fff; 
  overflow: auto;
  transform: translateX(100%);
  transition: transform .25s ease;
  box-shadow: 0 0 24px rgba(0,0,0,0.2);
}

#cartModal.modal.show .modal-content { 
  transform: translateX(0); 
}

.modal-header, .modal-body { 
  padding: 16px; 
}

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

.modal-close { 
  background: none; 
  border: 0; 
  font-size: 24px; 
  line-height: 1; 
  cursor: pointer; 
}

/* Cart Items */
.cart-items {
  padding: 20px;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px 0;
  border-bottom: 1px solid #eee;
}

.cart-item:last-child {
  border-bottom: none;
}

.cart-item-details {
  flex: 1;
}

.cart-item-name {
  font-weight: 600;
  margin-bottom: 5px;
}

.cart-item-price {
  color: #666;
  font-size: 14px;
}

.cart-quantity {
  display: flex;
  align-items: center;
  gap: 10px;
}

.quantity-btn {
  width: 30px;
  height: 30px;
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 5px;
  cursor: pointer;
  transition: all 0.2s;
}

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

.cart-remove {
  cursor: pointer;
  font-size: 18px;
  opacity: 0.7;
  transition: opacity 0.2s;
}

.cart-remove:hover {
  opacity: 1;
}

/* Cart Footer */
.cart-footer {
  position: sticky;
  bottom: 0;
  background: #fff;
  border-top: 2px solid #eee;
  padding: 20px;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 15px;
}

.checkout-btn {
  width: 100%;
  padding: 15px;
  background: #d35400;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s;
}

.checkout-btn:hover {
  background: #a84100;
}

/* Empty Cart */
.empty-cart {
  text-align: center;
  padding: 40px 20px;
}

.empty-cart p {
  color: #666;
  margin-bottom: 20px;
}

/* Loading Spinner */
.loading-spinner {
  text-align: center;
  padding: 40px;
  color: #666;
}