/* ============ 商城下单 ============ */
.shop-layout {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.shop-main {
  flex: 1;
  min-width: 0;
}

.shop-cart-panel {
  width: 340px;
  background: #fff;
  border-radius: 8px;
  box-shadow: var(--shadow);
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 100px);
  display: flex;
  flex-direction: column;
}

.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}

.cart-header h3 {
  font-size: 16px;
  font-weight: 600;
}

.cart-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  background: var(--primary);
  color: #fff;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 12px 20px;
  min-height: 200px;
}

.cart-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-secondary);
}

.cart-empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
  opacity: 0.5;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--border-color);
}

.cart-item:last-child { border-bottom: none; }

.cart-item-img {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: #f5f7fa;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
  overflow: hidden;
}

.cart-item-info { flex: 1; min-width: 0; }

.cart-item-name {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-price {
  font-size: 13px;
  color: var(--danger);
  font-weight: 600;
}

.cart-item-qty {
  display: flex;
  align-items: center;
  gap: 4px;
}

.cart-qty-btn {
  width: 24px;
  height: 24px;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  color: var(--text-regular);
  transition: all 0.2s;
}

.cart-qty-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.cart-qty-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.cart-qty-num {
  min-width: 32px;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
}

.cart-remove-btn {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 16px;
  padding: 4px;
}

.cart-remove-btn:hover { color: var(--danger); }

.cart-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--border-color);
  background: #fafafa;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 14px;
}

.cart-total-price {
  font-size: 22px;
  font-weight: 600;
  color: var(--danger);
}

/* ============ 搜索栏（PC 端可见，移动端隐藏）============ */
.shop-searchbar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  border: 1px solid #e4e8ef;
  border-radius: 24px;
  padding: 4px 4px 4px 14px;
  margin-bottom: 14px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.shop-searchbar input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 14px;
  background: transparent;
  padding: 8px 0;
  color: var(--text-primary);
  min-width: 0;
}

