/* ============================================
   ANIMATIONS - Transitions & Animations
   ============================================ */

/* Fade In */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Page load animation */
.main-content {
  animation: fadeIn 0.4s ease;
}

/* Staggered grid items */
.product-grid .product-card {
  animation: fadeInUp 0.5s ease both;
}

.product-grid .product-card:nth-child(1) { animation-delay: 0.05s; }
.product-grid .product-card:nth-child(2) { animation-delay: 0.1s; }
.product-grid .product-card:nth-child(3) { animation-delay: 0.15s; }
.product-grid .product-card:nth-child(4) { animation-delay: 0.2s; }
.product-grid .product-card:nth-child(5) { animation-delay: 0.25s; }
.product-grid .product-card:nth-child(6) { animation-delay: 0.3s; }
.product-grid .product-card:nth-child(7) { animation-delay: 0.35s; }
.product-grid .product-card:nth-child(8) { animation-delay: 0.4s; }

/* Category tiles */
.home-categories__item {
  animation: fadeInUp 0.4s ease both;
}

.home-categories__item:nth-child(1) { animation-delay: 0.05s; }
.home-categories__item:nth-child(2) { animation-delay: 0.1s; }
.home-categories__item:nth-child(3) { animation-delay: 0.15s; }
.home-categories__item:nth-child(4) { animation-delay: 0.2s; }
.home-categories__item:nth-child(5) { animation-delay: 0.25s; }

/* Dropdown animation */
.header-nav__category .dropdown {
  animation: fadeInDown 0.2s ease;
}

/* Image lazy load transition */
.product-card__img,
.product-gallery__main img {
  transition: opacity var(--transition-base);
}

/* Lazy load transition handled by browser natively */

/* Button press effect */
.btn:active {
  transform: scale(0.97);
}

/* Smooth focus outline */
*:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  *,*::before,*::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
