/* 客の注文画面 */
.order-body {
  background: var(--bg);
  /* 下部固定のカートバーに最後の商品が隠れないよう、スクロール余白を確保 */
  padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
}
.order-app {
  max-width: var(--maxw);
  margin: 0 auto;
  min-height: 100vh;
}

/* ヘッダ */
.o-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(250, 248, 245, 0.92);
  backdrop-filter: saturate(1.4) blur(8px);
  border-bottom: 1px solid var(--line);
  padding: 12px 16px calc(12px + env(safe-area-inset-top, 0px));
  padding-top: max(12px, env(safe-area-inset-top, 0px));
}
.o-header__shop {
  font-size: 13px;
  color: var(--ink-soft);
  font-weight: 600;
}
.o-header__seat {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 2px;
}
.o-header__seat strong {
  font-size: 20px;
}

/* カテゴリタブ */
.o-tabs {
  position: sticky;
  top: 58px;
  z-index: 19;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 16px;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.o-tabs::-webkit-scrollbar { display: none; }
.o-tab {
  flex: 0 0 auto;
  border: 1.5px solid var(--line);
  background: #fff;
  color: var(--ink-soft);
  border-radius: 999px;
  padding: 7px 15px;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}
.o-tab.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

/* メニュー */
.o-menu {
  padding: 8px 16px 140px;
}
.o-cat {
  scroll-margin-top: 110px;
}
.o-cat__title {
  font-size: 17px;
  font-weight: 800;
  margin: 22px 2px 10px;
}
.o-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);
}
.o-item--out {
  opacity: 0.55;
}
.o-item__thumb {
  flex: 0 0 76px;
  width: 76px;
  height: 76px;
  border-radius: 12px;
  background: repeating-linear-gradient(45deg, #f4eee4, #f4eee4 7px, #ece4d7 7px, #ece4d7 14px);
  object-fit: cover;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--ink-faint);
  overflow: hidden;
}
.o-item__body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.o-item__name {
  font-weight: 700;
  font-size: 15.5px;
}
.o-item__desc {
  font-size: 14px; /* 高齢のお客様の可読性 */
  color: var(--ink-soft);
  margin-top: 2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.o-item__foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 6px;
}
.o-item__price {
  font-weight: 800;
  font-size: 16px;
}

/* 数量ステッパ */
.stepper {
  display: flex;
  align-items: center;
  gap: 2px;
}
.stepper button {
  width: 44px; /* タップターゲット44pxガイドライン */
  height: 44px;
  border-radius: 10px;
  border: 1.5px solid var(--brand);
  background: #fff;
  color: var(--brand-dark);
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.stepper button:disabled { opacity: 0.4; }
.stepper .qty {
  min-width: 30px;
  text-align: center;
  font-weight: 800;
  font-size: 16px;
}
.add-btn {
  width: 44px; /* タップターゲット44pxガイドライン */
  height: 44px;
  border-radius: 12px;
  border: none;
  background: var(--brand);
  color: #fff;
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* カートバー（下部固定） */
.cart-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(to top, var(--bg) 60%, rgba(250, 248, 245, 0));
  display: flex;
  justify-content: center;
  pointer-events: none;
}
.cart-bar__inner {
  pointer-events: auto;
  width: 100%;
  max-width: calc(var(--maxw) - 32px);
}
.cart-bar .btn {
  box-shadow: var(--shadow-lg);
}
.cart-bar__count {
  background: rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 14px;
}

/* シート（カート・完了） */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 19, 17, 0.45);
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.sheet-backdrop.show {
  opacity: 1;
  pointer-events: auto;
}
.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 41;
  background: var(--bg);
  border-radius: 22px 22px 0 0;
  max-width: var(--maxw);
  margin: 0 auto;
  transform: translateY(100%);
  transition: transform 0.26s cubic-bezier(0.3, 0.9, 0.3, 1);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
}
.sheet.show {
  transform: translateY(0);
}
.sheet__handle {
  width: 40px;
  height: 4px;
  background: var(--line);
  border-radius: 4px;
  margin: 10px auto 4px;
}
.sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 18px 10px;
  border-bottom: 1px solid var(--line);
}
.sheet__head h2 { font-size: 18px; }
.sheet__close {
  border: none;
  background: #efece7;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  font-size: 18px;
  color: var(--ink-soft);
}
.sheet__body {
  overflow-y: auto;
  padding: 14px 18px;
  -webkit-overflow-scrolling: touch;
}
.sheet__foot {
  padding: 12px 18px calc(16px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  background: var(--card);
}

/* カート明細 */
.cart-line {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.cart-line__name { flex: 1; font-weight: 600; }
.cart-line__main { flex: 1; min-width: 0; }
.cart-line__main .cart-line__name { flex: none; }
.cart-line__alg { font-size: 11px; color: #9a7c2e; margin-top: 2px; line-height: 1.5; }
.cart-line__price { font-weight: 700; min-width: 70px; text-align: right; }
.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 14px 0 6px;
  font-weight: 800;
}
.cart-total .amount { font-size: 24px; }
.note-field {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  font-size: 15px;
  font-family: inherit;
  resize: vertical;
  margin-top: 8px;
}

/* 完了・状況 */
.done-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 24px 20px calc(24px + env(safe-area-inset-bottom, 0px));
}
.done-card {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 28px 22px;
  text-align: center;
  margin-top: 8px;
}
.done-check {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--ok-bg);
  color: var(--ok);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  margin: 0 auto 14px;
}
.ticket-big {
  font-size: 13px;
  color: var(--ink-soft);
  font-weight: 700;
  margin-top: 18px;
}
.ticket-big .num {
  display: block;
  font-size: 64px;
  font-weight: 900;
  color: var(--brand-dark);
  line-height: 1.1;
  letter-spacing: 2px;
}
.seat-big {
  font-size: 30px;
  font-weight: 900;
  color: var(--brand-dark);
}

