/**
 * WOLKENTAKT · Components · 统一商品卡 .wt-card
 *
 * 首页、口味页、归档页（Shop / 品牌 / 分类）共用。
 * 网格容器：components/product-grid.css　经典循环：components/loop-classic.css
 * 热销徽标函数：inc/hot-badge.php　规范：docs/产品卡片规范.md
 */

:root {
  --wt-card-radius: var(--wt-radius-card);
  --wt-card-pad: 24px 20px 22px;
  --wt-card-gap: 24px;
  --wt-card-title: 1.0625rem;
  --wt-card-price: 1.0625rem;
  --wt-card-brand: 0.8125rem;
  --wt-card-badge: 0.8125rem;
  --wt-card-cta-h: 40px;
  --wt-card-hover: translateY(-4px);
  --wt-card-img-radius: 12px;
}

.wt-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: var(--wt-card-pad);
  background: var(--wt-surface-card);
  border-radius: var(--wt-card-radius);
  min-width: 0;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.wt-card:hover {
  transform: var(--wt-card-hover);
  box-shadow: var(--wt-shadow-hover);
}

.wt-card__media {
  display: block;
  aspect-ratio: 1 / 1;
  margin-bottom: 14px;
}

.wt-card__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: var(--wt-card-img-radius);
  transition: transform 0.3s ease;
}

.wt-card:hover .wt-card__media img {
  transform: scale(1.02);
}

.wt-loop-puffs-tag,
.wt-card .wt-loop-puffs-tag {
  display: block;
  align-self: flex-start;
  font-size: var(--wt-card-badge);
  font-weight: 700;
  line-height: 1.3;
  color: var(--wt-tag-new);
  margin: 0 0 4px;
}

.wt-card__title {
  font-family: var(--wt-font-display);
  font-size: var(--wt-card-title);
  font-weight: 800;
  line-height: 1.3;
  color: var(--wt-carbon);
  margin: 0 0 4px;
  overflow-wrap: break-word;
}

.wt-card__title a {
  color: var(--wt-carbon);
  text-decoration: none;
  /* 触控热区：行内元素加纵向 padding 不改变行高，把可点区从 20px 扩到约 26px（WCAG 2.5.8 ≥24px） */
  padding-block: 3px;
}

.wt-card__title a:hover {
  color: var(--wt-link-blue);
}

.wt-card__brand {
  font-size: var(--wt-card-brand);
  line-height: 1.4;
  color: var(--wt-text-secondary);
  margin: 0 0 4px;
}

/* 类型 · 尼古丁强度（2026-11-17 新增） */
.wt-card__meta {
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--wt-text-secondary);
  margin: 0 0 14px;
  overflow-wrap: anywhere;
}

.wt-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
}

.wt-card__price {
  font-family: var(--wt-font-display, inherit);
  font-size: clamp(1.25rem, 1.05rem + 0.35vw, 1.375rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--wt-carbon);
  white-space: nowrap;
}

.wt-card__price del {
  color: var(--wt-text-muted);
  font-weight: 500;
}

.wt-card__price ins {
  text-decoration: none;
}

.wt-card__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--wt-card-cta-h);
  padding: 0 16px;
  border-radius: var(--wt-radius-sm);
  background: var(--wt-carbon);
  color: #FFFFFF;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  text-align: center;
  white-space: nowrap;
  transition: background-color 0.2s ease;
}

.wt-card__cta:hover {
  background: var(--wt-carbon-hover);
  color: #FFFFFF;
}

.wt-card__cta.is-disabled {
  background: var(--wt-border);
  color: var(--wt-text-muted);
  pointer-events: none;
}

.wt-card__figure {
  position: relative;
  display: block;
}

.wt-card__figure .wt-card__media {
  margin-bottom: 14px;
}

