/**
 * WOLKENTAKT · Components · 侧边栏购物车
 *
 * 右侧滑出抽屉、商品行、免邮进度条、结账按钮。
 *
 * 来源：拆分自原 components.css（2026-11-16），规则内容未修改。
 * 修改本文件时请同步更新《公共框架与子主题规范梳理.md》。
 */

/* --------------------------------------------------------------------------
   9. SLIDE-IN SIDE CART DRAWER
   -------------------------------------------------------------------------- */
body.wt-drawer-locked {
  overflow: hidden;
}

.wt-cart-overlay {
  position: fixed;
  inset: 0;
  z-index: 998;
  background: rgba(16, 20, 25, 0.5);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.28s ease, visibility 0.28s ease;
}

.wt-cart-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.wt-cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 999;
  width: min(100vw, 460px);
  background: #FFFFFF;
  box-shadow: -12px 0 40px rgba(16, 20, 25, 0.16);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.wt-cart-drawer.is-open {
  transform: translateX(0);
}

.wt-cart-drawer__header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--wt-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}

.wt-cart-drawer__title {
  font-family: var(--wt-font-display);
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--wt-carbon);
  margin: 0;
}

.wt-cart-drawer__close {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  color: var(--wt-carbon);
  font-family: var(--wt-font-body);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: var(--wt-radius-sm);
}

.wt-cart-drawer__close:hover {
  background: var(--wt-surface-subtle);
}

.wt-cart-drawer__inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.wt-cart-drawer__empty {
  flex: 1;
  padding: 44px 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--wt-text-secondary);
}

.wt-cart-drawer__empty svg {
  color: var(--wt-text-muted);
  margin-bottom: 14px;
}

.wt-cart-drawer__empty-title {
  font-family: var(--wt-font-display);
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--wt-carbon);
  margin: 0 0 8px;
}

.wt-cart-drawer__empty-sub {
  font-size: 0.875rem;
  margin: 0 0 22px;
  line-height: 1.6;
}

.wt-cart-drawer__list {
  flex: 1;
  overflow-y: auto;
  list-style: none;
  margin: 0;
  padding: 0 22px;
}

/* 顶部说明条 */
.wt-cart-drawer__note {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 10px 22px;
  background: var(--wt-surface-subtle);
  border-bottom: 1px solid var(--wt-border-subtle);
  font-size: 0.75rem;
  color: var(--wt-text-secondary);
  line-height: 1.4;
}

.wt-cart-drawer__note svg {
  flex-shrink: 0;
  opacity: 0.7;
}

/* 自定义滚动条（列表区） */
.wt-cart-drawer__list {
  scrollbar-width: thin;
  scrollbar-color: #CBD5E1 transparent;
}

.wt-cart-drawer__list::-webkit-scrollbar {
  width: 6px;
}

.wt-cart-drawer__list::-webkit-scrollbar-thumb {
  background: #CBD5E1;
  border-radius: 999px;
}

.wt-cart-drawer__list::-webkit-scrollbar-track {
  background: transparent;
}

/* 按钮下方 SSL 说明 */
.wt-cart-drawer__secure {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin: 10px 0 0;
  font-size: 0.75rem;
  color: var(--wt-text-muted);
}

/* 商品行：三行结构（参考图）
   row1: 缩略图 | 名称        | 删除
   row2:        | 口味 · Nikotin X%（跨列，完整显示）
   row3:        | 步进器      | 原价/现价 */
.wt-cart-item {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) auto;
  align-items: start;
  column-gap: 12px;
  row-gap: 10px;
  padding: 16px 0;
  border-bottom: 1px solid var(--wt-border-subtle);
}

.wt-cart-item__thumb {
  grid-row: 1 / span 2;
  width: 62px;
  height: 62px;
  border-radius: 10px;
  background: var(--wt-surface-card);
  padding: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wt-cart-item__thumb img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.wt-cart-item__name {
  grid-column: 2;
  font-family: var(--wt-font-display);
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--wt-carbon);
  line-height: 1.3;
  text-decoration: none;
}

.wt-cart-item__name:hover {
  color: var(--wt-link-blue);
}

.wt-cart-item__remove {
  grid-column: 3;
  justify-self: end;
  background: transparent;
  border: none;
  color: var(--wt-text-muted);
  font-size: 1.125rem;
  line-height: 1;
  padding: 0 2px;
  cursor: pointer;
}

.wt-cart-item__remove:hover {
  color: var(--wt-tag-new);
}

.wt-cart-item__remove.is-loading {
  opacity: 0.35;
  pointer-events: none;
}

/* 属性：口味 · Nikotin X% —— 无标签堆叠，完整显示并横排换行 */
.wt-cart-item__meta {
  grid-column: 2 / -1;
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--wt-text-secondary);
}

.wt-cart-item__stepper {
  grid-column: 2;
  grid-row: 3;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--wt-border);
  border-radius: 10px;
  overflow: hidden;
  height: 38px;
}

