/* ===== 全局 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
:root {
  --primary: #e85d2f;
  --primary-dark: #c94818;
  --primary-light: #fff0eb;
  --bg: #faf6f1;
  --card: #ffffff;
  --text: #2d2d2d;
  --text-light: #888;
  --border: #eee5dc;
  --shadow: 0 2px 12px rgba(0,0,0,0.06);
  --radius: 14px;
}
body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  padding-bottom: 80px;
}

/* ===== 满减横幅 ===== */
.promo-banner {
  background: linear-gradient(135deg, #fff3e0, #ffe0b2);
  color: #e65100;
  text-align: center;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  border-bottom: 1px solid #ffe0b2;
  display: none;
}
.promo-banner.show { display: block; }
.promo-banner .promo-tags { font-weight: 800; }
.promo-banner .promo-tags span { margin: 0 4px; }
.promo-banner .promo-hint { font-size: 12px; font-weight: 500; opacity: 0.85; }
.promo-banner .promo-progress {
  display: inline-block;
  background: #e65100;
  color: #fff;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: 6px;
}

/* 结算页优惠行 */
.discount-row {
  display: flex; justify-content: space-between; padding: 3px 0;
  color: #e65100; font-weight: 600;
}
.discount-row span:first-child { color: #e65100; }
.summary-box .discount-row { margin-top: 4px; }
.promo-hint-row {
  font-size: 12px; color: #e65100; font-weight: 500;
  padding: 4px 0 0; text-align: center;
}
.od-row.od-discount { color: #e65100; }
.od-row.od-discount span:first-child { color: #e65100; }

/* ===== 顶部栏 ===== */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  padding: 14px 20px;
  display: flex; justify-content: space-between; align-items: center;
  box-shadow: 0 2px 10px rgba(232,93,47,0.3);
}
.brand { display: flex; align-items: center; gap: 12px; }
.logo { font-size: 36px; }
.brand h1 { font-size: 20px; font-weight: 700; }
.tagline { font-size: 12px; opacity: 0.85; margin-top: 2px; }

.cart-btn {
  background: rgba(255,255,255,0.2);
  border: none; color: #fff;
  padding: 10px 16px; border-radius: 30px;
  font-size: 14px; cursor: pointer;
  display: flex; align-items: center; gap: 6px;
  transition: background 0.2s;
}
.cart-btn:hover { background: rgba(255,255,255,0.32); }
.cart-count {
  background: #fff; color: var(--primary);
  font-weight: 700; font-size: 13px;
  min-width: 22px; height: 22px;
  border-radius: 11px; display: inline-flex;
  align-items: center; justify-content: center;
  padding: 0 6px;
}

/* ===== 分类导航 ===== */
.category-nav {
  position: sticky; top: 68px; z-index: 90;
  background: var(--card);
  display: flex; gap: 4px;
  padding: 10px 12px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 4px rgba(0,0,0,0.03);
}
.cat-btn {
  flex-shrink: 0;
  background: transparent; border: none;
  padding: 8px 16px; border-radius: 20px;
  font-size: 14px; color: var(--text-light);
  cursor: pointer; transition: all 0.2s;
  font-weight: 500;
}
.cat-btn.active { background: var(--primary); color: #fff; }

/* ===== 菜单 ===== */
.menu {
  max-width: 900px; margin: 0 auto;
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.menu-item {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.18s, box-shadow 0.18s;
  border: 1px solid var(--border);
}
.menu-item:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,0,0,0.1); }
.menu-item img { width: 100%; height: 180px; object-fit: cover; display: block; background: #f5f0ea; }

.img-wrap { position: relative; }
.badge-recommend {
  position: absolute;
  top: 10px; left: 10px;
  background: linear-gradient(135deg, #ff5722, #e85d2f);
  color: #fff;
  padding: 4px 10px;
  font-size: 11px; font-weight: 700;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(232,93,47,0.4);
  letter-spacing: 0.5px;
}
.badge-recommend.large {
  top: 16px; left: 16px;
  padding: 6px 14px;
  font-size: 13px;
  border-radius: 14px;
}
.menu-item.is-recommend { border: 2px solid var(--primary); box-shadow: 0 4px 16px rgba(232,93,47,0.15); }

.modal-item-img-wrap { position: relative; margin: -20px -20px 14px; }
.modal-item-img-wrap img { width: 100%; height: 220px; object-fit: cover; border-radius: 14px 14px 0 0; }
.menu-item-body { padding: 14px; }
.menu-item-tag {
  display: inline-block; font-size: 11px;
  background: var(--primary-light); color: var(--primary);
  padding: 2px 8px; border-radius: 10px; margin-bottom: 6px;
}
.menu-item h3 { font-size: 16px; margin-bottom: 4px; }
.menu-item .desc { font-size: 12px; color: var(--text-light); line-height: 1.5; margin-bottom: 10px; }
.menu-item .price-row { display: flex; justify-content: space-between; align-items: center; }
.menu-item .price { font-size: 20px; font-weight: 700; color: var(--primary); }
.menu-item .add-btn {
  background: var(--primary); color: #fff; border: none;
  width: 34px; height: 34px; border-radius: 50%;
  font-size: 20px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.menu-item .add-btn:hover { background: var(--primary-dark); }

/* ===== 底部购物车栏 ===== */
.cart-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 95;
  background: var(--card);
  padding: 12px 20px;
  display: flex; justify-content: space-between; align-items: center;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
  transform: translateY(100%);
  transition: transform 0.3s;
}
.cart-bar.show { transform: translateY(0); }
.cart-bar-info { display: flex; align-items: center; gap: 16px; }
.cart-bar-count { font-size: 14px; color: var(--text-light); }
.cart-bar-total { font-size: 22px; font-weight: 700; color: var(--primary); }
.checkout-btn {
  background: var(--primary); color: #fff; border: none;
  padding: 12px 28px; border-radius: 30px;
  font-size: 15px; font-weight: 600; cursor: pointer;
  transition: background 0.2s;
}
.checkout-btn:hover { background: var(--primary-dark); }
.checkout-btn.full { width: 100%; margin-top: 12px; padding: 14px; }

/* ===== 购物车抽屉 ===== */
.overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4);
  z-index: 200; opacity: 0; pointer-events: none;
  transition: opacity 0.3s;
}
.overlay.show { opacity: 1; pointer-events: auto; }
.cart-drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 100%; max-width: 420px;
  background: var(--bg); z-index: 210;
  transform: translateX(100%);
  transition: transform 0.3s;
  display: flex; flex-direction: column;
}
.cart-drawer.show { transform: translateX(0); }
.drawer-header {
  background: var(--card); padding: 16px 20px;
  display: flex; justify-content: space-between; align-items: center;
  border-bottom: 1px solid var(--border);
}
.drawer-header h2 { font-size: 18px; }
.close-btn {
  background: none; border: none; font-size: 20px;
  cursor: pointer; color: var(--text-light);
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.close-btn:hover { background: #f0f0f0; }
.cart-items { flex: 1; overflow-y: auto; padding: 12px; }
.cart-empty { text-align: center; color: var(--text-light); padding: 60px 0; }
.cart-empty .emoji { font-size: 50px; display: block; margin-bottom: 12px; }

.cart-item {
  background: var(--card); border-radius: 12px;
  padding: 12px; margin-bottom: 10px;
  display: flex; gap: 12px; align-items: center;
  border: 1px solid var(--border);
}
.cart-item img { width: 60px; height: 60px; border-radius: 8px; object-fit: cover; }
.cart-item-info { flex: 1; }
.cart-item-info h4 { font-size: 14px; margin-bottom: 2px; }
.cart-item-info .opts { font-size: 11px; color: var(--text-light); }
.cart-item-info .item-price { font-size: 15px; font-weight: 700; color: var(--primary); margin-top: 4px; }
.qty-ctrl { display: flex; align-items: center; gap: 8px; }
.qty-ctrl button {
  background: var(--primary-light); color: var(--primary);
  border: none; width: 28px; height: 28px; border-radius: 50%;
  font-size: 16px; cursor: pointer; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.qty-ctrl button:hover { background: var(--primary); color: #fff; }
.qty-ctrl span { min-width: 20px; text-align: center; font-weight: 600; }

.drawer-footer {
  background: var(--card); padding: 16px 20px;
  border-top: 1px solid var(--border);
}
.total-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.total-row span:first-child { font-size: 14px; color: var(--text-light); }
.total-price { font-size: 24px; font-weight: 700; color: var(--primary); }

/* ===== 弹窗 ===== */
.modal {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.25s;
}
.modal.show { opacity: 1; pointer-events: auto; }
.modal-content {
  background: var(--card); border-radius: var(--radius);
  max-width: 440px; width: 100%; max-height: 85vh;
  overflow-y: auto; position: relative;
  padding: 20px;
  transform: scale(0.9); transition: transform 0.25s;
}
.modal.show .modal-content { transform: scale(1); }
.modal-close { position: absolute; top: 12px; right: 12px; z-index: 5; }

.modal-item-img { width: 100%; height: 220px; object-fit: cover; border-radius: 12px; margin-bottom: 14px; }
.modal h2 { font-size: 20px; margin-bottom: 6px; }
.modal .modal-desc { font-size: 13px; color: var(--text-light); margin-bottom: 16px; line-height: 1.6; }
.option-group { margin-bottom: 16px; }
.option-group h4 { font-size: 14px; margin-bottom: 8px; display: flex; justify-content: space-between; }
.option-group h4 .hint { font-size: 12px; color: var(--text-light); font-weight: 400; }
.option-list { display: flex; flex-wrap: wrap; gap: 8px; }
.option-chip {
  border: 2px solid var(--border); background: var(--card);
  padding: 8px 14px; border-radius: 20px;
  font-size: 13px; cursor: pointer; transition: all 0.15s;
  display: flex; align-items: center; gap: 4px;
}
.option-chip.selected { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }
.option-chip .chip-price { font-size: 11px; color: var(--text-light); }
.option-chip.selected .chip-price { color: var(--primary); }
.qty-select { display: flex; align-items: center; gap: 10px; }
.qty-select button {
  background: var(--primary-light); color: var(--primary);
  border: none; width: 36px; height: 36px; border-radius: 50%;
  font-size: 20px; cursor: pointer; font-weight: 700;
}
.qty-select span { font-size: 18px; font-weight: 700; min-width: 30px; text-align: center; }
.modal-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border);
}
.modal-footer .total { font-size: 22px; font-weight: 700; color: var(--primary); }
.add-cart-big {
  background: var(--primary); color: #fff; border: none;
  padding: 12px 32px; border-radius: 30px;
  font-size: 15px; font-weight: 600; cursor: pointer;
}
.add-cart-big:hover { background: var(--primary-dark); }

/* ===== 订单成功 ===== */
.order-success { text-align: center; padding: 30px 24px; }
.success-icon { font-size: 60px; margin-bottom: 12px; }
.order-success h2 { font-size: 22px; margin-bottom: 6px; }
.order-msg { color: var(--text-light); font-size: 14px; }
.order-number {
  font-size: 26px; font-weight: 800; color: var(--primary);
  margin: 14px 0 10px; letter-spacing: 2px;
}
.order-detail {
  background: var(--bg); border-radius: 12px; padding: 14px;
  text-align: left; margin-bottom: 16px; font-size: 13px;
  max-height: 320px; overflow-y: auto;
}
.order-detail .od-row { display: flex; justify-content: space-between; padding: 3px 0; }
.order-detail .od-row span:first-child { color: var(--text-light); flex-shrink: 0; }
.order-detail .od-row span:last-child { text-align: right; font-weight: 500; }
.order-detail .od-total { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 8px; font-weight: 700; color: var(--primary); }
.order-detail .od-total span:first-child { color: var(--text); }
.order-detail .od-address span:last-child { max-width: 220px; }
.order-detail .od-info { margin-bottom: 8px; }
.order-detail .od-divider { border-top: 1px dashed var(--border); margin: 10px 0; }

/* 支付提示 */
.pay-qr-tip {
  background: var(--primary-light); border-radius: 12px;
  padding: 16px; text-align: center; margin-top: 12px;
}
.pay-tip-title { font-size: 15px; font-weight: 700; color: var(--primary); margin-bottom: 10px; }
.pay-qr { width: 180px; height: 180px; object-fit: cover; border-radius: 10px; margin: 0 auto 8px; display: block; background: #fff; }
.pay-tip-sub { font-size: 12px; color: var(--text-light); line-height: 1.6; }
.pay-tip-cod {
  background: #fff3e0; border-radius: 10px; padding: 10px 14px;
  font-size: 13px; color: #e65100; font-weight: 600; margin-top: 12px; text-align: center;
}

/* ===== 表单 ===== */
.form-group { margin-bottom: 14px; }
.form-group label {
  display: block; font-size: 14px; font-weight: 600;
  margin-bottom: 6px; color: var(--text);
}
.form-group .required { color: var(--primary); }
.form-group input, .form-group textarea {
  width: 100%; padding: 12px 14px;
  border: 2px solid var(--border); border-radius: 10px;
  font-size: 14px; font-family: inherit;
  transition: border-color 0.2s; background: var(--bg);
}
.form-group input:focus, .form-group textarea:focus {
  outline: none; border-color: var(--primary); background: var(--card);
}
.form-group textarea { resize: none; }
.form-hint { font-size: 12px; color: var(--text-light); margin-top: 4px; }
.form-group input[type="date"] { color: var(--text); }

/* 配送时间高亮 */
.od-row.od-highlight {
  background: #fff3e0;
  border-radius: 8px;
  padding: 6px 10px !important;
  margin: 4px -10px;
  font-weight: 600;
}
.od-row.od-highlight span:first-child { color: #e65100; }
.od-row.od-highlight span:last-child { color: #e65100; }

.summary-box {
  background: var(--bg); border-radius: 10px; padding: 12px;
  margin: 16px 0; font-size: 13px;
}
.summary-box h4 { font-size: 14px; margin-bottom: 8px; }
.summary-box .od-row { display: flex; justify-content: space-between; padding: 3px 0; }
.summary-box .od-total { border-top: 1px solid var(--border); margin-top: 6px; padding-top: 8px; font-weight: 700; color: var(--primary); }

.order-actions { display: flex; flex-direction: column; gap: 8px; }

/* 订单截图区域 */
#orderCapture {
  background: #fff;
  padding: 6px;
}
.shot-content { text-align: center; }
.shot-img {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  display: block;
}
.action-btn {
  background: var(--bg); border: 2px solid var(--border);
  padding: 10px; border-radius: 30px;
  font-size: 14px; cursor: pointer; color: var(--text);
  transition: all 0.2s;
}
.action-btn:hover { border-color: var(--primary); color: var(--primary); }

@media (max-width: 600px) {
  .menu { grid-template-columns: 1fr; }
  .brand h1 { font-size: 17px; }
  .tagline { display: none; }
}
