/* Popular Meals Section - Premium Dynamic Design */

.popular-meals {
  position: relative;
  padding: 100px 0;
  background: 
    linear-gradient(135deg, #1a1a1a 0%, #2d2d2d 100%),
    radial-gradient(circle at 20% 20%, rgba(255, 106, 0, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(255, 193, 7, 0.05) 0%, transparent 50%);
  overflow: hidden;
  perspective: 1000px;
}

.popular-meals::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,106,0,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
  opacity: 0.3;
  animation: grid-move 20s linear infinite;
}

@keyframes grid-move {
  0% { transform: translateX(0) translateY(0); }
  100% { transform: translateX(10px) translateY(10px); }
}

.popular-meals .container {
  position: relative;
  z-index: 2;
}

/* Enhanced Section Header */
.popular-meals .section-head {
  text-align: center;
  margin-bottom: 80px;
  position: relative;
}

.popular-meals .section-head::before {
  content: '';
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  width: 100px;
  height: 4px;
  background: linear-gradient(90deg, transparent, var(--primary), transparent);
  border-radius: 2px;
}

.popular-meals .section-head h2 {
  font-size: 3.5rem;
  font-weight: 800;
  color: white;
  margin-bottom: 20px;
  font-family: var(--font-accent);
  position: relative;
  display: inline-block;
}

.popular-meals .section-head h2 i {
  color: var(--primary);
  margin-right: 15px;
  animation: fire-flicker 2s ease-in-out infinite;
}

@keyframes fire-flicker {
  0%, 100% { transform: scale(1) rotate(0deg); }
  25% { transform: scale(1.1) rotate(-2deg); }
  50% { transform: scale(1.05) rotate(1deg); }
  75% { transform: scale(1.1) rotate(-1deg); }
}

.popular-meals .section-head .link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
  font-size: 1.1rem;
  padding: 12px 24px;
  border: 2px solid var(--primary);
  border-radius: 50px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.popular-meals .section-head .link::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--primary);
  transition: left 0.3s ease;
  z-index: -1;
}

.popular-meals .section-head .link:hover::before {
  left: 0;
}

.popular-meals .section-head .link:hover {
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(255, 106, 0, 0.3);
}

/* Premium Product Cards Grid */
.popular-meals .grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  margin: 60px auto 0;
  max-width: 1400px;
  padding: 0 20px;
  perspective: 2000px;
}

.meal-card {
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
  transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  transform-style: preserve-3d;
  transform: translateZ(0);
  will-change: transform, box-shadow;
  opacity: 0;
  animation: fadeInUp 0.6s ease-out forwards;
  animation-delay: calc(var(--index) * 0.1s);
}

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

.meal-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 106, 0, 0.1) 0%, rgba(255, 193, 7, 0.05) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
}

.meal-card:hover::before {
  opacity: 1;
}

.meal-card:hover {
  transform: translateY(-15px) scale(1.03) rotateX(5deg) rotateY(5deg);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.25), 0 10px 20px rgba(0, 0, 0, 0.2);
  border-color: rgba(255, 106, 0, 0.3);
  z-index: 2;
}

.meal-card::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 106, 0, 0.1) 0%, rgba(255, 193, 7, 0.05) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
  border-radius: 20px;
}

.meal-card:hover::after {
  opacity: 1;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); opacity: 0.7; }
  50% { transform: scale(1); opacity: 0.9; }
  100% { transform: scale(0.95); opacity: 0.7; }
}

/* Enhanced Product Badge */
.meal-badge {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 3;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transform: translateY(10px);
  opacity: 0;
  animation: badgeSlideIn 0.5s ease-out forwards;
  animation-delay: calc(var(--index) * 0.1s + 0.3s);
}

