/* ------------------------------------
   🌈 CLOUD KITCHEN – FINAL MENU PAGE
------------------------------------ */

/* 🧱 Page Container */
.menu-section {
  width: 100%;
  max-width: 1200px;
  margin: 3rem auto;
  padding: 0 1rem;
  box-sizing: border-box;
}

/* 🧭 Titles */
.menu-section h2 {
  font-size: 1.9rem;
  font-weight: 700;
  color: var(--color-secondary);
  margin-bottom: 0.5rem;
  text-align: center;
}

.subtitle {
  color: #666;
  margin-bottom: 2rem;
  font-size: 1rem;
  text-align: center;
}

/* 🔍 Search Bar */
.menu-search {
  display: flex;
  justify-content: center;
  margin-bottom: 2rem;
}
.menu-search input {
  width: 100%;
  max-width: 420px;
  padding: 0.7rem 1rem;
  border: 1px solid #ddd;
  border-radius: 10px;
  font-size: 0.95rem;
  outline: none;
  transition: all 0.3s ease;
}
.menu-search input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 6px rgba(255, 102, 0, 0.3);
}

/* 🍱 Sticky Category Bar */
.menu-categories {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.8rem;
  margin-bottom: 2.5rem;
  position: sticky;
  top: 70px; /* just below navbar */
  background: #fff;
  z-index: 50;
  padding: 0.6rem 0;
  border-bottom: 1px solid #eee;
}
.menu-cat {
  background: #f7f7f7;
  padding: 0.6rem 1.2rem;
  border-radius: 25px;
  color: #444;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s ease;
}
.menu-cat.active,
.menu-cat:hover {
  background: var(--color-primary);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 2px 6px rgba(255, 102, 0, 0.3);
}

/* 🧩 Menu Grid */
.menu-grid {
  display: grid !important;
  grid-auto-flow: row dense !important;
  gap: 1rem !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  justify-items: stretch !important;
  align-items: stretch !important;
  animation: fadeIn 0.6s ease;
}

/* 🧾 Menu Card */
.menu-card {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  opacity: 0;
  transform: translateY(15px);
  animation: fadeInCard 0.6s ease forwards;
}
.menu-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 6px 18px rgba(255, 102, 0, 0.25);
}

/* 🖼️ Image */
.menu-img {
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  transition: border-color 0.3s ease;
}
.menu-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.menu-card:hover .menu-img img {
  transform: scale(1.08);
}

/* 🔥 Hot Badge */
.hot-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: #ff4d4d;
  color: white;
  padding: 4px 9px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 5px;
  z-index: 2;
}

/* 🟢 Veg / 🔴 Non-Veg Indicator + Accent Border */
.food-type {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 16px;
  height: 16px;
  border-radius: 3px;
  border: 2px solid #fff;
  z-index: 2;
}
.food-type.veg {
  background: #27ae60;
}
.food-type.non-veg {
  background: #e74c3c;
}

/* Border Accent by Type */
.food-type.veg ~ .menu-img {
  border-top: 4px solid #27ae60;
}
.food-type.non-veg ~ .menu-img {
  border-top: 4px solid #e74c3c;
}

/* 🧾 Info Section */
.menu-info {
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-grow: 1;
}
.menu-info h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: #222;
  margin-bottom: 0.5rem;
}
.menu-info .desc {
  font-size: 0.9rem;
  color: #555;
  margin-bottom: 1rem;
  line-height: 1.45;
}

/* 💰 Price + Add Row */
.menu-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}
.price {
  color: var(--color-primary);
  font-weight: 700;
  font-size: 1rem;
}

