/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --brand:    #e85d04;
  --brand-dk: #c44d00;
  --dark:     #1a1a2e;
  --mid:      #2d2d44;
  --light:    #f8f4ef;
  --white:    #ffffff;
  --gray:     #6b7280;
  --border:   #e5e7eb;
  --radius:   14px;
  --shadow:   0 4px 24px rgba(0,0,0,0.08);
  --shadow-lg:0 8px 40px rgba(0,0,0,0.14);
}

html { scroll-behavior: smooth; }
body { font-family: 'Inter', sans-serif; background: var(--white); color: var(--dark); line-height: 1.6; }
h1, h2, h3 { font-family: 'Playfair Display', serif; }
a { text-decoration: none; color: inherit; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ===== BUTTONS ===== */
.btn-primary {
  display: inline-block;
  background: var(--brand);
  color: var(--white);
  padding: 14px 32px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}
.btn-primary:hover { background: var(--brand-dk); transform: translateY(-1px); }
.btn-full { width: 100%; text-align: center; border-radius: var(--radius); padding: 16px; font-size: 1.05rem; }

.btn-secondary {
  display: inline-block;
  background: transparent;
  color: var(--gray);
  padding: 12px 28px;
  border-radius: 50px;
  font-weight: 600;
  font-size: 0.95rem;
  border: 2px solid var(--border);
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
  margin-top: 8px;
  width: 100%;
}
.btn-secondary:hover { border-color: var(--brand); color: var(--brand); }

/* ===== NAVBAR ===== */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: 1200px; margin: 0 auto; padding: 0 24px;
  height: 68px; display: flex; align-items: center; justify-content: space-between;
}
.logo { font-family: 'Playfair Display', serif; font-size: 1.5rem; color: var(--brand); }
.nav-links { display: flex; gap: 32px; }
.nav-links a { font-weight: 500; color: var(--gray); transition: color 0.2s; }
.nav-links a:hover { color: var(--brand); }
.cart-btn {
  background: var(--brand); color: var(--white); border: none;
  border-radius: 50px; padding: 10px 20px; font-size: 1rem;
  cursor: pointer; display: flex; align-items: center; gap: 8px;
  font-weight: 600; transition: background 0.2s;
}
.cart-btn:hover { background: var(--brand-dk); }
.cart-count {
  background: var(--white); color: var(--brand); border-radius: 50%;
  width: 22px; height: 22px; display: inline-flex; align-items: center;
  justify-content: center; font-size: 0.8rem; font-weight: 700;
}

/* ===== HERO ===== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 100px 24px 80px;
  overflow: hidden;
  background: radial-gradient(ellipse at 20% 50%, #2a0a00 0%, #1a1a2e 45%, #0d0d1a 100%);
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 70% 30%, rgba(232,93,4,0.18) 0%, transparent 55%),
    radial-gradient(circle at 20% 80%, rgba(232,93,4,0.10) 0%, transparent 45%);
  pointer-events: none;
}

/* Floating food emojis */
.hero-floats { position: absolute; inset: 0; pointer-events: none; }
.hero-floats span {
  position: absolute; left: var(--x); top: var(--y);
  font-size: var(--s); opacity: 0.13;
  animation: floatBob 6s ease-in-out var(--d) infinite alternate;
  filter: blur(0.5px);
}
@keyframes floatBob {
  from { transform: translateY(0px) rotate(-4deg); }
  to   { transform: translateY(-14px) rotate(4deg); }
}

.hero-content {
  position: relative; text-align: center; max-width: 680px; z-index: 1;
}

/* Logo mark */
.hero-logo-mark {
  width: 90px; height: 90px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), #ff8c42);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 24px;
  box-shadow: 0 0 0 12px rgba(232,93,4,0.12), 0 0 0 24px rgba(232,93,4,0.06);
  animation: pulseLogo 3s ease-in-out infinite;
}
@keyframes pulseLogo {
  0%,100% { box-shadow: 0 0 0 12px rgba(232,93,4,0.12), 0 0 0 24px rgba(232,93,4,0.06); }
  50%      { box-shadow: 0 0 0 16px rgba(232,93,4,0.16), 0 0 0 32px rgba(232,93,4,0.08); }
}
.hero-logo-icon { font-size: 2.6rem; line-height: 1; }

