:root {
  --bg-primary: #FAF6EE;
  --bg-secondary: #F4EBE1;
  --text-primary: #362517;
  --text-secondary: #6A5B4E;
  --accent: #5F6F52;
  --accent-light: #EFF2EC;
  --accent-hover: #4F5D3E;
  --price-color: #B85C38;
  --header-bg: linear-gradient(135deg, #362517 0%, #21140A 100%);
  --border-color: rgba(74, 55, 40, 0.08);
  --glass-bg: rgba(250, 246, 238, 0.88);
  --shadow-sm: 0 2px 8px rgba(74, 55, 40, 0.04);
  --shadow-md: 0 10px 30px rgba(74, 55, 40, 0.06);
  --shadow-lg: 0 20px 40px rgba(74, 55, 40, 0.12);
  --font-sans: 'Outfit', sans-serif;
  --font-serif: 'Playfair Display', serif;
  --border-radius-sm: 8px;
  --border-radius-md: 16px;
  --border-radius-lg: 24px;
}

/* Base Styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  overflow-x: hidden;
  padding-bottom: 60px; /* Safe space at the bottom */
}

/* Header Styles */
.app-header {
  background: var(--header-bg);
  color: #FFFFFF;
  padding: 40px 20px 35px;
  text-align: center;
  position: relative;
  overflow: hidden;
  border-bottom-left-radius: var(--border-radius-lg);
  border-bottom-right-radius: var(--border-radius-lg);
}

.app-header::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(95, 111, 82, 0.25) 0%, transparent 60%);
  pointer-events: none;
}

.brand-title {
  font-family: var(--font-serif);
  font-size: 3rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 2px;
  color: #FFFFFF;
}

.brand-subtitle {
  font-size: 0.8rem;
  letter-spacing: 5px;
  font-weight: 600;
  color: #DCA060;
  display: block;
  margin-bottom: 12px;
}

.welcome-text {
  font-size: 0.95rem;
  font-weight: 300;
  color: rgba(255, 255, 255, 0.7);
  max-width: 320px;
  margin: 0 auto;
}

/* Category Navigation (Horizontal Swipe) */
.category-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  padding: 14px 0;
  box-shadow: var(--shadow-sm);
}

.category-scroll-container {
  display: flex;
  overflow-x: auto;
  scroll-behavior: smooth;
  padding: 0 16px;
  gap: 10px;
  scrollbar-width: none; /* Hide standard scrollbar */
}

.category-scroll-container::-webkit-scrollbar {
  display: none; /* Hide webkit scrollbar */
}

.category-btn {
  white-space: nowrap;
  padding: 10px 20px;
  border-radius: 40px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  box-shadow: var(--shadow-sm);
}

.category-btn.active {
  background-color: var(--accent);
  color: #FFFFFF;
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(207, 92, 63, 0.3);
  transform: translateY(-1px);
}

/* Menu Layout */
.menu-container {
  padding: 24px 16px;
  max-width: 600px;
  margin: 0 auto;
}

.category-section {
  margin-bottom: 40px;
  scroll-margin-top: 85px; /* Offset for sticky header */
}

.category-header {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 18px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}

.category-header::after {
  content: '';
  flex-grow: 1;
  height: 1px;
  background-color: var(--border-color);
}

.products-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Product Cards */
.product-card {
  display: flex;
  background-color: var(--bg-primary);
  border-radius: var(--border-radius-md);
  border: 1px solid var(--border-color);
  padding: 14px;
  gap: 14px;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.product-card:active {
  transform: scale(0.98);
  background-color: var(--bg-secondary);
}

.product-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.product-name-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 4px;
}

.product-name {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.product-price {
  font-family: var(--font-sans);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--price-color);
}

.product-description {
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 12px;
  line-height: 1.4;
}

