/* ===== CART STYLES ===== */
/* Cart Styling - Consolidated */
.cart-indicator {
  position: fixed;
  top: 120px;
  right: 20px;
  background: var(--color-primary);
  color: white;
  padding: 12px 18px;
  border-radius: 25px;
  cursor: pointer;
  z-index: 1000;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: top 0.3s ease-in-out;
  box-shadow: var(--shadow-md);
  font-weight: 600;
  border: 2px solid var(--color-secondary);
  font-family: "Comic Neue", cursive, sans-serif;
  max-width: 200px;
}

.cart-indicator:hover {
  background: var(--color-secondary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.cart-indicator.sticky {
  top: 20px; /* Stick to top when scrolled - for ALL screens */
}

/* Mobile sticky cart - ALWAYS STICKY */
@media (max-width: 1024px) {
  .cart-indicator {
    top: 10%; /* Always sticky and closer to top */
    right: 15px;
    padding: 10px 15px;
    max-width: 160px;
    z-index: 1002;
  }
}

/* Smaller mobile adjustments */
@media (max-width: 768px) {
  .cart-indicator {
    top: 12px;
    right: 12px;
    padding: 8px 12px;
    font-size: 0.9rem;
    max-width: 140px;
  }
}

@media (max-width: 550px) {
  .cart-indicator {
    top: 10px;
    right: 10px;
    padding: 6px 10px;
    font-size: 0.85rem;
    max-width: 130px;
  }
}

@media (max-width: 420px) {
  .cart-indicator {
    top: 8px;
    right: 8px;
    padding: 5px 8px;
    font-size: 0.8rem;
    max-width: 120px;
  }
}

.cart-count {
  background: white;
  color: var(--color-primary);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9em;
  font-weight: bold;
}

.cart-count.pulse {
  animation: cartPulse 0.6s ease-in-out;
}

/* Cart Dropdown */
.cart-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 10px;
  background: white;
  border-radius: 15px;
  box-shadow: var(--shadow-lg);
  border: 2px solid var(--color-secondary);
  max-width: 40vw;
  min-width: 350px;
  max-height: 70vh;
  min-height: 200px;
  overflow-y: auto;
  z-index: 1001;
  display: none;
}

.cart-dropdown.active {
  display: block;
  animation: slideDown 0.3s ease-out;
}

.cart-dropdown-content {
  padding: var(--space-md);
  min-height: 150px;
  display: flex;
  flex-direction: column;
}

.cart-dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid #eee;
  max-height: calc(70vh - 150px);
}

.cart-dropdown-item:last-child {
  border-bottom: none;
}

.cart-dropdown-item img {
  width: 40%;
  height: auto;
  object-fit: contain;
  border-radius: 5px;
  flex-shrink: 0;
}

.cart-dropdown-item-info {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.cart-dropdown-item-name {
  color: var(--color-primary);
  font-weight: bold;
  margin-bottom: 4px;
  font-size: 0.95rem;
}

.cart-dropdown-item-price {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.cart-dropdown-remove {
  background: var(--color-accent);
  color: white;
  border: none;
  padding: 4px 8px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.8rem;
  transition: all var(--transition-normal);
}

.cart-dropdown-remove:hover {
  background: #e84393;
}

.cart-dropdown-empty {
  text-align: center;
  padding: var(--space-lg);
  color: var(--text-secondary);
}

.cart-dropdown-total {
  padding: var(--space-md);
  border-top: 2px solid var(--color-secondary);
  background: var(--color-dark);
  font-weight: bold;
  color: var(--color-primary);
}

.cart-dropdown-checkout {
  display: block;
  width: 100%;
  padding: var(--space-md);
  background: var(--color-primary);
  color: white;
  text-align: center;
  text-decoration: none;
  border: none;
  border-radius: 0 0 13px 13px;
  font-weight: bold;
  cursor: pointer;
  transition: all var(--transition-normal);
  font-family: "Comic Neue", cursive, sans-serif;
}

.cart-dropdown-checkout:hover {
  background: var(--color-secondary);
}

/* Quantity Controls - Consolidated */
.quantity-selector,
.cart-dropdown-item-quantity-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
  background: rgba(255, 255, 255, 0.95);
  padding: var(--space-sm);
  border-radius: 25px;
  box-shadow: var(--shadow-sm);
}

.quantity-btn {
  background: var(--color-primary);
  color: white;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.2rem;
  font-weight: bold;
  transition: all var(--transition-normal);
  font-family: "Comic Neue", cursive, sans-serif;
}

.quantity-btn:hover {
  background: var(--color-secondary);
  transform: scale(1.1);
}

.quantity-display {
  font-weight: bold;
  color: var(--color-primary);
  font-size: 1.1rem;
  min-width: 30px;
  text-align: center;
  padding: 4px 12px;
  border-radius: 4px;
  background: var(--color-light);
  border: 1px solid #ddd;
}

/* Cart page styles */
.checkout-container {
  max-width: 800px;
  margin: 140px auto 40px;
  padding: 0 var(--space-lg);
}

.cart-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md);
  background: white;
  border-radius: 10px;
  margin-bottom: var(--space-md);
  box-shadow: var(--shadow-sm);
  border: 2px solid var(--color-secondary);
}

