/* Shopping Cart Styles - Matches existing design */

/* Cart Drawer */
.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1000;
  transition: opacity 0.3s ease;
}

.cart-drawer.hidden {
  display: none;
}

.cart-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  cursor: pointer;
}

.cart-content {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 480px;
  background: white;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  animation: slideIn 0.3s ease;
}

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

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

.cart-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #6b7280;
  padding: 0.5rem;
  transition: color 0.2s;
}

.cart-close:hover {
  color: #111827;
}

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

.cart-footer {
  padding: 1.5rem;
  border-top: 1px solid #e5e7eb;
  background: #f9fafb;
}

/* Cart Items */
.cart-item {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid #e5e7eb;
}

.cart-item:first-child {
  padding-top: 0;
}

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

.cart-item-image {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 0.5rem;
}

.cart-item-details h3 {
  font-size: 1rem;
  margin-bottom: 0.25rem;
  color: #111827;
}

.cart-item-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.5rem;
}

.quantity-input {
  width: 60px;
  padding: 0.25rem 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  text-align: center;
}

.remove-item-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.25rem;
  transition: transform 0.2s;
}

.remove-item-btn:hover {
  transform: scale(1.1);
}

/* Cart Badge */
.cart-badge {
  position: fixed;
  top: 1rem;
  right: 1rem;
  background: #0284c7;
  color: white;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: bold;
  cursor: pointer;
  z-index: 999;
  box-shadow: 0 2px 8px rgba(2, 132, 199, 0.3);
}

/* Cart Toast Notification */
.cart-toast {
  position: fixed;
  top: 5rem;
  right: 1rem;
  background: #10b981;
  color: white;
  padding: 1rem 1.5rem;
  border-radius: 0.5rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  z-index: 1001;
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s ease;
}

.cart-toast.show {
  opacity: 1;
  transform: translateX(0);
}

/* Add to Cart Button */
.add-to-cart-btn {
  margin-bottom: 0.75rem;
}

/* Coupon Section */
.coupon-section label {
  color: #374151;
}

.coupon-section input {
  font-size: 0.875rem;
}

.coupon-section input:focus {
  outline: none;
  border-color: #0284c7;
  ring: 2px;
  ring-color: rgba(2, 132, 199, 0.2);
}

/* Cart Totals */
.cart-totals {
  font-size: 0.875rem;
}

.cart-totals > div {
  color: #374151;
}

/* Focus Styles for Accessibility */
.cart-close:focus,
.remove-item-btn:focus,
.quantity-input:focus,
#apply-coupon-btn:focus,
#checkout-btn:focus {
  outline: 2px solid #0284c7;
  outline-offset: 2px;
}

/* Mobile Responsive */
@media (max-width: 640px) {
  .cart-content {
    max-width: 100%;
  }
  
  .cart-item {
    grid-template-columns: 60px 1fr auto;
  }
  
  .cart-item-image {
    width: 60px;
    height: 60px;
  }
}

/* Image Loading States */
.image-loading {
  position: relative;
  background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.8;
  }
}

.image-loaded {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* Focus Visible (Keyboard Navigation) */
.focus-visible:focus {
  outline: 2px solid #0284c7;
  outline-offset: 2px;
}

/* Skip to Content Link */
.skip-to-content:focus {
  position: absolute;
  left: 1rem !important;
  top: 1rem;
  z-index: 999;
}

/* Hide SumUp's built-in submit button - we use our custom blue button */
#sumup-card button[type="submit"],
#sumup-card button[type="button"] {
  display: none !important;
}

/* Ensure SumUp card form has proper spacing without the button */
#sumup-card {
  margin-bottom: 1rem;
}
