@import url('https://fonts.googleapis.com/css2?family=Josefin+Sans:wght@300;400;500;600;700&display=swap');

:root {
  --bg: #F5F0E8;
  --bg-card: #FFFFFF;
  --bg-elevated: #FBF7F0;
  --bg-overlay: rgba(60, 36, 21, 0.55);
  --primary: #6B4423;
  --primary-light: #8B5E3C;
  --primary-dark: #3C2415;
  --accent: #C4A882;
  --text: #3C2415;
  --text-secondary: #6B4423;
  --text-muted: #A0846B;
  --border: rgba(107, 68, 35, 0.1);
  --shadow-sm: 0 2px 8px rgba(107, 68, 35, 0.06);
  --shadow: 0 8px 30px rgba(107, 68, 35, 0.08);
  --shadow-lg: 0 20px 60px rgba(107, 68, 35, 0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-full: 9999px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --nav-height: 60px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }

body {
  font-family: 'Josefin Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 12px);
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* ===== AMBIENT BG ART ===== */
body::before {
  content: '';
  position: fixed;
  top: -120px;
  right: -80px;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(196,168,130,0.15) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  animation: floatBlob 8s ease-in-out infinite;
}

body::after {
  content: '';
  position: fixed;
  bottom: -60px;
  left: -60px;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(107,68,35,0.08) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  animation: floatBlob 10s ease-in-out infinite reverse;
}

@keyframes floatBlob {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(20px, -20px) scale(1.05); }
  66% { transform: translate(-10px, 15px) scale(0.95); }
}

/* ===== HEADER ===== */
.app-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  height: var(--nav-height);
  background: rgba(245, 240, 232, 0.85);
  backdrop-filter: blur(24px) saturate(1.2);
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}

.app-header .brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

.brand-logo {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}

.cart-btn {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 17px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s var(--bounce), box-shadow 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.cart-btn:active { transform: scale(0.88); }

.cart-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  transform: scale(0);
  transition: transform 0.4s var(--bounce);
  box-shadow: 0 2px 8px rgba(107,68,35,0.3);
}

.cart-badge.visible { transform: scale(1); }
.cart-badge.bounce {
  animation: badgePop 0.4s var(--bounce);
}

@keyframes badgePop {
  0% { transform: scale(1); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

/* ===== GREETING BAR ===== */
.greeting-bar {
  margin-top: var(--nav-height);
  padding: 20px 16px 6px;
  position: relative;
  z-index: 1;
  animation: slideDown 0.6s var(--bounce) backwards;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

.greeting-bar::after {
  content: '';
  position: absolute;
  top: 10px;
  left: 16px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(196,168,130,0.12) 0%, transparent 70%);
  pointer-events: none;
}

.greeting-bar h1 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 4px;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.greeting-bar p {
  font-size: 14px;
  color: var(--text-muted);
  font-weight: 400;
}

/* ===== SEARCH ===== */
.search-bar {
  padding: 10px 16px 14px;
  position: relative;
  z-index: 1;
  animation: slideDown 0.6s 0.1s var(--bounce) backwards;
}

.search-bar .search-wrap {
  position: relative;
}

.search-bar .search-wrap i {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 15px;
  pointer-events: none;
}

.search-bar .search-wrap input {
  width: 100%;
  padding: 14px 16px 14px 42px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
  box-shadow: var(--shadow-sm);
}

.search-bar .search-wrap input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(107,68,35,0.08), var(--shadow);
  transform: scale(1.01);
}

.search-bar .search-wrap input::placeholder {
  color: var(--text-muted);
}

/* ===== CATEGORY CHIPS ===== */
.cat-scroll {
  padding: 0 16px 16px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  position: relative;
  z-index: 1;
  animation: slideDown 0.6s 0.2s var(--bounce) backwards;
}

.cat-scroll::-webkit-scrollbar { display: none; }

.cat-track {
  display: flex;
  gap: 10px;
}

.cat-chip {
  flex-shrink: 0;
  padding: 10px 20px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.3s var(--bounce);
  box-shadow: var(--shadow-sm);
}

.cat-chip:active { transform: scale(0.92); }

.cat-chip.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 4px 16px rgba(107,68,35,0.25);
}

