* {
  box-sizing: border-box;
}

body {
  font-family: 'Inter', sans-serif;
  background: #FFF5EE;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: #2A2A2A;
  overflow-x: hidden;
}

.hero {
  background: #FFF;
  padding: 3rem 1rem;
  text-align: center;
  margin-bottom: 2rem;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.hero h1 {
  color: #ad103c;
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.hero p {
  color: #2A2A2A;
  font-size: 1.1rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

.navbar {
  background: #ad103c;
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 1000;
}

.navbar-brand {
  color: #FFF !important;
  font-weight: 700;
  font-size: 1.5rem;
}

.navbar-nav .nav-link {
  color: #FFF !important;
  font-weight: 600;
  transition: all 0.2s ease-in-out;
}

.navbar-nav .nav-link:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffccd6 !important;
}

.navbar-nav .nav-link.active {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff !important;
}

.navbar .btn-search-toggle {
  color: #FFF;
  background: none;
  border: none;
  font-size: 1.2rem;
  transition: all 0.2s ease-in-out;
}

.navbar .btn-search-toggle:hover {
  color: #ffccd6;
}

.filter-bar {
  background: #FFF;
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid rgba(173, 16, 60, 0.2);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 100%;
  overflow: hidden;
}

.filter-scroll {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  gap: 0.75rem;
  white-space: nowrap;
  padding: 0.5rem;
  scrollbar-width: thin;
}

.filter-scroll::-webkit-scrollbar {
  height: 6px;
}

.filter-scroll::-webkit-scrollbar-track {
  background: #F9F6F2;
  border-radius: 3px;
}

.filter-scroll::-webkit-scrollbar-thumb {
  background: #ad103c;
  border-radius: 3px;
}

.filter-bar input,
.filter-bar select {
  border: 1px solid #ad103c;
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  font-weight: 500;
  transition: all 0.3s ease;
}

.filter-bar input:focus,
.filter-bar select:focus {
  border-color: #ffccd6;
  box-shadow: 0 0 6px rgba(173, 16, 60, 0.3);
  outline: none;
}

.filter-bar select#allergenFilter {
  background: #FFF;
  color: #ad103c;
  min-width: 100px;
}

.filter-bar select#allergenFilter:hover {
  border-color: #ffccd6;
}

.filter-bar button {
  background: #ad103c;
  color: #FFF;
  border: none;
  border-radius: 8px;
  padding: 0.5rem 1rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  transition: all 0.2s ease-in-out;
  min-width: 100px;
}

.filter-bar button:hover {
  background: #ffccd6;
  color: #ad103c;
  transform: scale(1.05);
}

.filter-bar button#clearFilters {
  background: #FFF;
  border: 1px solid #ad103c;
  color: #ad103c;
}

.filter-bar button#clearFilters:hover {
  background: #ad103c;
  color: #FFF;
}

.filter-bar i {
  color: #ad103c;
  margin-right: 0.5rem;
  transition: all 0.2s ease-in-out;
}

.filter-bar i:hover {
  transform: scale(1.1);
}

.search-container {
  flex-grow: 1;
  position: relative;
}

.search-container input {
  padding-right: 3rem;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.search-container button {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  padding: 0.5rem;
  color: #ad103c;
  transition: all 0.2s ease-in-out;
}

.search-container button:hover {
  color: #ffccd6;
}

.category-buttons {
  display: flex;
  overflow-x: auto;
  gap: 0.5rem;
  white-space: nowrap;
  padding: 0.5rem 0;
  margin: 1rem 0;
  scrollbar-width: thin;
  scroll-behavior: smooth;
}

.category-buttons::-webkit-scrollbar {
  height: 6px;
}

.category-buttons::-webkit-scrollbar-track {
  background: #F9F6F2;
  border-radius: 3px;
}

.category-buttons::-webkit-scrollbar-thumb {
  background: #ad103c;
  border-radius: 3px;
}

.category-btn {
  background: #FFF;
  border: 1px solid #ad103c;
  color: #ad103c;
  padding: 0.3rem 0.7rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
  min-width: 80px;
  flex-shrink: 0;
  transition: all 0.2s ease-in-out;
}

.category-btn.active,
.category-btn:hover {
  background: #ad103c;
  color: #ffccd6;
  border-color: #ad103c;
  transform: scale(1.05);
}

h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: #ad103c;
  margin: 2rem 0 1rem;
}

