@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,700&family=Inter:wght@400;500;600;700&display=swap');

:root {
  --ink: #1F2A24;
  --ink-soft: #5B6960;
  --paper: #FBF9F4;
  --card: #FFFFFF;
  --line: #E9E4D8;
  --turmeric: #C98A00;
  --turmeric-soft: #FBEAC7;
  --teal: #0F5257;
  --teal-soft: #DCEEEE;
  --green: #2F7D4C;
  --green-soft: #DFF3E4;
  --red: #B23A2F;
  --red-soft: #FBE3E0;
  --radius: 14px;
  --shadow: 0 1px 3px rgba(31,42,36,0.06), 0 6px 18px rgba(31,42,36,0.06);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: 'Inter', system-ui, sans-serif; background: var(--paper); color: var(--ink);
  padding-bottom: 76px; -webkit-font-smoothing: antialiased;
}
h1, h2, h3, .brand { font-family: 'Fraunces', serif; }
button { font-family: inherit; }

.hero {
  background: var(--ink); color: var(--paper); padding: 28px 18px 34px;
  border-radius: 0 0 22px 22px;
}
.hero .brandline { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.hero .brandline img { width: 44px; height: 44px; border-radius: 10px; object-fit: cover; background: var(--turmeric-soft); }
.hero h1 { font-size: 24px; margin: 0; }
.hero .addr { font-size: 12.5px; color: #C9D1CB; margin-top: 2px; }
.hero .tag { font-size: 14px; color: var(--turmeric-soft); margin-top: 10px; }

.view { display: none; padding: 16px; max-width: 640px; margin: 0 auto; }
.view.active { display: block; }

.search-bar { margin-top: -22px; margin-bottom: 16px; }
.search-bar input {
  width: 100%; padding: 13px 16px; border-radius: 999px; border: 1px solid var(--line);
  font-size: 14.5px; box-shadow: var(--shadow); background: var(--card);
}

.cat-heading { font-size: 18px; margin: 20px 0 10px; padding-left: 2px; }
.cat-heading:first-child { margin-top: 0; }

.menu-item {
  display: flex; gap: 12px; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px; margin-bottom: 10px; box-shadow: var(--shadow);
}
.menu-item img { width: 74px; height: 74px; border-radius: 10px; object-fit: cover; background: var(--line); flex-shrink: 0; }
.menu-item .info { flex: 1; min-width: 0; }
.menu-item .info .name { font-weight: 700; font-size: 15px; }
.menu-item .info .desc { font-size: 12.5px; color: var(--ink-soft); margin-top: 2px; }
.menu-item .info .price { font-weight: 700; margin-top: 6px; font-size: 14px; }
.menu-item .price .unit { color: var(--ink-soft); font-weight: 400; font-size: 12px; }
.menu-item .side { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; }
.oos-badge { font-size: 11px; font-weight: 700; color: var(--red); background: var(--red-soft); padding: 2px 8px; border-radius: 999px; }

.qty-control { display: flex; align-items: center; gap: 8px; }
.qty-control button {
  width: 30px; height: 30px; border-radius: 8px; border: 1px solid var(--line); background: var(--card);
  font-size: 16px; cursor: pointer; color: var(--teal); font-weight: 700;
}
.qty-control span { min-width: 18px; text-align: center; font-weight: 600; }
.add-btn {
  padding: 8px 16px; border-radius: 8px; border: 1px solid var(--teal); background: var(--teal-soft);
  color: var(--teal); font-weight: 700; cursor: pointer; font-size: 13px;
}
.add-btn[disabled] { opacity: 0.4; cursor: not-allowed; }

.bottomnav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  display: flex; background: var(--card); border-top: 1px solid var(--line);
  padding: 6px 2px calc(6px + env(safe-area-inset-bottom));
}
.bottomnav button {
  flex: 1; background: none; border: none; padding: 8px 2px; font-size: 11px;
  color: var(--ink-soft); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 3px; position: relative;
}
.bottomnav button .ic { font-size: 18px; }
.bottomnav button.active { color: var(--teal); font-weight: 700; }
.cart-badge {
  position: absolute; top: 2px; right: 26%; background: var(--turmeric); color: #fff; font-size: 10px;
  min-width: 16px; height: 16px; border-radius: 999px; display: flex; align-items: center; justify-content: center; padding: 0 3px;
}

.cart-line { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.cart-line .n { font-weight: 600; font-size: 14.5px; }
.cart-line .p { font-size: 13px; color: var(--ink-soft); }

.field { margin-bottom: 14px; }
label { display: block; font-size: 12.5px; font-weight: 700; color: var(--ink-soft); margin-bottom: 5px; }
input, select, textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: 9px; font-size: 15px;
  background: #fff; color: var(--ink); font-family: inherit;
}
input:focus, textarea:focus { outline: 2px solid var(--teal); outline-offset: 1px; border-color: var(--teal); }
.row { display: flex; gap: 10px; }
.row > * { flex: 1; }
.error-text { color: var(--red); font-size: 13px; margin-top: 6px; }
.hint { font-size: 12px; color: var(--ink-soft); margin-top: 4px; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; box-shadow: var(--shadow); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 13px 18px; border-radius: 10px; border: none; font-weight: 700; font-size: 15px; cursor: pointer;
}
.btn-block { width: 100%; }
.btn-primary { background: var(--teal); color: #fff; }
.btn-accent { background: var(--turmeric); color: #fff; }
.btn-outline { background: none; border: 1px solid var(--line); color: var(--ink); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; text-transform: capitalize; }
.pill.status-received { background: var(--teal-soft); color: var(--teal); }
.pill.status-preparing { background: var(--turmeric-soft); color: var(--turmeric); }
.pill.status-out_for_delivery { background: #E4DEFB; color: #5B3FBF; }
.pill.status-delivered { background: var(--green-soft); color: var(--green); }
.pill.status-cancelled { background: var(--red-soft); color: var(--red); }
.pill.pay-unpaid { background: var(--red-soft); color: var(--red); }
.pill.pay-partial { background: var(--turmeric-soft); color: var(--turmeric); }
.pill.pay-paid { background: var(--green-soft); color: var(--green); }

.track-order-card .head { display: flex; justify-content: space-between; align-items: center; }
.track-order-card .steps { display: flex; justify-content: space-between; margin: 14px 0 4px; position: relative; }
.track-order-card .steps::before { content: ''; position: absolute; top: 9px; left: 20px; right: 20px; height: 2px; background: var(--line); }
.track-step { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 10.5px; color: var(--ink-soft); flex: 1; z-index: 1; }
.track-step .dot { width: 18px; height: 18px; border-radius: 50%; background: var(--line); border: 2px solid var(--paper); }
.track-step.done .dot { background: var(--teal); }
.track-step.done { color: var(--teal); font-weight: 700; }

.empty-state { text-align: center; padding: 50px 16px; color: var(--ink-soft); }
.empty-state .big { font-size: 40px; margin-bottom: 10px; }

.toast {
  position: fixed; bottom: 84px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 13.5px;
  z-index: 100; box-shadow: var(--shadow); opacity: 0; transition: opacity .2s; white-space: nowrap;
}
.toast.show { opacity: 1; }

.confirm-wrap { text-align: center; padding: 30px 16px; }
.confirm-wrap .big { font-size: 52px; }
