/* =====================================================================
   购物车 —— 液态玻璃
   与底栏「筛选/联系」抽屉、商品页同一套玻璃参数（半透明底 + 背景模糊 + 亮边 + 内高光 + 大圆角 + 弹簧缓动）。
   明暗模式走 CSS 变量：html[data-bs-theme="dark"]（兼容旧布局的 html[data-theme="dark"]），脚本不写任何内联颜色。
   前缀约定：--cx-* 变量，.cx-* 购物车内容，.cp-* 弹层壳，.cx-fab 悬浮按钮，.cx-toast 提示条。
   ===================================================================== */
:root {
  --cx-ease: cubic-bezier(.22, 1, .36, 1);
  --cx-spring: cubic-bezier(.34, 1.56, .64, 1);

  --cx-bg: rgba(255, 255, 255, .66);
  --cx-border: rgba(255, 255, 255, .92);
  --cx-inset: inset 0 1px 0 rgba(255, 255, 255, .95), inset 0 -1px 0 rgba(255, 255, 255, .35);
  --cx-shadow: 0 30px 70px -24px rgba(24, 29, 37, .5), 0 4px 16px rgba(24, 29, 37, .1);
  --cx-card: rgba(255, 255, 255, .62);
  --cx-card-border: rgba(255, 255, 255, .95);
  --cx-hair: rgba(24, 29, 37, .07);
  --cx-line: rgba(24, 29, 37, .09);
  --cx-grab: rgba(24, 29, 37, .2);
  --cx-title: #181d25;
  --cx-text: #3d4754;
  --cx-muted: #6b7684;
  --cx-field-bg: rgba(255, 255, 255, .78);
  --cx-field-border: rgba(36, 86, 184, .18);
  --cx-soft: rgba(47, 110, 213, .09);
  --cx-glow: 1;
  --cx-foot-bg: rgba(255, 255, 255, .88);

  --cx-accent: #2f6ed5;
  --cx-price-a: #2456b8;
  --cx-price-b: #1f8fdc;
  --cx-danger: #d92d43;
  --cx-warn: #b96a12;
  --cx-warn-bg: rgba(217, 130, 43, .14);
  --cx-ok: #1f9d63;
}
html[data-bs-theme="dark"],
html[data-theme="dark"] {
  --cx-bg: rgba(28, 34, 46, .72);
  --cx-border: rgba(255, 255, 255, .15);
  --cx-inset: inset 0 1px 0 rgba(255, 255, 255, .16), inset 0 -1px 0 rgba(255, 255, 255, .03);
  --cx-shadow: 0 30px 70px -20px rgba(0, 0, 0, .8), 0 4px 16px rgba(0, 0, 0, .3);
  --cx-card: rgba(255, 255, 255, .07);
  --cx-card-border: rgba(255, 255, 255, .13);
  --cx-hair: rgba(255, 255, 255, 0);
  --cx-line: rgba(255, 255, 255, .1);
  --cx-grab: rgba(255, 255, 255, .3);
  --cx-title: #f4f7fb;
  --cx-text: #cdd6e4;
  --cx-muted: #93a0b4;
  --cx-field-bg: rgba(255, 255, 255, .07);
  --cx-field-border: rgba(255, 255, 255, .17);
  --cx-soft: rgba(110, 160, 255, .16);
  --cx-glow: .6;
  --cx-foot-bg: rgba(28, 34, 46, .9);

  --cx-accent: #7fb2ff;
  --cx-price-a: #8db9ff;
  --cx-price-b: #5ee0f5;
  --cx-danger: #ff7a8c;
  --cx-warn: #ffb066;
  --cx-warn-bg: rgba(255, 176, 102, .16);
  --cx-ok: #4ad19a;
}

/* ---------------------------------------------------------------------
   弹层壳：手机（<768px）是悬浮在底部的玻璃抽屉，平板/桌面是居中的玻璃卡片
   --------------------------------------------------------------------- */
