/* =============================================================================
   商品详情独立页（模块/操作层）· product-detail-source.css
   -----------------------------------------------------------------------------
   本文件负责：商品规格行 / 服务保障行 / 店铺卡 / 详情富文本 / 评价空态 /
              fa-skus 多规格抽屉（遮罩+抽屉+规格值+计步器+附加服务+提交）/
              温馨提示弹层 / 服务保障弹层 / 弹层层级修复（P0）
   参考数值：_qa/verify-1027/ref-h5/notes.md §3.3、§3.6；_qa/verify-1027/ref-h5/dom/ref-css-rules.txt
   加载顺序：product-detail.css 之后（index.html），用于压过 mobile-fix.css 的弹层规则
   ========================================================================== */

/* =============================================================================
   0. P0 弹层层级修复
   mobile-fix.css 里 `.overlay { z-index: 2000 !important; }` 把所有弹层压到 2000；
   本页路由层 z-index 1500 虽在其下，但这里再显式提到 5000（带 #modalRoot/ID 优先级）
   保证任何情况下「点规格行/立即购买」弹层都真实可见，且不依赖运行时注入。
   ========================================================================== */
#modalRoot .overlay.pd-sku-overlay,
#modalRoot .overlay.pd-sheet-overlay,
#modalRoot .overlay.pd-warm-overlay,
#modalRoot .overlay.pd-preview-overlay,
.pd-open #modalRoot .overlay,
.pd-open #modalRoot .chat-drawer-scrim {
  z-index: 5000 !important;
}
/* 弹层打开期间 toast 也要压在遮罩之上（如「该规格已售罄」提示） */
.pd-open #toastRoot { z-index: 6000 !important; }
/* 客服抽屉（详情页点客服时触发现有会话浮层）不能被路由页压住 */
.pd-open .chat-drawer,
.pd-open .chat-drawer-scrim { z-index: 5100 !important; }

/* =============================================================================
   1. 商品规格行（两行 module-box 360×85；标题行 h35 + 摘要行 h50）
   ========================================================================== */