/* ステータス進行 */
.steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 22px 0 6px;
}
.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  width: 80px;
}
.step__dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #eceae5;
  color: var(--ink-faint);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
}
.step__label { font-size: 12px; color: var(--ink-faint); font-weight: 700; }
.step.active .step__dot { background: var(--brand); color: #fff; }
.step.active .step__label { color: var(--brand-dark); }
.step.done .step__dot { background: var(--ok); color: #fff; }
.step.done .step__label { color: var(--ok); }
.step__bar {
  flex: 1;
  height: 3px;
  background: #eceae5;
  border-radius: 3px;
  min-width: 12px;
  margin-top: 16px;
}
.step__bar.fill { background: var(--ok); }

.fallback-note {
  margin-top: 18px;
  background: var(--warn-bg);
  color: #8a6400;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.6;
}
.order-recap {
  background: var(--card);
  border-radius: var(--radius);
  padding: 4px 16px;
  margin-top: 16px;
  box-shadow: var(--shadow);
}
.order-recap .cart-line:last-child { border-bottom: none; }

/* エラー全画面 */
.full-msg {
  min-height: 80vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  padding: 30px;
  color: var(--ink-soft);
}
.full-msg .emoji { font-size: 44px; }

/* ===== v1.3: バッジ・アレルゲン・注文履歴・お会計 ===== */
.o-badges { display: flex; flex-wrap: wrap; gap: 4px; margin: 2px 0 4px; }
.o-badge {
  display: inline-block; font-size: 11px; font-weight: 800;
  padding: 2px 8px; border-radius: 999px; border: none; line-height: 1.6;
}
.o-badge.rec { background: #fdeee6; color: #c14a17; }
.o-badge.pop { background: #fff3d6; color: #8a6210; }
.o-badge.alc { background: #eef2fb; color: #3556a8; }
.o-badge.alg { background: #f3f0eb; color: #5b5853; cursor: pointer; border: 1px solid var(--line); }

.alg-pop { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; }
.alg-pop__card {
  position: relative; z-index: 61; background: #fff; border-radius: 18px;
  padding: 20px; margin: 20px; max-width: 340px; width: calc(100% - 40px);
  box-shadow: 0 12px 40px rgba(30, 25, 15, 0.25);
}
.alg-pop__card h3 { margin: 0 0 6px; font-size: 17px; }
.alg-pop__label { font-size: 12.5px; font-weight: 700; color: var(--ink-faint); margin: 0 0 8px; }
.alg-pop__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.alg-pop__chips .chip { background: #fdecec; color: #b52929; font-weight: 800; }

.cart-note-alc, .cart-note-alg {
  font-size: 12.5px; border-radius: 10px; padding: 8px 12px; margin-top: 10px; line-height: 1.7;
}
/* お通し・席料の行（最初の注文にだけ加算） */
.cart-charge {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; margin-top: 10px;
  background: #faf6ee; border: 1.5px dashed #e0d3b8; border-radius: 12px;
}
.cart-charge__txt { flex: 1; min-width: 0; }
.cart-charge__name { font-weight: 700; font-size: 13.5px; }
.cart-charge__sub { font-size: 11px; color: #8a7c5a; margin-top: 2px; line-height: 1.5; }
.cart-note-alc { background: #eef2fb; color: #3556a8; }
.cart-note-alg { background: #f8f5ef; color: #6f6a61; }
.cart-allergy {
  display: flex; align-items: flex-start; gap: 9px;
  font-size: 12.5px; line-height: 1.7; color: #8a4b12;
  background: #fff7ed; border: 1.5px solid #f5cfa8; border-radius: 10px;
  padding: 9px 12px; margin-top: 10px; cursor: pointer;
}
.cart-allergy input { width: 20px; height: 20px; flex: 0 0 auto; margin-top: 2px; accent-color: var(--brand); }

/* 注文履歴 */
.hist { border-top: 1.5px dashed var(--line); margin-top: 12px; padding-top: 10px; text-align: left; }
.hist--canceled { opacity: 0.55; }
.hist__head { display: flex; align-items: center; gap: 8px; }
.hist__n { font-size: 12px; font-weight: 800; color: var(--ink-faint); }
.hist__st {
  font-size: 11.5px; font-weight: 800; padding: 2px 9px; border-radius: 999px;
  background: #f3f0eb; color: #5b5853;
}
.hist__st.st-received { background: #fdeee6; color: #c14a17; }
.hist__st.st-cooking { background: #eef2fb; color: #3556a8; }
.hist__st.st-done { background: #e8f6ec; color: #1c7c3c; }
.hist__st.st-paid { background: #e8f6ec; color: #1c7c3c; }
.hist__ticket { font-size: 12px; font-weight: 800; }
.hist__time { margin-left: auto; font-size: 12px; color: var(--ink-faint); font-weight: 700; }
.hist__items { margin-top: 4px; }
.hist__total { text-align: right; font-weight: 800; margin-top: 2px; }
.cart-line__name.adj { color: #7a5c17; }