#cartPanel {
  --bs-modal-width: 32.5rem;
  --bs-modal-bg: transparent;
  --bs-modal-border-width: 0;
  --bs-modal-box-shadow: none;
}
#cartPanel .modal-dialog { margin-inline: auto; }
#cartPanel .modal-content.cp {
  position: relative;
  display: flex;
  flex-direction: column;
  max-height: min(86vh, calc(100dvh - 3rem));
  overflow: hidden;
  color: var(--cx-text);
  border: 1px solid var(--cx-border);
  border-radius: 1.9rem;
  background:
    radial-gradient(60% 42% at 10% 0%, rgba(96, 165, 250, calc(.3 * var(--cx-glow))), transparent 70%),
    radial-gradient(52% 38% at 96% 6%, rgba(245, 82, 102, calc(.17 * var(--cx-glow))), transparent 70%),
    radial-gradient(60% 46% at 72% 100%, rgba(13, 202, 240, calc(.22 * var(--cx-glow))), transparent 70%),
    var(--cx-bg);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  backdrop-filter: blur(30px) saturate(180%);
  box-shadow: var(--cx-shadow), var(--cx-inset);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root { --cx-bg: rgba(255, 255, 255, .95); }
  html[data-bs-theme="dark"], html[data-theme="dark"] { --cx-bg: rgba(28, 34, 46, .97); }
}
/* 弹层打开时遮罩换成偏淡的蓝灰 + 轻微模糊，玻璃才有东西可折射（与筛选/联系抽屉一致） */
body:has(#cartPanel.show) .modal-backdrop {
  background-color: rgba(18, 26, 42, .34);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
body:has(#cartPanel.show) .modal-backdrop.show { opacity: 1; }

@media (max-width: 767.98px) {
  /* 停在底部导航条（.mobile-bottom-nav）上方而不是盖住它：底栏上「购物车」的选中态还看得见，
     用户才知道自己点开的是哪个弹层；--mbn-bar-total 是底栏占的高度，定义在 css/bottom-nav.css。 */
  #cartPanel .modal-dialog {
    position: fixed;
    inset: auto 0 0 0;
    display: block;
    width: auto;
    max-width: none;
    min-height: 0;
    margin: 0 .6rem calc(var(--mbn-bar-total, 78px) + .6rem);
    transform: translateY(calc(100% + 2rem));
    transition: transform .6s var(--cx-spring);
  }
  #cartPanel.show .modal-dialog { transform: none; }
  #cartPanel.modal.fade:not(.show) .modal-dialog { transition-duration: .32s; transition-timing-function: ease-in; }
  #cartPanel .modal-content.cp { max-height: min(88vh, calc(100dvh - 2rem - var(--mbn-bar-total, 78px))); }
  /* 顶部小把手 */
  #cartPanel .modal-content.cp::before {
    content: "";
    flex: none;
    width: 2.6rem;
    height: .32rem;
    margin: .7rem auto 0;
    border-radius: 99px;
    background: var(--cx-grab);
  }
}
@media (min-width: 768px) {
  #cartPanel .modal-content.cp { border-radius: 1.75rem; }
  #cartPanel.modal.fade .modal-dialog { transition: transform .5s var(--cx-spring), opacity .3s ease; transform: translateY(1.5rem) scale(.96); }
  #cartPanel.modal.show .modal-dialog { transform: none; }
}

.cp__close {
  position: absolute;
  z-index: 3;
  top: .9rem;
  right: .9rem;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  color: var(--cx-title);
  background: var(--cx-card);
  border: 1px solid var(--cx-card-border);
  border-radius: 50%;
  box-shadow: 0 10px 20px -12px rgba(24, 29, 37, .5), var(--cx-inset);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .4s var(--cx-spring), background-color .2s ease;
}
.cp__close:active { transform: scale(.9); }
.cp__close:focus-visible { outline: 3px solid rgba(59, 130, 246, .55); outline-offset: 2px; }
.cp__close svg { display: block; }

/* ---------------------------------------------------------------------
   购物车内容（弹层和 /cart 整页共用）
   --------------------------------------------------------------------- */
.cx { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; color: var(--cx-text); }
.cx__form { display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; }
/* 重新报价期间，合计先淡一下，表示正在更新 */
.cx.is-busy .cx-sum { opacity: .55; transition: opacity .2s ease; }
.cx--page {
  max-width: 46rem;
  margin: 0 auto;
  border: 1px solid var(--cx-border);
  border-radius: 1.75rem;
  background:
    radial-gradient(60% 42% at 10% 0%, rgba(96, 165, 250, calc(.26 * var(--cx-glow))), transparent 70%),
    radial-gradient(52% 38% at 96% 6%, rgba(245, 82, 102, calc(.14 * var(--cx-glow))), transparent 70%),
    var(--cx-bg);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  box-shadow: var(--cx-shadow), var(--cx-inset);
}

