:root {
  --primary-color: #0d3b2e;
  --secondary-color: #1a5c4a;
  --text-color: #ffffff;
  --accent-color: #ffd700;
  --font-heading: "Bebas Neue", sans-serif;
  --font-body: "Roboto", sans-serif;
  --card-bg: rgba(255, 255, 255, 0.05);
  --transition-speed: 0.15s;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--primary-color);
  color: var(--text-color);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern" 1;
}

body.loading {
  overflow: hidden;
}

/* Loading Screen */
.loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--secondary-color) 100%
  );
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.loading-screen.fade-out {
  opacity: 0;
  visibility: hidden;
}

.loading-content {
  text-align: center;
}

.burger-loader {
  width: 120px;
  height: 120px;
  margin: 0 auto 30px;
  position: relative;
  animation: burgerBounce 1s ease-in-out infinite;
}

.burger-bun {
  width: 100%;
  height: 20px;
  background: linear-gradient(to bottom, #f4a460, #d2691e);
  border-radius: 50px;
  position: absolute;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.burger-bun.top {
  top: 0;
  animation: bunTop 1.5s ease-in-out infinite;
}

.burger-bun.bottom {
  bottom: 0;
  animation: bunBottom 1.5s ease-in-out infinite;
}

.burger-patty {
  width: 90%;
  height: 18px;
  background: linear-gradient(to bottom, #8b4513, #654321);
  border-radius: 20px;
  position: absolute;
  left: 5%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
  animation: pattyPulse 1.5s ease-in-out infinite;
}

.burger-patty:nth-of-type(2) {
  top: 30px;
  animation-delay: 0.2s;
}

.burger-patty:nth-of-type(4) {
  top: 70px;
  animation-delay: 0.4s;
}

.burger-cheese {
  width: 85%;
  height: 8px;
  background: linear-gradient(to bottom, #ffd700, #ffed4e);
  border-radius: 15px;
  position: absolute;
  top: 52px;
  left: 7.5%;
  box-shadow: 0 1px 4px rgba(255, 215, 0, 0.5);
  animation: cheeseMelt 1.5s ease-in-out infinite;
}

.loading-text {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  color: var(--accent-color);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  animation: textPulse 2s ease-in-out infinite;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
  font-weight: 500;
}

/* Animations */
@keyframes burgerBounce {
  0%,
  100% {
    transform: translateY(0) scale(1);
  }
  50% {
    transform: translateY(-15px) scale(1.05);
  }
}

@keyframes bunTop {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  25% {
    transform: translateY(-3px) rotate(-2deg);
  }
  75% {
    transform: translateY(-3px) rotate(2deg);
  }
}

@keyframes bunBottom {
  0%,
  100% {
    transform: translateY(0) rotate(0deg);
  }
  25% {
    transform: translateY(3px) rotate(2deg);
  }
  75% {
    transform: translateY(3px) rotate(-2deg);
  }
}

@keyframes pattyPulse {
  0%,
  100% {
    transform: scaleY(1);
    opacity: 1;
  }
  50% {
    transform: scaleY(1.1);
    opacity: 0.9;
  }
}

@keyframes cheeseMelt {
  0%,
  100% {
    transform: scaleX(1) translateY(0);
    opacity: 1;
  }
  50% {
    transform: scaleX(1.15) translateY(2px);
    opacity: 0.8;
  }
}

@keyframes textPulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.05);
  }
}

/* Header & Logo */
header {
  padding: 1.25rem 1rem;
  text-align: center;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.2), transparent);
}

.logo-container {
  max-width: 200px;
  margin: 0 auto;
}

.logo {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}

.hero {
  text-align: center;
  padding: 1.5rem 1rem 2rem;
  animation: fadeIn 1s ease-out;
  max-width: 800px;
  margin: 0 auto;
}

.hero h1 {
  font-family: var(--font-heading);
  font-size: 2.75rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  line-height: 1.2;
  margin-bottom: 0.75rem;
  font-weight: 500;
}

.hero p {
  font-size: 1rem;
  color: var(--accent-color);
  opacity: 0.9;
  line-height: 1.5;
  font-weight: 400;
}

/* Filters */
.filters {
  display: flex;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 1rem;
  margin: 0 0 1.5rem 0;
  width: 100%;
  max-width: 100%;
  position: sticky;
  top: 0;
  background: var(--primary-color);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  z-index: 100;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(255, 255, 255, 0.05);
  background-color: var(--primary-color);
  box-sizing: border-box;
}

.filters::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.2),
    rgba(0, 0, 0, 0.05)
  );
  border-radius: 12px;
  pointer-events: none;
  z-index: 0;
}

