/* ============================================================
   Samourai Orsay — 在线逐层选菜、购物车、结账与 80mm 热敏小票样式
   保持现代日式高级视觉风格（和纸米白 #FAF7F0 · 深墨 #161513 · 朱红 #B8332A）
   重点优化移动端单手触控体验（底部抽屉、大触控区、流畅交互）
   ============================================================ */

/* ===== 顶部就餐模式切换条（堂食 / 外卖 + 桌号锁定） ===== */
.dining-bar {
  background: #1a1816;
  color: var(--washi);
  border-bottom: 1px solid rgba(196, 154, 92, 0.25);
  font-size: 13px;
}
.dining-bar-inner {
  min-height: 48px;
  padding-top: 7px;
  padding-bottom: 7px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.dining-switch-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.dining-label {
  font-size: 11.5px;
  color: #bfb7aa;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.dining-pills {
  display: inline-flex;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 99px;
  padding: 2px;
}
.dining-btn {
  border: none;
  background: transparent;
  color: #dcd4c7;
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.dining-btn:hover { color: #fff; }
.dining-btn.active {
  background: var(--shu);
  color: #fff;
  box-shadow: 0 2px 10px rgba(184, 51, 42, 0.45);
}
.dining-status-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.table-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(196, 154, 92, 0.16);
  border: 1px solid rgba(196, 154, 92, 0.5);
  color: #f3d7a3;
  padding: 4px 12px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 600;
}
.table-edit-btn {
  border: none;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-radius: 99px;
  padding: 2px 8px;
  font-size: 11px;
  cursor: pointer;
}
.dining-tip {
  font-size: 12px;
  color: #c8bfb2;
}

/* ===== 菜品卡片点单按钮与已点数量徽章 ===== */
.dish-footer-row {
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.dish-add-btn {
  border: 1px solid var(--shu);
  background: var(--shu);
  color: #fff;
  border-radius: 4px;
  padding: 6px 13px;
  font-size: 12.2px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.16s ease;
  white-space: nowrap;
}
.dish-add-btn:hover { background: var(--shu-hover); transform: translateY(-1px); }
.dish-add-btn.has-steps {
  background: var(--ink);
  border-color: var(--ink);
}
.dish-add-btn.has-steps:hover { background: var(--shu); border-color: var(--shu); }
.dish-add-btn:disabled {
  background: #d5cfc3;
  border-color: #d5cfc3;
  color: #7c756b;
  cursor: not-allowed;
  transform: none;
}
.qty-pill {
  background: #fff;
  color: var(--shu);
  font-size: 11px;
  font-weight: 700;
  padding: 0 6px;
  border-radius: 99px;
  line-height: 18px;
}
.dish-row.dinein-disabled { opacity: 0.58; }

/* 招牌卡片底部加入按钮 */
.sig-order-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* ===== 通用弹窗遮罩与 Step-by-Step 逐层选菜 Modal ===== */
.order-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(16, 15, 13, 0.68);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.order-overlay.open { display: flex; }

.step-modal {
  width: 100%;
  max-width: 620px;
  max-height: 90vh;
  background: var(--washi);
  color: var(--ink);
  border-radius: 10px;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-top: 4px solid var(--shu);
}
.sm-header {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 16px 20px;
  background: #fffdf9;
  border-bottom: 1px solid var(--washi-line);
}
.sm-thumb {
  width: 68px;
  height: 54px;
  border-radius: 5px;
  object-fit: cover;
  border: 1px solid var(--washi-line);
  flex-shrink: 0;
}
.sm-title-wrap { flex: 1; min-width: 0; }
.sm-fr {
  font-family: "Cormorant Garamond", serif;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.15;
}
.sm-zh { font-size: 13px; color: var(--ink-sub); margin-top: 2px; }
.sm-price-live {
  font-family: "Cormorant Garamond", serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--shu);
  white-space: nowrap;
}
.modal-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--washi-line);
  background: var(--washi-soft);
  color: var(--ink);
  font-size: 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.modal-close:hover { background: var(--ink); color: #fff; }

/* 步骤进度条 */
.sm-progress {
  display: flex;
  gap: 6px;
  padding: 10px 20px;
  background: var(--washi-soft);
  border-bottom: 1px solid var(--washi-line);
  overflow-x: auto;
}
.sm-step-tab {
  border: 1px solid var(--washi-line);
  background: #fff;
  color: var(--ink-muted);
  padding: 5px 11px;
  border-radius: 99px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.sm-step-tab.active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--washi);
}
.sm-step-tab.done {
  border-color: rgba(184, 51, 42, 0.45);
  color: var(--shu);
  background: #fff8f7;
}

/* 当前步骤内容区 */
.sm-body {
  padding: 18px 20px;
  overflow-y: auto;
  flex: 1;
}
.sm-step-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
}
.sm-step-title-fr {
  font-family: "Cormorant Garamond", serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
}
.sm-step-title-zh { font-size: 13px; color: var(--ink-sub); margin-top: 2px; }
.sm-req-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 4px;
  white-space: nowrap;
}
.sm-req-badge.required { background: var(--shu-soft); color: var(--shu); border: 1px solid rgba(184, 51, 42, 0.35); }
.sm-req-badge.optional { background: var(--washi-soft); color: var(--ink-sub); border: 1px solid var(--washi-line); }

