/* Global */
body {
  margin: 0;
  font-family: 'Playfair Display', sans-serif;
  background: #0f0f0f;
  color: #fff;
  /* Updated padding to match the combined height of fixed headers (60px + 60px) */
  padding-top: 120px;
  overflow-x: hidden;
}

/* Header container */
.header {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  padding: 0 10px;
  background: #111;
  position: fixed;
  top: 0;
  width: 100%;
  height: 60px;
  /* Explicit height to prevent overlap */
  z-index: 1000;
  transition: transform 0.3s ease, opacity 0.3s ease;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
  box-sizing: border-box;
}

/* Tabs */
.tab {
  text-align: center;
  padding: 8px 16px;
  border-radius: 8px;
  font-weight: 600;
  color: white;
  cursor: pointer;
  transition: 0.3s;
  box-shadow: 0 0 8px rgba(255, 80, 80, 0.2);
  letter-spacing: 0.3px;
  text-decoration: none;
  display: inline-block;
  flex: 1;
  max-width: 160px;
  font-size: 14px;
}

#breakfastTab {
  background: linear-gradient(90deg, #B71C1C, #da1118);
}

#allDayTab {
  background: linear-gradient(90deg, #f0050d, #621405);
}

.tab.active {
  transform: scale(1.05);
  box-shadow: 0 0 16px rgba(255, 255, 255, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.8);
  filter: brightness(1.2);
}

/* Sub header row */
.sub-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  position: fixed;
  top: 60px;
  /* Sits exactly below the 60px header */
  width: 100%;
  height: 60px;
  /* Explicit height */
  z-index: 999;
  transition: transform 0.3s ease, opacity 0.3s ease;
  background: #111;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  box-sizing: border-box;
  border-top: 1px solid #222;
}

/* Category tab */
.category-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #1c1c1c;
  border-radius: 12px;
  font-size: 13px;
  padding: 10px 15px;
  color: #ffffff;
  cursor: pointer;
  white-space: nowrap;
}

/* Search tab */
.search-tab {
  position: relative;
  display: flex;
  align-items: center;
  flex-grow: 1;
  min-width: 0;
}

.search-tab input {
  width: 100%;
  padding: 10px 35px 10px 15px;
  border: none;
  border-radius: 12px;
  background: #1c1c1c;
  color: #fff;
  font-size: 14px;
  box-sizing: border-box;
}

.search-tab input:focus {
  outline: 1px solid #ff4444;
}

.clear-btn {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: #aaa;
  font-size: 18px;
  cursor: pointer;
  display: none;
}

.clear-btn.visible {
  display: block;
}

/* Suggestion dropdown */
#suggestionBox {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #222;
  color: #fff;
  border-radius: 0 0 12px 12px;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
  z-index: 2000;
  max-height: 250px;
  overflow-y: auto;
}

#suggestionBox div {
  padding: 12px 15px;
  border-bottom: 1px solid #333;
  cursor: pointer;
}

#suggestionBox div:hover {
  background: #333;
}

/* Scroll Hide Logic */
.header.hide,
.sub-header.hide {
  transform: translateY(-100%);
  opacity: 0;
}

/* Category heading */
.menu-category {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 18px;
  font-weight: 700;
  margin: 30px 15px 10px;
  color: #ffcc00;
  border-left: 4px solid #ff4444;
  padding-left: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Home Icon styling */
.home-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1c1c1c;
  border-radius: 10px;
  padding: 10px;
  color: #fff;
  text-decoration: none;
  flex: 0 0 auto;
}

.home-icon:hover {
  background: #2a2a2a;
}

.home-icon img {
  width: 20px;
  height: 20px;
  display: block;
}

/* Grid for items - Fixed for Mobile (2 Columns) */
.menu-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 12px;
  margin-bottom: 30px;
}

@media (min-width: 768px) {
  .menu-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    padding: 20px;
  }
}

/* Food card */
.food-card {
  background: #1a1a1a;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease;
  height: 100%;
}

.food-card:active {
  transform: scale(0.98);
}

.food-img {
  width: 100%;
  aspect-ratio: 3 / 4;
  /* Square images keep grid balanced */
  object-fit: cover;
}

/* Info section */
.food-info {
  padding: 8px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.food-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 5px;
}

