cart.css 2.56 KB
.cart-sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  display: flex;
  justify-content: flex-end;
}

.cart-sidebar {
  width: 400px;
  max-width: 90vw;
  height: 100%;
  background: white;
  display: flex;
  flex-direction: column;
  animation: slideIn 0.3s ease;
}

@keyframes slideIn {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

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

.close-button {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0.5rem;
}

.cart-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.empty-cart {
  text-align: center;
  padding: 2rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
}

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

.item-image img {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 4px;
}

.item-details {
  flex: 1;
}

.item-name h4 {
  margin: 0;
  font-size: 0.9rem;
}

.item-category {
  color: #666;
  font-size: 0.8rem;
  margin: 0.25rem 0;
}

.item-price {
  font-weight: bold;
  color: #007bff;
}

.item-quantity {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.item-quantity button {
  width: 30px;
  height: 30px;
  border: 1px solid #ddd;
  background: white;
  display: flex;
  align-items: center;
  justify-content: center;
}

.item-quantity button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.item-subtotal {
  font-weight: bold;
  min-width: 80px;
  text-align: right;
}

.remove-button {
  background: #dc3545;
  color: white;
  border: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-size: 0.8rem;
}

.cart-footer {
  padding: 1rem;
  border-top: 1px solid #eee;
}

.cart-total {
  text-align: center;
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

.cart-actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.view-cart-button,
.checkout-button {
  display: block;
  text-align: center;
  padding: 0.75rem;
  border-radius: 4px;
  text-decoration: none;
}

.view-cart-button {
  background: #6c757d;
  color: white;
}

.checkout-button {
  background: #28a745;
  color: white;
}

.continue-shopping {
  color: #007bff;
  text-decoration: none;
  margin-top: 1rem;
  display: inline-block;
}