.cat-chip:not(.active):hover {
  border-color: var(--accent);
  background: var(--bg-elevated);
}

/* ===== DISH SHOWCASE RING ===== */
.dish-ring {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 0 10px;
  gap: 16px;
  user-select: none;
  animation: ringFloat 4s ease-in-out infinite;
}

.dish-ring__track {
  position: relative;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* outermost dashed dot ring */
.dish-ring__track::before {
  content: '';
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  border: 2px dashed var(--accent);
  opacity: 0.4;
  animation: ringSpin 20s linear infinite;
  pointer-events: none;
}

/* solid accent ring */
.dish-ring__track::after {
  content: '';
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  opacity: 0.6;
  pointer-events: none;
}

.dish-ring__glow {
  position: absolute;
  inset: -20px;
  border-radius: 50%;
  background: conic-gradient(from 0deg,
    transparent 0deg,
    rgba(196,168,130,0.25) 60deg,
    rgba(107,68,35,0.12) 120deg,
    transparent 180deg,
    rgba(196,168,130,0.15) 240deg,
    rgba(107,68,35,0.08) 300deg,
    transparent 360deg
  );
  animation: ringSpin 5s linear infinite;
  pointer-events: none;
  mask: radial-gradient(circle at center, transparent 120px, black 122px, black 140px, transparent 142px);
  -webkit-mask: radial-gradient(circle at center, transparent 120px, black 122px, black 140px, transparent 142px);
}

.dish-ring__image {
  position: relative;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--bg-elevated);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  box-shadow:
    0 0 0 4px var(--bg-card),
    0 0 0 7px var(--accent),
    0 0 0 10px rgba(196,168,130,0.15),
    var(--shadow-lg);
  transition: box-shadow 0.6s ease;
}

.dish-ring__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dish-ring__image img.enter {
  animation: dishEnter 0.55s var(--bounce) forwards;
}

.dish-ring__image img.exit {
  animation: dishExit 0.4s ease forwards;
}

/* vignette overlay on image for depth */
.dish-ring__image::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, transparent 40%, rgba(60,36,21,0.25) 100%);
  pointer-events: none;
  z-index: 1;
}

/* small decorative dots at cardinal points */
.dish-ring__dot {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  z-index: 3;
  box-shadow: 0 0 6px rgba(196,168,130,0.5);
}
.dish-ring__dot--t { top: -10px; left: 50%; margin-left: -4px; }
.dish-ring__dot--b { bottom: -10px; left: 50%; margin-left: -4px; }
.dish-ring__dot--l { left: -10px; top: 50%; margin-top: -4px; }
.dish-ring__dot--r { right: -10px; top: 50%; margin-top: -4px; }

.dish-ring__badge {
  position: absolute;
  bottom: 6px;
  right: 6px;
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  z-index: 2;
  box-shadow: 0 4px 12px rgba(107,68,35,0.3);
  letter-spacing: 0.5px;
  border: 2px solid var(--bg-card);
  animation: badgePop 0.4s var(--bounce);
}

.dish-ring__meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-height: 50px;
  text-align: center;
}

.dish-ring__name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  transition: all 0.3s ease;
  position: relative;
}

.dish-ring__name::after {
  content: '';
  display: block;
  width: 28px;
  height: 2px;
  background: var(--accent);
  margin: 6px auto 0;
  border-radius: 2px;
}

.dish-ring__price {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary-light);
  transition: all 0.3s ease;
  margin-top: 2px;
}

@keyframes ringSpin {
  to { transform: rotate(360deg); }
}

@keyframes ringFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes dishEnter {
  0% { opacity: 0; transform: scale(0.5) rotate(-10deg); }
  100% { opacity: 1; transform: scale(1) rotate(0deg); }
}

@keyframes dishExit {
  0% { opacity: 1; transform: scale(1) rotate(0deg); }
  100% { opacity: 0; transform: scale(0.6) rotate(10deg); }
}