.sm-options-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.sm-opt-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: #fffdf9;
  border: 1.5px solid var(--washi-line);
  border-radius: 7px;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  position: relative;
}
.sm-opt-card:hover { border-color: var(--ink); }
.sm-opt-card.selected {
  border-color: var(--shu);
  background: #fff7f6;
  box-shadow: 0 0 0 1px var(--shu);
}
.sm-opt-img {
  width: 48px;
  height: 40px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--washi-line);
}
.sm-opt-text { flex: 1; min-width: 0; }
.sm-opt-fr { font-size: 13px; font-weight: 600; color: var(--ink); line-height: 1.25; }
.sm-opt-zh { font-size: 11.5px; color: var(--ink-sub); margin-top: 2px; }
.sm-opt-price {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--shu);
  white-space: nowrap;
}
.sm-opt-price.free { color: #5b7856; font-weight: 600; }

.sm-dup-ctrl {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.sm-dup-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--washi-line);
  background: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  color: var(--ink);
}
.sm-dup-btn:hover { background: var(--shu); color: #fff; border-color: var(--shu); }

.sm-extra-row {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed var(--washi-line);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.sm-note-input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--washi-line);
  border-radius: 5px;
  background: #fff;
  font-size: 13px;
  color: var(--ink);
}
.sm-error {
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--shu);
  font-weight: 600;
  display: none;
}
.sm-error.show { display: block; }

.sm-footer {
  padding: 14px 20px;
  background: #fffdf9;
  border-top: 1px solid var(--washi-line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.qty-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--washi-line);
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
}
.qty-stepper button {
  width: 34px;
  height: 36px;
  border: none;
  background: var(--washi-soft);
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  color: var(--ink);
}
.qty-stepper button:hover { background: var(--ink); color: #fff; }
.qty-stepper span {
  min-width: 34px;
  text-align: center;
  font-weight: 700;
  font-size: 14px;
}
.sm-footer-btns {
  display: flex;
  gap: 10px;
  flex: 1;
  justify-content: flex-end;
}

/* ===== 底部悬浮购物车条 ===== */
.cart-float-bar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 18px;
  z-index: 220;
  width: min(680px, calc(100vw - 24px));
  background: rgba(22, 21, 19, 0.96);
  backdrop-filter: blur(12px);
  color: #fff;
  border-radius: 10px;
  border: 1px solid rgba(196, 154, 92, 0.35);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.34);
  padding: 12px 16px;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  cursor: pointer;
}
.cart-float-bar.visible { display: flex; }
.cfb-left { display: flex; align-items: center; gap: 12px; }
.cfb-badge {
  min-width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--shu);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.cfb-meta { display: flex; flex-direction: column; }
