.body-dark {
  background-color: #2b2422;
  font-family: Roboto, sans-serif;
}

.title-hero {
  text-align: center;
  text-transform: uppercase;
  font-weight: 650;
  color: #dc2743;
}

.category-title {
  font-style: italic;
  font-size: 2rem;
  border-bottom: 1px solid black;
}

.menu-layout {
  display: flex;
  flex-flow: row wrap;
  justify-content: space-around;
  box-sizing: border-box;
}

.menu-category-card {
  min-width: 300px;
  min-height: 10rem;
  height: auto;
  display: flex;
  flex-direction: column;
  border-radius: 5px;
  border: 1px solid black;
  box-sizing: border-box;
}

.food-item {
  margin-top: 1rem;
  list-style-type: none;
  transition: all 0.3s ease-in-out;
  /* Pre-allocate space to prevent CLS */
  min-height: 2rem;
  will-change: opacity, color;
  contain: layout style paint;
}

.food-item:hover {
  color: #dc2743;
  cursor: pointer;
}

.footer-card {
  margin: 20px 0;
  padding: 10px;
  background-color: rgba(127, 111, 107, 0.2);
  backdrop-filter: blur(10px);
  border-radius: 5px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.6);
  display: flex;
  justify-content: center;
  align-items: center;
}

.btn-primary {
  background-color: #dc2743;
  color: #ffffff;
  padding: 10px 20px;
  border: none;
  border-radius: 5px;
  cursor: pointer;
}

.btn-primary:hover {
  background-color: #ff0000;
}

.input-styled {
  margin: 15px 0;
  padding: 10px;
  display: block;
  width: 25%;
  border-radius: 5px;
  text-align: center;
}

.section-padded {
  padding: 20px;
  border-radius: 10px;
}

.section-starters {
  background-color: #ffb6c1;
}

.section-mains {
  background-color: #98fb98;
}

.section-desserts {
  background-color: #add8e6;
}

.footer-active {
  border: 2px solid #dc2743;
}

/* v2.1: Search & Filter Styles - CLS Optimized */
.hidden {
  /* Use visibility + opacity for smooth filtering without reflow */
  visibility: hidden;
  opacity: 0;
  height: 0;
  overflow: hidden;
  transition:
    opacity 0.2s ease,
    visibility 0.2s ease;
  margin: 0;
  padding: 0;
}

.hidden.no-results {
  /* Preserve space for no-results message */
  visibility: hidden;
  opacity: 0;
  height: auto;
  overflow: hidden;
  margin: 0;
  padding: 0;
  transition:
    opacity 0.2s ease,
    visibility 0.2s ease;
}

.search-match {
  background-color: rgba(220, 39, 67, 0.1);
  font-weight: 500;
  will-change: background-color;
}

.no-results {
  text-align: center;
  padding: 20px;
  color: #888;
  font-style: italic;
  font-size: 1.2rem;
  visibility: visible;
  opacity: 1;
  height: auto;
  overflow: visible;
  transition:
    opacity 0.2s ease,
    visibility 0.2s ease;
  margin-bottom: 20px;
}

.input-styled {
  transition: border-color 0.3s ease;
}

.input-styled:focus {
  border-color: #dc2743;
  outline: none;
}