/* Status badge */
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,0.08); backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.15); color: rgba(255,255,255,0.9);
  border-radius: 50px; padding: 7px 18px; font-size: 0.82rem;
  font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase;
  margin-bottom: 22px;
}
.badge-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #4ade80; box-shadow: 0 0 6px #4ade80;
  animation: blink 1.8s ease-in-out infinite;
}
@keyframes blink {
  0%,100% { opacity: 1; } 50% { opacity: 0.3; }
}
.hero-badge.closed .badge-dot { background: #f87171; box-shadow: 0 0 6px #f87171; animation: none; }
.hero-badge.closed { border-color: rgba(248,113,113,0.3); }

/* Heading */
.hero-content h1 {
  font-size: clamp(3.8rem, 9vw, 7rem); color: var(--white);
  line-height: 0.95; margin-bottom: 18px; letter-spacing: -0.02em;
}
.hero-content h1 em {
  font-style: normal;
  background: linear-gradient(135deg, #ff8c42, var(--brand));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-tagline { font-size: 1.15rem; color: rgba(255,255,255,0.55); font-style: italic; margin-bottom: 6px; }
.hero-type { font-size: 0.9rem; color: rgba(255,255,255,0.45); letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 32px; }

/* Meta pills */
.hero-meta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-bottom: 36px; }
.hero-meta-pill {
  display: flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.07); border: 1px solid rgba(255,255,255,0.12);
  border-radius: 50px; padding: 8px 16px; font-size: 0.85rem; color: rgba(255,255,255,0.8);
}
.hero-meta-pill strong { color: #fff; }
.hero-meta-pill span  { color: rgba(255,255,255,0.5); font-size: 0.78rem; }

/* CTA buttons */
.hero-actions { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.btn-hero {
  padding: 16px 40px; font-size: 1.05rem; border-radius: 50px;
  box-shadow: 0 8px 32px rgba(232,93,4,0.45);
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
}
.btn-hero:hover { transform: translateY(-2px); box-shadow: 0 12px 40px rgba(232,93,4,0.55); }
.btn-ghost {
  display: inline-flex; align-items: center;
  padding: 16px 32px; border-radius: 50px;
  border: 2px solid rgba(255,255,255,0.2); color: rgba(255,255,255,0.8);
  font-weight: 600; font-size: 1rem;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.btn-ghost:hover { border-color: rgba(255,255,255,0.5); color: #fff; background: rgba(255,255,255,0.06); }

/* Bottom wave */
.hero-wave { position: absolute; bottom: -1px; left: 0; right: 0; height: 80px; pointer-events: none; }
.hero-wave svg { width: 100%; height: 100%; display: block; }

/* ===== SEARCH ===== */
.search-wrap {
  margin-bottom: 20px;
  padding: 0 0 4px;
}
.search-box {
  position: relative;
  max-width: 520px;
  margin: 0 auto;
}
.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  pointer-events: none;
  opacity: 0.5;
}
#searchInput {
  width: 100%;
  padding: 14px 44px 14px 46px;
  border: 2px solid var(--border);
  border-radius: 50px;
  font-size: 0.97rem;
  font-family: inherit;
  color: var(--dark);
  background: var(--white);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
}
#searchInput:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(232,93,4,0.1);
}
#searchInput::placeholder { color: #aaa; }
/* hide browser's native clear button */
#searchInput::-webkit-search-cancel-button { display: none; }

.search-clear {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--border);
  border: none;
  border-radius: 50%;
  width: 24px;
  height: 24px;
  font-size: 0.75rem;
  cursor: pointer;
  color: var(--gray);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}
.search-clear:hover { background: var(--brand); color: #fff; }

.search-results-info {
  text-align: center;
  font-size: 0.88rem;
  color: var(--gray);
  margin-bottom: 16px;
  margin-top: -8px;
}
.search-results-info strong { color: var(--brand); }

/* highlight matched text */
.search-highlight {
  background: rgba(232,93,4,0.18);
  border-radius: 3px;
  padding: 0 2px;
  font-weight: 700;
  color: var(--brand-dk);
}

/* ===== MENU SECTION ===== */
.menu-section { padding: 80px 0; background: var(--light); }
.section-title { font-size: 2.4rem; text-align: center; margin-bottom: 8px; }
.section-sub { text-align: center; color: var(--gray); margin-bottom: 40px; font-size: 1.05rem; }

/* Tabs */
.tabs-wrap {
  position: sticky;
  top: 68px; /* navbar height */
  z-index: 90;
  background: var(--light);
  overflow-x: auto;
  padding: 14px 0;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 16px rgba(0,0,0,0.06);
  scrollbar-width: none;
}
.tabs-wrap::-webkit-scrollbar { display: none; }
.tabs { display: flex; gap: 10px; width: max-content; padding: 0 24px; }
.tab {
  padding: 10px 22px; border-radius: 50px; border: 2px solid var(--border);
  background: var(--white); font-size: 0.88rem; font-weight: 600;
  cursor: pointer; color: var(--gray); transition: all 0.2s; white-space: nowrap;
}
.tab:hover { border-color: var(--brand); color: var(--brand); }
.tab.active { background: var(--brand); border-color: var(--brand); color: var(--white); }

/* Menu Grid */
.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 22px;
}
.loading { grid-column: 1/-1; text-align: center; color: var(--gray); padding: 60px; font-size: 1.1rem; }

/* Menu Card */
.menu-card {
  background: var(--white); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex; flex-direction: column;
}
.menu-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

.card-img {
  height: 190px; overflow: hidden; position: relative;
  background: linear-gradient(135deg, #fff5ee, #ffe8d6);
}
.card-img img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.4s;
}
.menu-card:hover .card-img img { transform: scale(1.06); }
.card-img-fallback {
  width: 100%; height: 100%; display: flex;
  align-items: center; justify-content: center; font-size: 4rem;
}

.discount-badge {
  position: absolute; top: 10px; right: 10px;
  background: var(--brand); color: #fff;
  font-size: 0.72rem; font-weight: 700;
  padding: 3px 9px; border-radius: 50px;
}

.card-body { padding: 16px; flex: 1; display: flex; flex-direction: column; }
.card-cat {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--brand); margin-bottom: 5px;
}
.card-name { font-size: 1rem; font-weight: 700; margin-bottom: 5px; line-height: 1.3; }
.card-desc { font-size: 0.83rem; color: var(--gray); flex: 1; margin-bottom: 14px; line-height: 1.5; }
.card-footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