@keyframes badgePop {
  0% { transform: scale(0); }
  60% { transform: scale(1.15); }
  100% { transform: scale(1); }
}

/* ===== PROMO BANNER ===== */
.promo-banner {
  margin: 0 16px 20px;
  padding: 20px 22px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 50%, #9B6F4E 100%);
  background-size: 200% 200%;
  animation: gradientShift 6s ease infinite;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  position: relative;
  z-index: 1;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(107,68,35,0.2);
  animation: slideDown 0.6s 0.3s var(--bounce) backwards, gradientShift 6s ease infinite;
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.promo-banner::before {
  content: '';
  position: absolute;
  top: -30px;
  right: -30px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  pointer-events: none;
}

.promo-banner::after {
  content: '';
  position: absolute;
  bottom: -20px;
  left: -20px;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
  pointer-events: none;
}

.promo-banner .promo-text h3 {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 3px;
}

.promo-banner .promo-text p {
  font-size: 13px;
  opacity: 0.85;
}

.promo-banner i {
  font-size: 34px;
  opacity: 0.2;
  animation: truckBounce 3s ease-in-out infinite;
}

@keyframes truckBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-4px); }
}

/* ===== MENU SECTION ===== */
.menu-section {
  padding: 0 16px 16px;
  position: relative;
  z-index: 1;
  animation: fadeUp 0.6s 0.4s var(--bounce) backwards;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.menu-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.menu-section-header h2 {
  font-size: 20px;
  font-weight: 700;
  position: relative;
  display: inline-block;
}

.menu-section-header h2::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 32px;
  height: 3px;
  border-radius: 2px;
  background: var(--primary);
}

.menu-count {
  font-size: 13px;
  color: var(--text-muted);
  background: var(--bg-card);
  padding: 5px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  font-weight: 500;
}

.no-results {
  text-align: center;
  padding: 40px 16px;
  color: var(--text-muted);
  animation: fadeIn 0.3s ease;
}

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

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

/* ===== FOOD CARD ===== */
.food-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  cursor: pointer;
  position: relative;
  transition: transform 0.4s var(--bounce), box-shadow 0.4s ease, border-color 0.3s ease;
  animation: cardSlideUp 0.6s var(--bounce) backwards;
  box-shadow: var(--shadow-sm);
}

.food-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, transparent 40%, rgba(107,68,35,0.02) 100%);
  pointer-events: none;
  z-index: 1;
}

.food-card:nth-child(1) { animation-delay: 0.04s; }
.food-card:nth-child(2) { animation-delay: 0.08s; }
.food-card:nth-child(3) { animation-delay: 0.12s; }
.food-card:nth-child(4) { animation-delay: 0.16s; }
.food-card:nth-child(5) { animation-delay: 0.2s; }
.food-card:nth-child(6) { animation-delay: 0.24s; }
.food-card:nth-child(7) { animation-delay: 0.28s; }
.food-card:nth-child(8) { animation-delay: 0.32s; }

@keyframes cardSlideUp {
  from { opacity: 0; transform: translateY(24px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.food-card:active {
  transform: scale(0.96);
}

.food-card.selected {
  box-shadow: 0 0 0 2px var(--primary), var(--shadow-lg);
  border-color: var(--primary);
}

.food-card-img-wrap {
  position: relative;
  overflow: hidden;
  background: var(--bg-elevated);
  aspect-ratio: 1 / 1;
}

.food-card-img-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(60,36,21,0.08) 0%, transparent 50%);
  pointer-events: none;
  z-index: 1;
}

.food-card-img-wrap .food-card-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--bounce), opacity 0.5s ease;
  opacity: 0;
}

.food-card-img-wrap.loaded .food-card-img {
  opacity: 1;
}

.food-card-shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(107,68,35,0.06) 50%, transparent 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  pointer-events: none;
}

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

.food-card-img-wrap.loaded .food-card-shimmer {
  opacity: 0;
  animation: none;
  transition: opacity 0.4s ease;
}

.food-card-body {
  padding: 12px;
}

