/* 购物车页 + 购物车抽屉（Figma「CartPage」，手机端 393 宽一比一；电脑端沿用同一套尺寸，内容区最宽 1120）。
   商品行、结算卡片两边共用同一套组件，所以样式也共用。
   选择器都加 body 前缀：原主题的购物车样式分散在多个文件里，且在 section 内加载，晚于布局里的这份。 */

body .cart-drawer,
body #main-cart-items,
body #main-cart-footer,
body .bz-cart-head {
  --bzc-ink: #1d1d1f;
  --bzc-muted: #615b60;
  --bzc-line: #e8e3e5;
  font-family: 'Manrope', var(--body-font-family, sans-serif);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
/* 原主题的 .body2/.body3/.title6 等直接在元素上写了 font-family，容器上设的字体继承不下来 */
body .cart-drawer *,
body #main-cart-items *,
body #main-cart-footer *,
body .bz-cart-head * { font-family: inherit; }

/* ---------- 标题栏：购物车页自己的 + 抽屉头部 ---------- */
body .bz-cart-head,
body .cart-drawer .cart-drawer__header {
  height: 72px;
  padding: 0 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border-bottom: 1px solid var(--bzc-line);
}
body .bz-cart-head { position: sticky; top: 0; z-index: 5; backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); }
body .bz-cart-head__title,
body .cart-drawer .cart-drawer__heading {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  line-height: 30px;
  letter-spacing: -0.4px;
  text-transform: uppercase;
  color: var(--bzc-ink);
}
body .bz-cart-head__close,
body .cart-drawer .cart-drawer__close {
  width: 38px;
  height: 38px;
  border-radius: 19px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--bzc-ink);
}
body .bz-cart-head__close img { width: 22px; height: 22px; display: block; }
body .cart-drawer .cart-drawer__close svg { width: 15px; height: 15px; }

/* ---------- 商品行 ---------- */
body .cart-drawer__items .cart-item,
body .main-cart-items-wrapper .cart-item {
  position: relative;
  padding: 22px 14px 18px;
  border-bottom: 1px solid var(--bzc-line);
  background: #fff;
}
body .cart-item .cart-item__media {
  width: 112px;
  height: 112px;
  aspect-ratio: 1 / 1;
  margin-right: 12px;
  align-self: flex-start;
  border-radius: 0;
  overflow: hidden;
}
body .cart-item .cart-item__media .cart-item__image-container { height: 100%; }
body .cart-item .cart-item__details__wrapper {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 112px;
  min-width: 0;
  flex: 1 1 auto;
}
body .cart-item .cart-item__details { flex: 0 0 auto; }

body .cart-item .cart-item__name {
  margin: 0;
  padding-right: 18px;
  font-size: 15px;
  font-weight: 700 !important; /* 压过 .fw-bold 的 !important */
  line-height: 20px;
  letter-spacing: -0.36px;
  color: var(--bzc-ink);
}
body .cart-item .cart-item__details .product-option,
body .cart-item .cart-item__details .product-property {
  margin: 5px 0 0;
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
  color: var(--bzc-muted);
}
body .cart-item .cart-item__details .product-option span:first-child { font-weight: 600; color: var(--bzc-ink); }
body .cart-item .cart-item__details .product-option + .product-option { margin-top: 2px; }

/* 单品折扣：红色小字 + 标签图标，金额半透明 */
body .cart-item .cart-item__discounts { margin: 8px 0 0; padding: 0; list-style: none; }
body .cart-item .cart-item__discounts li {
  display: flex;
  align-items: flex-start;
  gap: 4px;
  font-size: 11px;
  line-height: 14px;
  color: #d54749;
}
body .cart-item .cart-item__discounts li span { margin: 0; }
body .cart-item .cart-item__discount-icon { width: 15px; height: 16px; flex: 0 0 15px; margin-top: -1px; }
body .cart-item .cart-item__discount-amount { opacity: 0.75; }