.price-wrap { display: flex; flex-direction: column; }
.card-price { font-size: 1.15rem; font-weight: 700; color: var(--dark); }
.card-price-original {
  font-size: 0.78rem; color: var(--gray);
  text-decoration: line-through; line-height: 1;
}

.add-btn {
  background: var(--brand); color: var(--white); border: none;
  border-radius: 50px; padding: 9px 18px; font-size: 0.85rem;
  font-weight: 600; cursor: pointer; white-space: nowrap;
  transition: background 0.2s, transform 0.15s;
}
.add-btn:hover { background: var(--brand-dk); transform: scale(1.05); }
.add-btn:active { transform: scale(0.97); }
.add-btn:disabled { background: #ccc; cursor: not-allowed; transform: none; }

/* ===== ABOUT ===== */
.about-section { padding: 80px 0; background: var(--white); }
.about-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }
.about-text h2 { font-size: 2.2rem; margin-bottom: 16px; }
.about-text p { color: var(--gray); margin-bottom: 16px; font-size: 1.02rem; }
.stats { display: flex; gap: 28px; margin-top: 32px; flex-wrap: wrap; }
.stat { text-align: center; }
.stat span { display: block; font-size: 1.8rem; font-weight: 700; color: var(--brand); font-family: 'Playfair Display', serif; }
.stat small { font-size: 0.82rem; color: var(--gray); }
.about-img { display: flex; justify-content: center; }
.about-img img {
  width: 100%; max-width: 420px; border-radius: 20px;
  box-shadow: var(--shadow-lg); object-fit: cover; aspect-ratio: 4/3;
}

/* ===== CONTACT ===== */
.contact-section { padding: 80px 0; background: var(--light); }
.contact-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px; margin-top: 40px;
}
.contact-card {
  background: var(--white); border-radius: var(--radius);
  padding: 28px 24px; box-shadow: var(--shadow);
  font-size: 0.95rem; line-height: 1.9;
}

/* ===== FOOTER ===== */
.footer {
  background: var(--dark); color: rgba(255,255,255,0.6);
  text-align: center; padding: 28px 24px; font-size: 0.9rem;
}

/* ===== CART SIDEBAR ===== */
.cart-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.45);
  z-index: 200; opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.cart-overlay.open { opacity: 1; pointer-events: all; }

.cart-sidebar {
  position: fixed; top: 0; right: 0; width: 400px; max-width: 100vw;
  height: 100vh; background: var(--white); z-index: 201;
  display: flex; flex-direction: column;
  box-shadow: -8px 0 40px rgba(0,0,0,0.15);
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
}
.cart-sidebar.open { transform: translateX(0); }