.shop-searchbar input::placeholder { color: #bfbfbf; }

.shop-search-icon {
  font-size: 16px;
  color: #8c8c8c;
  flex-shrink: 0;
}

.shop-smart-btn {
  background: linear-gradient(135deg, #722ed1, #531dab);
  color: #fff;
  border: none;
  padding: 6px 14px;
  border-radius: 18px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}

.shop-smart-btn:hover { background: linear-gradient(135deg, #9254de, #722ed1); }

.shop-filter-btn {
  background: #f0f5ff;
  color: #1890ff;
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s;
}

.shop-filter-btn:hover { background: #d6e4ff; }

/* 分类标签（PC 端 tab） */
.shop-categories {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.shop-cat-tab {
  padding: 8px 18px;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-regular);
  transition: all 0.3s;
}

.shop-cat-tab:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.shop-cat-tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

/* 菜品网格（PC 端） */
.shop-dish-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.shop-dish-card {
  background: #fff;
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
}

.shop-dish-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

.shop-dish-img {
  width: 100%;
  height: 140px;
  background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 64px;
  overflow: hidden;
}

.shop-dish-info {
  padding: 12px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.shop-dish-name {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}

.shop-dish-category {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.shop-dish-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  flex-wrap: wrap;
  gap: 6px;
}

.shop-dish-price {
  font-size: 18px;
  font-weight: 600;
  color: var(--danger);
}

.shop-dish-price small {
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 400;
}

.shop-add-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: all 0.2s;
}

.shop-add-btn:hover {
  background: var(--primary-dark);
  transform: scale(1.1);
}

/* 购物车动画 */
@keyframes cartBounce {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

.cart-bounce {
  animation: cartBounce 0.3s ease;
}

/* ============ 移动端布局（默认隐藏）============ */
.m-shop-layout {
  display: none;
  gap: 0;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  min-height: calc(100vh - 280px);
  margin-bottom: 70px; /* 给底部购物车条留位置 */
}

/* v20260922：移动端顶搜索栏（sticky 跟随滚动） */
.m-shop-searchbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: #fff;
  border-bottom: 1px solid #f0f0f0;
  position: sticky;
  top: 0;
  z-index: 20;
}

.m-shop-search-ico { font-size: 15px; flex-shrink: 0; }

.m-shop-smart-btn {
  background: linear-gradient(135deg, #722ed1, #531dab);
  color: #fff;
  border: none;
  padding: 7px 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(114, 46, 209, 0.35);
}

.m-shop-smart-btn:hover { background: linear-gradient(135deg, #9254de, #722ed1); }

.m-shop-searchbar input {
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  border: none;
  border-radius: 18px;
  background: #f5f6f8;
  font-size: 14px;
  outline: none;
}

/* v20260922：分类栏 —— 顶部横向滚动图标条（原左侧竖列） */
.m-shop-sidebar {
  width: 100%;
  flex-shrink: 0;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 6px;
  background: #fff;
  border-right: none;
  border-bottom: 1px solid #f0f0f0;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 8px 10px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.m-shop-sidebar::-webkit-scrollbar { display: none; }

.m-shop-cat {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: 13px;
  color: #595959;
  cursor: pointer;
  border-left: none;
  border: 1px solid #f0f0f0;
  border-radius: 20px;
  background: #fafbfc;
  transition: all 0.2s;
  user-select: none;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1;
}

.m-shop-cat-icon {
  font-size: 17px;
  margin-bottom: 0;
  line-height: 1;
}

.m-shop-cat-name {
  font-size: 13px;
  line-height: 1.2;
  text-align: center;
  word-break: keep-all;
}

.m-shop-cat.active {
  background: #f0ffe6;
  border-color: #95de64;
  color: #389e0d;
  font-weight: 600;
}

.m-shop-cat.active .m-shop-cat-name { color: #389e0d; }
.m-shop-cat.active .m-shop-cat-icon { transform: scale(1.08); }

/* 移动端商品列表 */
.m-shop-list {
  flex: 1;
  overflow-y: auto;
  background: #fff;
  padding: 0 0 20px 0;
  -webkit-overflow-scrolling: touch;
}

.m-dish-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px;
  border-bottom: 1px solid #f5f5f5;
  background: #fff;
  transition: background 0.15s;
}

.m-dish-row:active { background: #fafafa; }

.m-dish-img {
  width: 70px;
  height: 70px;
  flex-shrink: 0;
  background: linear-gradient(135deg, #f5f7fa 0%, #e8ecf1 100%);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid #f0f0f0;
}

.m-dish-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.m-dish-name {
  font-size: 15px;
  font-weight: 600;
  color: #262626;
  line-height: 1.35;
  /* v20261002a：去掉 2 行截断，长菜名完整显示；窄屏自适应换行，保证清晰可读 */
  overflow-wrap: anywhere;
  word-break: break-word;
}

.m-dish-desc {
  font-size: 12px;
  color: #8c8c8c;
  line-height: 1.2;
}

.m-dish-price {
  font-size: 14px;
  font-weight: 600;
  color: #f5222d;
  margin-top: 2px;
}

.m-dish-qty {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.m-qty-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid #d9d9d9;
  background: #fff;
  color: #595959;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
  flex-shrink: 0;
  line-height: 1;
  padding: 0;
}

.m-qty-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.m-qty-btn.plus {
  background: linear-gradient(135deg, #52c41a, #389e0d);
  border-color: #52c41a;
  color: #fff;
  font-weight: 600;
}

.m-qty-btn.minus:not(:disabled):hover {
  border-color: #f5222d;
  color: #f5222d;
}

.m-qty-btn.plus:hover {
  background: linear-gradient(135deg, #73d13d, #52c41a);
  transform: scale(1.05);
}

.m-qty-num {
  min-width: 24px;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  color: #262626;
}

/* v20260926f：点餐份数直接输入 */
.m-qty-input {
  width: 44px;
  min-width: 44px;
  height: 28px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: #262626;
  padding: 0 2px;
  -moz-appearance: textfield;
}
.m-qty-input:focus { outline: none; border-color: #52c41a; }
.m-qty-input::-webkit-outer-spin-button,
.m-qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* v20260926f：PC 端点餐卡片步进器 */
.shop-dish-stepper {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.shop-step-btn {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid #d9d9d9;
  background: #fff;
  color: #595959;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: all 0.15s;
}
.shop-step-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.shop-step-btn.plus {
  background: var(--primary, #52c41a);
  border-color: var(--primary, #52c41a);
  color: #fff;
  font-weight: 600;
}
.shop-step-btn.plus:hover { transform: scale(1.08); }
.shop-step-btn:not(:disabled):not(.plus):hover { border-color: #f5222d; color: #f5222d; }
.shop-step-input {
  width: 40px;
  height: 24px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: #262626;
  padding: 0 2px;
  -moz-appearance: textfield;
}
.shop-step-input:focus { outline: none; border-color: var(--primary, #52c41a); }
.shop-step-input::-webkit-outer-spin-button,
.shop-step-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* 移动端底部购物车条 */
.m-cart-bar {
  position: fixed;
  bottom: 56px; /* 底部 Tab 栏上方 */
  left: 0;
  right: 0;
  background: linear-gradient(135deg, #2c3e50, #34495e);
  color: #fff;
  padding: 10px 14px;
  display: none;
  align-items: center;
  justify-content: space-between;
  z-index: 250;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.m-cart-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.m-cart-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.m-cart-clear {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 17px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
  padding: 0;
  line-height: 1;
}

.m-cart-clear:active {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(0.95);
}

.m-cart-icon-wrap {
  position: relative;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.m-cart-icon { font-size: 22px; }

.m-cart-count {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #f5222d;
  color: #fff;
  border-radius: 10px;
  min-width: 18px;
  height: 18px;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  padding: 0 4px;
  border: 1.5px solid #2c3e50;
}

.m-cart-checkout {
  background: linear-gradient(135deg, #52c41a, #389e0d);
  color: #fff;
  border: none;
  padding: 8px 18px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.m-cart-checkout:hover { transform: scale(1.03); }

/* ============ 响应式 ============ */
/* 平板：< 900px → PC 端紧凑布局 + 显示 PC 搜索栏 */
@media (max-width: 900px) {
  .shop-layout { flex-direction: column; }
  .shop-cart-panel { width: 100%; position: static; max-height: 320px; }
  .shop-dish-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
}

/* 手机端：< 768px → 切到移动端布局（隐藏 PC 端 grid / cart panel / 顶部 tab；显示移动端 layout） */
@media (max-width: 768px) {
  /* 隐藏 PC 端元素 */
  .shop-searchbar,
  .shop-categories,
  .shop-dish-grid,
  .shop-cart-panel {
    display: none !important;
  }

  /* 显示移动端布局（v20260922：纵向 = 顶搜索栏 + 分类横滚条 + 商品列表） */
  .m-shop-layout { display: flex; flex-direction: column; min-height: calc(100vh - 200px); }

  /* 移动端：page-content 减少内边距（避免太挤） */
  #page-shop { padding: 0 !important; }
  #page-shop .page-header { padding: 12px 14px 6px; }
  #page-shop .page-header h2 { font-size: 16px; }
  #page-shop .page-header p { font-size: 12px; }

  /* 移动端：底部 Tab 栏适配 */
  .m-tabbar { z-index: 300; }
}

/* ============ v20260923：餐饮店手机端 App（方案A）============
   底部导航：点餐/收银台/订单/购物车/更多；四视图：首页/分类/订单/购物车。
   仅在 catering 模式 + 手机端由 JS 加 .mca-on 类激活，其余模式不受影响。 */
#mcaApp { display: none; }

@media (max-width: 768px) {
  #page-shop.mca-on { padding: 0 !important; }
  #page-shop.mca-on .page-header,
  #page-shop.mca-on .shop-layout { display: none !important; }
  #page-shop.mca-on #mcaApp { display: block; padding: 0 0 80px 0; }

  /* 底部 Tab：购物车角标 */
  .mca-tab { position: relative; }
  .mca-tab-badge {
    position: absolute; top: 1px; left: 50%; margin-left: 10px;
    min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px;
    background: #f5222d; color: #fff; font-size: 10px; font-weight: 600;
    display: flex; align-items: center; justify-content: center;
    border: 1.5px solid #fff;
  }

  /* ===== 首页 ===== */
  .mca-search {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 12px; background: #fff;
    position: sticky; top: 0; z-index: 20;
    border-bottom: 1px solid #f0f0f0;
  }
  .mca-search-ico { font-size: 15px; flex-shrink: 0; }
  .mca-search input {
    flex: 1; min-width: 0; padding: 8px 14px; border: none; border-radius: 18px;
    background: #f5f6f8; font-size: 14px; outline: none;
  }
  .mca-smart-btn {
    background: linear-gradient(135deg, #722ed1, #531dab); color: #fff; border: none;
    padding: 7px 12px; border-radius: 16px; font-size: 12px; font-weight: 500;
    cursor: pointer; white-space: nowrap; flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(114, 46, 209, 0.35);
  }

  .mca-banner {
    margin: 12px; padding: 18px 16px; border-radius: 14px;
    background: linear-gradient(135deg, #52c41a 0%, #389e0d 60%, #237804 100%);
    color: #fff; position: relative; overflow: hidden;
    box-shadow: 0 4px 14px rgba(82, 196, 26, 0.3);
  }
  .mca-banner::after {
    content: '🍜'; position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
    font-size: 50px; opacity: 0.9;
  }
  .mca-banner-title { font-size: 19px; font-weight: 700; margin-bottom: 6px; }
  .mca-banner-sub { font-size: 12px; opacity: 0.92; }

  .mca-sec-title {
    padding: 14px 14px 10px; font-size: 15px; font-weight: 700; color: #262626;
  }
  .mca-cat-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px;
    padding: 0 12px 4px;
  }
  .mca-cat-item {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 12px 4px; background: #fff; border-radius: 12px; cursor: pointer;
    transition: transform 0.15s; border: 1px solid #f0f0f0;
  }
  .mca-cat-item:active { transform: scale(0.94); background: #f6ffed; }
  .mca-cat-icon { font-size: 26px; line-height: 1; }
  .mca-cat-name { font-size: 12px; color: #595959; text-align: center; }

  .mca-card {
    margin: 0 12px; background: #fff; border-radius: 12px; overflow: hidden;
    border: 1px solid #f0f0f0;
  }
  .mca-card .m-dish-row:last-child { border-bottom: none; }

  /* ===== v20261002c：手机端菜品列表 → 双列卡片网格（对齐收银台菜品卡：上图 / 名下 / 价格 / 步进器）=====
     背景：原横排 list 把「图 70px」与「步进器 ≈110px」夹在菜名两侧，菜名纵向只剩 ~60px，
     中文菜名被逐字换行（红烧…/宫保…），既拥挤又看不清。改为卡片后菜名独占整卡宽度，长名自动换行。 */
  .mca-card,
  .m-shop-list {
    display: grid;
    /* 列宽阈值已用无头浏览器在 320/360/390/412/430/480 逐档实测：
       110px ⇒ 360px 及以上机型稳定 2 列（132px 时 390 只剩 1 列、125 以下才勉强，
       而 110 在 360 也能排满：可用 233 → floor(241/118)=2）。
       仅 320px（初代 iPhone SE）退化为 1 列大卡，可接受。 */
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 8px;
    align-content: start;
  }
  /* 外层白盒退场 —— 卡片自带边框底色，避免「盒中盒」 */
  .mca-card {
    margin: 0 10px;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: 0;
    overflow: visible;
  }
  .m-shop-list { padding: 8px 10px 20px; }

  /* 卡片本体（含 :last-child 一起覆盖旧「去底边」规则） */
  .mca-card .m-dish-row,
  .mca-card .m-dish-row:last-child,
  .m-shop-list .m-dish-row {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
  }
  .mca-card .m-dish-row:active,
  .m-shop-list .m-dish-row:active { background: #fafafa; }

  /* 图片：整卡宽度铺满（对齐 .cashier-dish-img 的 90px / 圆角 8px） */
  .mca-card .m-dish-img,
  .m-shop-list .m-dish-img {
    width: 100%;
    height: 82px;
    margin-bottom: 6px;
    border: 0;
    border-radius: 8px;
    background: #f9fafb;
  }

  /* 文字区：菜名独占整卡宽（关键 —— 不再被步进器挤压） */
  .mca-card .m-dish-info,
  .m-shop-list .m-dish-info { flex: none; min-width: 0; gap: 2px; }
  .mca-card .m-dish-name,
  .m-shop-list .m-dish-name {
    font-size: 14px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 36px;
  }
  .mca-card .m-dish-price,
  .m-shop-list .m-dish-price { font-size: 15px; margin-top: 2px; }
  .mca-card .m-dish-price small,
  .m-shop-list .m-dish-price small { font-size: 11px; color: #8c8c8c; font-weight: 400; }
  .mca-card .m-dish-desc,
  .m-shop-list .m-dish-desc {
    font-size: 11px;
    color: #8c8c8c;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* 步进器：移到底部右对齐（腾出横向空间给菜名） */
  .mca-card .m-dish-qty,
  .m-shop-list .m-dish-qty {
    margin-top: 6px;
    justify-content: flex-end;
    gap: 4px;
  }
  .mca-card .m-qty-btn,
  .m-shop-list .m-qty-btn { width: 24px; height: 24px; font-size: 14px; }
  .mca-card .m-qty-input,
  .m-shop-list .m-qty-input { width: 36px; min-width: 36px; height: 24px; font-size: 13px; }
  .mca-card .m-qty-num,
  .m-shop-list .m-qty-num { min-width: 20px; }

  /* ===== 分类视图（左栏 + 右列表）===== */
  .mca-cbar {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px; background: #fff; position: sticky; top: 0; z-index: 20;
    border-bottom: 1px solid #f0f0f0;
  }
  .mca-back {
    border: none; background: #f5f6f8; color: #595959; font-size: 13px;
    padding: 6px 12px; border-radius: 14px; cursor: pointer;
  }
  .mca-cbar-title { font-size: 16px; font-weight: 700; color: #262626; }
  /* v20261107f：★ 分类视图左右两栏【各自独立滚动】修复 ——
     旧版只有 min-height 没有高度约束，rail/listwrap 被 align-items:stretch
     拉伸到各自内容高度，两栏随 window 整体滚动（老板报「分类栏和菜品一起移动」）。
     现改为固定高度容器 + overflow:hidden，两栏 100% 高度各自内滚；
     精确高度由 shop.js MShopApp._fitCatBody() 动态测量覆写（calc 只是 JS 失效兜底）。 */
  .mca-cat-body {
    display: flex; align-items: stretch;
    height: calc(100dvh - 210px);
    min-height: 160px;
    overflow: hidden;
  }
  .mca-rail {
    width: 92px; flex-shrink: 0; background: #f7f8fa; overflow-y: auto;
    -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
    height: 100%;
    padding-bottom: 20px;
  }
  .mca-rail-item {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 12px 6px; font-size: 12px; color: #595959; cursor: pointer;
    position: relative;
  }
  .mca-rail-ico { font-size: 20px; line-height: 1; }
  .mca-rail-name { text-align: center; line-height: 1.25; }
  .mca-rail-item.active { background: #fff; color: #389e0d; font-weight: 600; }
  .mca-rail-item.active::before {
    content: ''; position: absolute; left: 0; top: 20%; bottom: 20%;
    width: 3px; border-radius: 2px; background: #52c41a;
  }
  /* v20261107f：右栏菜品列表同样 100% 高度内滚（与左栏互不影响） */
  .mca-cat-listwrap {
    flex: 1; min-width: 0; background: #fff;
    height: 100%; overflow-y: auto;
    -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  }
  .mca-cat-count { padding: 10px 14px 2px; font-size: 12px; color: #8c8c8c; }

  /* ===== 订单视图 ===== */
  .mca-view-title {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 14px 8px; font-size: 17px; font-weight: 700; color: #262626;
  }
  .mca-stat-row {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
    padding: 4px 12px 8px;
  }
  .mca-stat {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    background: #fff; border: 1px solid #f0f0f0; border-radius: 10px; padding: 10px 2px;
    min-width: 0;
  }
  .mca-stat-num { font-size: 13px; font-weight: 700; color: #262626; word-break: break-all; text-align: center; }
  .mca-stat-label { font-size: 11px; color: #8c8c8c; }
  .mca-ord-list { padding: 0 12px; display: grid; gap: 10px; }
  .mca-ord-card { background: #fff; border: 1px solid #f0f0f0; border-radius: 12px; padding: 12px 14px; }
  .mca-ord-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
  .mca-ord-table { font-size: 12px; color: #8c8c8c; }
  .mca-ord-sub { margin-top: 4px; font-size: 12px; color: #8c8c8c; }
  .mca-ord-detail { margin-top: 8px; padding-top: 8px; border-top: 1px dashed #f0f0f0; }
  .mca-ord-item { display: flex; justify-content: space-between; font-size: 13px; color: #595959; padding: 3px 0; }
  .mca-ord-note { font-size: 12px; color: #d48806; padding-top: 6px; }
  .mca-ord-actions { display: flex; gap: 8px; margin-top: 10px; }
  .mca-status { font-size: 11px; padding: 2px 8px; border-radius: 10px; flex-shrink: 0; white-space: nowrap; }
  .mca-status.st-open, .mca-status.st-draft { background: #fff7e6; color: #d48806; }
  .mca-status.st-checked_out { background: #f6ffed; color: #389e0d; }
  .mca-status.st-void { background: #f5f5f5; color: #8c8c8c; }
  .mca-status.st-refunded { background: #fff1f0; color: #cf1322; }

  /* ===== 购物车视图 ===== */
  .mca-clear {
    border: none; background: #f5f6f8; color: #8c8c8c; font-size: 12px;
    padding: 5px 12px; border-radius: 12px; cursor: pointer;
  }
  .mca-cart-list {
    margin: 0 12px 90px; background: #fff; border-radius: 12px;
    border: 1px solid #f0f0f0; overflow: hidden;
  }
  .mca-cart-row {
    display: flex; align-items: center; gap: 12px; padding: 12px;
    border-bottom: 1px solid #f5f5f5;
  }
  .mca-cart-row:last-child { border-bottom: none; }
  .mca-cart-img {
    width: 56px; height: 56px; border-radius: 8px; background: #f5f7fa;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden; flex-shrink: 0; border: 1px solid #f0f0f0;
  }
  .mca-cart-footer {
    position: fixed; left: 0; right: 0; bottom: 58px; z-index: 280;
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 10px 14px; background: #fff;
    box-shadow: 0 -3px 12px rgba(0, 0, 0, 0.08);
  }
  .mca-cart-sum { display: flex; align-items: baseline; gap: 4px; flex-wrap: wrap; }
  .mca-cart-total { font-size: 20px; font-weight: 700; color: #f5222d; }
  .mca-cart-cnt { font-size: 12px; color: #8c8c8c; }

  /* ===== 通用 ===== */
  .mca-btn {
    border: 1px solid #d9d9d9; background: #fff; color: #595959; font-size: 13px;
    padding: 7px 14px; border-radius: 18px; cursor: pointer;
  }
  .mca-btn.primary {
    background: linear-gradient(135deg, #52c41a, #389e0d); border-color: #52c41a;
    color: #fff; font-weight: 600; box-shadow: 0 2px 8px rgba(82, 196, 26, 0.35);
  }
  .mca-btn.big { padding: 10px 26px; font-size: 15px; }
  .mca-empty {
    text-align: center; padding: 44px 20px; color: #8c8c8c;
    display: flex; flex-direction: column; align-items: center; gap: 6px;
  }
  .mca-empty-ico { font-size: 52px; opacity: 0.5; }
  .mca-empty-sub { font-size: 12px; margin: 0; }
  .mca-empty .mca-btn { margin-top: 10px; }
}

/* v20260926b：移动端响应式优化 */
@media (max-width: 768px) {
  .dish-grid {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
    padding: 12px !important;
  }

  .mobile-dish-card {
    display: flex !important;
    flex-direction: column !important;
    min-height: auto !important;
  }

  .mobile-dish-action {
    padding: 8px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  .mobile-dish-action button,
  .mobile-dish-action .add-btn {
    min-width: 40px !important;
    min-height: 40px !important;
    font-size: 20px !important;
  }
}

@media (max-width: 375px) {
  .dish-grid {
    grid-template-columns: 1fr !important;
  }
}

/* ===== v20260926e：购物车数量可直接输入 ===== */
.cart-qty-input {
  width: 46px;
  min-width: 46px;
  height: 24px;
  border: 1px solid var(--border-color, #d9d9d9);
  border-radius: 4px;
  background: #fff;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  color: #262626;
  padding: 0 2px;
}
.cart-qty-input:focus {
  outline: none;
  border-color: var(--primary, #1890ff);
}
.cart-qty-input::-webkit-outer-spin-button,
.cart-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.cart-qty-input {
  -moz-appearance: textfield;
  appearance: textfield;
}
/* 手机端 App 化购物车行的数量输入框 */
.m-qty-input {
  width: 42px;
  min-width: 42px;
  height: 24px;
  border: 1px solid #e8e8e8;
  border-radius: 6px;
  background: #fff;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: #262626;
  padding: 0 2px;
}
.m-qty-input:focus {
  outline: none;
  border-color: #52c41a;
}
.m-qty-input::-webkit-outer-spin-button,
.m-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.m-qty-input {
  -moz-appearance: textfield;
  appearance: textfield;
}

/* ============ v20260926ct：「按食材下单」开关 ============ */
/* 默认按菜品下单；勾选后分类栏多出「🥬 食材」，可像点菜一样选购食材（按销售价计价） */
.shop-ing-toggle-bar {
  margin: 0 0 10px;
  /* v20261007i：一条栏里放两个互斥勾选（📦 按通用商品 / 🥬 按食材）⇒ 横向排列、窄屏自动换行 */
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.shop-ing-toggle-bar .shop-ing-toggle { flex: 1 1 260px; margin: 0; }
.shop-ing-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding: 8px 12px;
  border: 1px solid var(--border-color, #e8e8e8);
  border-radius: 8px;
  background: #fafafa;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary, #595959);
  user-select: none;
  transition: border-color .15s, background .15s;
}
.shop-ing-toggle:hover {
  border-color: #b7eb8f;
  background: #fcfff5;
}
.shop-ing-toggle.on {
  border-color: #b7eb8f;
  background: #f6ffed;
}
.shop-ing-toggle input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  cursor: pointer;
  accent-color: #52c41a;
  flex: none;
}
.shop-ing-toggle-label {
  font-weight: 600;
  color: var(--text-primary, #262626);
  white-space: nowrap;
}
.shop-ing-toggle.on .shop-ing-toggle-label {
  color: #389e0d;
}
.shop-ing-toggle-tip {
  font-size: 12px;
  color: #8c8c8c;
}
.shop-ing-toggle.on .shop-ing-toggle-tip {
  color: #52c41a;
}
/* 手机端 App 首页里略微收紧左右边距 */
.mca-ing-toggle {
  margin: 0 12px 8px;
}
/* PC 容器在移动端隐藏（移动端改用 #shopIngToggleBarM —— 它随 .m-shop-layout 一起显隐） */
@media (max-width: 768px) {
  #shopIngToggleBar {
    display: none !important;
  }
}


/* v20261003：分类视图内搜索条 —— 不 sticky（避免与顶栏 .mca-cbar 双 sticky 叠加） */
.mca-cat-search { position: static; }

/* ===== v20261028b：盒饭卡「🍱 组成」图片角标（点图片区即可看菜品组成，与后台盒饭管理同源） ===== */
.shop-dish-img.is-composable, .m-dish-img.is-composable { position: relative; cursor: pointer; }
.shop-dish-img.is-composable:hover, .m-dish-img.is-composable:hover { outline: 1px solid #1890ff; outline-offset: -1px; }
.shop-box-compose-badge, .m-box-compose-badge {
  position: absolute; right: 2px; bottom: 2px; z-index: 2;
  padding: 1px 5px; border-radius: 8px; font-size: 10px; line-height: 1.7;
  color: #fff; background: rgba(0, 0, 0, .55); pointer-events: none; white-space: nowrap;
}
.m-box-compose-badge { font-size: 9px; padding: 0 4px; }
