/* ============================================================
   FoodExpress — styles.css
   Mobile-first, vanilla CSS. No frameworks, no external assets.
   ============================================================ */

/* ---------- Design tokens ---------- */
:root {
  --brand: #e63946;
  --brand-dark: #c1121f;
  --brand-soft: #fff1f1;
  --ink: #1d1d1f;
  --muted: #6b7280;
  --bg: #fffdf9;
  --card: #ffffff;
  --line: #f0e8dd;
  --gold: #f4a261;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(0, 0, 0, 0.08);
  --font: "Poppins", -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; }
.container { width: min(1120px, 92%); margin-inline: auto; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 200;
  background: var(--ink); color: #fff; padding: 0.6rem 1rem; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }
.hidden { display: none !important; }

/* ---------- Buttons ---------- */
.btn {
  border: none; border-radius: 999px; padding: 0.8rem 1.6rem;
  font-weight: 600; font-size: 1rem; transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn.primary { background: var(--brand); color: #fff; box-shadow: 0 4px 14px rgba(230, 57, 70, 0.35); }
.btn.primary:hover { background: var(--brand-dark); transform: translateY(-1px); }
.btn.ghost { background: transparent; color: var(--ink); border: 2px solid var(--line); margin-top: 0.6rem; }
.btn.full { width: 100%; }
.icon-btn {
  background: none; border: none; font-size: 1.25rem; color: var(--muted); padding: 0.25rem 0.5rem;
}

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 253, 249, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; gap: 1rem; padding: 0.8rem 0; }
.logo { font-size: 1.5rem; font-weight: 800; text-decoration: none; letter-spacing: -0.5px; }
.logo span { color: var(--brand); }
.logo.light { color: #fff; }
.nav-links { display: none; gap: 1.4rem; margin-left: auto; }
.nav-links a { text-decoration: none; font-weight: 500; }
.nav-links a:hover { color: var(--brand); }
.nav-toggle {
  display: flex; flex-direction: column; gap: 5px; margin-left: auto;
  background: none; border: none; padding: 0.5rem;
}
.nav-toggle span { width: 24px; height: 2.5px; background: var(--ink); border-radius: 2px; }
.cart-btn {
  background: var(--ink); color: #fff; border: none; border-radius: 999px;
  padding: 0.55rem 1.1rem; font-weight: 600; font-size: 0.95rem;
  display: flex; align-items: center; gap: 0.5rem;
}
.cart-count {
  background: var(--brand); color: #fff; border-radius: 999px;
  min-width: 1.5rem; height: 1.5rem; display: inline-flex;
  align-items: center; justify-content: center; font-size: 0.8rem; padding: 0 0.35rem;
}
/* Mobile nav open state */
.nav-links.open {
  display: flex; flex-direction: column; position: absolute; top: 100%; left: 0; right: 0;
  background: var(--card); padding: 1rem 4%; border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow); gap: 0.9rem;
}

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, #fff7ed 0%, #ffe4e6 55%, #fff1f1 100%);
  padding: 3rem 0 2.5rem; overflow: hidden;
}
.hero-inner { display: grid; gap: 2rem; }
.hero-kicker {
  display: inline-block; background: var(--brand-soft); color: var(--brand-dark);
  font-weight: 600; font-size: 0.85rem; padding: 0.35rem 0.9rem; border-radius: 999px;
  margin-bottom: 1rem;
}
.hero h1 { font-size: clamp(1.9rem, 5.5vw, 3.2rem); line-height: 1.15; letter-spacing: -1px; margin-bottom: 1rem; }
.hero-sub { color: var(--muted); font-size: 1.05rem; margin-bottom: 1.5rem; max-width: 34rem; }
.search-bar { display: flex; gap: 0.5rem; max-width: 30rem; }
.search-bar input {
  flex: 1; border: 2px solid var(--line); border-radius: 999px;
  padding: 0.8rem 1.2rem; font-size: 1rem; font-family: inherit; background: #fff;
}
.search-bar input:focus { outline: none; border-color: var(--brand); }
.search-bar button {
  background: var(--brand); color: #fff; border: none; border-radius: 999px;
  padding: 0.8rem 1.6rem; font-weight: 600; font-size: 1rem;
}
.search-bar button:hover { background: var(--brand-dark); }
.hero-stats { display: flex; gap: 2rem; margin-top: 1.8rem; }
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats strong { font-size: 1.4rem; }
.hero-stats span { color: var(--muted); font-size: 0.85rem; }
/* Decorative pure-CSS visual (no images) */
.hero-visual {
  position: relative; min-height: 220px; border-radius: var(--radius);
  background: linear-gradient(135deg, #e63946, #f4a261);
  display: flex; align-items: flex-end; justify-content: center; overflow: hidden;
}
.hero-blob { position: absolute; border-radius: 50%; opacity: 0.35; }
.blob-1 { width: 180px; height: 180px; background: #fff; top: -40px; right: -30px; }
.blob-2 { width: 120px; height: 120px; background: #ffd166; bottom: 30px; left: 8%; }
.blob-3 { width: 70px; height: 70px; background: #fff; bottom: 90px; right: 20%; }
.hero-visual-caption {
  position: relative; color: #fff; font-weight: 700; font-size: 1.3rem;
  padding: 1.2rem; text-shadow: 0 2px 8px rgba(0,0,0,0.25); text-align: center;
}

/* ---------- Categories ---------- */
.categories { padding: 2.2rem 0 0.5rem; }
.categories h2, .menu-section h2, .how h2, .reviews h2 { font-size: 1.7rem; letter-spacing: -0.5px; margin-bottom: 1rem; }
.cat-pills { display: flex; gap: 0.6rem; overflow-x: auto; padding-bottom: 0.8rem; -webkit-overflow-scrolling: touch; }
.pill {
  flex: 0 0 auto; border: 2px solid var(--line); background: #fff; border-radius: 999px;
  padding: 0.55rem 1.2rem; font-weight: 500; font-size: 0.95rem;
}
.pill:hover { border-color: var(--brand); }
.pill.active { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---------- Menu grid ---------- */
.menu-section { padding: 1.5rem 0 3rem; }
.section-sub { color: var(--muted); margin-bottom: 1.6rem; }
.menu-grid { display: grid; gap: 1.2rem; grid-template-columns: 1fr; }
.dish-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.dish-card:hover { transform: translateY(-4px); box-shadow: 0 12px 32px rgba(0,0,0,0.12); }
/* Gradient placeholder visual — pure CSS, no images/emoji/SVG */
.dish-visual {
  aspect-ratio: 16 / 9; display: flex; align-items: center; justify-content: center;
  position: relative;
}
.dish-initial {
  font-size: 3.2rem; font-weight: 800; color: rgba(255,255,255,0.95);
  text-shadow: 0 3px 12px rgba(0,0,0,0.25);
}
.dish-badge {
  position: absolute; top: 0.7rem; left: 0.7rem; background: var(--ink); color: #fff;
  font-size: 0.72rem; font-weight: 600; padding: 0.25rem 0.7rem; border-radius: 999px;
}
.dish-body { padding: 1.1rem 1.2rem 1.3rem; display: flex; flex-direction: column; gap: 0.5rem; flex: 1; }
.dish-body h3 { font-size: 1.1rem; }
.dish-cat { font-size: 0.78rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.6px; }
.dish-desc { color: var(--muted); font-size: 0.92rem; flex: 1; }
.dish-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 0.4rem; }
.price { font-weight: 700; font-size: 1.15rem; color: var(--brand-dark); }
.add-btn {
  background: var(--brand); color: #fff; border: none; border-radius: 999px;
  padding: 0.55rem 1.3rem; font-weight: 600; font-size: 0.95rem;
}
.add-btn:hover { background: var(--brand-dark); }
.no-results { text-align: center; color: var(--muted); padding: 2rem 0; }

/* ---------- How it works ---------- */
.how { background: #fff; border-block: 1px solid var(--line); padding: 3rem 0; }
.steps { display: grid; gap: 1.2rem; }
.step { background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; }
.step-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.4rem; height: 2.4rem; border-radius: 50%;
  background: var(--brand); color: #fff; font-weight: 700; margin-bottom: 0.8rem;
}
.step h3 { margin-bottom: 0.4rem; }
.step p { color: var(--muted); font-size: 0.95rem; }

/* ---------- Reviews ---------- */
.reviews { padding: 3rem 0; }
.review-grid { display: grid; gap: 1.2rem; }
.review { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); }
.stars { color: #f4a261; letter-spacing: 2px; margin-bottom: 0.6rem; }
.review p { font-style: italic; margin-bottom: 1rem; }
.review footer { display: flex; gap: 0.8rem; align-items: center; font-size: 0.9rem; }
.avatar {
  width: 2.6rem; height: 2.6rem; border-radius: 50%; flex: 0 0 auto;
  background: linear-gradient(135deg, var(--brand), var(--gold));
  color: #fff; font-weight: 700; display: inline-flex; align-items: center; justify-content: center;
}

/* ---------- Footer ---------- */
.site-footer { background: #191919; color: #d6d3d1; padding: 3rem 0 0; }
.footer-grid { display: grid; gap: 2rem; padding-bottom: 2rem; }
.site-footer h3 { color: #fff; margin-bottom: 0.8rem; font-size: 1.05rem; }
.site-footer ul { display: grid; gap: 0.5rem; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: #fff; }
.site-footer address { font-style: normal; }
.site-footer .hours { margin-top: 0.8rem; color: #a8a29e; font-size: 0.9rem; }
.footer-bottom { border-top: 1px solid #2e2e2e; padding: 1.1rem 0; font-size: 0.88rem; color: #a8a29e; }

/* ---------- Cart drawer ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 90;
}
.cart-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 94vw);
  background: #fff; z-index: 100; display: flex; flex-direction: column;
  transform: translateX(105%); transition: transform 0.28s ease;
  box-shadow: -8px 0 32px rgba(0,0,0,0.15);
}
.cart-drawer.open { transform: translateX(0); }
.cart-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1.1rem 1.3rem; border-bottom: 1px solid var(--line);
}
.cart-head h2 { font-size: 1.25rem; }
.cart-view { padding: 1.2rem 1.3rem; overflow-y: auto; flex: 1; }
.cart-view.center { text-align: center; padding-top: 3rem; }
.cart-items { display: grid; gap: 1rem; }
.cart-item { display: grid; grid-template-columns: 1fr auto; gap: 0.4rem 0.8rem; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
.cart-item .ci-name { font-weight: 600; }
.cart-item .ci-price { color: var(--muted); font-size: 0.9rem; }
.qty-controls { display: flex; align-items: center; gap: 0.7rem; grid-column: 1; }
.qty-btn {
  width: 1.9rem; height: 1.9rem; border-radius: 50%; border: 2px solid var(--line);
  background: #fff; font-weight: 700; font-size: 1rem; line-height: 1;
}
.qty-btn:hover { border-color: var(--brand); color: var(--brand); }
.qty { font-weight: 600; min-width: 1.4rem; text-align: center; }
.ci-remove {
  grid-column: 2; grid-row: 1 / span 2; align-self: start;
  background: none; border: none; color: var(--muted); font-size: 0.85rem; text-decoration: underline;
}
.ci-remove:hover { color: var(--brand-dark); }
.ci-total { grid-column: 2; grid-row: 2; font-weight: 700; align-self: end; }
.cart-empty { color: var(--muted); text-align: center; padding: 2.5rem 0; }
.cart-summary { margin-top: 1.2rem; border-top: 2px dashed var(--line); padding-top: 1rem; display: grid; gap: 0.5rem; }
.row { display: flex; justify-content: space-between; }
.row.total { font-weight: 700; font-size: 1.15rem; margin: 0.4rem 0 0.8rem; }
.free-note { font-size: 0.85rem; color: #15803d; }
/* Checkout form */
#checkoutForm { display: grid; gap: 1rem; }
#checkoutForm h3 { font-size: 1.15rem; }
#checkoutForm label { display: grid; gap: 0.35rem; font-weight: 500; font-size: 0.95rem; }
#checkoutForm input, #checkoutForm textarea {
  border: 2px solid var(--line); border-radius: 10px; padding: 0.7rem 0.9rem;
  font-size: 1rem; font-family: inherit; width: 100%;
}
#checkoutForm input:focus, #checkoutForm textarea:focus { outline: none; border-color: var(--brand); }
.form-error { color: var(--brand-dark); font-size: 0.9rem; font-weight: 500; }
/* Confirmation */
.confirm-badge {
  width: 4.5rem; height: 4.5rem; border-radius: 50%; margin: 0 auto 1rem;
  background: #dcfce7; color: #15803d; font-size: 2.2rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.order-id { margin: 1rem 0 1.5rem; color: var(--muted); }

/* ---------- Larger screens ---------- */
@media (min-width: 640px) {
  .menu-grid { grid-template-columns: repeat(2, 1fr); }
  .steps, .review-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 1.4fr 1fr 1.2fr; }
}
@media (min-width: 900px) {
  .nav-toggle { display: none; }
  .nav-links { display: flex; position: static; }
  .hero-inner { grid-template-columns: 1.1fr 0.9fr; align-items: center; }
  .hero { padding: 4.5rem 0; }
  .hero-visual { min-height: 340px; }
}
@media (min-width: 1024px) {
  .menu-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