.wt-card__sale {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  padding: 4px 10px;
  border-radius: var(--wt-radius-pill, 9999px);
  background: var(--wt-tag-new, #e8452c);
  color: #ffffff;
  font-size: var(--wt-card-badge, 0.75rem);
  font-weight: 700;
  line-height: 1.4;
}

.wt-card.is-outofstock .wt-card__media img {
  opacity: 0.55;
  filter: grayscale(0.2);
}

.wt-card.is-outofstock .wt-card__cta {
  background: #c9ced6;
  color: #ffffff;
  pointer-events: none;
}

@media (max-width: 640px) {
  :root {
    --wt-card-pad: 18px 16px 18px;
    --wt-card-cta-h: 38px;
    --wt-card-gap: 16px;
  }

  .wt-card__footer {
    gap: 8px;
  }

  .wt-card__cta {
    padding: 0 12px;
    font-size: 0.8125rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .wt-card:hover .wt-card__media img {
    transform: none;
  }
}

/* ==========================================================================
   6 · 热销徽标（横向胶囊，2026-11-17 重做）
   背景：此前 .wt-card__hot 被定义两次（圆形 46×46 + 横排），属性互相拼接，
        结果压成黑色小圆块并遮挡商品图。此处合并为唯一定义。
   PDP 的「热销」勾选（_wt_is_hot）逻辑不变，只改呈现。
   ========================================================================== */
.wt-card__hot {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 5px;
  width: auto;
  height: auto;
  max-width: calc(100% - 20px);
  padding: 5px 10px 5px 8px;
  border-radius: var(--wt-radius-pill, 9999px);
  background: rgba(16, 20, 25, 0.92);
  color: #FFFFFF;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.15;
  box-shadow: 0 2px 8px rgba(16, 20, 25, 0.22);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.wt-card__hot .wt-hot__icon {
  width: 11px;
  height: 11px;
  color: #FF8A3D;
  flex-shrink: 0;
  filter: drop-shadow(0 0 3px rgba(255, 138, 61, 0.8));
}

.wt-card__hot-text {
  font-family: var(--wt-font-body, inherit);
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .wt-card__hot {
    top: 8px;
    right: 8px;
    padding: 4px 8px 4px 7px;
    font-size: 0.6875rem;
  }

  .wt-card__hot .wt-hot__icon {
    width: 10px;
    height: 10px;
  }

  .wt-card__price {
    font-size: 1.125rem;
  }
}

/* ══════════════════════════════════════════════════════════════════════
   徽标重构（2026-11-23）：pill 形态 + 促销配色
   - 热销 .wt-card__hot：橙红渐变 pill，右上角，闪电图标
   - 新品 .wt-card__new：墨绿 pill，左上角，三粒 sparkles
   - 两者互斥（热销优先，由 PHP 控制）
   ══════════════════════════════════════════════════════════════════════ */
.wt-card__hot {
  top: 10px;
  right: 10px;
  bottom: auto;
  left: auto;
  width: auto;
  height: 24px;
  min-width: 0;
  padding: 0 9px 0 7px;
  border-radius: 999px;
  flex-direction: row;
  gap: 4px;
  background: linear-gradient(135deg, #f97316, #ea580c);
  color: #fff;
  box-shadow: 0 2px 8px rgba(234, 88, 12, 0.3);
}

.wt-card__hot .wt-hot__icon {
  width: 12px;
  height: 12px;
  margin: 0;
}

.wt-card__hot-text {
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.01em;
  text-align: left;
}

.wt-card__new {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 24px;
  padding: 0 9px 0 7px;
  border-radius: 999px;
  background: #0e9f6e;
  color: #fff;
  box-shadow: 0 2px 8px rgba(14, 159, 110, 0.3);
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  pointer-events: none;
}

.wt-card__new .wt-new__icon {
  width: 11px;
  height: 11px;
}

.wt-card__new-text {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

@media (max-width: 640px) {
  .wt-card__hot,
  .wt-card__new {
    top: 8px;
    height: 20px;
    padding: 0 8px 0 6px;
    gap: 3px;
  }

  .wt-card__hot {
    right: 8px;
  }

  .wt-card__new {
    left: 8px;
  }

  .wt-card__hot-text,
  .wt-card__new-text {
    font-size: 10px;
  }

  .wt-card__hot .wt-hot__icon {
    width: 10px;
    height: 10px;
  }

  .wt-card__new .wt-new__icon {
    width: 9px;
    height: 9px;
  }
}

/* ══════════════════════════════════════════════════════════════════════
   徽标调整（2026-11-23 第二轮）：统一右上角 + 图标白色 + 放大
   - 热销与新品都定位右上角（两者互斥，不会同时出现）
   - 图标与文字统一白色；图标 14px、文字 12px、pill 高 28px
   ══════════════════════════════════════════════════════════════════════ */

/* 统一位置与尺寸 */
.wt-card__hot,
.wt-card__new {
  position: absolute;
  top: 10px;
  right: 10px;
  left: auto;
  bottom: auto;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: auto;
  min-width: 0;
  height: 28px;
  padding: 0 12px 0 10px;
  border-radius: 999px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.01em;
  white-space: nowrap;
  pointer-events: none;
}

/* 图标：显式白色，统一 14px */
.wt-card__hot .wt-hot__icon,
.wt-card__new .wt-new__icon {
  width: 14px;
  height: 14px;
  margin: 0;
  color: #fff;
  fill: currentColor;
  stroke: none;
  flex: 0 0 auto;
}

.wt-card__hot-text,
.wt-card__new-text {
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  color: #fff;
}

/* 移动端：等比收敛 */
@media (max-width: 640px) {
  .wt-card__hot,
  .wt-card__new {
    top: 8px;
    right: 8px;
    height: 24px;
    padding: 0 10px 0 8px;
    gap: 5px;
  }

  .wt-card__hot .wt-hot__icon,
  .wt-card__new .wt-new__icon {
    width: 12px;
    height: 12px;
  }

  .wt-card__hot-text,
  .wt-card__new-text {
    font-size: 11px;
  }
}
﻿
/* ---------------------------------------------------------------
 * 卡片底部（2026-11-23）：促销商品价格+按钮上下排列，修复按钮溢出
 * 原因：折扣商品含 <del>+<ins> 两个价格，单行放不下会把 CTA 挤出卡片
 * ------------------------------------------------------------- */
.wt-card__footer {
  flex-wrap: wrap;
  gap: 10px 12px;
}

.wt-card__price {
  min-width: 0;
}

.wt-card__price del,
.wt-card__price ins {
  white-space: nowrap;
}

/* 含划线价（折扣商品）：价格独占一行，按钮通栏 */
.wt-card__footer:has(del) {
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
}

.wt-card__footer:has(del) .wt-card__price {
  width: 100%;
}

.wt-card__footer:has(del) .wt-card__cta {
  width: 100%;
  text-align: center;
  justify-content: center;
}

/* 无 :has() 支持的浏览器兜底：按钮自动换到下一行，不溢出 */
.wt-card__footer .wt-card__cta {
  flex: 0 0 auto;
  margin-left: auto;
}
﻿
/* ---------------------------------------------------------------
 * 卡片底部（2026-11-23 二次修正）
 * 统一左右排列：价格区在左，CTA 在右；促销商品价格区内部竖排
 *   del（常规价）在上、ins（实售价）在下
 * 取代上一版的「价格与按钮上下排列」
 * ------------------------------------------------------------- */
.wt-card__footer {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.wt-card__price {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
  flex: 0 1 auto;
}

/* 促销：价格区内部竖排 */
.wt-card__footer:has(del) .wt-card__price {
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  line-height: 1.15;
}

.wt-card__footer:has(del) .wt-card__price del {
  font-size: 12px;
  font-weight: 500;
  color: #8a919c;
  text-decoration: line-through;
}

.wt-card__footer:has(del) .wt-card__price ins {
  font-size: 20px;
  font-weight: 800;
  color: #101419;
  text-decoration: none;
  line-height: 1.1;
}

/* CTA 固定右侧、不参与压缩 */
.wt-card__footer .wt-card__cta {
  flex: 0 0 auto;
  margin-left: 0;
  width: auto;
  white-space: nowrap;
}

/* 上一版遗留的「含 del 时按钮通栏」规则在此覆盖 */
.wt-card__footer:has(del) .wt-card__cta {
  width: auto;
}

/* 窄屏：价格与按钮都缩小一档，仍保持同行 */
@media (max-width: 640px) {
  .wt-card__footer {
    gap: 8px;
  }

  .wt-card__footer:has(del) .wt-card__price ins {
    font-size: 18px;
  }

  .wt-card__footer .wt-card__cta {
    font-size: 12px;
    padding-inline: 12px;
  }
}
﻿
/* 覆盖更早的 :has(del) 纵向规则（同特异性，靠顺序取胜） */
.wt-card__footer:has(del) {
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

.wt-card__footer:has(del) .wt-card__price {
  flex-direction: column;
  align-items: flex-start;
  width: auto;
  flex: 0 1 auto;
}
﻿
/* 最终覆盖：以更高特异性锁定「价格左 / 按钮右」的横向布局（促销卡片同样） */
.wt-card .wt-card__footer:has(del) {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.wt-card .wt-card__footer:has(del) .wt-card__price {
  flex-direction: column;
  align-items: flex-start;
  width: auto;
  flex: 0 1 auto;
}

.wt-card .wt-card__footer:has(del) .wt-card__cta {
  width: auto;
  flex: 0 0 auto;
}
﻿
/* 决定性覆盖（2026-11-23）：其他样式表存在同属性规则，此处用 !important 锁定
   目标：所有卡片（含促销）统一「价格左、按钮右」；促销价内部竖排（常规价上/实售价下） */
.wt-card .wt-card__footer:has(del) {
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
}

.wt-card .wt-card__footer:has(del) .wt-card__price {
  flex-direction: column !important;
  align-items: flex-start !important;
  width: auto !important;
  flex: 0 1 auto !important;
}

.wt-card .wt-card__footer:has(del) .wt-card__cta {
  width: auto !important;
  flex: 0 0 auto !important;
}

/* 促销卡片：以 is-sale 类名锁定横向布局（避开 :has(del) 的规则竞争） */
.wt-card .wt-card__footer.is-sale {
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 10px !important;
}

.wt-card .wt-card__footer.is-sale .wt-card__price {
  flex-direction: column !important;
  align-items: flex-start !important;
  width: auto !important;
  flex: 0 1 auto !important;
  line-height: 1.15;
}

.wt-card .wt-card__footer.is-sale .wt-card__price del {
  font-size: 12px;
  color: #8a919c;
}

.wt-card .wt-card__footer.is-sale .wt-card__price ins {
  font-size: 20px;
  font-weight: 800;
  text-decoration: none;
}

.wt-card .wt-card__footer.is-sale .wt-card__cta {
  width: auto !important;
  flex: 0 0 auto !important;
}
﻿
/* =====================================================================
 * 归档页（品牌 / 分类）信任条 → 卡片式（2026-11-23，与首页统一）
 * 结构：.wt-archive-trust > .wt-trust-pill
 * ===================================================================== */
.wt-archive-trust {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  max-width: 1200px;
  margin: 56px auto 48px;
  padding: 0 24px;
  border: 0;
  background: transparent;
}

.wt-archive-trust .wt-trust-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 168px;
  padding: 32px 22px;
  border: 0;
  border-radius: 20px;
  background: #f6f7f9;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.45;
  text-align: center;
  color: #101419;
  transition: background-color 200ms ease, transform 200ms ease;
}

.wt-archive-trust .wt-trust-pill:hover {
  background: #eff1f4;
  transform: translateY(-2px);
}

/* 图标：白底圆形 + 勾（与首页同款） */
.wt-archive-trust .wt-trust-pill::before {
  content: "" !important;
  display: block;
  width: 48px;
  height: 48px;
  margin: 0;
  border-radius: 50%;
  background-color: #fff;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23101419' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 12.5l5 5L20 6.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 22px 22px;
  box-shadow: inset 0 0 0 1px #e3e6ea, 0 2px 6px rgba(16, 20, 25, 0.05);
}

@media (max-width: 1023px) {
  .wt-archive-trust {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    margin: 40px auto 32px;
    padding: 0 20px;
  }

  .wt-archive-trust .wt-trust-pill {
    min-height: 140px;
    padding: 24px 16px;
    gap: 12px;
    font-size: 14px;
  }

  .wt-archive-trust .wt-trust-pill::before {
    width: 42px;
    height: 42px;
    background-size: 20px 20px;
  }
}