.cfb-total {
  font-family: "Cormorant Garamond", serif;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.05;
  color: #fff;
}
.cfb-sub { font-size: 11.5px; color: #cbc3b6; }
.cfb-cta {
  background: var(--shu);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 10px 18px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

/* ===== 购物车侧边抽屉（手机端底部大抽屉） ===== */
.cart-overlay {
  position: fixed;
  inset: 0;
  z-index: 320;
  background: rgba(16, 15, 13, 0.62);
  backdrop-filter: blur(3px);
  display: none;
  justify-content: flex-end;
}
.cart-overlay.open { display: flex; }
.cart-drawer {
  width: 100%;
  max-width: 460px;
  height: 100%;
  background: var(--washi);
  display: flex;
  flex-direction: column;
  box-shadow: -14px 0 40px rgba(0, 0, 0, 0.25);
}
.cd-head {
  padding: 16px 20px;
  background: #181715;
  color: var(--washi);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.cd-head h3 {
  font-family: "Cormorant Garamond", "Noto Serif SC", serif;
  font-size: 21px;
}
.cd-mode-strip {
  padding: 10px 20px;
  background: var(--washi-soft);
  border-bottom: 1px solid var(--washi-line);
  font-size: 12.5px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.cd-items {
  flex: 1;
  overflow-y: auto;
  padding: 14px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cd-item {
  background: #fffdf9;
  border: 1px solid var(--washi-line);
  border-radius: 7px;
  padding: 12px;
  display: flex;
  gap: 12px;
}
.cd-item-img {
  width: 58px;
  height: 48px;
  border-radius: 4px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--washi-line);
}
.cd-item-body { flex: 1; min-width: 0; }
.cd-item-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
}
.cd-item-fr { font-weight: 700; font-size: 13.5px; color: var(--ink); }
.cd-item-zh { font-size: 12px; color: var(--ink-sub); }
.cd-item-price { font-weight: 700; color: var(--shu); white-space: nowrap; font-size: 14px; }
.cd-sublist {
  margin-top: 6px;
  padding-left: 10px;
  border-left: 2px solid var(--washi-line);
  font-size: 11.5px;
  color: var(--ink-sub);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cd-item-actions {
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.cd-del-btn {
  border: none;
  background: transparent;
  color: var(--ink-muted);
  font-size: 12px;
  cursor: pointer;
  text-decoration: underline;
}
.cd-del-btn:hover { color: var(--shu); }

.cd-note-box {
  padding: 12px 20px;
  background: var(--washi-soft);
  border-top: 1px solid var(--washi-line);
}
.quick-note-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 8px;
}
.qn-chip {
  border: 1px solid var(--washi-line);
  background: #fff;
  color: var(--ink-sub);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 99px;
  cursor: pointer;
}
.qn-chip:hover { border-color: var(--shu); color: var(--shu); }
.cd-foot {
  padding: 14px 20px 18px;
  background: #fffdf9;
  border-top: 1px solid var(--washi-line);
}
.cd-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 12px;
}
.cd-summary-total {
  font-family: "Cormorant Garamond", serif;
  font-size: 26px;
  font-weight: 700;
  color: var(--shu);
}

/* ===== 结账 & 订单确认 & 80mm 热敏小票 Modal ===== */
.checkout-modal {
  width: 100%;
  max-width: 680px;
  max-height: 92vh;
  background: var(--washi);
  border-radius: 10px;
  border-top: 4px solid var(--shu);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.36);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.ck-body {
  padding: 20px 24px;
  overflow-y: auto;
  flex: 1;
}
.ck-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.ck-field { display: flex; flex-direction: column; gap: 5px; }
.ck-field.full { grid-column: 1 / -1; }
.ck-field label { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.ck-field input, .ck-field select, .ck-field textarea {
  padding: 9px 12px;
  border: 1px solid var(--washi-line);
  border-radius: 5px;
  background: #fff;
  font-size: 13.5px;
  color: var(--ink);
  font-family: inherit;
}
.ck-field input:focus, .ck-field select:focus, .ck-field textarea:focus {
  outline: none;
  border-color: var(--shu);
}
.ck-radio-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.ck-radio-pill {
  flex: 1;
  min-width: 140px;
  border: 1.5px solid var(--washi-line);
  background: #fff;
  padding: 10px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}
.ck-radio-pill.active {
  border-color: var(--shu);
  background: #fff7f6;
  color: var(--shu);
}

/* 订单确认与 80mm 小票预览 */
.confirm-banner {
  background: #17271c;
  color: #e9f7ed;
  border-left: 4px solid #3ea35c;
  padding: 14px 16px;
  border-radius: 6px;
  margin-bottom: 16px;
}
.confirm-order-no {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 18px;
  font-weight: 700;
  color: #9be5b1;
}
.dispatch-actions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 16px 0;
}
.dispatch-btn {
  border: 1px solid var(--washi-line);
  background: #fff;
  color: var(--ink);
  padding: 11px 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.16s;
}
.dispatch-btn:hover { border-color: var(--ink); background: var(--washi-soft); }
.dispatch-btn.wa { background: #1c7c43; border-color: #1c7c43; color: #fff; }
.dispatch-btn.wa:hover { background: #156234; }
.dispatch-btn.receipt { background: var(--ink); border-color: var(--ink); color: #fff; }
.dispatch-btn.receipt:hover { background: var(--shu); border-color: var(--shu); }
.webhook-status {
  font-size: 12px;
  padding: 8px 12px;
  border-radius: 5px;
  background: var(--washi-soft);
  border: 1px solid var(--washi-line);
  color: var(--ink-sub);
  margin-bottom: 14px;
  display: none;
}
.webhook-status.show { display: block; }

/* 80mm 热敏纸小票可视化预览盒 */
.receipt-80mm {
  width: 80mm;
  max-width: 100%;
  margin: 0 auto;
  background: #fff;
  color: #000;
  border: 1px dashed #999;
  padding: 5mm 4.5mm;
  font-family: ui-monospace, "SF Mono", Menlo, "PingFang SC", monospace;
  font-size: 11px;
  line-height: 1.45;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
}
.r-center { text-align: center; }
.r-hr { border-top: 1px dashed #000; margin: 6px 0; }
.r-row { display: flex; justify-content: space-between; gap: 6px; }
.r-bold { font-weight: 700; }
.r-big { font-size: 14px; font-weight: 700; }
.r-sub { padding-left: 10px; font-size: 10px; color: #222; }

/* ===== 移动端单手交互优化（Bottom Sheet + 大按钮） ===== */
@media (max-width: 680px) {
  .order-overlay { align-items: flex-end; padding: 0; }
  .step-modal, .checkout-modal {
    max-width: 100%;
    max-height: 92vh;
    border-radius: 16px 16px 0 0;
  }
  .cart-overlay { align-items: flex-end; }
  .cart-drawer {
    max-width: 100%;
    height: 88vh;
    border-radius: 16px 16px 0 0;
    overflow: hidden;
  }
  .sm-options-grid, .ck-grid, .dispatch-actions { grid-template-columns: 1fr; }
  .cart-float-bar { bottom: 12px; padding: 10px 14px; }
  body.has-cart .mobile-dock { display: none !important; }
  body.has-cart .site-footer { padding-bottom: 92px; }
}