.table-container {
  background: #FFF5EE;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  margin-bottom: 2rem;
  overflow-x: auto;
  width: 100%;
  max-width: 100%;
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: auto;
  display: table !important;
  visibility: visible !important;
  opacity: 1 !important;
}

#dishTables {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

th, td {
  padding: 0.75rem;
  vertical-align: middle;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

th {
  width: auto;
}

th[data-sort="name"] { width: 20%; min-width: 150px; }
th[data-sort="size_oz"] { width: 10%; min-width: 80px; }
th[data-sort="calories"] { width: 10%; min-width: 80px; }
th[data-sort="protein_g"] { width: 12%; min-width: 80px; }
th[data-sort="carbs_g"] { width: 12%; min-width: 80px; }
th[data-sort="fat_g"] { width: 12%; min-width: 80px; }
th[data-sort="sugars_g"] { width: 12%; min-width: 80px; }
th[data-sort="allergens"] { width: 12%; min-width: 100px; }
th:not([data-sort]) {
  min-width: 160px;
  background: #FFF;
  box-shadow: -4px 0 6px rgba(0, 0, 0, 0.15);
  z-index: 6;
  color: #2A2A2A;
  text-align: center;
}

thead {
  background: #ad103c;
  color: #FFF;
  position: sticky;
  top: 0;
  z-index: 5;
}

th {
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: all 0.2s ease-in-out;
}

th i {
  margin-left: 0.5rem;
  opacity: 0.7;
}

th:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffccd6;
}

tbody tr {
  background: #FFF;
  transition: all 0.3s ease;
  animation: fadeIn 0.5s ease-in;
}

tbody tr:nth-child(even) {
  background: #F9F6F2;
}

tbody tr:hover {
  background: #FFF5EE;
  transform: translateY(-1px);
}

td a {
  color: #ad103c;
  text-decoration: none;
  font-weight: 500;
  position: relative;
}

td a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -2px;
  left: 0;
  background-color: #ad103c;
  transition: width 0.3s ease-in-out;
}

td a:hover::after {
  width: 100%;
}

td:last-child {
  background: #FFF;
  box-shadow: -4px 0 6px rgba(0, 0, 0, 0.15);
  z-index: 6;
  padding: 0.75rem;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: visible;
}

.allergen-icon {
  color: #ad103c;
  margin-right: 0.3rem;
}

.btn-add {
  background: #ad103c;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  min-width: 50px;
  min-height: 50px;
  color: #FFF;
  font-size: 1.1rem;
  line-height: 1;
  transition: all 0.2s ease-in-out;
  position: relative;
  z-index: 12;
}

.btn-add:hover {
  background: #ffccd6;
  color: #ad103c;
  transform: scale(1.1);
}

.meal-cart {
  background: #FFF5EE;
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
  animation: fadeIn 0.5s ease-in;
  z-index: 1000;
  position: relative;
}

.meal-cart.active {
  display: block !important;
}

.meal-cart .btn-close-cart,
.meal-cart .btn-close-cart-mobile {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  color: #ad103c;
  font-size: 1.2rem;
  transition: all 0.2s ease-in-out;
}

.meal-cart .btn-close-cart:hover,
.meal-cart .btn-close-cart-mobile:hover {
  color: #ffccd6;
}

.meal-cart .btn-close-cart-mobile {
  display: none;
}

.meal-cart h3 {
  font-size: 1.4rem;
  color: #ad103c;
  font-weight: 600;
}

.meal-cart .btn-remove {
  color: #ad103c;
  font-size: 0.85rem;
  text-decoration: none;
  padding: 0.2rem 0.5rem;
  transition: all 0.2s ease-in-out;
}

.meal-cart .btn-remove:hover {
  color: #ffccd6;
  background: rgba(173, 16, 60, 0.1);
  border-radius: 4px;
}

#mealList li {
  padding: 0.5rem;
}

#mealList li:nth-child(odd) {
  background: #F9F6F2;
}

#mealList li:nth-child(even) {
  background: #FFF;
}

.nutrition-card {
  background: #FFF;
  border: 1px solid #ad103c;
  border-radius: 6px;
  padding: 0.5rem 1rem;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: all 0.3s ease;
  animation: slideIn 0.3s ease-in;
}

.nutrition-card:hover {
  background: #FFF5EE;
  transform: scale(1.02);
}