.filters > * {
  position: relative;
  z-index: 1;
}

.menu-controls {
  width: 100%;
  max-width: 100%;
  margin: 0 0 2rem 0;
  padding: 0;
  box-sizing: border-box;
}

.sort-modal-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.4rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: var(--text-color);
  font-family: var(--font-heading);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  font-weight: 500;
  line-height: 1.4;
}

.sort-modal-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.sort-modal-btn:active {
  transform: translateY(0);
}

.sort-modal-btn svg {
  width: 20px;
  height: 20px;
}

.sort-modal {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.85);
}

.sort-modal.show {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.sort-modal-content {
  background: var(--primary-color);
  border-radius: 16px;
  max-width: 500px;
  width: 100%;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.sort-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sort-modal-header h3 {
  color: var(--accent-color);
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 500;
  letter-spacing: 0.8px;
  margin: 0;
  text-transform: uppercase;
  line-height: 1.3;
}

.sort-modal-close {
  background: none;
  border: none;
  color: var(--text-color);
  font-size: 2rem;
  cursor: pointer;
  padding: 0;
  width: 35px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.1s ease;
}

.sort-modal-close:hover {
  background: rgba(255, 107, 107, 0.3);
}

.sort-modal-body {
  padding: 20px 24px;
}

.sort-options {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.sort-option-btn {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.875rem 1.15rem; /* Reduced */
  background: rgba(255, 255, 255, 0.05);
  border: 2px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  color: var(--text-color);
  font-family: var(--font-heading);
  font-size: 0.875rem; /* Reduced from 1rem */
  font-weight: 500;
  line-height: 1.4;
  text-transform: uppercase;
  letter-spacing: 1px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: left;
}

.sort-option-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent-color);
  transform: translateX(5px);
}

.sort-option-btn.active {
  background: var(--text-color);
  color: var(--primary-color);
  border-color: var(--text-color);
  font-weight: 500;
}

.sort-check {
  opacity: 0;
  color: var(--primary-color);
  font-weight: bold;
  font-size: 1.2rem;
  transition: opacity 0.2s ease;
}

.sort-option-btn.active .sort-check {
  opacity: 1;
}

.filter-btn {
  background: transparent;
  border: 2px solid var(--secondary-color);
  color: var(--text-color);
  padding: 0.55rem 1.1rem; /* Slightly reduced */
  font-family: var(--font-heading);
  font-size: 0.875rem; /* Reduced from 1rem - 14px */
  cursor: pointer;
  transition: all 0.2s ease;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  white-space: nowrap;
  font-weight: 500;
  line-height: 1.4;
}

.filter-btn:hover:not(.active) {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.filter-btn:active:not(.active) {
  transform: translateY(0);
}

.filter-btn.active {
  background: var(--text-color) !important;
  color: var(--primary-color) !important;
  border-color: var(--text-color) !important;
  font-weight: 500;
  box-shadow: 0 2px 8px rgba(255, 255, 255, 0.2);
  transform: none;
}

.filter-btn.active:hover {
  background: var(--text-color) !important;
  color: var(--primary-color) !important;
  border-color: var(--text-color) !important;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 255, 255, 0.3);
}

/* Menu Grid */
.menu-section {
  max-width: 95%;
  width: 95%;
  margin: 0 auto;
  padding: 0 1rem 4rem;
  /* Ensure same width as filters and menu-controls */
  box-sizing: border-box;
}

.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.75rem;
}

@media (max-width: 1024px) and (min-width: 769px) {
  .menu-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
  }

  .menu-item {
    padding: 0.875rem;
  }

  .item-name {
    font-size: 1.3rem; /* Reduced from 1.65rem */
  }

  .item-price {
    font-size: 1.25rem; /* Reduced from 1.5rem */
    padding: 0.4rem 0.85rem;
  }

  .item-desc {
    font-size: 0.85rem;
  }
}

.menu-item {
  background: var(--card-bg);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 1rem;
  transition: all 0.2s ease;
  display: flex;
  flex-direction: column;
  opacity: 1;
  position: relative;
  transform: translateZ(0);
  will-change: transform;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.menu-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
  border-color: rgba(255, 255, 255, 0.2);
}

.menu-item:focus-within {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

.filter-btn:focus,
.sort-modal-btn:focus,
.sort-option-btn:focus {
  outline: 2px solid var(--accent-color);
  outline-offset: 2px;
}

.menu-item-content {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
  height: 100%;
}

.menu-item-image-container {
  width: 100%;
  margin-bottom: 0.75rem;
  border-radius: 8px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.2);
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: 120px;
  height: 120px;
}