.pd-spec-card { cursor: pointer; }
.pd-spec-title { padding-bottom: 0; }
.pd-spec-row {
  height: 50px;
  box-sizing: border-box;
  padding: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.pd-spec-sum {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 14px;
  line-height: 20px;
  color: rgba(0, 0, 0, .9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pd-arrow { flex: none; color: #7f7f7f; }

/* =============================================================================
   2. 服务保障（数据驱动：360×92；行 h57 pad 15；✓ 17px #f2140c）
   ========================================================================== */
.pd-guar-card { cursor: pointer; }
.pd-guar-row {
  padding: 15px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.pd-guar-items {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}
.pd-guar-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0 7.5px 7.5px 0;
  font-size: 14px;
  line-height: 20px;
  color: rgba(0, 0, 0, .9);
}
.pd-guar-item svg { flex: none; display: block; }
.pd-guar-row > .pd-arrow { margin-top: 2px; }

/* =============================================================================
   3. 店铺卡（360×82 pad 15；头像 52×52；名 14/700；粉丝 13 #666；+关注 53×20 r52 #E84359）
   ========================================================================== */
.pd-shop-card {
  padding: 15px;
  height: 82px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
}
.pd-shop-ava {
  width: 52px;
  height: 52px;
  flex: none;
  border-radius: 5px;
  overflow: hidden;
  background: #f2f2f2;
  color: #909399;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pd-shop-ava img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pd-shop-info { flex: 1 1 auto; min-width: 0; margin-left: 10px; }
.pd-shop-name {
  font-size: 14px;
  font-weight: 700;
  line-height: 20px;
  color: rgba(0, 0, 0, .9);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.pd-shop-fans { margin-top: 5px; font-size: 13px; line-height: 18px; color: #666; }
.pd-follow {
  flex: none;
  margin-left: 10px;
  height: 20px;
  padding: 0 10px;
  border: 0;
  border-radius: 52px;
  background: #E84359;
  color: #fff;
  font-size: 13px;
  line-height: 20px;
  font-family: inherit;
  cursor: pointer;
}
.pd-follow.is-on { background: #f5f5f5; color: #7f7f7f; }

/* =============================================================================
   4. 详情卡（标题 h50；富文本 14px / 行高 1.7 / padding 0 15 15 / #7f7f7f）
   ========================================================================== */
.pd-detail-title { padding: 15px; height: 50px; box-sizing: border-box; }
.pd-detail-body {
  padding: 0 15px 15px;
  font-size: 14px;
  /* 参考实测：正文行高 ≈ normal（14px 字约 20px/行）；此处用 1.43 固定为 20px 行高，保证详情卡 85 高 */
  line-height: 1.43;
  color: #7f7f7f;
  /* 与参考 u-parse 一致：CJK 正常换行，超长无空格串不强制断行（超出裁掉） */
  word-break: normal;
  overflow: hidden;
}
.pd-detail-body p { margin: 0; }
.pd-detail-body img,
.pd-detail-body .pd-detail-img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 8px 0;
  border-radius: 4px;
  cursor: zoom-in;
}
.pd-detail-body * { max-width: 100%; }

/* =============================================================================
   5. 评价卡（360×293：标题行 h50 + 空态 243；空态图 208×208 + 文案 #909399；无「更多评论」按钮）
   ========================================================================== */
.pd-review-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px;
  height: 50px;
  box-sizing: border-box;
}
.pd-review-rate { font-size: 13px; font-weight: 400; color: #909399; }
.pd-review-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 15px 15px;
}
.pd-empty-img { width: 208px; height: 208px; object-fit: contain; display: block; }
.pd-review-empty-txt { font-size: 14px; line-height: 20px; color: #909399; }

/* =============================================================================
   6. 弹层基础壳（遮罩 rgba(0,0,0,.6) + 贴底抽屉 上圆角 10）
   ========================================================================== */
#modalRoot .overlay.pd-sku-overlay,
#modalRoot .overlay.pd-sheet-overlay {
  background: rgba(0, 0, 0, .6) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  align-items: flex-end !important;
  justify-content: center !important;
  padding: 0 !important;
  overflow: hidden !important;
}
#modalRoot .overlay.pd-sku-overlay .modal,
#modalRoot .overlay.pd-sheet-overlay .modal {
  width: 100%;
  max-width: 430px;
  /* 高度由内容决定（参考实测抽屉 y275 h569）；极端长内容时不超过一屏并可滚动 */
  max-height: 100dvh;
  margin: 0;
  padding: 0;
  background: #fff;
  border: 0;
  border-radius: 10px 10px 0 0;
  box-shadow: none;
  overflow-y: auto;
  animation: none;
}
.pd-sku-sheet {
  position: relative;
  width: 100%;
  background: #fff;
  border-radius: 10px 10px 0 0;
  box-sizing: border-box;
}
.pd-sku-close {
  position: absolute;
  top: 5px;
  right: 5px;
  z-index: 3;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #909399;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* =============================================================================
   7. fa-skus 抽屉内容（.add-carts padding 15 + safe-area）
   ========================================================================== */
.pd-add-carts {
  padding: 15px 15px calc(15px + env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
  background: #fff;
}
/* 头部：缩略图 78×78 r5 + 右侧 h62 纵向 space-between */
.pd-sku-header { display: flex; align-items: center; }
.pd-sku-thumb {
  width: 78px;
  height: 78px;
  flex: none;
  border-radius: 5px;
  object-fit: cover;
  display: block;
  background: #f5f5f5;
}
.pd-sku-ph {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: #909399;
}
.pd-sku-hr {
  flex: 1 1 auto;
  min-width: 0;
  padding-left: 15px;
  height: 62px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.pd-sku-price { font-size: 18px; line-height: 26px; color: #E84359; }
.pd-sku-sel {
  font-size: 14px;
  line-height: 20px;
  color: #909399;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* 内容区（上 10 / 下 5） */
.pd-sku-wrap { padding: 10px 0 5px; }
.pd-sku-scroll {
  max-height: 55vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
/* 规格组标题（14/700 pad 10 0 15 → h45） */
.pd-sku-gtitle {
  padding: 10px 0 15px;
  font-size: 14px;
  font-weight: 700;
  line-height: 20px;
  color: #303133;
}
/* 规格值（h28 / r52 / 11px / pad 0 20；选中 #FF3F4F 实心白字；未选 #F5F5F5 + 细边框） */
.pd-sku-vals { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 10px; }
.pd-sku-val {
  height: 28px;
  padding: 0 20px;
  border: 0;
  border-radius: 52px;
  background: #F5F5F5;
  color: rgba(0, 0, 0, .9);
  font-size: 11px;
  line-height: 28px;
  font-family: inherit;
  cursor: pointer;
  box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .1);
}
.pd-sku-val.on {
  background: #FF3F4F;
  color: #fff;
  box-shadow: none;
}
/* 数量行（pad 10 0 15 → h51） */
.pd-sku-qtyrow {
  padding: 10px 0 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.pd-sku-qlabel { font-size: 14px; font-weight: 700; line-height: 20px; color: #303133; }

/* 计步器 109×26（31 + 3 + 41 + 3 + 31；左右外侧圆角 4；底 #E6E6E6） */
.pd-stepper {
  width: 109px;
  height: 26px;
  flex: none;
  display: flex;
  align-items: center;
  border-radius: 4px;
  overflow: hidden;
}
.pd-st-btn {
  width: 31px;
  height: 26px;
  flex: none;
  padding: 0;
  border: 0;
  background: #E6E6E6;
  color: #333;
  font-size: 16px;
  line-height: 26px;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.pd-st-btn.pd-st-minus { border-radius: 4px 0 0 4px; }
.pd-st-btn.pd-st-plus { border-radius: 0 4px 4px 0; }
.pd-st-btn.disabled { color: #7f7f7f; cursor: default; }
.pd-st-input {
  width: 41px;
  height: 26px;
  margin: 0 3px;
  padding: 0;
  border: 0;
  background: #fff;
  color: #303133;
  text-align: center;
  font-family: inherit;
  font-size: 13px !important;
  box-sizing: content-box;
  outline: 0;
}
#modalRoot .pd-st-input { font-size: 13px !important; }

/* =============================================================================
   8. 附加服务（浅灰块 #F7F8FA r6 pad 0 12 mb；标题橙条 3×13 #FF6A16；折叠）
   ========================================================================== */
.pd-attach-block {
  background: #F7F8FA;
  border-radius: 6px;
  padding: 0 12px;
  margin: -5px 0 15px;
}
.pd-attach-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #EBEEF5;
  cursor: pointer;
}
.pd-attach-title {
  position: relative;
  padding-left: 9px;
  font-size: 14px;
  font-weight: 700;
  line-height: 20px;
  color: #303133;
}
.pd-attach-title::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  width: 3px;
  height: 13px;
  margin-top: -6.5px;
  background: #FF6A16;
  border-radius: 1px;
}
.pd-attach-headr { display: flex; align-items: center; }
.pd-attach-none { font-size: 12px; line-height: 18px; color: #909399; }
.pd-attach-none.attach-total { color: #FF6A16; }
.pd-attach-arrow {
  width: 0;
  height: 0;
  margin-left: 6px;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid #909399;
  transition: transform .2s;
}
.pd-attach-arrow.is-collapse { transform: rotate(180deg); }
.pd-attach-list { display: block; }
.pd-attach-item {
  display: flex;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #EBEEF5;
}
.pd-attach-item:last-child { border-bottom: none; }
.pd-attach-info { flex: 1 1 auto; min-width: 0; padding-right: 10px; }
.pd-attach-name { font-size: 14px; line-height: 20px; color: #303133; }
.pd-attach-content { margin-top: 3px; font-size: 12px; line-height: 17px; color: #909399; }
.pd-attach-price { margin-top: 3px; font-size: 12px; line-height: 17px; color: #FF6A16; }

/* =============================================================================
   9. 提交按钮（单按钮 85vw×36 r52 #FF3F4F 白字 13；无「取消」）
   ========================================================================== */
.pd-sku-submit {
  display: block;
  width: 85vw;
  max-width: 365px;
  height: 36px;
  margin: 0 auto;
  padding: 0;
  border: 0;
  border-radius: 52px;
  background: #FF3F4F;
  color: #fff;
  font-size: 13px;
  line-height: 36px;
  text-align: center;
  font-family: inherit;
  cursor: pointer;
}

/* =============================================================================
   10. 服务保障列表弹层（点「服务保障」行打开）
   ========================================================================== */
.pd-guar-sheet {
  padding: 0 15px calc(15px + env(safe-area-inset-bottom, 0px));
  background: #fff;
  border-radius: 10px 10px 0 0;
}
.pd-guar-head {
  height: 45px;
  line-height: 45px;
  text-align: center;
  font-size: 16px;
  color: rgba(0, 0, 0, .9);
  border-bottom: 1px solid #EBEEF5;
}
.pd-guar-list { padding: 5px 0; }
.pd-guar-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 15px 0;
  font-size: 14px;
  line-height: 20px;
  color: rgba(0, 0, 0, .9);
  border-bottom: 1px solid #f4f4f4;
}
.pd-guar-cell:last-child { border-bottom: none; }
.pd-guar-cell svg { flex: none; }
.pd-guar-ok { margin-top: 15px; }

/* =============================================================================
   11. 温馨提示（居中：标题「温馨提示」+ 富文本 + 圆形关闭按钮）
   ========================================================================== */
#modalRoot .overlay.pd-warm-overlay {
  background: rgba(0, 0, 0, .6) !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 16px !important;
  overflow: visible !important;
}
#modalRoot .overlay.pd-warm-overlay .modal {
  width: auto;
  max-width: 340px;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
  animation: none;
}
.pd-warm { display: flex; flex-direction: column; align-items: center; }
.pd-warm-card {
  width: min(336px, calc(100vw - 54px));
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 12px 31px rgba(0, 0, 0, .22);
}
.pd-warm-head { padding: 14px 16px; border-bottom: 1px solid #f0f0f0; }
.pd-warm-badge {
  display: inline-block;
  padding: 4px 9px;
  border-radius: 5px;
  background: rgba(232, 67, 89, .12);
  color: #E84359;
  font-size: 15px;
  font-weight: 600;
  line-height: 19px;
}
.pd-warm-body {
  max-height: 374px;
  overflow-y: auto;
  padding: 13px 16px;
  font-size: 14px;
  line-height: 23px;
  color: rgba(0, 0, 0, .9);
  word-break: break-word;
}
.pd-warm-body img { max-width: 100%; height: auto; }
.pd-warm-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 33px;
  height: 33px;
  margin: 15px auto 0;
  padding: 0;
  border: 2px solid rgba(255, 255, 255, .9);
  border-radius: 50%;
  background: rgba(0, 0, 0, .16);
  color: #fff;
  cursor: pointer;
}