.wt-cart-item__stepper.is-loading {
  opacity: 0.5;
  pointer-events: none;
}

.wt-cart-item__step {
  width: 38px;
  height: 100%;
  border: 0;
  background: #FFFFFF;
  color: var(--wt-carbon);
  font-size: 1.125rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.12s;
}

.wt-cart-item__step:hover {
  background: var(--wt-surface-card);
}

/* 数量为 1 时减号禁用：删除只能走右上 × ，避免误删整行 */
.wt-cart-item__step:disabled {
  color: #C9CED6;
  background: #FFFFFF;
  cursor: not-allowed;
}

.wt-cart-item__count {
  min-width: 34px;
  text-align: center;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--wt-carbon);
}

/* 价格：只展示 原价（划线）+ 现价，不显示折扣百分比 */
.wt-cart-item__prices {
  grid-column: 3;
  grid-row: 3;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  text-align: right;
  white-space: nowrap;
}

.wt-cart-item__prices del {
  font-size: 0.75rem;
  color: var(--wt-text-muted);
  text-decoration: line-through;
}

.wt-cart-item__prices ins {
  font-family: var(--wt-font-display);
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--wt-carbon);
  text-decoration: none;
}
.wt-cart-drawer__footer {
  padding: 18px 22px 22px;
  border-top: 1px solid var(--wt-border);
  background: #FFFFFF;
  flex-shrink: 0;
}

/* 合计三段：Zwischensumme / Mengenrabatt / Gesamt */
.wt-cart-drawer__totals {
  margin-bottom: 14px;
}

.wt-cart-drawer__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 0;
  font-size: 0.875rem;
  color: var(--wt-text-secondary);
}

.wt-cart-drawer__row--save {
  color: #047857;
  font-weight: 600;
}

.wt-cart-drawer__row--total {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--wt-border-subtle);
  font-family: var(--wt-font-display);
  font-size: 1.125rem;
  font-weight: 800;
  color: var(--wt-carbon);
}



.wt-cart-drawer__shipping-box {
  background: var(--wt-surface-subtle);
  border-radius: var(--wt-radius-control);
  padding: 12px 14px;
  margin-bottom: 16px;
}

.wt-cart-drawer__shipping-text {
  font-size: 0.8125rem;
  color: var(--wt-text-secondary);
  line-height: 1.5;
  margin: 0 0 8px;
}

.wt-cart-drawer__shipping-text.is-unlocked {
  color: #047857;
}

.wt-cart-drawer__progress {
  width: 100%;
  height: 6px;
  border-radius: var(--wt-radius-pill);
  background: #E2E8F0;
  overflow: hidden;
}

.wt-cart-drawer__progress-bar {
  height: 100%;
  border-radius: var(--wt-radius-pill);
  background: var(--wt-carbon);
  transition: width 0.35s ease;
}

.wt-cart-drawer__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.wt-cart-drawer__btn-cart,
.wt-cart-drawer__btn-checkout {
  width: 100%;
  border-radius: var(--wt-radius-pill);
  min-height: 46px;
}

/* ── 移动端精简（2026-11-26）──
   目标：同一视窗看到更多商品；数量步进器与 PC 统一尺寸（38px）。 */
@media (max-width: 768px) {
  /* 顶部说明条与免运进度条不显示，把空间留给商品 */
  #wt-cart-drawer .wt-cart-drawer__note,
  #wt-cart-drawer .wt-cart-drawer__shipping-box {
    display: none !important;
  }

  #wt-cart-drawer .wt-cart-drawer__list {
    padding: 0 16px;
  }

  #wt-cart-drawer .wt-cart-item {
    grid-template-columns: 54px minmax(0, 1fr) auto;
    column-gap: 10px;
    row-gap: 8px;
    padding: 12px 0;
  }

  #wt-cart-drawer .wt-cart-item__thumb {
    width: 54px;
    height: 54px;
  }

  #wt-cart-drawer .wt-cart-item__meta {
    font-size: 0.75rem;
    line-height: 1.35;
  }

  #wt-cart-drawer .wt-cart-item__prices {
    min-width: 78px;
  }

  #wt-cart-drawer .wt-cart-drawer__footer {
    padding: 12px 16px 16px;
  }

  #wt-cart-drawer .wt-cart-drawer__totals {
    margin-bottom: 10px;
  }

  #wt-cart-drawer .wt-cart-drawer__actions {
    gap: 8px;
    margin-top: 10px;
  }
}
/* 阶梯提示（wolkentakt-pricing 插件经 tier-hint.js 注入 div.wt-tier-hint--cart）
   业务方决定：PC 与移动统一不显示；合计区的 Mengenrabatt 已表达同样信息。
   仅 CSS 隐藏，不改插件。 */
#wt-cart-drawer .wt-tier-hint--cart {
  display: none !important;
}