/* 🛒 Quantity & Add to Cart */
.add-to-cart {
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.qty-input {
  width: 38px;
  text-align: center;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 0.25rem;
  font-size: 0.9rem;
  outline: none;
  background: #fff;
}
.qty-btn {
  border: none;
  background: #f2f2f2;
  padding: 0.35rem 0.65rem;
  border-radius: 4px;
  font-weight: 600;
  cursor: pointer;
  font-size: 1rem;
  transition: background 0.3s ease;
}
.qty-btn:hover {
  background: #e6e6e6;
}
.add-btn {
  background: var(--color-primary);
  color: white;
  border: none;
  padding: 0.45rem 0.9rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  transition: background 0.3s ease, transform 0.2s ease;
}
.add-btn:hover {
  background: var(--color-primary-dark);
  transform: translateY(-2px);
}
/* ------------------------------------
   🪄 Add Button Animation
------------------------------------ */
.add-btn {
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, background 0.3s ease;
}

.add-btn.added {
  background: #28a745; /* success green */
  transform: scale(1.05);
}

.add-btn.added::after {
  content: "✓ Added";
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: white;
  animation: fadeInScale 0.4s ease forwards;
}

@keyframes fadeInScale {
  0% {
    opacity: 0;
    transform: scale(0.8);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

/* Slight bounce when pressed */
.add-btn:active {
  transform: scale(0.95);
}

.menu-categories::after {
  content: "›";
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: #aaa;
  font-size: 1.2rem;
  pointer-events: none;
}
/* ------------------------------------
   📱 Fix: Add to Cart Visibility on Mobile
------------------------------------ */

/* Ensure Add-to-Cart stays visible and wraps nicely */
.add-to-cart {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.4rem;
}

/* Adjust button sizing for small screens */
@media (max-width: 600px) {
  .add-to-cart {
    flex-direction: row;
    justify-content: space-between;
    gap: 0.3rem;
  }

  .qty-btn {
    padding: 0.3rem 0.55rem;
    font-size: 0.9rem;
  }

  .qty-input {
    width: 30px;
    font-size: 0.85rem;
    padding: 0.2rem;
  }

  .add-btn {
    flex: 1 1 100%;
    text-align: center;
    padding: 0.5rem 0.9rem;
    margin-top: 0.3rem;
    font-size: 0.9rem;
  }

  /* Prevent overflow by reducing padding */
  .menu-info {
    padding: 0.8rem;
  }

  .menu-card {
    overflow: visible; /* ensures buttons never hide */
  }
}

/* ------------------------------------
   🪄 Responsive Breakpoints
------------------------------------ */
@media (max-width: 1200px) {
  .menu-grid {
    grid-template-columns: repeat(3, 1fr) !important; /* ✅ 3 per row tablet */
  }
}
@media (max-width: 768px) {
  .menu-grid {
    grid-template-columns: repeat(2, 1fr) !important; /* ✅ 2 per row mobile */
  }
}
@media (max-width: 480px) {
  .menu-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .menu-info h3 {
    font-size: 0.95rem;
  }
  .menu-info .desc {
    font-size: 0.85rem;
  }
}

/* ------------------------------------
   ✨ Animations
------------------------------------ */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes fadeInCard {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ------------------------------------
   📱 MOBILE CATEGORY UX IMPROVEMENT
------------------------------------ */

/* Make categories scroll horizontally on smaller screens */
@media (max-width: 768px) {
  .menu-categories {
    overflow-x: auto;
    white-space: nowrap;
    flex-wrap: nowrap;
    justify-content: flex-start;
    padding: 0.6rem 0.5rem;
    gap: 0.6rem;
    border-bottom: 1px solid #eee;
    scrollbar-width: none; /* hide scrollbar (Firefox) */
  }

  .menu-categories::-webkit-scrollbar {
    display: none; /* hide scrollbar (Chrome/Safari) */
  }

  .menu-cat {
    display: inline-block;
    font-size: 0.85rem;
    padding: 0.4rem 0.9rem;
    border-radius: 18px;
    flex: 0 0 auto;
  }
}

/* Ultra small screens – tighter spacing */
@media (max-width: 480px) {
  .menu-cat {
    font-size: 0.8rem;
    padding: 0.35rem 0.8rem;
    border-radius: 16px;
  }
}
