/* ============================================================
   唐久便利 · 手机点单 /m
   外卖商家式布局：门店信息 + 左分类 / 右商品 + 底部购物车
   ============================================================ */

.mm-shell {
  padding-bottom: calc(82px + env(safe-area-inset-bottom));
  overflow: visible;
}

/* ---------- 顶栏 ---------- */
.mm-header {
  position: sticky;
  top: 0;
  z-index: 60;
  padding-top: env(safe-area-inset-top);
  background: rgba(255, 248, 239, .95);
  border-bottom: 1px solid rgba(234, 220, 205, .72);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
}
.mm-header-inner {
  height: 52px;
  padding: 0 13px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.mm-brand {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.mm-brand .brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-size: 20px;
  box-shadow: 0 5px 12px rgba(242,106,33,.22);
}
.mm-brand .brand-text strong { font-size: 15.5px; }
.mm-brand .brand-text small { font-size: 6px; letter-spacing: .16em; margin-top: 2px; }
.mm-head-actions { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.mm-head-btn {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0;
  transition: all .2s ease;
}
.mm-head-btn:active { transform: scale(.94); }
.mm-head-btn .icon { width: 17px; height: 17px; }
.mm-user-btn {
  width: auto;
  min-width: 35px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 9px;
  color: var(--muted);
}
.mm-user-btn .icon { width: 14px; height: 14px; }
.mm-user-btn span {
  max-width: 62px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mm-main { padding: 11px 12px 0; position: relative; z-index: 1; }

/* ---------- 门店信息 ---------- */
.mm-store {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 7px 20px rgba(68, 42, 24, .045);
}
.mm-store-photo {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  object-fit: cover;
  flex: 0 0 auto;
  background: #eee3d7;
}
.mm-store-info { flex: 1; min-width: 0; }
.mm-store-info h1 {
  margin: 1px 0 0;
  font-size: 14.5px;
  line-height: 1.3;
  letter-spacing: -.03em;
  font-weight: 850;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mm-store-info h1 span { font-size: 10px; font-weight: 500; color: var(--muted); }
.mm-store-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 7px;
  margin-top: 4px;
  font-size: 8.5px;
  color: var(--muted);
  line-height: 1.3;
}
.mm-store-meta b { color: var(--orange); font-family: var(--font-en); font-size: 11px; }
.mm-store-meta span { display: inline-flex; align-items: center; gap: 3px; }
.mm-store-meta span + span::before {
  content: "";
  width: 1px; height: 8px;
  background: var(--line);
  margin-right: 3px;
}
.mm-store-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.mm-store-tags span {
  background: #f7eee3;
  border-radius: 3px;
  padding: 2px 5px;
  font-size: 7.5px;
  color: var(--ink-2);
  line-height: 1.25;
}
.mm-store-switch {
  border: 0;
  background: transparent;
  color: var(--orange);
  font-size: 9px;
  font-weight: 650;
  padding: 2px 0 0;
  white-space: nowrap;
  flex: 0 0 auto;
}

/* ---------- 优惠 / 会员 ---------- */
.mm-offer {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-top: 8px;
  padding: 9px 10px;
  background: linear-gradient(120deg, #fff4e9, #ffe4ce);
  border: 1px solid #f7d7bc;
  border-radius: 14px;
  min-height: 54px;
}
.mm-offer-badge {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--orange);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-en);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -.04em;
  flex: 0 0 auto;
  box-shadow: 0 5px 12px rgba(242,106,33,.2);
}
.mm-offer-badge small { font-size: 9px; margin-right: 1px; }
.mm-offer-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.mm-offer-copy b { font-size: 10.5px; color: var(--ink); }
.mm-offer-copy span { font-size: 8px; color: #a48b78; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mm-offer-btn {
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  padding: 7px 11px;
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
  flex: 0 0 auto;
}
.mm-offer-btn.is-claimed { background: #eadbcb; color: #9a8574; }
.mm-offer-btn:disabled { cursor: default; }

/* ---------- 点餐标题 ---------- */
.mm-menu-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin: 15px 3px 8px;
}
.mm-menu-title h2 { margin: 0; font-size: 19px; line-height: 1; letter-spacing: -.05em; font-weight: 900; }
.mm-menu-title span { display: block; margin-top: 4px; font-size: 8px; color: var(--muted); }
.mm-menu-title button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 8.5px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 0 2px;
}
.mm-menu-title button .icon { width: 12px; height: 12px; }

/* ---------- 菜单主体 ---------- */
.mm-menu {
  --mm-sidebar-w: 86px;
  display: grid;
  grid-template-columns: var(--mm-sidebar-w) minmax(0, 1fr);
  align-items: start;
  margin: 0 -12px;
  border-top: 1px solid var(--line-soft);
  /* 左侧分类底色铺满整个菜单高度，和右侧商品列表对齐 */
  background: linear-gradient(
    to right,
    #f5ece1 0,
    #f5ece1 calc(var(--mm-sidebar-w) - 1px),
    var(--line-soft) calc(var(--mm-sidebar-w) - 1px),
    var(--line-soft) var(--mm-sidebar-w),
    var(--cream) var(--mm-sidebar-w)
  );
}
.mm-sidebar {
  position: sticky;
  top: calc(52px + env(safe-area-inset-top));
  max-height: calc(100vh - 52px - 82px);
  overflow-y: auto;
  background: transparent;
  padding: 5px 0;
  scrollbar-width: none;
  z-index: 2;
}
.mm-sidebar::-webkit-scrollbar { display: none; }
.mm-side-btn {
  width: 100%;
  border: 0;
  background: transparent;
  position: relative;
  display: flex;
  align-items: center;
  gap: 3px;
  text-align: left;
  padding: 12px 7px 12px 11px;
  font-size: 10.5px;
  line-height: 1.25;
  color: var(--ink-2);
  transition: background .18s ease, color .18s ease;
}
.mm-side-btn span { flex: 1; }
.mm-side-btn i {
  font-style: normal;
  font-family: var(--font-en);
  font-size: 7.5px;
  color: #b5a18f;
}
.mm-side-btn.is-active {
  background: var(--cream);
  color: var(--orange-deep);
  font-weight: 800;
}
.mm-side-btn.is-active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 15px;
  border-radius: 0 3px 3px 0;
  background: var(--orange);
}
.mm-side-btn.is-active i { color: var(--orange); }