/* v2.2: Animation Styles */
@keyframes fadeInUp {
  from {
    opacity: 0;
    /* Use transform instead of margin/padding to avoid layout shift */
    transform: translateY(0);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.animate-fade-in-up {
  animation: fadeInUp 0.3s ease-out forwards;
}

.animate-slide-in {
  animation: slideInLeft 0.3s ease-out forwards;
}

.food-item {
  transition:
    all 0.3s ease-in-out,
    opacity 0.3s ease,
    transform 0.3s ease;
}

.section-padded {
  transition:
    transform 0.3s ease,
    opacity 0.3s ease;
  will-change: transform, opacity;
  contain: layout style paint;
}

.btn-primary {
  transition:
    background-color 0.2s ease,
    transform 0.2s ease;
}

.btn-primary:active {
  transform: scale(0.95);
}

/* v2.3: Accessibility Styles */

/* Skip link for keyboard users */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #dc2743;
  color: white;
  padding: 8px 16px;
  z-index: 100;
  transition: top 0.3s;
  text-decoration: none;
  font-weight: bold;
}

.skip-link:focus {
  top: 0;
  outline: 3px solid #ff0000;
}

/* Visually hidden but accessible to screen readers */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus indicators - visible focus for keyboard navigation */
*:focus {
  outline: 3px solid #ffb74d;
  outline-offset: 2px;
}

*:focus:not(:focus-visible) {
  outline: none;
}

*:focus-visible {
  outline: 3px solid #ffb74d;
  outline-offset: 2px;
}

/* Enhanced focus for interactive elements */
.btn-primary:focus-visible {
  outline: 3px solid #ffb74d;
  outline-offset: 2px;
  box-shadow: 0 0 0 6px rgba(255, 183, 77, 0.3);
}

.input-styled:focus-visible {
  outline: 3px solid #ffb74d;
  outline-offset: 2px;
  border-color: #dc2743;
}

.food-item:focus-visible {
  outline: 3px solid #ffb74d;
  outline-offset: 2px;
}

/* High contrast focus for better visibility */
.food-item:focus-visible {
  background-color: rgba(220, 39, 67, 0.2);
  outline: 3px solid #ffb74d;
}

/* v2.4: Responsive Design Styles */

/* ============================================
   BASE STYLES (Mobile First - 375px and below)
   ============================================ */

* {
  box-sizing: border-box;
}

body {
  padding: 10px;
  margin: 0;
}

.title-hero {
  font-size: 1.5rem;
}

.category-title {
  font-size: 1.3rem;
}

.menu-category-card {
  width: 100%;
  min-width: unset;
  height: auto;
  min-height: 8rem;
  margin-bottom: 15px;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

.food-item {
  padding: 10px 5px;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.section-padded {
  padding: 15px;
}

.input-styled {
  width: 100%;
  max-width: 300px;
  min-height: 44px;
}

.btn-primary {
  min-height: 44px;
  min-width: 44px;
}

.footer-card {
  flex-direction: column;
  gap: 10px;
}

/* Touch-friendly states */
.food-item:active {
  background-color: rgba(220, 39, 67, 0.1);
  transform: scale(0.98);
}

.btn-primary:active {
  background-color: #ff0000;
  transform: scale(0.95);
}

/* ============================================
   TABLET (768px and above)
   ============================================ */

@media screen and (min-width: 768px) {
  body {
    padding: 20px;
  }

  .title-hero {
    font-size: 2rem;
  }

  .category-title {
    font-size: 1.5rem;
  }

  .menu-category-card {
    width: 45%;
    margin-bottom: 20px;
  }

  .section-padded {
    padding: 20px;
  }

  .input-styled {
    width: 50%;
  }

  .footer-card {
    flex-direction: row;
  }
}

/* ============================================
   DESKTOP (1024px and above)
   ============================================ */

@media screen and (min-width: 1024px) {
  body {
    padding: 30px 50px;
    max-width: 1400px;
    margin: 0 auto;
  }

  .title-hero {
    font-size: 2.5rem;
  }

  .category-title {
    font-size: 2rem;
  }

  .menu-category-card {
    width: 30%;
    min-width: 300px;
    min-height: 10rem;
    height: auto;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
  }

  .section-padded {
    padding: 25px;
  }

  .input-styled {
    width: 25%;
  }
}

/* ============================================
   LARGE DESKTOP (1440px and above)
   ============================================ */

@media screen and (min-width: 1440px) {
  body {
    padding: 40px 80px;
  }

  .title-hero {
    font-size: 3rem;
  }

  .menu-category-card {
    min-width: 350px;
    min-height: 12rem;
    height: auto;
  }
}

/* v2.5: Error Handling & Validation Styles */

.error {
  color: #ff4444;
  font-size: 0.875rem;
  margin-top: 5px;
}

.invalid-input {
  border-color: #ff4444 !important;
  background-color: rgba(255, 68, 68, 0.05);
}

.invalid-input:focus {
  border-color: #ff4444;
  box-shadow: 0 0 0 3px rgba(255, 68, 68, 0.2);
}