.cx__head {
  flex: none;
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: 1.15rem 4.3rem .7rem 1.4rem;
  min-height: 3.4rem;
}
.cx--page .cx__head { padding-right: 1.4rem; }
/* 弹层里关闭按钮是绝对定位悬浮的（见 .cp__close），标题区默认的 3.4rem 不够把它完全让开：
   手机端靠顶部的拖动把手把内容整体下推了才躲开，平板/桌面没有把手，首条商品的删除按钮会贴到关闭按钮底边，
   这里单独给弹层内的标题区加高，不影响 /cart 整页（那边没有悬浮关闭按钮）。 */
#cartPanel .cx__head { min-height: 4.3rem; }
.cx__title { margin: 0; font-size: 1.25rem; font-weight: 700; letter-spacing: -.01em; color: var(--cx-title); }
.cx__chip {
  padding: .12rem .6rem;
  font-size: .8rem;
  font-weight: 700;
  color: var(--cx-accent);
  background: var(--cx-soft);
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
.cx__back {
  display: grid;
  place-items: center;
  flex: none;
  width: 2.75rem;
  height: 2.75rem;
  margin: -.4rem 0 -.4rem -.7rem;
  padding: 0;
  color: var(--cx-title);
  background: transparent;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .2s ease, transform .4s var(--cx-spring);
}
.cx__back:active { transform: scale(.9); }
@media (hover: hover) { .cx__back:hover { background: var(--cx-soft); } }
.cx__back:focus-visible { outline: 3px solid rgba(59, 130, 246, .5); outline-offset: 1px; }

.cx__scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: .2rem 1rem 1rem; }
.cx__scroll::-webkit-scrollbar { width: 6px; }
.cx__scroll::-webkit-scrollbar-thumb { background: var(--cx-line); border-radius: 99px; }

/* 提示条 */
.cx__notice {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  margin: 0 .2rem .8rem;
  padding: .7rem .9rem;
  font-size: .86rem;
  line-height: 1.45;
  color: var(--cx-warn);
  background: var(--cx-warn-bg);
  border-radius: 1.1rem;
}
.cx__notice i { flex: none; margin-top: .1rem; }
.cx__notice button {
  margin-left: auto;
  flex: none;
  padding: .1rem .2rem;
  font: inherit;
  font-weight: 700;
  color: inherit;
  text-decoration: underline;
  background: none;
  border: 0;
  cursor: pointer;
}

/* 提示条：商品列表下面的常驻小贴士（留意邮箱/订单更新），语气比 .cx__notice 的警示色弱一档 */
.cx__tip {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  margin: .6rem .2rem .2rem;
  padding: .65rem .85rem;
  font-size: .8rem;
  line-height: 1.45;
  color: var(--cx-muted);
  background: var(--cx-soft);
  border-radius: 1.1rem;
}
.cx__tip i { flex: none; margin-top: .1rem; color: var(--cx-accent); }