.cart-item img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  border-radius: 5px;
}

.cart-item-info {
  flex-grow: 1;
}

.cart-item h3 {
  color: var(--color-primary);
  margin-bottom: var(--space-xs);
}

.cart-item p {
  color: var(--text-secondary);
  margin-bottom: var(--space-xs);
}

.empty-cart {
  text-align: center;
  padding: var(--space-xl);
  background: white;
  border-radius: 15px;
  box-shadow: var(--shadow-md);
  border: 2px solid var(--color-secondary);
}

.empty-cart p {
  color: var(--text-secondary);
  margin-bottom: var(--space-lg);
  font-size: 1.2rem;
}

/* Image Fallback Styles */
.image-fallback {
  display: none;
  width: 50px;
  height: 50px;
  background: #f0f0f0;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  font-size: 20px;
}

.image-fallback.show {
  display: flex;
}

/* Theme-aware fallback styles */
body.dark-mode .image-fallback {
  background: #3d3d3d;
  color: var(--color-dark);
}

/* Dark mode support */
body.dark-mode .cart-dropdown-item {
  border-bottom-color: #555;
}

body.dark-mode .quantity-display {
  background: #3d3d3d;
  color: var(--color-dark);
  border-color: #666;
}

body.dark-mode .cart-dropdown {
  background: var(--color-light);
  border-color: #555;
}

body.dark-mode .cart-dropdown-item-info {
  color: var(--color-dark);
}

body.dark-mode .cart-dropdown-item-name {
  color: var(--color-secondary);
}

body.dark-mode .cart-dropdown-item-price {
  color: var(--text-secondary);
}

body.dark-mode .cart-dropdown-total {
  background: #3d3d3d;
  border-top-color: #555;
  color: var(--color-dark);
}

body.dark-mode .cart-dropdown-empty {
  color: var(--text-secondary);
}

/* ===== CART NOTIFICATION STYLES ===== */
/* Cart Notification - Left Side (for cart system notifications) */
#cart-notification {
  position: fixed;
  top: 25vh;
  left: 20px;
  background: var(--notification-bg, #10b981);
  color: var(--notification-text, white);
  padding: 15px 20px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  z-index: 10000;
  transform: translateX(-400px);
  transition: transform 0.3s ease, opacity 0.3s ease;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  max-width: 300px;
  border: 1px solid var(--notification-border, transparent);
  opacity: 0;
}

/* Dark mode support for notifications */
body.dark-mode #cart-notification {
  --notification-bg: #059669;
  --notification-text: #ffffff;
  --notification-border: #047857;
}

/* Warning and error states */
#cart-notification.warning {
  background: #f59e0b !important;
}

#cart-notification.error {
  background: #ef4444 !important;
}

body.dark-mode #cart-notification.warning {
  background: #d97706 !important;
}

body.dark-mode #cart-notification.error {
  background: #dc2626 !important;
}

@media (max-width: 375px) {
  body.our-stickers-page .cart-dropdown {
    right: -15px;
  }
  .cart-dropdown {
    margin-left: 25%;
  }
}

/* Cart-specific animations */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes cartPulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.3);
  }
}