.food-card-name {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.food-card-category {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 8px;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

.food-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.food-card-price {
  font-size: 16px;
  font-weight: 800;
  color: var(--primary);
}

.add-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s var(--bounce), background 0.2s ease, box-shadow 0.2s ease;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(107,68,35,0.2);
}

.add-btn:active { transform: scale(0.8); }

.add-btn.added {
  background: #22c55e;
  box-shadow: 0 2px 12px rgba(34,197,94,0.3);
  animation: addPulse 0.4s var(--bounce);
}

@keyframes addPulse {
  0% { transform: scale(1); }
  40% { transform: scale(1.25); }
  100% { transform: scale(1); }
}

/* ===== 3D TILT (desktop) ===== */
@media (hover: hover) {
  .food-card {
    perspective: 800px;
    transform-style: preserve-3d;
    will-change: transform;
  }

  .food-card:hover {
    transform: perspective(800px) rotateX(calc(var(--tilt-y, 0) * 6deg)) rotateY(calc(var(--tilt-x, 0) * -6deg)) translateY(-6px);
    box-shadow: 0 20px 60px rgba(107,68,35,0.12), 0 0 0 1px rgba(107,68,35,0.06);
    border-color: rgba(107,68,35,0.15);
  }

  .food-card:hover .food-card-img {
    transform: scale(1.1);
  }

  .food-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(107,68,35,0.06), transparent 60%);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease;
  }

  .food-card:hover::after {
    opacity: 1;
  }

  .cat-chip:hover {
    transform: translateY(-1px);
  }
}

/* ===== CART OVERLAY ===== */
.cart-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(60, 36, 21, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}

.cart-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* ===== CART DRAWER ===== */
.cart-drawer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--bg-card);
  border-radius: 20px 20px 0 0;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform 0.45s var(--bounce);
  box-shadow: 0 -20px 60px rgba(107,68,35,0.15);
  padding-bottom: var(--safe-bottom);
}

.cart-drawer.open {
  transform: translateY(0);
}

.cart-drawer-handle {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: var(--text-muted);
  margin: 12px auto 0;
  opacity: 0.3;
}

.cart-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px 12px;
}

.cart-drawer-header h3 {
  font-size: 18px;
  font-weight: 700;
}

.cart-drawer-header h3 span {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 14px;
}

.cart-close-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-elevated);
  border: none;
  color: var(--text-secondary);
  font-size: 17px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s var(--bounce), background 0.2s ease;
}

.cart-close-btn:active { transform: scale(0.85); background: rgba(239,68,68,0.1); color: #ef4444; }

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 4px 20px;
}

.cart-empty {
  text-align: center;
  padding: 50px 20px;
  color: var(--text-muted);
}

.cart-empty i {
  font-size: 52px;
  margin-bottom: 14px;
  opacity: 0.2;
}

.cart-empty p {
  font-size: 15px;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  animation: slideInItem 0.3s ease;
}

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

.cart-item:last-child { border-bottom: none; }

.cart-item-img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg-elevated);
  flex-shrink: 0;
  border: 2px solid var(--border);
}

.cart-item-info {
  flex: 1;
  min-width: 0;
}

.cart-item-name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}

.cart-item-price {
  font-size: 13px;
  color: var(--primary);
  font-weight: 700;
}

