.catalog {
  width: 100%;
  max-width: 1300px;
  margin: 0 auto;
  padding: 40px 20px;
}

/* SEARCH */
.search-box {
  width: 350px;
  margin: 0 auto 25px;
  position: relative;
}
.search-box input {
  width: 100%;
  padding: 10px 40px 10px 15px;
  border-radius: 30px;
  border: 1px solid #ccc;
  font-size: 14px;
}
.search-box .icon {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  color: #666;
  font-size: 18px;
}

/* FILTER */
.menu-filter {
  display: flex;
  justify-content: center;
  gap: 25px;
  margin-bottom: 35px;
}
.menu-filter button {
  background: transparent;
  border: 1px solid transparent;
  padding: 8px 16px;
  font-size: 14px;
  cursor: pointer;
  color: #444;
  border-radius: 999px;
  transition: transform 220ms ease, background 220ms ease, color 220ms ease,
    box-shadow 220ms ease;
  box-shadow: inset 0 0 0 0 rgba(0, 0, 0, 0);
}

.menu-filter button:not(.active):hover {
  color: #e63946;
  transform: translateY(-3px);
}

.menu-filter .active {
  background-color: #e63946;
  color: #fff;
  border-color: rgba(230, 57, 70, 0.12);
  font-weight: 700;
  transform: translateY(-4px);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 25px;
}

/* CARD */
.card {
  background: #fff;
  border: 1px solid #e6e6e6;
  border-radius: 8px;
  padding-bottom: 15px;
  overflow: hidden;
}
.card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}
.card h3 {
  font-size: 15px;
  margin: 10px 15px 5px;
}
.card p {
  font-size: 12px;
  color: #555;
  margin: 0 15px;
  line-height: 1.4;
}
.card .bottom {
  display: flex;
  justify-content: space-between;
  padding: 12px 15px 0;
  align-items: center;
}
.card .price {
  font-size: 14px;
  font-weight: bold;
}
.card .detail {
  background: #fc6c6c;
  border: none;
  color: #fff;
  font-size: 12px;
  padding: 5px 12px;
  border-radius: 5px;
  cursor: pointer;
}

/* MENU CAROUSEL */
.menu-carousel-section {
  width: 100%;
  background: linear-gradient(135deg, #f9f9f9 0%, #f0f0f0 100%);
  padding: 100px 20px 40px 20px;
  margin-top: 20px;
  display: flex;
  align-items: center;
  min-height: auto;
}

#menuCarousel {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  position: relative;
  display: block;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);
}

#menuCarousel .carousel-inner {
  border-radius: 12px;
  overflow: hidden;
}

#menuCarousel .carousel-item {
  height: 320px;
  width: 100%;
  border-radius: 15px;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

#menuCarousel .carousel-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  border-radius: inherit;
}

#menuCarousel .carousel-control-prev,
#menuCarousel .carousel-control-next {
  width: 60px;
  color: #fff;
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.9;
}

#menuCarousel .carousel-control-prev-icon,
#menuCarousel .carousel-control-next-icon {
  width: 45px;
  height: 45px;
  background-size: 60%;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.5));
}

.menu-popup {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.6);
  z-index: 2000;
  padding: 20px;
}

.menu-popup-inner {
  background: #fff;
  max-width: 900px;
  width: 100%;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

.menu-popup .popup-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255, 255, 255, 0.95);
  border: 0;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: #333;
  box-shadow: 0 6px 18px rgba(0,0,0,0.12);
  transition: transform 140ms ease, box-shadow 140ms ease, background 140ms ease;
  z-index: 30;
}

.menu-popup .popup-close:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(0,0,0,0.18);
}

.menu-popup .popup-close:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(230,57,70,0.12);
}

.menu-popup .popup-body {
  display: flex;
  gap: 20px;
  padding: 24px;
  align-items: flex-start;
  max-height: calc(100vh - 120px);
  overflow: auto;
}

.menu-popup .popup-img {
  flex: 0 0 40%;
}

.menu-popup .popup-img img {
  width: 100%;
  height: 260px;
  object-fit: cover;
  border-radius: 8px;
}

.menu-popup .popup-info {
  flex: 1;
}

.menu-popup .popup-info h3 {
  margin: 0 0 12px 0;
  font-size: 22px;
}

.menu-popup .popup-info p {
  margin: 0;
  color: #555;
  line-height: 1.6;
}

#menuCarousel .carousel-control-prev:hover .carousel-control-prev-icon,
#menuCarousel .carousel-control-next:hover .carousel-control-next-icon {
  background-color: rgba(0, 0, 0, 0.4);
  border-radius: 50%;
  padding: 10px;
}