/* Fixed heights for titles to ensure price alignment */
.food-title {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

/* One Line - Standard height */
.food-title.one-line {
  -webkit-line-clamp: 1;
  height: 1.3em;
  /* Fixed to exactly one line */
}

/* Two Lines - Increased height for consistency */
.food-title.two-line {
  -webkit-line-clamp: 2;
  height: 2.6em;
  /* Fixed to exactly two lines (1.3 * 2) */
}

.food-price {
  font-size: 14px;
  font-weight: 700;
  color: #ffcc00;
  margin-left: 5px;
}

.food-desc {
  font-size: 12px;
  color: #aaa;
  margin: 1px 0 1px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Footer links */
.food-links {
  display: flex;
  justify-content: space-around;
  padding: 8px 0;
  border-top: 1px solid #2a2a2a;
  background: #222;
}

.icon-link img {
  width: 20px;
  height: 20px;
  opacity: 0.8;
  transition: transform 0.2s;
}

.icon-link:hover img {
  transform: scale(1.2);
  opacity: 1;
}

.icon-link.disabled {
  opacity: 0.5;          
  filter: grayscale(1);  
  cursor: not-allowed;   
}

.icon-link.disabled:hover {
  transform: none;
}

/* Overlay / Modal */
.overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(6px);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  padding: 16px;
  box-sizing: border-box;
}

/* Modal Box */
.overlay-content {
  background: #1c1c1c;
  width: 100%;
  max-width: 420px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 22px;
  border-radius: 22px;
  text-align: center;
  box-sizing: border-box;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Title */
.overlay-content h2 {
  color: #ffffff;
  font-size: 1.45rem;
  font-weight: 700;
  margin-bottom: 20px;
  font-family: 'Product Sans', 'Roboto', 'Inter', sans-serif;
}

/* Grid */
.category-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin: 20px 0;
  align-items: stretch;
}

/* Category Card */
.category-card {
  background: #f1eeee;
  border-radius: 18px;
  font-weight: 700;
  text-align: left;
  color: #111111;
  font-size: 15px;
  font-family: 'Product Sans', 'Roboto', 'Inter', sans-serif;
  letter-spacing: 0.3px;
  line-height: 1.35;
  display: flex;
  align-items: center;
  min-height: 88px;
  height: 100%;
  padding: 16px;
  box-sizing: border-box;
  cursor: pointer;
  transition: all 0.25s ease;
}

.category-card:hover {
  transform: translateY(-2px);
  background: #ffffff;
}

/* Close Button */
.close-btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(90deg, #ff512f, #dd2476);
  color: #ffffff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: 0.25s ease;
}

.close-btn:hover {
  opacity: 0.92;
}

/* Mobile Optimization */
@media(max-width:480px) {

  .overlay {
    padding: 12px;
  }

  .overlay-content {
    padding: 18px;
    border-radius: 18px;
  }

  .overlay-content h2 {
    font-size: 1.2rem;
    margin-bottom: 18px;
  }

  .category-grid {
    gap: 10px;
  }

  .category-card {
    min-height: 76px;
    padding: 14px;
    font-size: 13px;
    border-radius: 14px;
  }

  .close-btn {
    padding: 12px;
    font-size: 14px;
  }
}

.food-card.has-desc {
  cursor: pointer;
}

/* The dark background behind the popup */
.desc-popup-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(5px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 3000;
  /* Higher than headers */
  animation: fadeIn 0.2s ease;
}

/* The Popup Box */
.desc-popup-content {
  background: #1c1c1c;
  padding: 24px;
  border-radius: 20px;
  width: 85%;
  max-width: 400px;
  text-align: left;
  border: 1px solid #333;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  white-space: normal;
}

.desc-popup-content h4 {
  margin: 0 0 12px;
  color: #ffcc00;
  font-size: 18px;
}

.desc-popup-content p {
  color: #ccc;
  font-size: 15px;
  line-height: 1.5;
  margin-bottom: 20px;
  text-align: justify;
}

.desc-popup-content hr {
  border: 0;
  height: 1px;
  background-image: linear-gradient(to right, transparent, #ffcc00, transparent);
  margin: 15px 0;
  opacity: 0.5;
}

.review-note {
  font-size: 13px;
  color: #c2dd2c !important;
  text-align: center;
  margin-top: 0;
  margin-bottom: 20px;
}

.close-popup {
  display: block;
  margin: 0 auto;
  background: #ff4444;
  color: #fefefe;
  border: 1px solid rgba(255, 68, 68, 0.3);
  padding: 8px 24px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.2s;
}

.close-popup:hover {
  background: rgba(255, 68, 68, 0.1);
  border-color: #ff4444;
}

/* Overlay to match your existing popup style */
.popup-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  /* Smooth background blur */
  z-index: 2000;
  justify-content: center;
  align-items: center;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}