.cart-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 24px; border-bottom: 1px solid var(--border);
}
.cart-header h3 { font-size: 1.4rem; }
.close-cart {
  background: none; border: none; font-size: 1.2rem; cursor: pointer;
  color: var(--gray); padding: 4px 8px; border-radius: 6px; transition: background 0.2s;
}
.close-cart:hover { background: var(--light); }

.cart-items { flex: 1; overflow-y: auto; padding: 12px 24px; }
.cart-empty { text-align: center; color: var(--gray); margin-top: 60px; line-height: 2.2; font-size: 1rem; }

.cart-item {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 0; border-bottom: 1px solid var(--border);
}
.cart-item-img {
  width: 52px; height: 52px; border-radius: 10px; overflow: hidden;
  background: var(--light); flex-shrink: 0;
}
.cart-item-img img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-weight: 600; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-item-flavor { font-size: 0.75rem; color: var(--brand); font-weight: 500; }
.cart-item-price { font-size: 0.85rem; color: var(--gray); margin-top: 2px; }
.cart-item-qty { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.qty-btn {
  width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--border);
  background: var(--white); font-size: 1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: var(--dark); transition: border-color 0.2s, background 0.2s;
}
.qty-btn:hover { border-color: var(--brand); background: #fff5ee; }
.qty-num { font-weight: 600; min-width: 20px; text-align: center; font-size: 0.95rem; }

.cart-footer {
  padding: 18px 24px; border-top: 1px solid var(--border); background: var(--light);
}
.cart-subtotal {
  display: flex; justify-content: space-between;
  font-size: 0.92rem; color: var(--gray); margin-bottom: 8px;
}
.cart-total {
  display: flex; justify-content: space-between;
  font-size: 1.15rem; font-weight: 700; margin-bottom: 14px;
  padding-top: 10px; border-top: 1px solid var(--border);
}
.min-order-note {
  font-size: 0.8rem; color: var(--brand); text-align: center;
  margin-bottom: 10px; font-weight: 500;
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55);
  z-index: 300; display: flex; align-items: center;
  justify-content: center; padding: 24px;
}
.modal {
  background: var(--white); border-radius: 20px; padding: 44px 36px;
  max-width: 440px; width: 100%; text-align: center;
  box-shadow: var(--shadow-lg);
  animation: popIn 0.35s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes popIn {
  from { transform: scale(0.8); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}
.modal-icon { font-size: 3.5rem; margin-bottom: 14px; }
.modal h2 { font-size: 1.9rem; margin-bottom: 12px; }
.modal p { color: var(--gray); margin-bottom: 10px; font-size: 0.97rem; }
.order-id { font-size: 0.85rem; color: var(--brand); font-weight: 600; margin-bottom: 22px; }

/* Flavor modal */
.flavor-modal { max-width: 380px; }
.flavor-modal h2 { font-size: 1.5rem; margin-bottom: 8px; }
.flavor-modal p { font-size: 0.9rem; margin-bottom: 20px; }
.flavor-options { display: flex; flex-direction: column; gap: 10px; margin-bottom: 8px; }
.flavor-opt {
  padding: 12px 20px; border-radius: 10px; border: 2px solid var(--border);
  background: var(--white); font-size: 0.95rem; font-weight: 600;
  cursor: pointer; transition: all 0.2s; text-align: left;
}
.flavor-opt:hover { border-color: var(--brand); background: #fff5ee; color: var(--brand); }

/* ===== TOAST ===== */
.toast {
  position: fixed; bottom: 28px; left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--dark); color: var(--white);
  padding: 12px 24px; border-radius: 50px;
  font-size: 0.88rem; font-weight: 500; z-index: 400;
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
  white-space: nowrap; max-width: 90vw; text-align: center;
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ===== RESPONSIVE ===== */

/* --- Tablet (≤ 900px) --- */
@media (max-width: 900px) {
  .about-inner { grid-template-columns: 1fr; gap: 36px; }
  .about-img { order: -1; }
  .about-img img { max-width: 100%; aspect-ratio: 16/9; }
  .menu-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
}

/* --- Mobile (≤ 640px) --- */
@media (max-width: 640px) {

  /* Navbar */
  .nav-links { display: none; }
  .nav-inner { padding: 0 16px; }
  .logo { font-size: 1.25rem; }
  .cart-btn { padding: 9px 14px; font-size: 0.9rem; gap: 6px; }

  /* Hero */
  .hero { min-height: 100svh; padding: 72px 20px 64px; }
  .hero-logo-mark { width: 72px; height: 72px; margin-bottom: 18px; }
  .hero-logo-icon { font-size: 2rem; }
  .hero-content h1 { font-size: clamp(2.8rem, 14vw, 4rem); line-height: 1; margin-bottom: 14px; }
  .hero-tagline { font-size: 1rem; }
  .hero-type { font-size: 0.78rem; margin-bottom: 24px; }
  .hero-badge { font-size: 0.75rem; padding: 6px 14px; margin-bottom: 16px; }
  .hero-meta { gap: 8px; margin-bottom: 28px; }
  .hero-meta-pill { font-size: 0.76rem; padding: 7px 11px; gap: 4px; }
  .hero-actions { flex-direction: column; align-items: center; gap: 10px; }
  .btn-hero { width: 100%; max-width: 280px; text-align: center; padding: 15px 24px; font-size: 1rem; }
  .btn-ghost { width: 100%; max-width: 280px; text-align: center; justify-content: center; padding: 14px 24px; }
  .hero-floats span { opacity: 0.07; } /* subtler on small screens */

  /* Menu section */
  .menu-section { padding: 48px 0 60px; }
  .section-title { font-size: 1.8rem; }
  .section-sub { font-size: 0.92rem; margin-bottom: 0; }
  .container { padding: 0 16px; }

  /* Sticky tabs */
  .tabs-wrap { top: 60px; padding: 10px 0; }
  .tabs { padding: 0 16px; gap: 8px; }
  .tab { padding: 8px 16px; font-size: 0.82rem; }

  /* Search */
  #searchInput { font-size: 1rem; padding: 13px 42px 13px 44px; }

  /* Menu grid — single column on very small, 2-col on wider mobile */
  .menu-grid { grid-template-columns: 1fr; gap: 16px; }
  .card-img { height: 160px; }
  .card-body { padding: 14px; }
  .card-name { font-size: 0.95rem; }
  .card-desc { font-size: 0.8rem; margin-bottom: 10px; }
  .card-price { font-size: 1.05rem; }
  .add-btn { padding: 8px 14px; font-size: 0.82rem; }

  /* About */
  .about-section { padding: 48px 0; }
  .about-text h2 { font-size: 1.7rem; }
  .stats { gap: 12px; justify-content: center; }
  .stat span { font-size: 1.5rem; }

  /* Contact */
  .contact-section { padding: 48px 0; }
  .contact-grid { grid-template-columns: 1fr; gap: 14px; margin-top: 24px; }
  .contact-card { padding: 20px 18px; font-size: 0.9rem; }

  /* Cart sidebar — full screen on mobile */
  .cart-sidebar { width: 100vw; }
  .cart-header { padding: 18px 16px; }
  .cart-items { padding: 10px 16px; }
  .cart-footer { padding: 14px 16px; }
  .cart-item-name { font-size: 0.85rem; }

  /* Modals */
  .modal-overlay { padding: 12px; align-items: flex-end; }
  .modal {
    padding: 32px 20px 24px;
    border-radius: 20px 20px 0 0;
    max-width: 100%;
    width: 100%;
    animation: slideUp 0.3s ease;
  }
  @keyframes slideUp {
    from { transform: translateY(60px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
  }
  .modal h2 { font-size: 1.5rem; }
  .modal-icon { font-size: 2.8rem; }

  /* Address modal */
  .address-modal {
    padding: 24px 16px 20px;
    border-radius: 20px 20px 0 0;
    max-height: 96svh;
  }
  .address-modal h2 { font-size: 1.4rem; }
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .form-group input,
  .form-group select { font-size: 1rem; padding: 13px 14px; } /* prevent iOS zoom */
  .btn-locate { font-size: 0.85rem; }

  /* Flavor modal */
  .flavor-modal { max-width: 100%; }

  /* Toast */
  .toast { bottom: 16px; font-size: 0.82rem; padding: 10px 18px; }
}

/* --- Two-column cards on mid-size phones (400–640px) --- */
@media (min-width: 400px) and (max-width: 640px) {
  .menu-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .card-img { height: 130px; }
  .card-body { padding: 10px; }
  .card-name { font-size: 0.85rem; }
  .card-desc { display: none; } /* hide desc in 2-col to save space */
  .card-price { font-size: 0.95rem; }
  .add-btn { padding: 7px 10px; font-size: 0.78rem; }
}


/* ===== ADDRESS / CHECKOUT MODAL ===== */
.address-modal {
  max-width: 560px;
  width: 100%;
  padding: 36px 36px 32px;
  text-align: left;
  max-height: 92vh;
  overflow-y: auto;
}
.address-modal h2 { font-size: 1.8rem; margin-bottom: 4px; }
.modal-sub { color: var(--gray); font-size: 0.92rem; margin-bottom: 20px; }

/* Delivery / Pickup toggle */
.order-type-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 24px;
  background: var(--light);
  border-radius: 14px;
  padding: 6px;
}
.order-type-btn {
  padding: 12px 16px;
  border-radius: 10px;
  border: none;
  background: transparent;
  font-size: 0.97rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--gray);
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.order-type-btn.active {
  background: var(--white);
  color: var(--brand);
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}
.order-type-btn:not(.active):hover { color: var(--dark); }

/* Pickup info box */
.pickup-info {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  background: var(--light);
  border-radius: 14px;
  padding: 20px;
  border-left: 4px solid var(--brand);
}
.pickup-info-icon { font-size: 2rem; flex-shrink: 0; }
.pickup-info strong { display: block; font-size: 1rem; margin-bottom: 4px; }
.pickup-info p { font-size: 0.88rem; color: var(--gray); margin: 0; line-height: 1.6; }
.pickup-note { margin-top: 8px !important; color: var(--brand) !important; font-weight: 500; }

.label-hint { font-weight: 400; color: var(--gray); text-transform: none; letter-spacing: 0; font-size: 0.78rem; }

.modal-back {
  background: none; border: none; color: var(--brand);
  font-size: 0.88rem; font-weight: 600; cursor: pointer;
  padding: 0; margin-bottom: 16px; display: inline-flex;
  align-items: center; gap: 4px; transition: opacity 0.2s;
}
.modal-back:hover { opacity: 0.75; }

/* Form layout */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { display: flex; flex-direction: column; margin-bottom: 16px; }
.form-group label {
  font-size: 0.82rem; font-weight: 600; color: var(--dark);
  margin-bottom: 6px; text-transform: uppercase; letter-spacing: 0.04em;
}
.form-group input,
.form-group select {
  padding: 12px 14px; border: 2px solid var(--border);
  border-radius: 10px; font-size: 0.95rem; font-family: inherit;
  color: var(--dark); background: var(--white);
  transition: border-color 0.2s, box-shadow 0.2s;
  outline: none;
}
.form-group input:focus,
.form-group select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(232,93,4,0.12);
}
.form-group input.invalid { border-color: #e53e3e; }
.field-err { font-size: 0.78rem; color: #e53e3e; margin-top: 4px; min-height: 16px; }

/* Location row */
.location-row { margin-bottom: 20px; }
.btn-locate {
  margin-top: 8px; padding: 10px 18px; border-radius: 50px;
  border: 2px solid var(--border); background: var(--white);
  font-size: 0.88rem; font-weight: 600; cursor: pointer;
  color: var(--dark); transition: border-color 0.2s, color 0.2s;
  display: inline-flex; align-items: center; gap: 6px;
}
.btn-locate:hover { border-color: var(--brand); color: var(--brand); }
.locate-status { display: block; font-size: 0.8rem; color: var(--gray); margin-top: 6px; }
.locate-status.ok { color: #38a169; }
.locate-status.err { color: #e53e3e; }

/* Checkout summary */
.checkout-summary {
  background: var(--light); border-radius: 12px;
  padding: 16px 18px; margin-bottom: 20px;
}
.checkout-summary h4 {
  font-size: 0.85rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--gray); margin-bottom: 12px;
}
.summary-item {
  display: flex; justify-content: space-between; align-items: flex-start;
  font-size: 0.88rem; margin-bottom: 6px; gap: 8px;
}
.summary-item-name { flex: 1; color: var(--dark); }
.summary-item-price { font-weight: 600; white-space: nowrap; }
.summary-divider { border: none; border-top: 1px solid var(--border); margin: 10px 0; }
.summary-row {
  display: flex; justify-content: space-between;
  font-size: 0.9rem; color: var(--gray); margin-bottom: 4px;
}
.summary-total {
  display: flex; justify-content: space-between;
  font-size: 1.05rem; font-weight: 700; color: var(--dark);
  margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border);
}

/* Place order button loading state */
#placeOrderBtn:disabled { background: #ccc; cursor: not-allowed; transform: none; }
#placeOrderBtn.loading { background: var(--brand-dk); }
