/* HEZI order site styles. No frameworks, no build step.
   Mobile-first: most orders come from Facebook on phones.
   Dark mode: follows the system by default, toggle in the header overrides. */

:root, html[data-theme="light"] {
  --bg: #faf7f2;
  --card: #ffffff;
  --field: #ffffff;
  --ink: #2b2118;
  --muted: #7a6a58;
  --accent: #b4552d;
  --accent-dark: #93431f;
  --accent-soft: #f6e8dc;
  --green: #2e7d4f;
  --green-soft: #e3f2e9;
  --blue-soft: #e3ecf7;
  --blue: #2b5f9e;
  --red-soft: #f7e3e1;
  --red: #b3261e;
  --warn-soft: #fdf0dd;
  --warn: #9a5b13;
  --line: #e8ded2;
  --radius: 16px;
  --shadow: 0 2px 14px rgba(43, 33, 24, 0.08);
  --header-bg: rgba(250, 247, 242, 0.85);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16120e;
    --card: #211a14;
    --field: #2b221a;
    --ink: #f3e9db;
    --muted: #a8977f;
    --accent: #d97f42;
    --accent-dark: #e08c4e;
    --accent-soft: #3a2a1c;
    --green: #6fce8f;
    --green-soft: #1d3527;
    --blue-soft: #1e2f47;
    --blue: #7ba7dd;
    --red-soft: #3d2320;
    --red: #e88a80;
    --warn-soft: #3a2c17;
    --warn: #e0a94f;
    --line: #38302a;
    --shadow: 0 2px 16px rgba(0, 0, 0, 0.45);
    --header-bg: rgba(22, 18, 14, 0.85);
  }
}

html[data-theme="dark"] {
  --bg: #16120e;
  --card: #211a14;
  --field: #2b221a;
  --ink: #f3e9db;
  --muted: #a8977f;
  --accent: #d97f42;
  --accent-dark: #e08c4e;
  --accent-soft: #3a2a1c;
  --green: #6fce8f;
  --green-soft: #1d3527;
  --blue-soft: #1e2f47;
  --blue: #7ba7dd;
  --red-soft: #3d2320;
  --red: #e88a80;
  --warn-soft: #3a2c17;
  --warn: #e0a94f;
  --line: #38302a;
  --shadow: 0 2px 16px rgba(0, 0, 0, 0.45);
  --header-bg: rgba(22, 18, 14, 0.85);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  transition: background 0.25s ease, color 0.25s ease;
}

.wrap { max-width: 640px; margin: 0 auto; padding: 0 16px 80px; }

/* ---------- header ---------- */
header.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; max-width: 640px; margin: 0 auto;
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { font-size: 20px; font-weight: 800; letter-spacing: 0.5px; }
.header-btns { display: flex; gap: 8px; }
.pill-btn {
  border: 1px solid var(--line); background: var(--card); border-radius: 999px;
  padding: 7px 14px; font-size: 14px; cursor: pointer; color: var(--ink);
  font-family: inherit; transition: border-color 0.15s ease, transform 0.1s ease;
  min-height: 36px;
}
.pill-btn:hover { border-color: var(--accent); }
.pill-btn:active { transform: scale(0.96); }

/* ---------- hero ---------- */
.hero {
  background: linear-gradient(135deg, #a34a26, #d98a4b);
  color: #fff; border-radius: var(--radius); padding: 30px 24px; margin-top: 14px;
  box-shadow: var(--shadow);
}
.hero h1 { margin: 0 0 6px; font-size: 26px; letter-spacing: 0.3px; }
.hero p { margin: 0; opacity: 0.92; font-size: 15px; }

/* ---------- cards ---------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; margin-top: 16px; box-shadow: var(--shadow);
  transition: background 0.25s ease, border-color 0.25s ease;
}
.card h2 { margin: 0 0 8px; font-size: 18px; }

.drop-status {
  display: inline-block; font-size: 13px; font-weight: 700; border-radius: 999px;
  padding: 4px 12px; margin-bottom: 8px;
}
.drop-status.live { background: var(--green-soft); color: var(--green); }
.drop-status.closed { background: var(--line); color: var(--muted); }

.meta { color: var(--muted); font-size: 14px; margin: 4px 0; }

/* ---------- products ---------- */
.product { display: flex; gap: 14px; align-items: flex-start; padding: 14px 0; border-top: 1px solid var(--line); }
.product:first-of-type { border-top: none; }
.product-photo {
  width: 84px; height: 84px; border-radius: 12px; flex-shrink: 0;
  background: var(--accent-soft); display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: var(--muted); text-align: center; padding: 6px;
}
.product-info { flex: 1; }
.product-info h3 { margin: 0 0 4px; font-size: 16px; }
.product-info p { margin: 0 0 8px; font-size: 13px; color: var(--muted); }
.price { font-weight: 700; font-size: 17px; }
.remaining { font-size: 12px; color: var(--muted); margin-left: 8px; }
.remaining.low { color: var(--accent-dark); font-weight: 700; }

.qty-row { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.qty-btn {
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--field); color: var(--ink); font-size: 20px; cursor: pointer; line-height: 1;
  touch-action: manipulation; user-select: none; font-family: inherit;
  transition: border-color 0.15s ease, transform 0.1s ease;
}
.qty-btn:hover { border-color: var(--accent); }
.qty-btn:active { transform: scale(0.92); }
.qty-num { min-width: 28px; text-align: center; font-weight: 700; font-size: 17px; }

/* ---------- forms ---------- */
label { display: block; font-size: 14px; font-weight: 600; margin: 12px 0 4px; }
input[type="text"], input[type="tel"], textarea, select {
  width: 100%; padding: 12px; font-size: 16px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--field); color: var(--ink); font-family: inherit;
  transition: border-color 0.15s ease;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); }
