/* GrabNova — Dark deal-focused theme */

/* Smooth scrolling */
html {
  scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #0d0d1a;
}
::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* Hide horizontal scrollbar for category nav */
.scrollbar-hide::-webkit-scrollbar {
  display: none;
}
.scrollbar-hide {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Hero gradient */
.hero-gradient {
  background: linear-gradient(
    135deg,
    #0d0d1a 0%,
    #1a0a2e 25%,
    #2d1b4e 50%,
    #1a0a2e 75%,
    #0d0d1a 100%
  );
  position: relative;
}

.hero-gradient::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(255, 107, 53, 0.15) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 50%, rgba(230, 57, 70, 0.12) 0%, transparent 60%);
  pointer-events: none;
}

/* Hero glow effect */
.hero-glow {
  text-shadow: 0 0 40px rgba(255, 107, 53, 0.4), 0 0 80px rgba(255, 107, 53, 0.2);
}

/* Category buttons */
.cat-btn {
  background: rgba(255, 255, 255, 0.05);
  color: #9ca3af;
  border: 1px solid transparent;
}
.cat-btn:hover {
  background: rgba(255, 107, 53, 0.1);
  color: #ff6b35;
  border-color: rgba(255, 107, 53, 0.2);
}
.cat-btn.active {
  background: rgba(255, 107, 53, 0.15);
  color: #ff6b35;
  border-color: rgba(255, 107, 53, 0.4);
  font-weight: 600;
}

/* Product card */
.product-card {
  background: #1a1a2e;
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 1rem;
  overflow: hidden;
  transition: all 0.3s ease;
  position: relative;
}
.product-card:hover {
  transform: translateY(-4px);
  border-color: rgba(255, 107, 53, 0.3);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4), 0 0 20px rgba(255, 107, 53, 0.1);
}

.product-card .product-image-wrap {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: #16213e;
}
.product-card .product-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.product-card:hover .product-image-wrap img {
  transform: scale(1.08);
}

/* Discount badge */
.discount-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background: #e63946;
  color: white;
  font-weight: 800;
  font-size: 0.75rem;
  padding: 2px 8px;
  border-radius: 6px;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(230, 57, 70, 0.4);
}

/* Stock badge */
.stock-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255, 215, 0, 0.15);
  border: 1px solid rgba(255, 215, 0, 0.3);
  color: #ffd700;
  font-weight: 600;
  font-size: 0.65rem;
  padding: 2px 6px;
  border-radius: 20px;
  z-index: 2;
}

/* Sold count */
.sold-count {
  font-size: 0.7rem;
  color: #00c853;
  font-weight: 500;
}

/* Add to cart button on card */
.add-cart-btn {
  background: #ff6b35;
  color: white;
  border: none;
  padding: 8px 0;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  border-radius: 8px;
}
.add-cart-btn:hover {
  background: #e55a25;
  transform: scale(1.02);
}
.add-cart-btn:active {
  transform: scale(0.98);
}

/* Buy Now button on card (primary action) */
.buy-now-btn {
  background: #ff6b35;
  color: white;
  border: none;
  padding: 8px 0;
  font-weight: 700;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex: 1;
  border-radius: 8px;
}
.buy-now-btn:hover {
  background: #e55a25;
  transform: scale(1.02);
}
.buy-now-btn:active {
  transform: scale(0.98);
}
.buy-now-btn:disabled {
  opacity: 0.7;
  cursor: wait;
}

/* Add to cart secondary button (icon only) */
.add-cart-secondary-btn {
  background: rgba(255, 255, 255, 0.05);
  color: #ff6b35;
  border: 1px solid rgba(255, 107, 53, 0.3);
  padding: 8px 12px;
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  flex-shrink: 0;
}
.add-cart-secondary-btn:hover {
  background: rgba(255, 107, 53, 0.15);
  border-color: rgba(255, 107, 53, 0.5);
  transform: scale(1.05);
}
.add-cart-secondary-btn:active {
  transform: scale(0.95);
}

/* Pulse animation */
@keyframes pulse-slow {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.85; }
}
.animate-pulse-slow {
  animation: pulse-slow 2s ease-in-out infinite;
}

/* Bounce slow */
@keyframes bounce-slow {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.animate-bounce-slow {
  animation: bounce-slow 2s ease-in-out infinite;
}

/* Floating particles */
.particle {
  position: absolute;
  border-radius: 50%;
  opacity: 0.3;
  animation: float 8s ease-in-out infinite;
}
.particle-1 {
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, rgba(255, 107, 53, 0.3), transparent);
  top: -50px;
  left: 10%;
  animation-delay: 0s;
}
.particle-2 {
  width: 150px;
  height: 150px;
  background: radial-gradient(circle, rgba(230, 57, 70, 0.25), transparent);
  bottom: -30px;
  right: 15%;
  animation-delay: -3s;
}
.particle-3 {
  width: 100px;
  height: 100px;
  background: radial-gradient(circle, rgba(255, 215, 0, 0.2), transparent);
  top: 30%;
  right: 30%;
  animation-delay: -5s;
}

@keyframes float {
  0%, 100% { transform: translateY(0) translateX(0); }
  25% { transform: translateY(-20px) translateX(10px); }
  50% { transform: translateY(-10px) translateX(-10px); }
  75% { transform: translateY(-25px) translateX(5px); }
}

/* Confetti animation */
.confetti-dot {
  position: absolute;
  width: 8px;
  height: 8px;
  background: var(--color);
  border-radius: 50%;
  left: var(--x);
  top: 50%;
  animation: confetti-fall 1.5s ease-out var(--delay) infinite;
}

@keyframes confetti-fall {
  0% {
    transform: translateY(0) scale(0);
    opacity: 1;
  }
  100% {
    transform: translateY(100px) scale(1);
    opacity: 0;
  }
}

/* Line clamp */
.line-clamp-1 {
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Product card star rating */
.card-rating {
  font-size: 0.65rem;
  color: #ffd700;
  letter-spacing: -1px;
}

/* Shimmer loading effect */
@keyframes shimmer {
  0% { background-position: -200px 0; }
  100% { background-position: calc(200px + 100%) 0; }
}
.shimmer {
  background: linear-gradient(90deg, #1a1a2e 0%, #2a2a4e 50%, #1a1a2e 100%);
  background-size: 200px 100%;
  animation: shimmer 1.5s ease-in-out infinite;
}

/* Toast notification */
#addedToast.show {
  transform: translateY(0);
  opacity: 1;
}

/* Mobile optimizations */
@media (max-width: 640px) {
  .product-card .add-cart-btn {
    font-size: 0.7rem;
    padding: 6px 0;
  }
  .product-card .buy-now-btn {
    font-size: 0.7rem;
    padding: 6px 0;
  }
  .product-card .add-cart-secondary-btn {
    padding: 6px 10px;
    font-size: 0.75rem;
  }
}