.cart-item-qty {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cart-item-qty button {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s var(--bounce), background 0.2s ease;
}

.cart-item-qty button:active { transform: scale(0.85); }
.cart-item-qty button.minus:hover { background: rgba(239,68,68,0.1); color: #ef4444; }
.cart-item-qty button.plus:hover { background: rgba(34,197,94,0.1); color: #22c55e; }

.cart-item-qty span {
  font-size: 15px;
  font-weight: 700;
  min-width: 20px;
  text-align: center;
}

.cart-item-remove {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: rgba(239,68,68,0.1);
  color: #ef4444;
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.2s var(--bounce), background 0.2s ease;
}

.cart-item-remove:active { transform: scale(0.8); background: rgba(239,68,68,0.2); }

.cart-checkout {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  background: var(--bg-card);
}

.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.cart-total-label {
  font-size: 15px;
  color: var(--text-secondary);
  font-weight: 600;
}

.cart-total-amount {
  font-size: 22px;
  font-weight: 900;
  color: var(--primary);
}

.checkout-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.form-input {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(107,68,35,0.06);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-row {
  display: flex;
  gap: 10px;
}

.form-row .form-input { flex: 1; }

.send-order-btn {
  width: 100%;
  padding: 16px;
  border-radius: var(--radius-sm);
  border: none;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  background-size: 200% 200%;
  animation: gradientShift 6s ease infinite;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.2s var(--bounce), opacity 0.2s ease, box-shadow 0.2s ease;
  margin-top: 4px;
  box-shadow: 0 4px 16px rgba(107,68,35,0.2);
}

.send-order-btn:active { transform: scale(0.97); }
.send-order-btn:disabled { opacity: 0.5; transform: none; cursor: not-allowed; box-shadow: none; }

.send-order-btn i { font-size: 18px; }

/* ===== LOCATION ===== */
.location-section {
  position: relative;
}

.location-section .delivery-map {
  width: 100%;
  height: 150px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  margin-top: 8px;
}

.location-section .location-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 20;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  max-height: 180px;
  overflow-y: auto;
}

.location-suggestion-item {
  width: 100%;
  padding: 12px 14px;
  text-align: left;
  border: none;
  border-bottom: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s ease;
}

.location-suggestion-item:last-child { border-bottom: none; }
.location-suggestion-item:hover { background: rgba(107,68,35,0.05); }
.location-suggestion-item.is-empty {
  color: var(--text-muted);
  cursor: default;
}

.location-map-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.location-tool-btn {
  padding: 8px 14px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: inherit;
  transition: transform 0.2s var(--bounce), border-color 0.2s ease;
}

.location-tool-btn:active { transform: scale(0.95); }
.location-tool-btn:hover { border-color: var(--primary); }

.location-selected-state {
  font-size: 11px;
  color: var(--text-muted);
  flex: 1;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: calc(var(--nav-height) + var(--safe-bottom) + 20px);
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  z-index: 200;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  font-weight: 600;
  transition: transform 0.45s var(--bounce);
  pointer-events: none;
  white-space: nowrap;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
}

.toast.success i { color: #22c55e; }
.toast.warning i { color: #f59e0b; }
.toast.error i { color: #ef4444; }

/* ===== SUCCESS OVERLAY ===== */
.success-overlay {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(60, 36, 21, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
  text-align: center;
  padding: 24px;
  overflow-y: auto;
}

.success-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.success-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  color: #fff;
  margin-bottom: 18px;
  animation: successPop 0.6s var(--bounce);
  box-shadow: 0 8px 32px rgba(34,197,94,0.3);
}

@keyframes successPop {
  0% { transform: scale(0) rotate(-10deg); }
  60% { transform: scale(1.15) rotate(2deg); }
  100% { transform: scale(1) rotate(0); }
}

.success-anim-wrap {
  animation: successFloat 0.8s var(--bounce);
}

@keyframes successFloat {
  0% { opacity: 0; transform: translateY(40px) scale(0.9); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* ===== RECEIPT ===== */
.receipt {
  background: #FFFFFF;
  border-radius: var(--radius);
  padding: 28px 24px;
  max-width: 320px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  text-align: left;
  color: var(--text);
  margin-bottom: 16px;
  position: relative;
}

.receipt-header {
  text-align: center;
  border-bottom: 2px dashed var(--border);
  padding-bottom: 16px;
  margin-bottom: 16px;
}

.receipt-header img {
  border-radius: 50%;
  border: 2px solid var(--border);
}

.receipt-header h2 {
  font-size: 17px;
  font-weight: 700;
  margin-top: 6px;
}

.receipt-header .receipt-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.receipt-items {
  margin: 12px 0;
  border-bottom: 1px solid var(--border);
  padding-bottom: 12px;
}

.receipt-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  font-size: 13px;
}

.receipt-item-name {
  font-weight: 600;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.receipt-item-qty {
  color: var(--text-muted);
  margin: 0 8px;
  flex-shrink: 0;
}

.receipt-item-price {
  font-weight: 700;
  color: var(--primary);
  flex-shrink: 0;
}

.receipt-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-top: 2px dashed var(--border);
  font-size: 16px;
  font-weight: 800;
}

.receipt-total-amount {
  color: var(--primary);
  font-size: 18px;
}

.receipt-info {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 12px;
  line-height: 1.7;
}

.receipt-info-row {
  display: flex;
  gap: 6px;
}

.receipt-info-label {
  font-weight: 600;
  min-width: 55px;
  flex-shrink: 0;
}

.receipt-not-paid-badge {
  display: table;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  padding: 5px 16px;
  border-radius: var(--radius-full);
  margin: 8px auto 12px;
  box-shadow: 0 3px 12px rgba(239,68,68,0.3);
  text-transform: uppercase;
  animation: badgePulse 2s ease-in-out infinite;
}

.receipt-paid-badge {
  display: table;
  background: linear-gradient(135deg, #22c55e, #16a34a);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  padding: 5px 16px;
  border-radius: var(--radius-full);
  margin: 8px auto 12px;
  box-shadow: 0 3px 12px rgba(34,197,94,0.35);
  text-transform: uppercase;
}

.receipt-pending-badge {
  display: table;
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1.5px;
  padding: 5px 16px;
  border-radius: var(--radius-full);
  margin: 8px auto 12px;
  box-shadow: 0 3px 12px rgba(245,158,11,0.35);
  text-transform: uppercase;
  animation: badgePulse 2s ease-in-out infinite;
}

@keyframes badgePulse {
  0%, 100% { box-shadow: 0 3px 12px rgba(239,68,68,0.3); }
  50% { box-shadow: 0 3px 20px rgba(239,68,68,0.5); }
}

.receipt-qr {
  display: flex;
  justify-content: center;
  padding: 14px 0 4px;
}

.receipt-qr img {
  border-radius: 8px;
  border: 2px solid var(--border);
}

.receipt-qr canvas {
  display: block;
  margin: 0 auto;
  border-radius: 8px;
  border: 2px solid var(--border);
}

.receipt-footer-text {
  text-align: center;
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.receipt-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s var(--bounce), background 0.2s ease;
}

.receipt-close:active { transform: scale(0.85); background: rgba(239,68,68,0.1); color: #ef4444; }

.continue-btn {
  padding: 14px 28px;
  border-radius: var(--radius-full);
  border: none;
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.2s var(--bounce), box-shadow 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(107,68,35,0.2);
}

.continue-btn:active { transform: scale(0.95); }
.continue-btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  box-shadow: none;
}

/* ===== BOTTOM NAV ===== */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 50;
  height: calc(var(--nav-height) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(24px) saturate(1.2);
  -webkit-backdrop-filter: blur(24px) saturate(1.2);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
}

.bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  transition: var(--transition);
  padding: 6px 16px;
  position: relative;
}

.bottom-nav a i {
  font-size: 20px;
  transition: transform 0.2s var(--bounce);
}

.bottom-nav a.active {
  color: var(--primary);
}

.bottom-nav a.active i {
  transform: scale(1.15);
}

.bottom-nav a.active::after {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 3px;
  border-radius: 2px;
  background: var(--primary);
}

/* ===== RESPONSIVE ===== */
@media (min-width: 600px) {
  .menu-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
  }
}

@media (min-width: 900px) {
  .menu-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
  }
  .menu-section { padding: 0 32px 24px; }
  .greeting-bar { padding: 24px 32px 6px; }
  .search-bar { padding: 10px 32px 14px; }
  .cat-scroll { padding: 0 32px 16px; }
  .promo-banner { margin: 0 32px 20px; }
  .app-header { padding: 0 32px; }
  .cart-drawer {
    max-width: 420px;
    right: 20px;
    left: auto;
    bottom: 20px;
    border-radius: 20px;
    max-height: 80vh;
  }
  .cart-overlay.open {
    opacity: 0;
    pointer-events: none;
  }
}

/* ===== UTILITIES ===== */
.hidden { display: none; }