.detail-btn {
  align-self: flex-start;
  background-color: var(--accent-light);
  color: var(--accent);
  border: none;
  padding: 6px 14px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.8rem;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.detail-btn:hover {
  background-color: var(--accent);
  color: #FFFFFF;
}

.product-image-container {
  width: 90px;
  height: 90px;
  border-radius: var(--border-radius-md);
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
  background-color: var(--bg-secondary);
}

.product-image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Skeletons */
.category-skeleton, .skeleton-title, .product-skeleton-card {
  background: linear-gradient(90deg, var(--bg-secondary) 25%, #EAE2D8 50%, var(--bg-secondary) 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

.category-skeleton {
  width: 80px;
  height: 38px;
  border-radius: 40px;
  flex-shrink: 0;
}

.skeleton-title {
  width: 150px;
  height: 30px;
  margin-bottom: 18px;
  border-radius: var(--border-radius-sm);
}

.product-skeleton-card {
  height: 118px;
  border-radius: var(--border-radius-md);
}

@keyframes loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Bottom Sheet Details */
.bottom-sheet-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(21, 15, 13, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.bottom-sheet-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  max-width: 600px;
  left: 50%;
  transform: translate(-50%, 100%);
  background-color: var(--bg-primary);
  border-top-left-radius: var(--border-radius-lg);
  border-top-right-radius: var(--border-radius-lg);
  z-index: 1000;
  box-shadow: var(--shadow-lg);
  transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
  max-height: 85vh;
  overflow-y: auto;
}

.bottom-sheet.active {
  transform: translate(-50%, 0);
}

.bottom-sheet-handle {
  width: 40px;
  height: 4px;
  background-color: var(--border-color);
  border-radius: 2px;
  margin: 12px auto 8px;
}

.close-sheet-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  background-color: var(--bg-secondary);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: all 0.2s ease;
  z-index: 10;
}

.close-sheet-btn:active {
  transform: scale(0.9);
}

.bottom-sheet-content {
  padding: 0 20px 30px;
}

.sheet-image-container {
  width: 100%;
  height: 200px;
  border-radius: var(--border-radius-md);
  overflow: hidden;
  margin-top: 10px;
  box-shadow: var(--shadow-sm);
  background-color: var(--bg-secondary);
}

.sheet-image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sheet-details {
  margin-top: 20px;
}

.sheet-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 15px;
  margin-bottom: 12px;
}

.sheet-title {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.sheet-price {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--price-color);
}

.sheet-description {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 24px;
}

.allergen-section {
  background-color: var(--bg-secondary);
  padding: 16px;
  border-radius: var(--border-radius-md);
  margin-bottom: 24px;
  border: 1px solid var(--border-color);
}

.allergen-section h3 {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: var(--text-primary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.allergen-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.allergen-tag {
  background-color: #FFFFFF;
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
}

.info-footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  border-top: 1px solid var(--border-color);
  padding-top: 18px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.info-footer span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.info-footer i {
  width: 16px;
  height: 16px;
  color: var(--accent);
}

/* Card Calories Info */
.product-meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.kcal-info {
  font-size: 0.75rem;
  font-weight: 600;
  background-color: var(--accent-light);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.kcal-info i {
  width: 10px;
  height: 10px;
}

/* Ingredients Section inside Bottom Sheet */
.ingredients-section {
  margin-top: 16px;
  margin-bottom: 16px;
}

.ingredients-section h3 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.ingredients-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.calories-info i {
  color: var(--price-color) !important;
}

/* Search Bar styling */
.menu-search-container {
  padding: 16px 16px 0;
  max-width: 600px;
  margin: 0 auto;
}

.menu-search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background-color: var(--glass-bg);
  border: 1px solid var(--border-color);
  border-radius: 30px;
  padding: 4px 8px 4px 16px;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.menu-search-wrapper:focus-within {
  border-color: var(--accent);
  box-shadow: 0 4px 12px rgba(95, 111, 82, 0.15);
  transform: translateY(-1px);
}

.menu-search-wrapper .search-icon {
  width: 18px;
  height: 18px;
  color: var(--text-secondary);
  margin-right: 10px;
  flex-shrink: 0;
}

.menu-search-wrapper input {
  width: 100%;
  border: none;
  background: transparent;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--text-primary);
  outline: none;
  padding: 8px 0;
}

.menu-search-wrapper input::placeholder {
  color: var(--text-secondary);
  opacity: 0.6;
}

.clear-search-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background-color 0.2s;
}

.clear-search-btn:hover {
  background-color: rgba(74, 55, 40, 0.05);
}

.clear-search-btn i {
  width: 16px;
  height: 16px;
}

/* Floating Waiter Call Button */
.waiter-call-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: var(--accent);
  color: #FFFFFF;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(95, 111, 82, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  outline: none;
}

.waiter-call-btn:hover {
  transform: scale(1.05) translateY(-2px);
  background-color: var(--accent-hover);
  box-shadow: 0 6px 20px rgba(95, 111, 82, 0.5);
}

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

.waiter-call-btn i {
  width: 24px;
  height: 24px;
  animation: bellRing 3s infinite ease-in-out;
}

/* Ringing effect pseudo-element */
.waiter-call-btn::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid var(--accent);
  opacity: 0.8;
  animation: wavePing 2.5s infinite cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  box-sizing: border-box;
}

.waiter-tooltip {
  position: absolute;
  bottom: 72px;
  right: 0;
  background-color: var(--text-primary);
  color: var(--bg-primary);
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all 0.3s ease;
  box-shadow: var(--shadow-md);
  pointer-events: none;
}

.waiter-call-btn:hover .waiter-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Custom Alert Toast */
.menu-alert-toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background-color: var(--text-primary);
  color: var(--bg-primary);
  padding: 12px 24px;
  border-radius: 30px;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.menu-alert-toast.active {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.menu-alert-toast i {
  color: var(--accent);
  width: 18px;
  height: 18px;
}

@keyframes bellRing {
  0%, 100%, 50% { transform: rotate(0deg); }
  5%, 15%, 25% { transform: rotate(15deg); }
  10%, 20%, 30% { transform: rotate(-15deg); }
  35%, 45% { transform: rotate(3deg); }
  40% { transform: rotate(-3deg); }
}

@keyframes wavePing {
  0% {
    transform: scale(1);
    opacity: 0.8;
  }
  100% {
    transform: scale(1.6);
    opacity: 0;
  }
}
