/* ============================================
   DIARIOLAPALABRA - ANIMATIONS CSS
   ============================================ */

/* ============================================
   KEYFRAME ANIMATIONS
   ============================================ */

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

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

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

@keyframes fadeInLeft {
  from { opacity: 0; transform: translateX(-40px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes fadeInRight {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.85); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes slideInUp {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 0 rgba(211, 47, 47, 0.4);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 0 12px rgba(211, 47, 47, 0);
  }
}

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

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

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

@keyframes bounceIn {
  0% { transform: scale(0.3); opacity: 0; }
  50% { transform: scale(1.05); }
  70% { transform: scale(0.9); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes ripple {
  0% { transform: scale(0); opacity: 1; }
  100% { transform: scale(2.5); opacity: 0; }
}

@keyframes typing {
  0%, 20% { content: ''; }
  40% { content: '.'; }
  60% { content: '..'; }
  80%, 100% { content: '...'; }
}

@keyframes cartBounce {
  0%, 100% { transform: scale(1); }
  25% { transform: scale(1.3) rotate(-10deg); }
  50% { transform: scale(1.1) rotate(5deg); }
  75% { transform: scale(1.2) rotate(-5deg); }
}

@keyframes progressFill {
  from { width: 0%; }
  to { width: var(--target-width, 100%); }
}

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

@keyframes heroZoom {
  0% { transform: scale(1); }
  100% { transform: scale(1.05); }
}

@keyframes borderDraw {
  from { clip-path: inset(0 100% 0 0); }
  to { clip-path: inset(0 0% 0 0); }
}

/* ============================================
   HERO ANIMATION
   ============================================ */
.hero-bg {
  animation: heroZoom 12s ease-in-out infinite alternate;
}

.hero-badge {
  animation: fadeInDown 0.6s ease both;
}

.hero h1 {
  animation: fadeInUp 0.7s ease 0.1s both;
}

.hero p {
  animation: fadeInUp 0.7s ease 0.2s both;
}

.hero-cta {
  animation: fadeInUp 0.7s ease 0.3s both;
}

/* ============================================
   TRUST BAR ANIMATION
   ============================================ */
.trust-item {
  animation: fadeInUp 0.5s ease both;
}

.trust-item:nth-child(1) { animation-delay: 0.05s; }
.trust-item:nth-child(2) { animation-delay: 0.1s; }
.trust-item:nth-child(3) { animation-delay: 0.15s; }
.trust-item:nth-child(4) { animation-delay: 0.2s; }

/* ============================================
   SECTION REVEAL ON SCROLL
   ============================================ */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.65s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.65s cubic-bezier(0.4, 0, 0.2, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-left {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.reveal-left.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-right {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.reveal-right.visible {
  opacity: 1;
  transform: translateX(0);
}

.reveal-scale {
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.reveal-scale.visible {
  opacity: 1;
  transform: scale(1);
}

/* Stagger delays */
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }
.reveal-delay-5 { transition-delay: 0.5s; }

/* ============================================
   CARD HOVER EFFECTS
   ============================================ */
.pizza-card,
.menu-item-card,
.review-card,
.location-card,
.team-card {
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
              box-shadow 0.3s ease;
}

/* ============================================
   BUTTON CLICK RIPPLE
   ============================================ */
.btn {
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.4s ease, height 0.4s ease, opacity 0.4s ease;
  opacity: 0;
}

.btn:active::after {
  width: 200px;
  height: 200px;
  opacity: 0;
}

/* ============================================
   CART BUTTON BOUNCE
   ============================================ */
.cart-bounce {
  animation: cartBounce 0.5s ease;
}

/* ============================================
   LOADING SKELETON
   ============================================ */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--gray-100) 25%,
    var(--gray-200) 50%,
    var(--gray-100) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

/* ============================================
   ADD TO CART SUCCESS ANIMATION
   ============================================ */
.add-success {
  animation: bounceIn 0.4s ease;
}

/* ============================================
   NOTIFICATION TOAST
   ============================================ */
.toast {
  position: fixed;
  top: calc(var(--nav-height) + 16px + env(safe-area-inset-top));
  right: 24px;
  background: var(--gray-900);
  color: white;
  padding: 14px 20px;
  border-radius: var(--radius-lg);
  font-size: 14px;
  font-weight: 600;
  box-shadow: var(--shadow-xl);
  z-index: 9998;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 320px;
  animation: slideInUp 0.3s ease;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast.success {
  background: #1B5E20;
  border-left: 4px solid var(--accent);
}

.toast.error {
  background: #B71C1C;
  border-left: 4px solid var(--primary-light);
}

.toast.hiding {
  opacity: 0;
  transform: translateY(-10px);
}

/* ============================================
   PROMO BADGE PULSE
   ============================================ */
.pizza-card-badge.popular {
  animation: pulse 2.5s ease-in-out infinite;
}

/* ============================================
   FLOATING EMOJI DECORATIONS
   ============================================ */
.float-emoji {
  animation: float 3s ease-in-out infinite;
  display: inline-block;
}

.float-emoji:nth-child(2) { animation-delay: 0.5s; }
.float-emoji:nth-child(3) { animation-delay: 1s; }

/* ============================================
   NAV TRANSITION
   ============================================ */
.navbar {
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
              background 0.3s ease,
              box-shadow 0.3s ease;
}

/* ============================================
   PROGRESS BAR ANIMATION
   ============================================ */
#scroll-progress {
  transition: width 0.08s linear;
}

/* ============================================
   MODAL OPEN/CLOSE
   ============================================ */
.modal-enter {
  animation: fadeIn 0.2s ease, scaleIn 0.25s ease;
}

/* ============================================
   CHAT BUBBLE ANIMATION
   ============================================ */
.chat-bubble {
  animation: fadeInUp 0.3s ease;
}

/* ============================================
   FILTER BUTTON ACTIVE ANIMATION
   ============================================ */
.filter-btn {
  transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.filter-btn.active {
  animation: scaleIn 0.2s ease;
}

/* ============================================
   PAGE LOAD ANIMATION
   ============================================ */
.page-wrapper {
  animation: fadeIn 0.4s ease;
}

/* ============================================
   TYPING INDICATOR (for chat)
   ============================================ */
.typing-dots {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gray-400);
  animation: pulse 1.5s ease-in-out infinite;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

/* ============================================
   STAT NUMBER COUNT UP
   ============================================ */
.stat-item h3 {
  animation: countUp 0.8s ease both;
}

.stat-item:nth-child(1) h3 { animation-delay: 0.1s; }
.stat-item:nth-child(2) h3 { animation-delay: 0.2s; }
.stat-item:nth-child(3) h3 { animation-delay: 0.3s; }
.stat-item:nth-child(4) h3 { animation-delay: 0.4s; }

/* ============================================
   ORDER TRACKING PULSE
   ============================================ */
.status-step.active .status-icon {
  animation: pulse 2s ease-in-out infinite;
}

/* ============================================
   LOYALTY CARD GLOW
   ============================================ */
.loyalty-card {
  animation: fadeInUp 0.6s ease;
}

/* ============================================
   REDUCE MOTION OVERRIDE
   ============================================ */
@media (prefers-reduced-motion: reduce) {
  .hero-bg { animation: none; }
  .reveal, .reveal-left, .reveal-right, .reveal-scale {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .float-emoji { animation: none; }
  .pizza-card-badge.popular { animation: none; }
  .trust-item { animation: none; }
  .hero-badge, .hero h1, .hero p, .hero-cta { animation: none; opacity: 1; }
  .status-step.active .status-icon { animation: none; }
  .skeleton { animation: none; background: var(--gray-100); }
}
