/* =========================================
   Animations CSS
   ========================================= */

/* Fade In Up */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.05); }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-8px); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.animate-fade-up   { animation: fadeInUp 0.5s ease forwards; }
.animate-fade-in   { animation: fadeIn   0.4s ease forwards; }
.animate-scale-in  { animation: scaleIn  0.3s ease forwards; }
.animate-pulse     { animation: pulse    2s   ease-in-out infinite; }
.animate-float     { animation: float    3s   ease-in-out infinite; }

/* Staggered grid animations */
.products-grid .product-card:nth-child(1)  { animation: fadeInUp 0.4s ease 0.05s both; }
.products-grid .product-card:nth-child(2)  { animation: fadeInUp 0.4s ease 0.10s both; }
.products-grid .product-card:nth-child(3)  { animation: fadeInUp 0.4s ease 0.15s both; }
.products-grid .product-card:nth-child(4)  { animation: fadeInUp 0.4s ease 0.20s both; }
.products-grid .product-card:nth-child(5)  { animation: fadeInUp 0.4s ease 0.25s both; }
.products-grid .product-card:nth-child(6)  { animation: fadeInUp 0.4s ease 0.30s both; }
.products-grid .product-card:nth-child(7)  { animation: fadeInUp 0.4s ease 0.35s both; }
.products-grid .product-card:nth-child(8)  { animation: fadeInUp 0.4s ease 0.40s both; }

/* Category cards stagger */
.categories-grid .category-card:nth-child(1)  { animation: scaleIn 0.3s ease 0.05s both; }
.categories-grid .category-card:nth-child(2)  { animation: scaleIn 0.3s ease 0.10s both; }
.categories-grid .category-card:nth-child(3)  { animation: scaleIn 0.3s ease 0.15s both; }
.categories-grid .category-card:nth-child(4)  { animation: scaleIn 0.3s ease 0.20s both; }
.categories-grid .category-card:nth-child(5)  { animation: scaleIn 0.3s ease 0.25s both; }
.categories-grid .category-card:nth-child(6)  { animation: scaleIn 0.3s ease 0.30s both; }
.categories-grid .category-card:nth-child(7)  { animation: scaleIn 0.3s ease 0.35s both; }
.categories-grid .category-card:nth-child(8)  { animation: scaleIn 0.3s ease 0.40s both; }
.categories-grid .category-card:nth-child(9)  { animation: scaleIn 0.3s ease 0.45s both; }
.categories-grid .category-card:nth-child(10) { animation: scaleIn 0.3s ease 0.50s both; }
.categories-grid .category-card:nth-child(11) { animation: scaleIn 0.3s ease 0.55s both; }
.categories-grid .category-card:nth-child(12) { animation: scaleIn 0.3s ease 0.60s both; }

/* Cart slide-in */
.cart-item { animation: fadeInUp 0.3s ease both; }

/* Spinner */
.spinner {
  width: 32px; height: 32px; border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}

/* Page loading */
.page-loader {
  position: fixed; inset: 0; background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  z-index: 99999; transition: opacity 0.3s, visibility 0.3s;
}
.page-loader.hidden { opacity: 0; visibility: hidden; }
.page-loader-inner { text-align: center; }
.page-loader .logo-icon { font-size: 3rem; margin-bottom: 16px; animation: float 2s ease-in-out infinite; }
.page-loader p { color: var(--text-muted); font-size: 14px; margin-top: 12px; }

/* Hover ripple on buttons */
.btn { position: relative; overflow: hidden; }
.btn::after {
  content: '';
  position: absolute; inset: 0;
  background: rgba(255,255,255,0.1);
  opacity: 0; border-radius: inherit;
  transition: opacity 0.2s;
}
.btn:hover::after { opacity: 1; }
.btn:active::after { opacity: 0.2; }

/* Glow effect for primary btn */
.btn-primary:hover {
  box-shadow: 0 8px 30px rgba(192,57,43,0.6), 0 0 0 1px rgba(192,57,43,0.4);
}
.btn-gold:hover {
  box-shadow: 0 8px 30px rgba(212,175,55,0.5), 0 0 0 1px rgba(212,175,55,0.3);
}