.nutrition-card i {
  color: #ad103c;
  font-size: 1.2rem;
}

footer {
  background: #ad103c;
  color: #FFF;
  padding: 2rem 0;
  margin-top: auto;
}

footer a {
  color: #FFF;
  text-decoration: none;
  font-size: 0.9rem;
  transition: all 0.2s ease-in-out;
}

footer a:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #ffccd6;
}

footer a.active {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

footer .disclaimer {
  font-size: 0.8rem;
  opacity: 0.8;
  margin-top: 1rem;
}

.spinner {
  border: 4px solid #ad103c;
  border-top: 4px solid #ffccd6;
  border-radius: 50%;
  width: 36px;
  height: 36px;
  animation: spin 1s linear infinite;
  margin: 2rem auto;
}

.btn-toggle-cart {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #ad103c;
  color: #FFF;
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  transition: all 0.2s ease-in-out;
}

.btn-toggle-cart:hover {
  background: #ffccd6;
  color: #ad103c;
  transform: scale(1.1);
}

.noscript-links {
  margin-top: 1rem;
  padding: 1rem;
  background: #FFF;
  border-radius: 8px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.noscript-links h2 {
  font-size: 1.5rem;
  color: #ad103c;
}

.noscript-links ul {
  list-style: none;
  padding: 0;
}

.noscript-links li {
  margin: 0.5rem 0;
}

.noscript-links a {
  color: #ad103c;
  text-decoration: none;
}

.noscript-links a:hover {
  text-decoration: underline;
}

.noscript-links p {
  color: #2A2A2A;
  font-size: 0.9rem;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}

@media (min-width: 992px) {
  .meal-cart {
    position: fixed;
    right: 20px;
    top: 100px;
    width: 300px;
    max-height: 80vh;
    overflow-y: auto;
    display: none;
  }
  .meal-cart.active {
    display: block !important;
  }
  .meal-cart .btn-close-cart-mobile {
    display: none;
  }
}

@media (max-width: 768px) {
  .filter-bar {
    gap: 0.5rem;
  }

  .filter-scroll select,
  .filter-scroll button {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    min-width: 100px;
    width: auto;
  }

  .search-container input {
    padding: 0.5rem 2.5rem 0.5rem 0.75rem;
  }

  .category-buttons {
    justify-content: flex-start;
  }

  .meal-cart {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    border-radius: 8px 8px 0 0;
    z-index: 999;
    transform: translateY(100%);
    transition: transform 0.3s ease;
  }

  .meal-cart.active {
    display: block !important;
    transform: translateY(0);
  }

  .meal-cart .btn-close-cart {
    display: none;
  }

  .meal-cart .btn-close-cart-mobile {
    display: block;
  }

  .btn-add {
    width: 30px;
    height: 30px;
    min-width: 30px;
    min-height: 30px;
    font-size: 0.8rem;
    margin: 0 auto;
    display: block;
    box-shadow: -2px 0 4px rgba(0, 0, 0, 0.2);
  }

  th, td {
    font-size: 0.85rem;
  }

  th[data-sort="name"],
  td:first-child {
    width: 50%;
    min-width: 120px;
    white-space: normal;
    text-overflow: initial;
  }

  th[data-sort="size_oz"],
  th[data-sort="calories"] {
    width: 20%;
    min-width: 60px;
    white-space: normal;
    font-size: 0.8rem;
  }

  th:not([data-sort]) {
    min-width: 60px;
    text-align: center;
  }

  td:last-child {
    padding: 0.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: visible;
  }

  th[data-sort="protein_g"],
  th[data-sort="carbs_g"],
  th[data-sort="fat_g"],
  th[data-sort="sugars_g"],
  th[data-sort="allergens"],
  td:nth-child(4),
  td:nth-child(5),
  td:nth-child(6),
  td:nth-child(7),
  td:nth-child(8) {
    display: none;
  }

  .modal-dialog {
    margin: 0;
    width: 100%;
    height: 100%;
    max-height: 100vh;
  }

  .modal-content {
    border-radius: 0;
    height: 100%;
  }
}

@media (max-width: 576px) {
  .hero h1 {
    font-size: 1.8rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .navbar-brand {
    font-size: 1.2rem;
  }

  .category-btn {
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    min-width: 70px;
  }

  h2 {
    font-size: 1.3rem;
  }
}