/* Floating Cart Styles */
.floating-cart {
  position: fixed;
  bottom: 100px;
  right: 20px;
  z-index: 99998; /* Below modals but above content, and below Tawk.to (99999) */
  animation: slideInRight 0.3s ease-out;
  cursor: grab;
  transition: transform 0.1s ease-out;
}

.floating-cart.dragging {
  cursor: grabbing;
  opacity: 0.9;
  transition: none;
}

/* Responsive positioning to avoid Tawk.to widget */
@media (max-width: 768px) {
  .floating-cart {
    bottom: 85px; /* Higher position on mobile to avoid Tawk.to */
    right: 15px;
  }
}

@media (max-width: 480px) {
  .floating-cart {
    bottom: 75px;
    right: 12px;
  }
}

.floating-cart-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.4), 0 2px 4px rgba(0, 0, 0, 0.1);
  color: white;
  text-decoration: none;
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: auto;
}

@media (max-width: 480px) {
  .floating-cart-link {
    width: 52px;
    height: 52px;
  }
}

.floating-cart-link:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 20px rgba(220, 38, 38, 0.5), 0 4px 8px rgba(0, 0, 0, 0.15);
}

.floating-cart-link:active {
  transform: translateY(-1px) scale(1.02);
}

.floating-cart-link i {
  font-size: 24px;
  position: relative;
  z-index: 1;
}

@media (max-width: 480px) {
  .floating-cart-link i {
    font-size: 20px;
  }
}

/* Cart badge with count */
.floating-cart-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #fbbf24;
  color: #78350f;
  font-size: 11px;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  padding: 0 6px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  border: 2px solid white;
  z-index: 2;
  line-height: 1;
}

@media (max-width: 480px) {
  .floating-cart-badge {
    font-size: 10px;
    min-width: 18px;
    height: 18px;
    top: -3px;
    right: -3px;
  }
}

/* Drag hint indicator */
.floating-cart-drag-hint {
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.6);
  color: white;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 8px;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: auto;
  cursor: grab;
  white-space: nowrap;
}

.floating-cart:hover .floating-cart-drag-hint {
  opacity: 1;
}

.floating-cart.dragging .floating-cart-drag-hint {
  cursor: grabbing;
}

/* Pulse animation for cart updates */
@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.2);
  }
}

.pulse-animation {
  animation: pulse 0.5s ease-in-out;
}

/* Slide in animation */
@keyframes slideInRight {
  from {
    transform: translateX(100px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* Bounce effect on hover */
.floating-cart-link:hover .floating-cart-badge {
  animation: bounce 0.6s ease-in-out;
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

/* Ripple effect on click */
.floating-cart-link::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.floating-cart-link:active::before {
  width: 100%;
  height: 100%;
}

/* Hide on cart page */
body.cart-page .floating-cart,
body[class*="cart.html"] .floating-cart {
  display: none;
}

/* Ensure it doesn't overlap with Tawk.to widget */
@media (min-width: 769px) {
  /* Desktop: Tawk.to is usually bottom-right, so position cart higher */
  .floating-cart {
    bottom: 100px; /* Above Tawk.to */
  }
}

/* Print mode - hide floating cart */
@media print {
  .floating-cart {
    display: none !important;
  }
}

/* Accessibility - focus states */
.floating-cart-link:focus {
  outline: 3px solid #fbbf24;
  outline-offset: 2px;
}

.floating-cart-link:focus:not(:focus-visible) {
  outline: none;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .floating-cart-link {
    border: 2px solid currentColor;
  }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
  .floating-cart,
  .floating-cart-link,
  .floating-cart-badge,
  .floating-cart-drag-hint {
    animation: none !important;
    transition: none !important;
  }
}