.mm-products {
  min-width: 0;
  padding: 0 11px 14px;
  background: var(--cream);
}
.mm-section { scroll-margin-top: 58px; }
.mm-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 1px 3px;
}
.mm-section-head h2 { margin: 0; font-size: 13.5px; line-height: 1.2; letter-spacing: -.03em; font-weight: 850; }
.mm-section-head span { font-size: 7.5px; color: var(--muted); }
.mm-item {
  display: flex;
  gap: 9px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
}
.mm-item:last-child { border-bottom: 0; }
.mm-item-media {
  position: relative;
  width: 74px;
  height: 74px;
  flex: 0 0 auto;
  border: 0;
  padding: 0;
  border-radius: 10px;
  overflow: hidden;
  background: #eee3d7;
}
.mm-item-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.mm-item-media:active img { transform: scale(1.04); }
.mm-item-tag {
  position: absolute;
  left: 4px;
  top: 4px;
  background: var(--orange);
  color: #fff;
  font-size: 7px;
  line-height: 1;
  padding: 3px 4px;
  border-radius: 999px;
  font-weight: 700;
}
.mm-item-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mm-item-name {
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 750;
  line-height: 1.3;
  letter-spacing: -.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mm-item-main > p {
  margin: 2px 0 0;
  font-size: 8.5px;
  line-height: 1.4;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mm-item-meta { margin-top: 2px; font-size: 7.5px; color: #ad9988; }
.mm-item-bottom {
  margin-top: auto;
  padding-top: 5px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 5px;
}
.mm-item-price { display: flex; align-items: baseline; gap: 1px; min-width: 0; }
.mm-item-price small { font-family: var(--font-en); font-size: 9px; font-weight: 800; color: var(--orange); }
.mm-item-price b { font-family: var(--font-en); font-size: 18px; line-height: 1; letter-spacing: -.04em; font-weight: 800; }
.mm-item-price s { font-family: var(--font-en); font-size: 7.5px; color: #b5a18f; text-decoration: line-through; margin-left: 3px; }
.mm-item-ctrl { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; }
.mm-minus {
  width: 22px;
  height: 22px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--ink-2);
  display: grid;
  place-items: center;
  padding: 0;
  font-size: 14px;
  line-height: 1;
}
.mm-qty {
  min-width: 13px;
  text-align: center;
  font-family: var(--font-en);
  font-size: 10.5px;
  font-weight: 700;
}
.mm-plus {
  width: 25px;
  height: 25px;
  border: 0;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  display: grid;
  place-items: center;
  padding: 0;
  box-shadow: 0 4px 9px rgba(36,23,15,.18);
  transition: all .18s ease;
}
.mm-plus .icon { width: 12px; height: 12px; }
.mm-plus:active { transform: scale(.9); background: var(--orange); }
.is-hidden { display: none !important; }

/* ---------- 底部购物车 ---------- */
.mm-cartbar {
  position: fixed;
  z-index: 70;
  left: 50%;
  bottom: calc(66px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(480px, calc(100vw - 24px));
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 7px 7px 9px;
  background: rgba(36, 23, 15, .97);
  border-radius: 999px;
  box-shadow: 0 14px 36px rgba(30, 18, 10, .28);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.mm-cart-summary {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  border: 0;
  background: transparent;
  color: #fff;
  text-align: left;
  padding: 0;
}
.mm-cart-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,.09);
  display: grid;
  place-items: center;
  position: relative;
  flex: 0 0 auto;
  transition: background .2s ease;
}
.mm-cart-icon .icon { width: 20px; height: 20px; }
.mm-cart-icon b {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 16px;
  height: 16px;
  padding: 0 3px;
  border-radius: 999px;
  background: var(--orange);
  border: 2px solid #24170f;
  color: #fff;
  font-family: var(--font-en);
  font-size: 7.5px;
  display: grid;
  place-items: center;
}
.mm-cart-summary.has-items .mm-cart-icon { background: var(--orange); }
.mm-cart-copy { display: flex; flex-direction: column; min-width: 0; line-height: 1.12; }
.mm-cart-copy b { font-family: var(--font-en); font-size: 19px; letter-spacing: -.04em; color: #fff; }
.mm-cart-copy small {
  margin-top: 2px;
  font-size: 8px;
  color: #a8917f;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mm-cart-summary.has-items .mm-cart-copy small { color: #d9c5b5; }
.mm-checkout {
  height: 42px;
  flex: 0 0 auto;
  border: 0;
  border-radius: 999px;
  background: var(--orange);
  color: #fff;
  font-size: 11.5px;
  font-weight: 750;
  padding: 0 19px;
  white-space: nowrap;
  transition: all .2s ease;
}
.mm-checkout:active { transform: scale(.97); }
.mm-checkout:disabled { background: #5c493c; color: #a18a78; }

/* ---------- 页脚 ---------- */
.mm-footer {
  padding: 23px 8px 12px;
  text-align: center;
  color: #a18c7b;
  font-size: 8px;
}
.mm-footer p { margin: 0 0 9px; color: var(--ink-2); font-size: 8.5px; }
.mm-footer-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; margin-bottom: 7px; }
.mm-footer-links a { color: var(--muted); font-size: 8.5px; }
.mm-footer > span { font-size: 7.5px; color: #b5a18f; }

/* ---------- 小屏适配 ---------- */
@media (max-width: 360px) {
  .mm-menu { --mm-sidebar-w: 78px; grid-template-columns: var(--mm-sidebar-w) minmax(0, 1fr); }
  .mm-side-btn { padding: 11px 6px 11px 9px; font-size: 10px; }
  .mm-item-media { width: 68px; height: 68px; }
  .mm-item-name { font-size: 12px; }
  .mm-item-price b { font-size: 17px; }
  .mm-offer-copy b { font-size: 10px; }
  .mm-offer-copy span { font-size: 7.5px; }
  .mm-cartbar { width: calc(100vw - 18px); }
  .mm-checkout { padding: 0 15px; }
}

/* ---------- 底部导航 ---------- */
.mm-tabbar {
  position: fixed;
  z-index: 80;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(480px, 100vw);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  padding: 5px 5px calc(5px + env(safe-area-inset-bottom));
  background: rgba(255, 253, 249, .98);
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 26px rgba(74, 43, 23, .07);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.mm-tabbar button {
  position: relative;
  border: 0;
  background: transparent;
  color: #a18c7b;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 5px 0 4px;
  font-size: 8px;
  line-height: 1.2;
}
.mm-tabbar button .icon { width: 20px; height: 20px; }
.mm-tabbar button.is-active { color: var(--orange); font-weight: 700; }
.mm-tab-cart { position: relative; display: inline-flex; }
.mm-tabbar button.has-items { color: var(--orange); }
.mm-tab-cart b {
  position: absolute;
  top: -5px;
  right: -8px;
  min-width: 17px;
  height: 17px;
  padding: 0 3px;
  border-radius: 999px;
  background: #e84135;
  border: 2px solid var(--cream);
  color: #fff;
  font-family: var(--font-en);
  font-size: 7.5px;
  display: grid;
  place-items: center;
}
.mm-tab-cart b.is-empty { display: none; }

/* 底部导航键盘焦点 */
.mm-tabbar button:focus { outline: none; }
.mm-tabbar button:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; border-radius: 8px; }

/* ---------- 顶部地址定位 ---------- */
.mm-address {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 7px;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
}
.mm-address-pin {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: var(--orange-soft);
  color: var(--orange);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}
.mm-address-pin .icon { width: 16px; height: 16px; }
.mm-address-copy { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; line-height: 1.15; }
.mm-address-copy small { font-size: 7.5px; color: var(--muted); letter-spacing: .04em; }
.mm-address-copy b {
  font-size: 12.5px;
  font-weight: 750;
  letter-spacing: -.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mm-address-chev { width: 11px; height: 11px; color: var(--muted); flex: 0 0 auto; }

/* ---------- 地址选择弹层 ---------- */
.address-picker {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translate(-50%, 102%);
  width: min(480px, 100vw);
  max-height: 86vh;
  background: var(--cream);
  border-radius: 26px 26px 0 0;
  box-shadow: 0 -26px 70px rgba(30,18,10,.25);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform .34s cubic-bezier(.2,.82,.24,1);
}
.layer.is-open .address-picker { transform: translate(-50%, 0); }
.address-picker-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 21px 17px 14px;
  border-bottom: 1px solid var(--line);
  flex: 0 0 auto;
}
.address-picker-head .eyebrow { font-size: 7.5px; }
.address-picker-head h2 { margin: 5px 0 0; font-size: 22px; letter-spacing: -.055em; line-height: 1.1; }
.address-picker-head p { margin: 3px 0 0; font-size: 8.5px; color: var(--muted); }
.address-picker-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 15px;
  display: grid;
  gap: 7px;
  align-content: start;
}
.address-picker-body .checkout-address { padding: 11px; }
.picker-empty { text-align: center; padding: 25px 8px; }
.picker-empty p { margin: 0 0 12px; font-size: 9.5px; color: var(--muted); }
.address-picker-foot {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 16px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--paper);
}
.address-picker-foot .btn { padding: 10px 14px; font-size: 9.5px; }
.address-picker-foot span { font-size: 8px; color: var(--muted); text-align: right; }
