/* Hirame Sushi customer app — Japanese-inspired, mobile-first.
   Dark charcoal header, warm red accent #C1272D, system fonts. */

:root {
  --charcoal: #232326;
  --charcoal-soft: #333338;
  --ink: #1c1c1e;
  --paper: #faf8f4;
  --card: #ffffff;
  --accent: #c1272d;
  --accent-dark: #9c1f24;
  --gold: #c8a24b;
  --line: #e8e2d8;
  --muted: #6f6a63;
  --green: #1f7a3d;
  --radius: 12px;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  --tap: 48px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  padding-bottom: 92px; /* room for floating cart bar */
}

/* ---------- Header ---------- */
.site-header {
  background: var(--charcoal);
  color: #f5f2ec;
  padding: 14px 16px 16px;
  position: relative;
}
.site-header::after {
  content: "";
  display: block;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  position: absolute;
  left: 0; right: 0; bottom: 0;
}
.header-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  max-width: 860px;
  margin: 0 auto;
}
.brand h1 {
  margin: 0;
  font-size: 24px;
  letter-spacing: 2px;
  font-weight: 700;
}
.brand .tagline {
  margin: 2px 0 0;
  font-size: 12.5px;
  color: #cfc9bd;
  letter-spacing: 1px;
}
.header-actions { display: flex; gap: 8px; flex-shrink: 0; }
.hbtn {
  min-height: var(--tap);
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid #55555c;
  background: transparent;
  color: #f5f2ec;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.hbtn:active { background: var(--charcoal-soft); }
.header-meta {
  max-width: 860px;
  margin: 10px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  align-items: center;
  font-size: 14px;
  color: #e6e0d4;
}
.header-meta a { color: #fff; font-weight: 600; text-decoration: none; }
.header-meta .addr { display: inline-block; }
.hours-line { display: inline-flex; align-items: center; gap: 8px; }
.badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.badge.open { background: var(--green); color: #fff; }
.badge.closed { background: #5a5a60; color: #fff; }

/* ---------- Category nav ---------- */
.cat-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(250, 248, 244, 0.97);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 10px 12px;
  display: flex;
  gap: 8px;
}
.cat-nav::-webkit-scrollbar { display: none; }
.cat-pill {
  flex: 0 0 auto;
  min-height: var(--tap);
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  font-size: 14.5px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
}
.cat-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* ---------- Menu (DoorDash style) ---------- */
.menu-wrap { max-width: 860px; margin: 0 auto; padding: 8px 14px 40px; }
.menu-layout { display: flex; gap: 24px; max-width: 1200px; margin: 0 auto; padding: 12px 18px 60px; align-items: flex-start; }
.menu-sidebar {
  position: sticky; top: 76px;
  flex: 0 0 190px;
  display: flex; flex-direction: column; gap: 2px;
  max-height: calc(100vh - 100px); overflow-y: auto;
  padding: 8px 0;
}
.side-cat {
  background: none; border: none; border-left: 3px solid transparent;
  text-align: left; padding: 10px 14px; font-size: 14.5px; font-weight: 500;
  color: var(--ink); cursor: pointer; white-space: nowrap;
}
.side-cat:hover { color: var(--accent); }
.side-cat.active { border-left-color: var(--accent); font-weight: 700; color: var(--accent); background: rgba(0,0,0,.03); }
.menu-main { flex: 1; min-width: 0; }
.cat-section { scroll-margin-top: 76px; margin-bottom: 8px; }
.cat-title {
  font-size: 21px;
  font-weight: 800;
  margin: 24px 4px 4px;
  padding-bottom: 8px;
}
.cat-note { color: var(--muted); font-size: 13.5px; margin: 6px 4px 12px; }
.dish-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }

.dish {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
  padding: 18px;
  display: flex;
  gap: 16px;
  align-items: flex-start;
}
.dish.soldout { opacity: 0.55; }
.dish-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dish-name { font-weight: 700; font-size: 17px; margin: 0 0 6px; line-height: 1.35; }
.dish-desc {
  color: var(--muted); font-size: 14px; margin: 0 0 12px; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.dish-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dish-price { font-weight: 800; font-size: 17px; }
.dish-img {
  flex: 0 0 128px; width: 128px; height: 128px; border-radius: 12px; overflow: hidden;
  background: linear-gradient(135deg, #faf3e8 0%, #f0e0c8 50%, #e6d0ae 100%);
  display: flex; align-items: center; justify-content: center; position: relative;
}
.dish-img img { width: 100%; height: 100%; object-fit: cover; }
.dish-img .dish-emoji { font-size: 56px; opacity: .45; filter: saturate(.8); }
.dish-img:not(.noimg) .dish-emoji { display: none; }
.add-btn {
  width: 34px; height: 34px; border-radius: 50%;
  background: #fff; border: 1px solid var(--line); box-shadow: 0 1px 4px rgba(0,0,0,.12);
  font-size: 20px; line-height: 1; color: var(--ink); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.add-btn:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.dish-ctrl { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* mobile: sidebar hidden, top pills shown */
@media (max-width: 899px) {
  .menu-layout { padding: 8px 12px 60px; }
  .menu-sidebar { display: none; }
  .dish-grid { grid-template-columns: 1fr; }
  .dish-img { flex-basis: 110px; width: 110px; height: 110px; }
}
@media (min-width: 900px) {
  .cat-nav { display: none; }
}

.stepper { display: inline-flex; align-items: center; gap: 2px; }
.stepper button {
  width: var(--tap); height: var(--tap);
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  background: #fff;
  color: var(--accent);
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}
.stepper button:disabled { opacity: 0.35; cursor: default; }
.stepper .qty {
  min-width: 30px; text-align: center;
  font-size: 17px; font-weight: 700;
}
.btn {
  min-height: var(--tap);
  padding: 12px 22px;
  border-radius: var(--radius);
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 0.5px;
}
.btn:active { background: var(--accent-dark); }
.btn:disabled { background: #b9b3a8; cursor: default; }
.btn.ghost {
  background: transparent;
  border: 1.5px solid var(--accent);
  color: var(--accent);
}
.btn.block { width: 100%; }
.soldout-tag {
  font-size: 13px; font-weight: 700; color: #8a857c;
  border: 1px solid #c9c3b8; border-radius: 8px; padding: 8px 12px;
}

/* ---------- Floating cart bar ---------- */
.cart-bar {
  position: fixed;
  left: 12px; right: 12px; bottom: 12px;
  z-index: 50;
  max-width: 860px;
  margin: 0 auto;
  background: var(--charcoal);
  color: #fff;
  border-radius: 16px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.28);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 8px 8px 18px;
  min-height: 64px;
  cursor: pointer;
  border: none;
  width: calc(100% - 24px);
  text-align: left;
  font: inherit;
}
.cart-bar .cb-info { display: flex; flex-direction: column; }
.cart-bar .cb-count { font-size: 13px; color: #cfc9bd; }
.cart-bar .cb-total { font-size: 19px; font-weight: 700; }
.cart-bar .cb-cta {
  background: var(--accent);
  border-radius: 12px;
  padding: 12px 22px;
  font-weight: 700;
  font-size: 16px;
}
.cart-bar.hidden { display: none; }

/* ---------- Drawer ---------- */
.scrim {
  position: fixed; inset: 0;
  background: rgba(20, 18, 16, 0.55);
  z-index: 60;
  opacity: 0; pointer-events: none;
  transition: opacity 0.22s ease;
}
.scrim.show { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; left: 0; right: 0; bottom: 0;
  z-index: 61;
  max-width: 860px; margin: 0 auto;
  background: var(--paper);
  border-radius: 20px 20px 0 0;
  max-height: 88vh;
  display: flex; flex-direction: column;
  transform: translateY(102%);
  transition: transform 0.25s ease;
}
.drawer.show { transform: translateY(0); }
.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}
.drawer-head h2 { margin: 0; font-size: 18px; }
.drawer-close {
  width: var(--tap); height: var(--tap);
  border: none; background: transparent;
  font-size: 24px; color: var(--muted); cursor: pointer;
}
.drawer-body { overflow-y: auto; padding: 8px 18px 18px; flex: 1; }
.drawer-foot {
  border-top: 1px solid var(--line);
  padding: 14px 18px calc(14px + env(safe-area-inset-bottom));
  background: var(--card);
}
.cart-line {
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.cart-line .cl-body { flex: 1; min-width: 0; }
.cart-line .cl-name { font-weight: 700; font-size: 15.5px; }
.cart-line .cl-choices {
  margin: 4px 0 0 12px; padding-left: 10px;
  border-left: 2px solid var(--gold);
  color: var(--muted); font-size: 13.5px;
}
.cart-line .cl-price { font-weight: 700; color: var(--accent); margin-top: 4px; }
.cart-line .cl-remove {
  border: none; background: transparent; color: var(--muted);
  font-size: 13.5px; padding: 10px 4px; cursor: pointer;
  text-decoration: underline;
}
.totals { margin: 12px 0; font-size: 15.5px; }
.totals .row { display: flex; justify-content: space-between; padding: 3px 0; }
.totals .row.grand { font-size: 19px; font-weight: 700; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 10px; }
.totals .neg { color: var(--accent); }
.note-box {
  background: #fff7e8; border: 1px solid #ecd9ac; color: #7a5c1e;
  border-radius: var(--radius); padding: 12px 14px; font-size: 14px; margin: 10px 0;
}

/* ---------- Forms / checkout ---------- */
.view { max-width: 860px; margin: 0 auto; padding: 18px 16px 60px; }
.view h2.page-title { font-size: 21px; margin: 6px 0 14px; }
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px; margin-bottom: 14px;
}
.card h3 { margin: 0 0 12px; font-size: 16.5px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 600; font-size: 14.5px; margin-bottom: 6px; }
.field input[type="text"],
.field input[type="tel"],
.field input[type="email"],
.field textarea,
.field select {
  width: 100%;
  min-height: var(--tap);
  border: 1.5px solid #d8d1c4;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 16px;
  font-family: inherit;
  background: #fff;
}
.field textarea { min-height: 84px; resize: vertical; }
.field .hint { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.field .err { font-size: 13px; color: var(--accent); font-weight: 600; margin-top: 4px; display: none; }
.field.invalid input { border-color: var(--accent); }
.field.invalid .err { display: block; }

.checkrow {
  display: flex; align-items: center; gap: 12px;
  min-height: var(--tap); padding: 6px 0;
  font-size: 15.5px; cursor: pointer;
}
.checkrow input[type="checkbox"] { width: 24px; height: 24px; accent-color: var(--accent); }

.radios .radio {
  display: flex; align-items: flex-start; gap: 12px;
  border: 1.5px solid var(--line); border-radius: var(--radius);
  padding: 12px 14px; margin: 8px 0; cursor: pointer;
  min-height: var(--tap);
}
.radios .radio input[type="radio"] { width: 22px; height: 22px; margin-top: 2px; accent-color: var(--accent); flex-shrink: 0; }
.radios .radio.sel { border-color: var(--accent); background: #fdf3f3; }
.radios .radio .r-title { font-weight: 700; font-size: 15.5px; }
.radios .radio .r-sub { color: var(--muted); font-size: 13.5px; }
.radios .radio .r-right { margin-left: auto; font-weight: 700; color: var(--accent); white-space: nowrap; }

.promo-group { margin: 4px 0; }
.promo-rule-name { font-weight: 700; margin: 6px 0 2px; font-size: 15px; }

.pickup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 420px) { .pickup-grid { grid-template-columns: 1fr; } }

/* ---------- Confirmation ---------- */
.confirm-hero {
  text-align: center; padding: 30px 18px 22px;
}
.confirm-hero .big-no {
  font-size: 64px; font-weight: 800; color: var(--accent);
  line-height: 1; margin: 8px 0 4px; letter-spacing: 2px;
}
.confirm-hero .code-box {
  display: inline-block; margin: 14px 0 6px;
  border: 2px dashed var(--accent); border-radius: var(--radius);
  padding: 10px 26px; background: #fff;
}
.confirm-hero .code-box .code { font-size: 34px; font-weight: 800; letter-spacing: 8px; }
.confirm-hero .code-hint { font-size: 13px; color: var(--muted); }
.confirm-rows { margin: 6px 0 18px; }
.confirm-rows .row {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 10px 2px; border-bottom: 1px solid var(--line); font-size: 15.5px;
}
.confirm-rows .row .k { color: var(--muted); }
.confirm-rows .row .v { font-weight: 700; text-align: right; }
.btn-row { display: flex; gap: 10px; margin-top: 14px; }
.btn-row .btn { flex: 1; }

/* ---------- Tracking ---------- */
.steps { margin: 18px 0; }
.step { display: flex; gap: 14px; align-items: flex-start; position: relative; padding-bottom: 22px; }
.step::before {
  content: ""; position: absolute; left: 15px; top: 34px; bottom: 0;
  width: 2px; background: var(--line);
}
.step:last-child::before { display: none; }
.step .dot {
  width: 32px; height: 32px; border-radius: 50%;
  border: 2px solid #c9c3b8; background: #fff; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700; color: #a09a8e; z-index: 1;
}
.step.done .dot { background: var(--accent); border-color: var(--accent); color: #fff; }
.step.done::before { background: var(--accent); }
.step .s-label { font-weight: 700; font-size: 16px; padding-top: 4px; }
.step.pending .s-label { color: #a09a8e; font-weight: 500; }

.review-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 20px; text-align: center; margin-top: 18px;
}
.review-card h3 { margin: 0 0 6px; }
.review-card p { color: var(--muted); font-size: 14.5px; margin: 0 0 14px; }

/* ---------- Modal ---------- */
.modal-wrap {
  position: fixed; inset: 0; z-index: 70;
  display: flex; align-items: flex-end; justify-content: center;
  pointer-events: none;
  visibility: hidden;
  transition: visibility 0s linear 0.35s;
}
.modal-wrap.show {
  pointer-events: auto;
  visibility: visible;
  transition-delay: 0s;
}
.modal {
  background: var(--paper);
  border-radius: 20px 20px 0 0;
  width: 100%; max-width: 860px;
  max-height: 86vh; display: flex; flex-direction: column;
  transform: translateY(102%); transition: transform 0.25s ease;
}
.modal-wrap.show .modal { transform: translateY(0); }
/* Centered variant: used for the closed-store notice so it never covers the cart bar on mobile */
.modal-wrap.modal-centered { align-items: center; padding: 24px; }
.modal-wrap.modal-centered .modal {
  border-radius: 20px;
  transform: translateY(24px) scale(.98);
  opacity: 0;
  transition: transform .25s ease, opacity .2s ease;
}
.modal-wrap.modal-centered.show .modal { transform: none; opacity: 1; }
.modal-head { padding: 16px 18px 10px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 18px; }
.modal-head .sub { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.modal-body { overflow-y: auto; padding: 8px 18px; flex: 1; }
.modal-foot { padding: 14px 18px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--card); }
.combo-opt {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 4px; border-bottom: 1px solid var(--line);
  min-height: var(--tap); cursor: pointer; font-size: 15.5px;
}
.combo-opt input[type="checkbox"] { width: 24px; height: 24px; accent-color: var(--accent); flex-shrink: 0; }
.combo-opt .co-name { flex: 1; }
.combo-opt .co-price { color: var(--muted); font-size: 14px; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 16px; right: 16px; bottom: 96px; z-index: 90;
  max-width: 640px; margin: 0 auto;
  background: var(--charcoal); color: #fff;
  border-radius: var(--radius); padding: 14px 18px;
  font-size: 15px; box-shadow: 0 6px 24px rgba(0,0,0,0.3);
  opacity: 0; transform: translateY(12px); pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }

.hidden { display: none !important; }
.center { text-align: center; }
.mt { margin-top: 14px; }
.loading-wrap { text-align: center; padding: 60px 20px; color: var(--muted); }

@media (min-width: 700px) {
  .modal-wrap { align-items: center; padding: 24px; }
  .modal { border-radius: 20px; }
  .brand h1 { font-size: 28px; }
}