input:focus-visible, textarea:focus-visible, select:focus-visible, button:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
.hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.error { color: var(--red); font-size: 13px; margin-top: 6px; min-height: 20px; }

/* ---------- buttons ---------- */
.btn {
  display: block; width: 100%; border: none; border-radius: 14px; cursor: pointer;
  background: var(--accent); color: #fff; font-size: 17px; font-weight: 700;
  padding: 15px; margin-top: 18px; font-family: inherit;
  transition: transform 0.1s ease, background 0.15s ease, opacity 0.15s ease;
}
.btn:hover { filter: brightness(1.06); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }
.btn.secondary { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn.secondary:hover { border-color: var(--accent); filter: none; }

/* ---------- steps (instant, no page reloads) ---------- */
.step { display: none; }
.step.active { display: block; animation: stepIn 0.22s ease-out; }
@keyframes stepIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .step.active { animation: none; }
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
.step-dots { display: flex; gap: 8px; justify-content: center; margin: 18px 0 4px; }
.step-dots button {
  width: 12px; height: 12px; border-radius: 50%; border: none; padding: 0;
  background: var(--line); cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
}
.step-dots button.on { background: var(--accent); }
.step-dots button:disabled { cursor: default; opacity: 0.45; }
.step-dots button:not(:disabled):active { transform: scale(1.25); }

/* ---------- payment ---------- */
.pay-tabs { display: flex; gap: 8px; margin: 12px 0; }
.pay-tab {
  flex: 1; padding: 12px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--field); color: var(--ink); cursor: pointer; font-size: 15px; font-weight: 700; font-family: inherit;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.pay-tab.on { border-color: var(--accent); background: var(--accent-soft); }
.qr-box {
  border: 2px dashed var(--line); border-radius: var(--radius); padding: 22px;
  text-align: center; margin: 12px 0; background: var(--card);
}
.qr-box img { max-width: 200px; width: 100%; height: auto; border-radius: 8px; }
.qr-placeholder { font-size: 13px; color: var(--muted); }
.qr-handle { font-size: 18px; font-weight: 700; margin: 8px 0 2px; }
.total-line { display: flex; justify-content: space-between; font-size: 16px; padding: 6px 0; }
.total-line.grand { font-weight: 700; font-size: 19px; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; }

/* ---------- confirmation ---------- */
.confirm-no {
  font-size: 24px; font-weight: 800; letter-spacing: 1px; text-align: center;
  background: var(--green-soft); color: var(--green); border-radius: var(--radius);
  padding: 16px; margin: 12px 0; word-break: break-all;
}
.checklist { font-size: 14px; color: var(--muted); padding-left: 20px; }
.checklist li { margin-bottom: 6px; }

footer { text-align: center; color: var(--muted); font-size: 12px; padding: 24px 0; }

@media (max-width: 420px) {
  .hero h1 { font-size: 22px; }
  .hero { padding: 24px 20px; }
}

/* ---------- v1 additions ---------- */
.mini-btn {
  border: 1px solid var(--line); background: var(--field); color: var(--ink);
  border-radius: 8px; padding: 6px 12px; font-size: 13px; cursor: pointer; font-family: inherit;
  transition: border-color 0.15s ease;
}
.mini-btn:hover { border-color: var(--accent); }
.mini-btn.on { border-color: var(--accent); background: var(--accent-soft); font-weight: 700; }

.order-no-box {
  background: var(--field); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px; margin-top: 14px;
}
.order-no-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 4px; }
.order-no { font-size: 22px; font-weight: 800; letter-spacing: 1px; }
.memo-text {
  font-size: 14px; font-weight: 700; color: var(--accent-dark);
  background: var(--accent-soft); border-radius: 10px; padding: 10px 12px; margin-top: 12px;
}

.status-pill.accepted { background: var(--blue-soft); color: var(--blue); }
.status-pill.declined { background: var(--red-soft); color: var(--red); }
.status-pill.expired { background: var(--line); color: var(--muted); }
