/* Section 04 only. The current layout/options plugins retain all product behavior. */
body.dm-site-wide.single-product .dm-product-template .pd-detail.dmss-product-details {
  display: grid !important;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr) !important;
  align-items: start;
  gap: clamp(28px, 3vw, 48px) !important;
  padding-block: clamp(28px, 4vw, 56px);
}
body.dm-site-wide.single-product .dm-product-template .pd-detail.dmss-product-details > .dmss-product-gallery-panel {
  grid-column: 1 !important;
  grid-row: 1 !important;
  min-width: 0;
  margin: 0 !important;
}
body.dm-site-wide.single-product .dm-product-template .pd-detail.dmss-product-details > .dmss-product-specifications-panel {
  grid-column: 2 !important;
  grid-row: 1 !important;
  min-width: 0;
  margin: 0 !important;
}
body.dm-site-wide.single-product .dm-product-template .pd-detail.dmss-product-details > .dmss-product-overview {
  grid-column: 1 / -1 !important;
  grid-row: auto !important;
  min-width: 0;
  margin: 0 !important;
  padding-top: 24px;
  border-top: 1px solid var(--dml-rule, #e8e1d7);
}
body.dm-site-wide.single-product .dm-product-template .dmss-product-gallery-panel > .pd-sq {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 14px !important;
  margin: 12px 0 0;
}
body.dm-site-wide.single-product .dm-product-template .dmss-product-gallery-panel > .pd-sq > figure {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  width: 100%;
  height: auto !important;
  max-height: 560px;
  aspect-ratio: 4 / 3;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden;
  border: 1px solid var(--dml-rule, #e8e1d7);
  border-radius: 4px;
  background: var(--dml-surface, #faf8f4);
  transform: none;
  box-shadow: none;
}
body.dm-site-wide.single-product .dm-product-template .dmss-product-gallery-panel > .pd-sq > figure:only-child {
  grid-column: 1 / -1;
}
body.dm-site-wide.single-product .dm-product-template .dmss-product-gallery-panel > .pd-sq > figure img {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
  object-fit: contain !important;
}
body.dm-site-wide.single-product .dm-product-template .dmss-product-specifications-panel .dm-table-scroll {
  overflow: visible;
}
body.dm-site-wide.single-product .dm-product-template .dmss-product-specifications-panel .pd-tbl {
  width: 100%;
  margin: 0 !important;
  table-layout: fixed;
  border-collapse: collapse;
}
body.dm-site-wide.single-product .dm-product-template .dmss-product-specifications-panel .pd-tbl :is(th, td) {
  padding: 11px 0 !important;
  font-size: 13px !important;
  line-height: 1.65;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
  border-bottom: 1px solid var(--dml-rule, #e8e1d7);
}
body.dm-site-wide.single-product .dm-product-template .dmss-product-specifications-panel .pd-tbl th {
  width: 36%;
  padding-right: 18px !important;
}
@media (max-width: 900px) {
  body.dm-site-wide.single-product .dm-product-template .pd-detail.dmss-product-details {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 28px !important;
  }
  body.dm-site-wide.single-product .dm-product-template .pd-detail.dmss-product-details > .dmss-product-gallery-panel,
  body.dm-site-wide.single-product .dm-product-template .pd-detail.dmss-product-details > .dmss-product-specifications-panel {
    grid-column: 1 !important;
    grid-row: auto !important;
  }
}
@media (max-width: 480px) {
  body.dm-site-wide.single-product .dm-product-template .dmss-product-gallery-panel > .pd-sq {
    gap: 10px !important;
  }
  body.dm-site-wide.single-product .dm-product-template .dmss-product-specifications-panel .pd-tbl th {
    width: 39%;
    padding-right: 12px !important;
  }
}

/* ===== dm-product-refine v2 (2026-10-27) ===== */
/* ---------------------------------------------------------------
   商品页精修 · 2026-10-27
   依据在 wp.seoha.top 实测（1440 / 1280 / 1024 / 768 / 390 / 320）：
   1) .pd-desc 被 dmill-product-layout 压成 13px 且去掉行宽（主题本意 16px / 50ch）
   2) 选项控件 444px 落在 645px 的列里（flex 子项没有 basis，右侧空出一条）
   3) form.cart 主按钮被压成 40px 高 / 12px 字 / 3px 圆角，脱离 .dm-btn 体系（48 / 15 / 8）
   4) 右侧固定销售条在桌面压住规格最后一列 19–31px
   只改这一层，不动模板结构；值全部取站点既有令牌。
   --------------------------------------------------------------- */

/* 1 · 正文回到主题本来字号与行宽 */
body.single-product .pd-hero .pd-info .pd-desc {
  font-size: var(--fs-body-lg, 16px) !important;
  line-height: 1.7 !important;
  max-width: min(60ch, 100%) !important;
  text-wrap: pretty;
}
body.single-product .pd-hero .pd-info .pd-desc p {
  font-size: inherit !important;
  line-height: inherit !important;
}

/* 2 · 选项控件占满整行；数量与主按钮落到下一行、同一条左边缘 */
body.single-product .pd-hero .pd-info form.cart .optis-storefront {
  flex: 1 1 100%;
  width: 100%;
  max-width: none;
}

/* 3 · 主按钮回到站点按钮体系；数量框同高 */
body.single-product .pd-hero .pd-info form.cart .single_add_to_cart_button {
  flex: 1 1 220px;
  min-height: 48px !important;
  padding: 12px 22px !important;
  border-radius: var(--r-btn, 8px) !important;
  font-size: var(--fs-body, 15px) !important;
  font-weight: 500;
  letter-spacing: 0;
}
body.single-product .pd-hero .pd-info form.cart .quantity {
  flex: 0 0 76px !important;
  margin: 0 !important;
}
body.single-product .pd-hero .pd-info form.cart input.qty {
  min-height: 48px !important;
  border-radius: var(--r-btn, 8px) !important;
}

/* 4 · 桌面给固定销售条让位，宽度按实测最大值 31px + 呼吸 25px */
@media (min-width: 1024px) {
  body.single-product .pd-hero .pd-info { padding-inline-end: 56px; }
}
@media (max-width: 768px) {
  body.single-product .pd-hero .pd-info form.cart .single_add_to_cart_button { min-height: 44px !important; }
  body.single-product .pd-hero .pd-info form.cart input.qty { min-height: 44px !important; }
  body.single-product .pd-hero .pd-info { padding-bottom: 8px; }
}

/* 5 · 购买路径块：主按钮已经是实心棕，三条路径不再跟着实心，避免同屏两个主色块；
       说明文字 10px 提到 12px，桌面与手机用同一套层级 */
body.single-product .pd-hero .pd-info .dpp-action-primary {
  background: #faf8f4 !important;
  border-color: #d9ccba !important;
  color: #4e3922 !important;
}
body.single-product .pd-hero .pd-info .dpp-action-primary span { color: #655d52 !important; }
body.single-product .pd-hero .pd-info .dpp-action b { font-size: 13px !important; }
body.single-product .pd-hero .pd-info .dpp-action span { font-size: 12px !important; line-height: 1.5; }

/* 6 · 兼容兜底：键盘焦点、高对比度、减少动态 */
body.single-product .pd-hero :is(a, button, select, input, .optis-choice, .pd-thumb):focus-visible {
  outline: 2px solid var(--primary, #59300f);
  outline-offset: 2px;
}
@media (forced-colors: active) {
  body.single-product .pd-hero .pd-info form.cart .single_add_to_cart_button,
  body.single-product .pd-hero .pd-info form.cart input.qty,
  body.single-product .pd-hero .pd-thumb { border: 1px solid ButtonText; }
  body.single-product .pd-hero .pd-thumb.is-active { outline: 2px solid Highlight; outline-offset: 1px; }
}
@media (prefers-reduced-motion: reduce) {
  body.single-product .pd-hero *,
  body.single-product .pd-hero *::before,
  body.single-product .pd-hero *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
/* ===== end dm-product-refine ===== */
