/* Micro-interactions & Animations */

/* Keyframes definitions */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.95) translateY(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.03);
  }
  100% {
    transform: scale(1);
  }
}

@keyframes float {
  0% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-4px);
  }
  100% {
    transform: translateY(0px);
  }
}

@keyframes shimmer {
  0% {
    background-position: -200% 0;
  }
  100% {
    background-position: 200% 0;
  }
}

/* Card Entry Animations */
.menu-card {
  animation: fadeInUp 0.5s cubic-bezier(0.4, 0, 0.2, 1) both;
}

/* Stagger card loading via loop in JS or simple nth-child helpers */
.menu-card:nth-child(1) { animation-delay: 0.05s; }
.menu-card:nth-child(2) { animation-delay: 0.1s; }
.menu-card:nth-child(3) { animation-delay: 0.15s; }
.menu-card:nth-child(4) { animation-delay: 0.2s; }
.menu-card:nth-child(5) { animation-delay: 0.25s; }
.menu-card:nth-child(6) { animation-delay: 0.3s; }
.menu-card:nth-child(7) { animation-delay: 0.35s; }
.menu-card:nth-child(8) { animation-delay: 0.4s; }

/* Interactive Hover/Active Animations */
.category-item {
  transition: all var(--transition-normal);
}

.category-item:active,
.view-details-btn:active,
.modal-close-btn:active {
  transform: scale(0.95);
}

.badge-bestseller {
  animation: float 3s ease-in-out infinite;
}

/* Search Focus Glow */
.search-wrapper {
  transition: all var(--transition-normal);
}

/* Page entrance */
header, .search-container, .category-navbar {
  animation: fadeIn 0.8s ease-out both;
}

header { animation-delay: 0.05s; }
.search-container { animation-delay: 0.1s; }
.category-navbar { animation-delay: 0.15s; }

/* Modal Open Transitions */
.modal-overlay {
  transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal-container {
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@media screen and (min-width: 600px) {
  .modal-container {
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease;
  }
}

/* Shimmer Skeletal Loading Placeholder */
.skeleton {
  background: linear-gradient(90deg, #F0F0F0 25%, #E0E0E0 50%, #F0F0F0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* BOGO Pulsing Glow Animation */
@keyframes pulse-glow {
  0% {
    transform: scale(1);
    box-shadow: 0 2px 8px rgba(211, 47, 47, 0.4);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(211, 47, 47, 0.7);
  }
  100% {
    transform: scale(1);
    box-shadow: 0 2px 8px rgba(211, 47, 47, 0.4);
  }
}

.badge-bogo {
  animation: pulse-glow 2s infinite ease-in-out;
}