/* 数量：两个 30px 描边圆按钮，中间 34px 宽的数字；价格在同一行右侧，底部对齐 */
body .cart-item .cart-item__quantity { width: auto; min-width: 0; margin: auto 0 0; padding-top: 8px; }
body .cart-item .cart-item__quantity > div,
body .cart-item .cart-item__quantity .cart-item__quantity-wrapper { position: static; }
body .cart-item .cart-item__quantity .quantity {
  width: auto;
  height: 30px;
  min-height: 0;
  margin: 0;
  padding: 0;
  display: inline-flex;
  align-items: center;
  border: 0;
  background: none;
}
body .cart-item .cart-item__quantity .quantity::before,
body .cart-item .cart-item__quantity .quantity::after { display: none; }
body .cart-item .cart-item__quantity .quantity .quantity__button {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border: 1px solid #8f898d;
  border-radius: 15px;
  background: #fff;
  color: var(--bzc-ink);
}
body .cart-item .cart-item__quantity .quantity .quantity__button.disabled { opacity: 0.4; }
body .cart-item .cart-item__quantity .quantity__button svg { width: 10px; height: 10px; }
body .cart-item .cart-item__quantity .quantity .quantity__input {
  width: 34px;
  padding: 0;
  font-size: 13px;
  font-weight: 650;
  line-height: 19px;
  text-align: center;
  color: var(--bzc-ink);
  font-variant-numeric: tabular-nums;
}
body .cart-item .cart-item__totals {
  position: absolute;
  right: 0;
  bottom: 0;
  margin: 0;
  width: auto;
}
body .cart-item .cart-item__price-wrapper {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
body .cart-item .original__price {
  font-size: 10px;
  font-weight: 400 !important;
  line-height: 15px;
  color: #999297;
  text-decoration: line-through;
}
body .cart-item .final__price {
  font-size: 15px;
  font-weight: 700 !important;
  line-height: 22.5px;
  color: var(--bzc-ink);
}

/* 删除：右上角的 ×（设计稿 32px 点击区，图标 19px） */
body .cart-item .cart-item__quantity cart-remove-button {
  position: absolute;
  top: -15px;
  right: -4px;
  width: 32px;
  height: 32px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 0;
}
body .cart-item .cart-item__remove-icon { width: 19px; height: 19px; display: block; }

/* 物流提示：保留原来的样式（时钟图标 + 文案，颜色取后台设置），前面加设计稿的绿色圆点 */
body .cart-item .cart-item-tips {
  justify-content: flex-start;
  gap: 8px;
  margin-top: 14px;
  padding: 9px 14px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  line-height: 16px;
  letter-spacing: 0.005em;
}
body .cart-item .cart-item-tips-dot {
  order: -2;
  flex: 0 0 6px;
  width: 6px;
  height: 6px;
  margin: 0 2px 0 4px;
  border-radius: 50%;
  background: #4bad82;
  box-shadow: 0 0 0 4px rgba(75, 173, 130, 0.12);
}
body .cart-item .cart-item-tips:not(:has(img))::before {
  content: '';
  order: -1;
  flex: 0 0 14px;
  height: 14px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E") center / contain no-repeat;
}
body .cart-item .cart-item-tips img { width: 14px; height: 14px; }

/* ---------- 结算卡片（抽屉底部 + 购物车页共用） ---------- */
body .cart-fixed-checkout .cart-fixed-checkout__container { box-shadow: none; background: transparent; }
body .cart-fixed-checkout .cart-fixed-checkout__footer {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 14px 14px 18px;
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 22px 22px 0 0;
  background:
    radial-gradient(ellipse 50px 35px at 0 0, rgba(193, 205, 239, 0.44), rgba(193, 205, 239, 0) 100%),
    linear-gradient(151.5deg, rgba(252, 251, 255, 0.96) 0%, rgba(239, 234, 247, 0.92) 100%),
    #fff; /* 白底垫底：手机上卡片吸底，滚到深色页脚时不透出底下的字 */
  box-shadow: 0 20px 45px rgba(74, 56, 91, 0.1), inset 0 1px 0 #fff;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
}
/* 设计稿里没有的几行：税费说明、「You save」条、折扣明细、「over $xx」 */
body .cart-fixed-checkout .cart-drawer__taxes__desc,
body .cart-fixed-checkout .cart-bottom-price .cart-save,
body .cart-fixed-checkout .cart-discount-item,
body .cart-fixed-checkout .cart-discount-over { display: none !important; }

body .cart-fixed-checkout .cart-bottom-price {
  gap: 0;
  font-size: 12px;
  font-weight: 400;
  color: var(--bzc-ink);
  font-variant-numeric: tabular-nums;
}
body .cart-fixed-checkout .cart-discount {
  padding: 20px 2px 8px;
  font-size: 12px;
  line-height: 18px;
}
body .cart-fixed-checkout .cart-discount > p:first-child { font-weight: 400; }
body .cart-fixed-checkout .cart-discount-amount { font-weight: 700; color: #dc3f43; }
body .cart-fixed-checkout .cart-subtotal {
  align-items: center;
  margin: 0;
  padding: 8px 2px;
  border-top: 1px solid rgba(45, 39, 48, 0.1);
}
body .cart-fixed-checkout .cart-subtotal > p:first-child { font-size: 13px; font-weight: 400; line-height: 19px; }
body .cart-fixed-checkout .cart-subtotal > p:last-child {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
body .cart-fixed-checkout .cart-subtotal > p:last-child > span:first-child {
  font-size: 15px;
  font-weight: 700;
  line-height: 22.5px;
}
body .cart-fixed-checkout .cart-subtotal .price { font-size: 10px; line-height: 15px; color: #a39da1; }
/* 没有折扣时：不显示折扣行，也不显示和现价一样的划线价 */
body .cart-fixed-checkout.collapsed .cart-discount,
body .cart-fixed-checkout.collapsed .cart-subtotal .price { display: none; }
body .cart-fixed-checkout.collapsed .cart-subtotal { border-top: 0; padding-top: 14px; }

body .cart-fixed-checkout .cart-fixed-checkout__buttons { margin: 0; padding-top: 9px; }
body .cart-fixed-checkout .bz-cart-secure-note {
  margin: 0;
  padding-top: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 8px;
  line-height: 12px;
  color: #766f74;
}
body .cart-fixed-checkout .bz-cart-secure-note img { width: 14px; height: 14px; }

/* ---------- 结账按钮 + 点击动效 ---------- */
body .bz-checkout-btn#checkout {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 0;
  height: 44px;
  min-height: 44px;
  margin: 0 auto;
  padding: 0 14px;
  gap: 0;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: var(--bzc-btn-bg, #111);
  color: var(--bzc-btn-ink, #fff);
  box-shadow: 0 12px 12px rgba(0, 0, 0, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  overflow: hidden;
  cursor: pointer;
  transition: width 300ms ease-in-out, padding 300ms ease-in-out, background-color 250ms ease;
}
body .bz-checkout-btn#checkout::before,
body .bz-checkout-btn#checkout::after { display: none; }
body .bz-checkout-btn__lock {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.07);
}
body .bz-checkout-btn__lock img { width: 19px; height: 19px; object-fit: contain; }
body .bz-checkout-btn__text {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 18px;
  letter-spacing: 0.12px;
  text-align: center;
  white-space: nowrap;
}
body .bz-checkout-btn__arrow { flex: 0 0 18px; width: 18px; height: 18px; }
body .bz-checkout-btn__lock,
body .bz-checkout-btn__text,
body .bz-checkout-btn__arrow { transition: opacity 150ms ease; }

body .bz-checkout-btn__spinner,
body .bz-checkout-btn__check {
  position: absolute;
  top: 50%;
  left: 50%;
  pointer-events: none;
  opacity: 0;
}
body .bz-checkout-btn__spinner {
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid rgba(255, 255, 255, 0.25);
  border-top-color: #fff;
  border-radius: 50%;
  box-sizing: border-box;
  animation: bz-checkout-spin 0.7s linear infinite;
  transition: opacity 150ms ease;
}
body .bz-checkout-btn__check { width: 22px; height: 22px; margin: -11px 0 0 -11px; }
body .bz-checkout-btn__check path { stroke-dasharray: 20; stroke-dashoffset: 20; }

body .bz-checkout-btn.is-busy .bz-checkout-btn__lock,
body .bz-checkout-btn.is-busy .bz-checkout-btn__text,
body .bz-checkout-btn.is-busy .bz-checkout-btn__arrow { opacity: 0; }
body .bz-checkout-btn#checkout.is-shrunk { padding: 0; }
body .bz-checkout-btn.is-shrunk:not(.is-done):not(.is-restoring) .bz-checkout-btn__spinner { opacity: 1; transition-delay: 200ms; }
body .bz-checkout-btn#checkout.is-done { background: #22a06b; }
body .bz-checkout-btn.is-done .bz-checkout-btn__check { opacity: 1; }
body .bz-checkout-btn.is-done .bz-checkout-btn__check path { stroke-dashoffset: 0; transition: stroke-dashoffset 350ms ease-out 80ms; }
body .bz-checkout-btn#checkout.is-restoring { padding: 0 14px; }
/* 绿色按钮拉回原长度：对勾留在正中，文字和图标仍隐藏 */
body .bz-checkout-btn#checkout.is-wide { padding: 0; }
/* 按下回弹，与加购按钮同一条曲线 */
body .bz-checkout-btn#checkout.is-press { animation: bz-checkout-press 380ms cubic-bezier(.3, 1.6, .5, 1); }
@keyframes bz-checkout-press {
  0% { transform: scale(1); }
  35% { transform: scale(0.94); }
  100% { transform: scale(1); }
}

@keyframes bz-checkout-spin { to { transform: rotate(360deg); } }

/* ---------- 购物车页布局 ---------- */
body #main-cart-items .main-cart-items-header { display: none; }
body cart-items.page-width,
body #main-cart-footer.page-width { max-width: 1120px; }
body #main-cart-items.cart__items { padding-top: 0; }
body #main-cart-footer .bz-cart-summary.cart-empty { display: none; }
body #main-cart-footer .bz-cart-summary {
  display: block;
  opacity: 1;
  transform: none;
  background: transparent;
}
body #main-cart-footer.cart__footer-container { padding-top: 24px; padding-bottom: 56px; }

@media (min-width: 960px) {
  body .bz-cart-head { padding: 0 max(15px, calc((100% - 1120px) / 2)); }
  body cart-items.page-width { padding-left: 0; padding-right: 0; }
  body .main-cart-items-wrapper .cart-item { padding-left: 0; padding-right: 0; }
  body .main-cart-items-wrapper .cart-item .cart-item__quantity cart-remove-button { right: -10px; }
  body #main-cart-footer.page-width { padding-left: 0; padding-right: 0; }
  body #main-cart-footer .bz-cart-summary { position: static; width: 400px; margin: 0; padding: 0; }
  body #main-cart-footer .bz-cart-summary .cart-fixed-checkout__footer { border-radius: 22px; }
}

/* 手机：结算卡片吸底（设计稿的 Sticky），页面底部留出同样高度，免得盖住页脚 */
@media (max-width: 959px) {
  body cart-items.page-width { padding-left: 0; padding-right: 0; }
  body #main-cart-footer.cart__footer-container { padding: 0; }
  body #main-cart-footer .bz-cart-summary {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 20;
    width: 100%;
    padding: 0;
    border-top: 0;
  }
  body[data-page-type="cart"] { padding-bottom: var(--bzc-summary-h, 214px); }
}