@keyframes badgeSlideIn {
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.meal-badge:contains("Popular") {
  background: linear-gradient(135deg, #ff6a00, #ff8f00);
  color: white;
  animation: badge-pulse 2s ease-in-out infinite;
}

.meal-badge:contains("Special") {
  background: linear-gradient(135deg, #e91e63, #f06292);
  color: white;
}

.meal-badge:contains("New") {
  background: linear-gradient(135deg, #4caf50, #66bb6a);
  color: white;
}

.meal-badge:contains("Chef's Choice") {
  background: linear-gradient(135deg, #9c27b0, #ba68c8);
  color: white;
}

@keyframes badge-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

/* Premium Product Image */
.meal-image {
  position: relative;
  height: 250px;
  overflow: hidden;
  border-radius: 20px 20px 0 0;
}

.meal-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.meal-card:hover .meal-image img {
  transform: scale(1.1);
}

.meal-image::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 50%;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.3));
  pointer-events: none;
}

/* Enhanced Product Actions */
.meal-actions {
  position: absolute;
  top: 20px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  opacity: 0;
  transform: translateX(20px);
  transition: all 0.3s ease;
  z-index: 3;
}

.meal-card:hover .meal-actions {
  opacity: 1;
  transform: translateX(0);
}

.meal-actions .btn-icon {
  width: 45px;
  height: 45px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.meal-actions .btn-icon:hover {
  background: var(--primary);
  color: white;
  transform: scale(1.1);
}

/* Enhanced Card Body */
.meal-info {
  padding: 20px;
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Premium Rating System */
.meal-rating {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 15px;
}

.meal-rating i {
  color: #ffc107;
  font-size: 0.9rem;
  transition: transform 0.2s ease;
}

.meal-rating i:hover {
  transform: scale(1.2);
}

.meal-rating span {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.85rem;
  margin-left: 8px;
}

/* Enhanced Typography */
.meal-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 10px;
  font-family: var(--font-accent);
  line-height: 1.2;
}

.meal-description {
  color: rgba(0, 0, 0, 0.7);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 20px;
  flex: 1;
}

/* Premium Product Footer */
.meal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 15px;
  border-top: 1px solid #f0f0f0;
}

.meal-price {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* Enhanced Add to Cart Button */
.add-to-cart-btn {
  background: linear-gradient(135deg, var(--primary) 0%, #ff8c42 100%);
  color: white;
  border: none;
  padding: 10px 16px;
  border-radius: 20px;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 15px rgba(255, 106, 0, 0.3);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Responsive Design */
@media (max-width: 1200px) {
  .meals-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
  }
}

@media (max-width: 992px) {
  .meals-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
  
  .popular-meals .section-head h2 {
    font-size: 2.8rem;
  }
}

@media (max-width: 768px) {
  .popular-meals {
    padding: 60px 0;
  }
  
  .meals-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .meal-card {
    min-height: 450px;
    display: flex;
    flex-direction: column;
  }
  
  .meal-info {
    padding: 18px;
    flex: 1;
    display: flex;
    flex-direction: column;
  }
  
  .meal-description {
    flex: 1;
    margin-bottom: 15px;
  }
  
  .meal-footer {
    margin-top: auto;
    padding-top: 15px;
  }
  
  .meal-title {
    font-size: 1.2rem;
    margin-bottom: 8px;
  }
  
  .meal-description {
    font-size: 0.9rem;
    margin-bottom: 15px;
  }
  
  .meal-footer {
    padding-top: 12px;
    margin-top: 15px;
  }
  
  .meal-price {
    font-size: 1.2rem;
  }
  
  .add-to-cart-btn {
    padding: 8px 14px;
    font-size: 0.8rem;
  }
}

/* Mobile Responsive */
@media (max-width: 480px) {
  .meals-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  
  .meal-card {
    max-width: 100%;
    min-height: 380px;
  }
  
  .meal-info {
    padding: 16px;
  }
  
  .meal-title {
    font-size: 1.1rem;
    margin-bottom: 6px;
  }
  
  .meal-description {
    font-size: 0.85rem;
    margin-bottom: 12px;
    line-height: 1.3;
  }
  
  .meal-footer {
    flex-direction: row;
    gap: 10px;
    align-items: center;
    justify-content: space-between;
  }
  
  .meal-price {
    font-size: 1.3rem;
  }
  
  .add-to-cart-btn {
    padding: 10px 14px;
    font-size: 0.8rem;
    white-space: nowrap;
  }
}