#menuCarousel .carousel-control-prev,
#menuCarousel .carousel-control-next {
  background: none !important;
}

#menuCarousel .carousel-control-prev:hover,
#menuCarousel .carousel-control-next:hover {
  opacity: 1;
}

/* PAGINATION */
.pagination {
  display: flex;
  justify-content: center;
  gap: 5px;
  margin-bottom: 20px;
  margin-top: 20px;
}

.pagination button {
  padding: 8px 12px;
  border: 1px solid #ddd;
  background: #fff;
  color: #333;
  border-radius: 5px;
  cursor: pointer;
  font-size: 14px;
  transition: 0.3s ease;
  font-weight: 500;
}

.pagination button:hover:not(:disabled) {
  background: #e63946;
  color: #fff;
  border-color: #e63946;
}

.pagination button.active {
  background: #e63946;
  color: #fff;
  border-color: #e63946;
  font-weight: 600;
}

.pagination button:disabled {
  background: #f0f0f0;
  color: #ccc;
  cursor: not-allowed;
  border-color: #e0e0e0;
}

/* Responsive */
@media (max-width: 768px) {
  .catalog {
    padding: 24px 16px;
  }

  .search-box {
    width: 100%;
    margin-bottom: 18px;
    padding: 0 8px;
  }

  .menu-filter {
    gap: 12px;
    padding: 0 8px;
    justify-content: flex-start;
    overflow-x: auto;
  }

  .menu-filter button {
    padding: 7px 12px;
    font-size: 13px;
  }

  .grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 18px;
  }

  .card img {
    height: 150px;
  }

  .card h3 {
    font-size: 14px;
  }

  .card p {
    font-size: 12px;
  }

  .card .price {
    font-size: 14px;
  }

  .menu-carousel-section {
    padding: 60px 12px 20px;
  }

  #menuCarousel .carousel-item {
    height: 240px;
  }

  #menuCarousel .carousel-control-prev,
  #menuCarousel .carousel-control-next {
    width: 44px;
  }

  /* popup -> stack vertically on narrower screens */
  .menu-popup .popup-body {
    flex-direction: column;
    gap: 16px;
    padding: 18px;
  }

  .menu-popup .popup-img {
    flex: 0 0 100%;
  }

  .menu-popup .popup-img img {
    height: 220px;
  }
}

@media (max-width: 480px) {
  .catalog {
    padding: 16px 12px;
  }

  .search-box {
    width: 100%;
    padding: 0;
    margin-bottom: 14px;
  }

  .search-box input {
    padding: 10px 36px 10px 12px;
    font-size: 14px;
  }

  .menu-filter {
    gap: 10px;
    padding: 0 6px;
  }

  .grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .card {
    border-radius: 10px;
  }

  .card img {
    height: 140px;
  }

  .card h3 {
    font-size: 14px;
    margin: 8px 12px 4px;
  }

  .card p {
    font-size: 13px;
    margin: 0 12px;
  }

  .card .bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 10px 12px 12px;
  }

  .card .detail {
    width: 100%;
    text-align: center;
    padding: 8px 10px;
  }

  /* carousel smaller on small phones */
  #menuCarousel .carousel-item {
    height: 180px;
  }

  /* popup adjustments for very small screens */
  .menu-popup-inner {
    max-width: 95%;
  }

  .menu-popup .popup-img img {
    height: 180px;
  }

  .menu-popup .popupName {
    text-align: center;
  }

  .menu-popup .popup-body {
    padding: 12px;
  }

  .menu-popup .popup-info h3 {
    font-size: 18px;
  }

  /* better mobile popup experience */
  .menu-popup {
    align-items: flex-start;
    padding: 8px;
  }

  .menu-popup-inner {
    max-width: 95%;
    width: 100%;
    border-radius: 10px;
    max-height: 96vh;
    overflow: hidden;
  }

  .menu-popup .popup-body {
    max-height: calc(100vh - 120px);
    overflow: auto;
    padding: 12px;
  }

  .menu-popup .popup-close {
    top: 10px;
    right: 10px;
    z-index: 30;
    font-size: 26px;
    padding: 6px 8px;
    background: rgba(255,255,255,0.95);
    border-radius: 6px;
    color: #333;
  }

  .menu-popup .popup-img img {
    height: 160px;
    border-radius: 6px;
  }

  .menu-popup .popup-info {
    padding-top: 6px;
  }

  .menu-popup .popup-info p {
    font-size: 14px;
  }

}