/* 商品行 */
.cx__lines { display: grid; gap: .65rem; margin: 0; padding: 0; list-style: none; }
.cx-line {
  display: grid;
  grid-template-columns: 4.25rem minmax(0, 1fr) auto;
  gap: .3rem .85rem;
  align-items: start;
  padding: .8rem;
  background: var(--cx-card);
  border: 1px solid var(--cx-card-border);
  border-radius: 1.4rem;
  box-shadow: 0 0 0 1px var(--cx-hair), 0 14px 26px -22px rgba(24, 29, 37, .5), var(--cx-inset);
  transition: opacity .3s ease;
}
.cx-line.is-enter { animation: cx-in .55s var(--cx-spring) backwards; animation-delay: calc(var(--i, 0) * 45ms); }
.cx-line.is-bad { opacity: .78; }
.cx-line__img {
  grid-row: 1 / span 2;
  width: 4.25rem;
  height: 4.25rem;
  object-fit: cover;
  background: var(--cx-soft);
  border-radius: 1.05rem;
}
.cx-line.is-bad .cx-line__img { filter: grayscale(1); }
.cx-line__main { min-width: 0; }
.cx-line__name {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: .95rem;
  font-weight: 650;
  line-height: 1.35;
  color: var(--cx-title);
  text-decoration: none;
  overflow-wrap: anywhere;
}
a.cx-line__name:hover { color: var(--cx-accent); }
.cx-line__spec { margin-top: .15rem; font-size: .8rem; color: var(--cx-muted); }
.cx-line__meta { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .5rem; margin-top: .3rem; font-size: .82rem; color: var(--cx-muted); }
.cx-line__price { font-weight: 700; color: var(--cx-title); font-variant-numeric: tabular-nums; }
.cx-line__price del { margin-right: .3rem; font-weight: 500; color: var(--cx-muted); }
.cx-tag {
  padding: .05rem .5rem;
  font-size: .72rem;
  font-weight: 700;
  color: var(--cx-accent);
  background: var(--cx-soft);
  border-radius: 999px;
  white-space: nowrap;
}
.cx-tag--deal { color: #fff; background: linear-gradient(120deg, #f55266, #ff8a5c); }
.cx-tag--warn { color: var(--cx-warn); background: var(--cx-warn-bg); }
.cx-line__hint { margin: .35rem 0 0; font-size: .8rem; font-weight: 600; color: var(--cx-accent); }
.cx-line__hint--warn { color: var(--cx-warn); }
.cx-line__sub { font-size: 1rem; font-weight: 800; color: var(--cx-title); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cx-line__del {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  margin: -.5rem -.4rem -.2rem 0;
  padding: 0;
  color: var(--cx-muted);
  background: transparent;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color .2s ease, background-color .2s ease, transform .4s var(--cx-spring);
}
@media (hover: hover) { .cx-line__del:hover { color: var(--cx-danger); background: var(--cx-warn-bg); } }
.cx-line__del:active { transform: scale(.88); }
.cx-line__del:focus-visible { outline: 3px solid rgba(59, 130, 246, .5); outline-offset: 1px; }
.cx-line__foot { grid-column: 2 / -1; display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-top: .2rem; }

/* 数量步进器（触屏点击区域 ≥ 44px） */
.cx-qty {
  display: inline-flex;
  align-items: center;
  background: var(--cx-field-bg);
  border: 1px solid var(--cx-field-border);
  border-radius: 999px;
}
.cx-qty:focus-within { border-color: var(--cx-accent); box-shadow: 0 0 0 4px rgba(59, 130, 246, .16); }
.cx-qty button {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  color: var(--cx-title);
  background: transparent;
  border: 0;
  border-radius: 50%;
  font-size: 1.05rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color .2s ease, transform .4s var(--cx-spring), opacity .2s ease;
}
@media (hover: hover) { .cx-qty button:hover:not(:disabled) { background: var(--cx-soft); } }
.cx-qty button:active:not(:disabled) { transform: scale(.86); transition-duration: .1s; }
.cx-qty button:disabled { opacity: .3; cursor: not-allowed; }
.cx-qty button:focus-visible { outline: 3px solid rgba(59, 130, 246, .5); outline-offset: 1px; }
.cx-qty input {
  width: 2.9rem;
  min-height: 2.75rem;
  padding: 0;
  color: var(--cx-title);
  text-align: center;
  font-size: 1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  background: transparent;
  border: 0;
  -moz-appearance: textfield;
  appearance: textfield;
}
.cx-qty input:focus { outline: 0; }
.cx-qty input::-webkit-inner-spin-button, .cx-qty input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

/* 空购物车 */
.cx-empty { display: grid; justify-items: center; gap: .6rem; padding: 2.4rem 1rem 2rem; text-align: center; }
.cx-empty__orb {
  display: grid;
  place-items: center;
  width: 4.6rem;
  height: 4.6rem;
  color: #fff;
  font-size: 1.9rem;
  border-radius: 58% 42% 55% 45% / 48% 56% 44% 52%;
  background:
    radial-gradient(circle at 28% 22%, rgba(255, 255, 255, .78), rgba(255, 255, 255, 0) 42%),
    linear-gradient(140deg, #2f6ed5, #1f8fdc);
  box-shadow: 0 14px 26px -12px rgba(47, 110, 213, .85), inset 0 -7px 12px rgba(0, 0, 0, .14), inset 0 2px 5px rgba(255, 255, 255, .65);
}
.cx-empty h3 { margin: .3rem 0 0; font-size: 1.1rem; font-weight: 700; color: var(--cx-title); }
.cx-empty p { margin: 0 0 .6rem; font-size: .9rem; color: var(--cx-muted); }

/* 底部：合计 + 操作 */
.cx__foot {
  flex: none;
  padding: .85rem 1.2rem calc(1rem + env(safe-area-inset-bottom, 0px) * 0);
  border-top: 1px solid var(--cx-line);
  background: var(--cx-card);
}
.cx-sum { display: grid; gap: .25rem; margin-bottom: .8rem; }
.cx-sum__row { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; font-size: .88rem; color: var(--cx-muted); font-variant-numeric: tabular-nums; }
.cx-sum__row b { font-weight: 700; color: var(--cx-title); }
.cx-sum__row--save b { color: var(--cx-ok); }
.cx-sum__total { align-items: center; margin-top: .1rem; font-size: .95rem; font-weight: 700; color: var(--cx-title); }
.cx-sum__total b {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.1;
  background: linear-gradient(120deg, var(--cx-price-a), var(--cx-price-b));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.cx-sum__total b.is-bump { animation: cx-bump .5s var(--cx-spring); }
.cx__actions { display: flex; align-items: stretch; gap: .6rem; }
.cx__err { margin: 0 0 .7rem; padding: .6rem .85rem; font-size: .86rem; font-weight: 600; color: var(--cx-danger); background: rgba(217, 45, 67, .1); border-radius: 1rem; }
.cx__err:empty { display: none; }
.cx__help { margin: 0 0 .6rem; font-size: .82rem; color: var(--cx-warn); }

/* 按钮：与商品页主按钮同一套蓝色渐变胶囊 */
.cx-btn {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 3.1rem;
  padding: .65rem 1.3rem;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  color: #fff;
  text-decoration: none;
  white-space: nowrap;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .6s var(--cx-spring), box-shadow .4s ease, opacity .3s ease;
}
.cx-btn--primary {
  flex: 1 1 auto;
  background: linear-gradient(120deg, #2456b8 0%, #2f6ed5 45%, #1f8fdc 100%);
  box-shadow: 0 16px 30px -12px rgba(47, 110, 213, .8), inset 0 1px 0 rgba(255, 255, 255, .45);
}
.cx-btn--primary::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(105deg, transparent 32%, rgba(255, 255, 255, .5) 48%, transparent 64%);
  transform: translateX(-130%);
}
@media (hover: hover) {
  .cx-btn--primary:hover:not(:disabled) { color: #fff; transform: translateY(-2px) scale(1.02); }
  .cx-btn--primary:hover:not(:disabled)::after { transform: translateX(130%); transition: transform .9s var(--cx-ease); }
}
.cx-btn:active:not(:disabled) { transform: translateY(1px) scale(.97, .94); transition-duration: .15s; }
.cx-btn:focus-visible { outline: 3px solid rgba(59, 130, 246, .5); outline-offset: 3px; }
.cx-btn:disabled { opacity: .5; cursor: not-allowed; }
.cx-btn--ghost {
  color: var(--cx-title);
  background: var(--cx-card);
  border: 1px solid var(--cx-card-border);
  box-shadow: 0 0 0 1px var(--cx-hair), var(--cx-inset);
}
.cx-btn--danger { color: #fff; background: linear-gradient(120deg, #d92d43, #f55266); box-shadow: 0 14px 26px -12px rgba(217, 45, 67, .8), inset 0 1px 0 rgba(255, 255, 255, .4); }
.cx-btn--icon { flex: none; width: 3.1rem; min-width: 3.1rem; padding: 0; }
.cx-spin {
  width: 1.05rem;
  height: 1.05rem;
  border: 2px solid rgba(255, 255, 255, .45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: cx-rot .7s linear infinite;
}

/* 结算表单 */
.cx-form { display: grid; gap: 1rem; padding: .2rem .2rem 0; }
.cx-field { display: grid; gap: .35rem; }
.cx-label { display: flex; align-items: baseline; flex-wrap: wrap; gap: .3rem; font-size: .88rem; font-weight: 600; color: var(--cx-title); }
.cx-req { color: var(--cx-danger); }
.cx-opt { font-size: .78rem; font-weight: 500; color: var(--cx-muted); }
.cx-input {
  width: 100%;
  min-height: 3rem;
  padding: .65rem 1rem;
  font: inherit;
  font-size: 1rem;
  color: var(--cx-title);
  background: var(--cx-field-bg);
  border: 1px solid var(--cx-field-border);
  border-radius: 1rem;
  transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
}
textarea.cx-input { min-height: 4.5rem; resize: vertical; }
.cx-input::placeholder { color: var(--cx-muted); opacity: .8; }
.cx-input:focus { outline: 0; border-color: var(--cx-accent); box-shadow: 0 0 0 4px rgba(59, 130, 246, .16); }
.cx-input.is-invalid { border-color: var(--cx-danger); box-shadow: 0 0 0 4px rgba(217, 45, 67, .14); }
.cx-hint { margin: 0; font-size: .78rem; color: var(--cx-muted); }
.cx-captcha { display: flex; align-items: center; gap: .6rem; }
.cx-captcha .cx-input { flex: 1 1 auto; min-width: 0; }
.cx-captcha img { flex: none; height: 3rem; border: 1px solid var(--cx-field-border); border-radius: .8rem; background: #fff; cursor: pointer; }

.cx-pays { display: grid; grid-template-columns: repeat(auto-fit, minmax(8.6rem, 1fr)); gap: .55rem; }
.cx-pay { position: relative; margin: 0; }
.cx-pay input { position: absolute; opacity: 0; pointer-events: none; }
.cx-pay__face {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 3rem;
  padding: .5rem .8rem;
  font-size: .9rem;
  font-weight: 650;
  text-align: center;
  color: var(--cx-title);
  background: var(--cx-field-bg);
  border: 1.5px solid var(--cx-field-border);
  border-radius: 1rem;
  cursor: pointer;
  transition: transform .4s var(--cx-spring), border-color .2s ease, background-color .2s ease, box-shadow .2s ease;
}
.cx-pay:active .cx-pay__face { transform: scale(.97); transition-duration: .12s; }
.cx-pay input:checked + .cx-pay__face { color: var(--cx-accent); border-color: var(--cx-accent); background: var(--cx-soft); box-shadow: 0 8px 18px -12px rgba(47, 110, 213, .7); }
.cx-pay input:focus-visible + .cx-pay__face { outline: 3px solid rgba(59, 130, 246, .55); outline-offset: 2px; }
.cx-pay .paymentsvg { flex: none; display: grid; place-items: center; width: 1.6rem; height: 1.6rem; }
.cx-pay .paymentsvg svg { display: block; width: 1.5rem !important; height: 1.5rem !important; }
.cx-pay__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.cx-recap { display: grid; gap: .3rem; padding: .8rem 1rem; font-size: .86rem; background: var(--cx-card); border: 1px solid var(--cx-card-border); border-radius: 1.2rem; box-shadow: 0 0 0 1px var(--cx-hair), var(--cx-inset); }
.cx-recap div { display: flex; justify-content: space-between; gap: .8rem; }
.cx-recap span:first-child { min-width: 0; overflow-wrap: anywhere; }
.cx-recap b { flex: none; color: var(--cx-title); font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------------
   悬浮按钮（平板/桌面）+ 徽章 + 提示条
   --------------------------------------------------------------------- */
.cx-fab {
  position: fixed;
  z-index: 1000;
  right: 24px;
  bottom: 24px;
  display: none;
  place-items: center;
  width: 3.5rem;
  height: 3.5rem;
  padding: 0;
  color: var(--cx-title);
  background: var(--cx-bg);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--cx-border);
  border-radius: 50%;
  box-shadow: 0 16px 32px -14px rgba(24, 29, 37, .5), var(--cx-inset);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .5s var(--cx-spring), box-shadow .3s ease;
}
.cx-fab i { font-size: 1.5rem; line-height: 1; }
/* 悬浮按钮只在桌面用；<992px（手机、平板）底部有导航条，购物车入口就是导航条里的「购物车」 */
@media (min-width: 992px) { .cx-fab { display: grid; } }
@media (hover: hover) { .cx-fab:hover { transform: translateY(-3px) scale(1.05); } }
.cx-fab:active { transform: scale(.93); }
.cx-fab:focus-visible { outline: 3px solid rgba(59, 130, 246, .55); outline-offset: 3px; }
html[data-cart-empty="true"] .cx-fab,
body.cart-page .cx-fab,
body:has([data-cart-page]) .cx-fab { display: none !important; }

/* 整页：和商品页一样铺一层柔光，玻璃才有东西可折射；合计/结算栏吸在底部（手机上要避开悬浮导航条） */
body.cart-page,
body:has([data-cart-page]) {
  background-image:
    radial-gradient(28rem 28rem at 6% 32%, rgba(96, 165, 250, calc(.2 * var(--cx-glow))), transparent 70%),
    radial-gradient(26rem 26rem at 94% 60%, rgba(13, 202, 240, calc(.18 * var(--cx-glow))), transparent 70%),
    radial-gradient(24rem 24rem at 28% 72%, rgba(245, 82, 102, calc(.13 * var(--cx-glow))), transparent 70%);
  background-size: 100% 1500px;
  background-repeat: repeat-y;
}
.cx--page .cx__foot {
  position: sticky;
  bottom: 0;
  background: var(--cx-foot-bg);
  border-radius: 0 0 calc(1.75rem - 1px) calc(1.75rem - 1px);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
}
@media (max-width: 991.98px) {
  .cx--page .cx__foot { bottom: calc(64px + env(safe-area-inset-bottom, 0px) + 14px + 8px); border-radius: 1.4rem; margin: 0 .6rem; }
}

.cx-badge {
  position: absolute;
  top: -.25rem;
  right: -.25rem;
  display: grid;
  place-items: center;
  min-width: 1.35rem;
  height: 1.35rem;
  padding: 0 .35rem;
  font-size: .72rem;
  font-weight: 800;
  line-height: 1;
  color: #fff;
  background: linear-gradient(140deg, #f55266, #ff8a5c);
  border: 2px solid var(--cx-badge-ring, #fff);
  border-radius: 999px;
  box-shadow: 0 4px 10px -2px rgba(245, 82, 102, .6);
  font-variant-numeric: tabular-nums;
}
html[data-bs-theme="dark"] .cx-badge, html[data-theme="dark"] .cx-badge { --cx-badge-ring: #1c222e; }
.cx-badge[hidden] { display: none; }
.cx-badge.is-bump { animation: cx-bump .5s var(--cx-spring); }

/* 底栏里的购物车入口（徽章位置见 bottom-nav.css 的 .mbn-ico .cx-badge） */

.cx-toast {
  position: fixed;
  z-index: 1090;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 24px);
  display: flex;
  align-items: center;
  gap: .8rem;
  /* left:50% 会让可用宽度只剩半屏，文字被挤成窄高条；按内容宽度算，再限制最大宽度 */
  width: max-content;
  max-width: min(92vw, 26rem);
  padding: .7rem 1.1rem;
  font-size: .9rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--cx-title);
  background: var(--cx-bg);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--cx-border);
  border-radius: 1.5rem;
  box-shadow: var(--cx-shadow), var(--cx-inset);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 1rem) scale(.96);
  transition: opacity .25s ease, transform .5s var(--cx-spring);
}
.cx-toast.is-on { opacity: 1; pointer-events: auto; transform: translate(-50%, 0); }
.cx-toast > span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.cx-toast.is-warn { color: var(--cx-warn); }
.cx-toast button {
  flex: none;
  min-height: 2.75rem;
  margin: -.5rem -.5rem -.5rem 0;
  padding: 0 .9rem;
  font: inherit;
  font-weight: 800;
  color: var(--cx-accent);
  background: none;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}
@media (max-width: 991.98px) {
  .cx-toast { bottom: calc(64px + env(safe-area-inset-bottom, 0px) + 14px + 14px); }
}
body:has(#cartPanel.show) .cx-toast { bottom: calc(env(safe-area-inset-bottom, 0px) + 24px); }

.cx-fly { position: fixed; z-index: 1095; left: 0; top: 0; width: 3.5rem; height: 3.5rem; object-fit: cover; border-radius: 50%; pointer-events: none; box-shadow: 0 10px 24px rgba(0, 0, 0, .3); }

@keyframes cx-in { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes cx-bump { 0% { transform: scale(.9); opacity: .6; } 100% { transform: none; opacity: 1; } }
@keyframes cx-rot { to { transform: rotate(360deg); } }

/* 用户选择减少动态效果时，去掉位移/弹跳/流动，只保留必要的显隐 */
@media (prefers-reduced-motion: reduce) {
  #cartPanel .modal-dialog,
  .cx-line.is-enter,
  .cx-btn,
  .cx-fab,
  .cx-toast,
  .cx-qty button,
  .cx-pay__face { animation: none !important; transition-duration: .01s !important; }
  .cx-btn--primary::after { display: none; }
  .cx-sum__total b.is-bump, .cx-badge.is-bump { animation: none; }
  #cartPanel.modal.fade .modal-dialog { transform: none; }
}