.menu-item-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.menu-item:hover .menu-item-image {
  transform: scale(1.05);
}

.item-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.item-name {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  color: var(--text-color);
  text-transform: uppercase;
  line-height: 1.3;
  flex: 1;
  margin: 0;
  letter-spacing: 0.3px;
  font-weight: 500;
}

.item-price {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  letter-spacing: 0.05rem;
  color: var(--accent-color);
  font-weight: 500;
  white-space: nowrap;
}

.item-desc {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.88);
  margin: 0;
  line-height: 1.65;
  flex: 1;
  font-weight: 400;
}

.item-footer {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  margin-top: auto;
  padding-top: 0.5rem;
}

.item-category {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.7);
  text-transform: uppercase;
  letter-spacing: 1px;
  background: rgba(255, 255, 255, 0.08);
  padding: 0.35rem 0.75rem;
  border-radius: 6px;
  font-weight: 400;
  line-height: 1.4;
}

/* Footer */
footer {
  text-align: center;
  padding: 2rem 1rem;
  background: rgba(0, 0, 0, 0.2);
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.6);
  line-height: 1.6;
}

footer a {
  text-align: center;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: color 0.2s ease;
}

footer a:hover {
  color: var(--accent-color);
  text-decoration: underline;
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* Scroll to Top Button */
.scroll-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 50px;
  height: 50px;
  background: var(--accent-color);
  color: var(--primary-color);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all 0.3s ease;
}

.scroll-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.scroll-to-top:hover {
  background: var(--accent-color);
  filter: brightness(1.1);
  transform: translateY(-5px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.4);
}

.scroll-to-top:active {
  transform: translateY(-2px);
}

.scroll-to-top svg {
  width: 24px;
  height: 24px;
}

/* Responsive */
@media (max-width: 768px) {
  .hero {
    padding: 0.5rem;
  }

  .hero h1 {
    font-size: 2rem;
    letter-spacing: 1px;
  }

  .hero p {
    font-size: 0.9rem;
  }

  .menu-section {
    padding: 1rem 0.75rem;
  }

  .menu-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .menu-item {
    border-radius: 10px;
    padding: 0.875rem;
  }

  .menu-item:hover {
    transform: translateY(-3px);
  }

  .menu-item-content {
    gap: 0.625rem;
  }

  .menu-item-image-container {
    margin-bottom: 0.5rem;
  }

  .item-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .item-name {
    font-size: 1.25rem; /* Reduced from 1.5rem */
    width: 100%;
  }

  .item-price {
    font-size: 1.2rem; /* Reduced from 1.4rem */
    padding: 0.4rem 0.75rem;
    align-self: flex-start;
  }

  .item-desc {
    font-size: 0.85rem; /* Reduced from 0.9rem */
    line-height: 1.6;
  }

  .item-footer {
    padding-top: 0.5rem;
  }

  .item-category {
    font-size: 0.65rem; /* Reduced */
    padding: 0.3rem 0.7rem;
  }

  .filter-btn {
    font-size: 0.8rem;
    padding: 0.5rem 1rem;
  }

  .sort-modal-btn {
    font-size: 0.8rem;
    padding: 0.65rem 1.25rem;
  }

  .filters {
    gap: 0.5rem;
    position: static;
    padding: 0.5rem 0;
    width: 95%;
    max-width: none;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 0;
    margin: 0 auto 1rem;
  }

  .filter-btn {
    padding: 0.5rem 0.9rem;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
  }

  .filter-btn.active {
    background: var(--text-color) !important;
    color: var(--primary-color) !important;
    border-color: var(--text-color) !important;
  }

  .menu-controls {
    width: auto;
    max-width: none;
    padding: 0;
    margin: 0 0 1.5rem 0;
    display: flex;
    justify-content: flex-start;
  }

  .sort-modal-btn {
    font-size: 0.9rem;
    padding: 0.65rem 1.25rem;
    width: auto;
    min-width: fit-content;
  }

  .sort-modal-content {
    max-width: 90%;
    margin: 20px;
  }

  .sort-modal-header {
    padding: 16px 20px;
  }

  .sort-modal-header h3 {
    font-size: 1.1rem;
  }

  .sort-option-btn {
    font-size: 0.8rem;
    padding: 0.75rem 1rem;
  }

  .sort-modal-body {
    padding: 20px;
  }

  .sort-option-btn {
    padding: 0.85rem 1rem;
    font-size: 0.9rem;
  }

  .scroll-to-top {
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
  }
}
