/* 裏物 LIWU — 商品詳情頁（第二層頁面）
   ------------------------------------------------------------------
   只作用於 .pd- 前綴，與商品列表／預覽視窗完全隔離，不動既有版面。
   構圖變數（每張圖各自帶在 figure 的 style 上）：
     --pd-fit contain|cover、--pd-x/--pd-y 焦點、--pd-scale 縮放、--pd-bg 背景
   ------------------------------------------------------------------ */

.pd-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: calc(var(--header-height, 96px) + 34px) 32px 70px;
  /* 行動瀏覽器的字體自動放大（text autosizing）會把長段落吹大而破版——鎖住 */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* ── 麵包屑 ── */
.pd-crumbs {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--text-mid, #8a8a8a);
  margin-bottom: 26px; font-weight: 300;
}
.pd-crumbs a { color: inherit; text-decoration: none; }
.pd-crumbs a:hover { color: var(--text-charcoal, #2e2e2e); }
.pd-crumbs b { color: var(--text-charcoal, #2e2e2e); font-weight: 400; }

/* ── 首屏：左圖右摘要 ── */
.pd-hero {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 56px;
  align-items: start;
}

/* 圖片瀏覽區：scroll-snap 輪播（桌機與手機同一套 DOM） */
.pd-stage-wrap { position: relative; }
.pd-slider {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  border-radius: 18px;
  outline: none;
}
.pd-slider::-webkit-scrollbar { display: none; }
.pd-slide {
  position: relative;
  flex: 0 0 100%;
  margin: 0;
  aspect-ratio: 4 / 3;            /* 穩定比例：載入不跳動 */
  scroll-snap-align: center;
  background: var(--pd-bg, #f7f5f1);
  overflow: hidden;
  cursor: zoom-in;
}
.pd-slide picture, .pd-slide img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
}
.pd-slide img {
  object-fit: var(--pd-fit, contain);
  object-position: var(--pd-x, 50%) var(--pd-y, 50%);
  transform: scale(var(--pd-scale, 1));
  transform-origin: var(--pd-x, 50%) var(--pd-y, 50%);
}
.pd-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 44px; height: 44px; border-radius: 50%;
  border: 1px solid var(--line, #e3e0da);
  background: rgba(255, 255, 255, 0.92);
  color: var(--text-charcoal, #2e2e2e);
  font-size: 22px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s ease;
}
.pd-nav:hover { background: #fff; }
.pd-nav.prev { left: 14px; }
.pd-nav.next { right: 14px; }

.pd-dots { display: none; justify-content: center; gap: 7px; margin-top: 12px; }
.pd-dot { width: 6px; height: 6px; border-radius: 50%; background: #d8d4cd; transition: background 0.2s; }
.pd-dot.on { background: var(--text-charcoal, #2e2e2e); }

.pd-thumbs {
  display: flex; gap: 10px; margin-top: 14px;
  overflow-x: auto; scrollbar-width: thin; padding-bottom: 4px;
}
.pd-thumb {
  flex: 0 0 76px; width: 76px; aspect-ratio: 4 / 3;
  border-radius: 10px; overflow: hidden; padding: 0;
  border: 1px solid var(--line, #e3e0da);
  background: #f7f5f1; cursor: pointer; opacity: 0.55;
  transition: opacity 0.2s ease, border-color 0.2s ease;
}
.pd-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pd-thumb.on, .pd-thumb:hover { opacity: 1; border-color: var(--text-charcoal, #2e2e2e); }
.pd-caption {
  margin: 10px 2px 0; font-size: 12.5px; font-weight: 300;
  color: var(--text-mid, #8a8a8a); min-height: 1.2em;
}

/* ── 右側摘要（瀏覽圖片時適度固定；grid align-start 讓它停在首屏內，不會遮頁尾） ── */
.pd-summary {
  position: sticky;
  top: calc(var(--header-height, 96px) + 24px);
}
.pd-title {
  font-family: var(--serif, 'Noto Serif TC', serif);
  font-weight: 500; font-size: 30px; line-height: 1.35;
  color: var(--text-charcoal, #2e2e2e);
  margin: 12px 0 10px;
}
.pd-title-en {
  display: block; font-family: var(--wide, 'Jost', sans-serif);
  font-size: 12px; letter-spacing: 0.22em; color: var(--text-mid, #8a8a8a);
  margin-top: 8px; font-weight: 400;
}
.pd-positioning { font-size: 15px; font-weight: 300; color: #6e6e6e; line-height: 1.9; margin: 0 0 18px; }
.pd-price {
  font-family: var(--wide, 'Jost', sans-serif);
  font-size: 21px; color: var(--text-charcoal, #2e2e2e); margin: 4px 0 2px;
}
.pd-price-note { font-size: 12px; color: var(--text-mid, #8a8a8a); font-weight: 300; margin: 4px 0 18px; }

.pd-opts { margin: 0 0 22px; border-top: 1px solid var(--line, #e3e0da); }
.pd-opt {
  display: grid; grid-template-columns: 84px 1fr; gap: 12px;
  padding: 10px 2px; border-bottom: 1px solid var(--line, #e3e0da);
  font-size: 13.5px; line-height: 1.7;
}
.pd-opt dt { color: var(--text-mid, #8a8a8a); font-weight: 300; }
.pd-opt dd { margin: 0; color: var(--text-charcoal, #2e2e2e); font-weight: 300; }

.pd-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.pd-actions .btn-dark, .pd-actions .btn-outline { min-height: 46px; }
.pd-copied { font-size: 12.5px; color: var(--text-mid, #8a8a8a); margin: 10px 0 0; }
.pd-journal {
  display: inline-block; margin-top: 20px; font-size: 13.5px;
  color: var(--text-charcoal, #2e2e2e); text-decoration: underline;
  text-underline-offset: 4px; text-decoration-color: #cfcbc4;
}
.pd-visit { font-size: 12.5px; font-weight: 300; color: var(--text-mid, #8a8a8a); line-height: 1.9; margin-top: 18px; }
.pd-visit a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.pd-visit a:hover { color: var(--text-charcoal, #2e2e2e); }

/* ── 內容區塊：窄欄、大量留白 ── */
.pd-content { max-width: 720px; margin: 70px auto 0; }
.pd-block { margin: 0 0 58px; }
.pd-block h2 {
  font-family: var(--serif, 'Noto Serif TC', serif);
  font-weight: 500; font-size: 21px; color: var(--text-charcoal, #2e2e2e);
  margin: 0 0 16px;
}
.pd-block p { font-size: 14.5px; font-weight: 300; line-height: 2.05; color: #5c5c5c; margin: 0 0 14px; }
.pd-features { list-style: none; margin: 0; padding: 0; }
.pd-features li {
  position: relative; padding: 10px 0 10px 22px;
  font-size: 14.5px; font-weight: 300; line-height: 1.9; color: #5c5c5c;
  border-bottom: 1px solid var(--line, #e3e0da);
}
.pd-features li::before { content: '—'; position: absolute; left: 0; color: #b9b4ab; }
.pd-specs { width: 100%; border-collapse: collapse; }
.pd-specs th, .pd-specs td {
  text-align: left; padding: 11px 4px; font-size: 13.5px; font-weight: 300;
  border-bottom: 1px solid var(--line, #e3e0da); line-height: 1.7; vertical-align: top;
}
.pd-specs th { width: 108px; color: var(--text-mid, #8a8a8a); font-weight: 300; }
.pd-specs td { color: var(--text-charcoal, #2e2e2e); }
.pd-note { font-size: 12.5px !important; color: var(--text-mid, #8a8a8a) !important; }

/* ── 內文區塊圖片（文字講到哪、圖放到哪） ── */
.pd-sec-imgs { display: grid; gap: 16px; margin-top: 22px; }
.pd-sec-imgs.two { grid-template-columns: 1fr 1fr; }
.pd-sec-img { margin: 0; }
.pd-sec-img img {
  display: block; width: 100%; height: auto;
  border-radius: 14px; background: #f7f5f1;
}
.pd-sec-img figcaption {
  font-size: 12.5px; font-weight: 300; color: var(--text-mid, #8a8a8a);
  margin-top: 8px; line-height: 1.7;
}
@media (max-width: 767px) {
  .pd-sec-imgs.two { grid-template-columns: 1fr; }
}

/* ── 商品影片「實際體驗」：直式原比例、不裁切；封面先行，點了才播 ── */
.pd-videos { max-width: 1240px; margin: 76px auto 0; text-align: center; }
.pd-videos .subcat-head { margin: 0 0 26px; }
.pd-vtrack { position: relative; display: flex; justify-content: center; gap: 28px; }
.pd-vcard { flex: 0 1 380px; max-width: 380px; min-width: 0; margin: 0; }
.pd-vbox {
  position: relative; width: 100%; aspect-ratio: 9 / 16;
  border-radius: 18px; overflow: hidden; background: #f7f5f1;
}
.pd-vbox > video, .pd-vbox > .pd-vposter {
  position: absolute; inset: 0; width: 100%; height: 100%;
  display: block; object-fit: contain; background: #f7f5f1;
}
.pd-vposter { pointer-events: none; transition: opacity 0.25s ease; }
.pd-vcard.is-playing .pd-vposter { opacity: 0; }
.pd-vplay {
  position: absolute; left: 50%; top: 50%; width: 68px; height: 68px; margin: -34px 0 0 -34px;
  display: grid; place-items: center; padding: 0; cursor: pointer;
  border-radius: 50%; border: 1px solid rgba(46, 46, 46, 0.1);
  background: rgba(255, 255, 255, 0.92); color: var(--text-charcoal, #2e2e2e);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, background 0.2s ease;
}
.pd-vplay svg { width: 26px; height: 26px; fill: currentColor; margin-left: 3px; }
.pd-vplay:hover { transform: scale(1.05); background: #fff; }
.pd-vplay:focus-visible { outline: 2px solid var(--text-charcoal, #2e2e2e); outline-offset: 3px; }
.pd-vcard.is-loading .pd-vplay svg { opacity: 0.25; }
.pd-vcard.is-loading .pd-vplay::after {
  content: ''; position: absolute; inset: 10px; border-radius: 50%;
  border: 2px solid rgba(46, 46, 46, 0.15); border-top-color: var(--text-charcoal, #2e2e2e);
  animation: pd-vspin 0.8s linear infinite;
}
@keyframes pd-vspin { to { transform: rotate(360deg); } }
.pd-vcard.is-playing .pd-vplay, .pd-vcard.is-error .pd-vplay { display: none; }
.pd-verr {
  position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); margin: 0;
  padding: 8px 16px; border-radius: 999px; white-space: nowrap;
  background: rgba(46, 46, 46, 0.78); color: #fff; font-size: 13px; font-weight: 300;
}
.pd-verr[hidden] { display: none; }
.pd-vcap { margin-top: 12px; font-size: 13px; font-weight: 300; color: var(--text-mid, #8a8a8a); }
.pd-vdots { display: none; }
.pd-vdot { width: 6px; height: 6px; border-radius: 50%; background: #d8d4cd; transition: background 0.2s; }
.pd-vdot.on { background: var(--text-charcoal, #2e2e2e); }
@media (prefers-reduced-motion: reduce) {
  .pd-vplay, .pd-vposter { transition: none; }
  .pd-vcard.is-loading .pd-vplay::after { animation-duration: 2.4s; }
}
@media (max-width: 767px) {
  .pd-videos { margin-top: 52px; }
  .pd-videos .subcat-head { margin-bottom: 18px; }
  .pd-vtrack {
    justify-content: flex-start; gap: 12px;
    overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
    scrollbar-width: none; -webkit-overflow-scrolling: touch;
  }
  .pd-vtrack::-webkit-scrollbar { display: none; }
  .pd-vtrack[data-count="1"] { justify-content: center; }
  .pd-vcard { flex: 0 0 100%; max-width: 420px; scroll-snap-align: center; }
  .pd-vbox { border-radius: 14px; }
  .pd-vdots { display: flex; justify-content: center; gap: 8px; margin-top: 14px; }
}

/* ── 相關商品／最近看過：沿用列表卡片樣式，整張卡是連結 ── */
.pd-related, .pd-recent { max-width: 1200px; margin: 40px auto 0; }
.pd-retired {
  border: 1px solid var(--line, #e3e0da); border-radius: 14px; background: #faf9f6;
  padding: 18px 22px; margin-bottom: 26px; font-size: 14px; font-weight: 300; color: #5c5c5c;
}
.prod-card__go { display: block; text-decoration: none; color: inherit; }

/* ── 放大檢視（點圖開啟） ── */
.pd-lightbox {
  position: fixed; inset: 0; z-index: 1200;
  background: rgba(20, 20, 20, 0.92);
  display: flex; align-items: center; justify-content: center;
}
.pd-lightbox img { max-width: 94vw; max-height: 90dvh; object-fit: contain; }
.pd-lightbox figcaption {
  position: absolute; left: 0; right: 0; bottom: 18px; text-align: center;
  color: #d8d4cd; font-size: 13px; font-weight: 300; padding: 0 20px;
}
.pd-lightbox .pd-lb-x {
  position: absolute; top: 16px; right: 16px; width: 44px; height: 44px;
  border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.35);
  background: transparent; color: #fff; font-size: 24px; cursor: pointer;
}

/* ── 平板以下 ── */
@media (max-width: 1023px) {
  .pd-hero { grid-template-columns: 1fr; gap: 30px; }
  .pd-summary { position: static; }
}

/* ── 手機 ── */
@media (max-width: 767px) {
  .pd-main { padding: calc(var(--header-height, 74px) + 20px) 18px 54px; }
  .pd-crumbs { margin-bottom: 16px; }
  .pd-slider { border-radius: 14px; }
  .pd-nav { display: none; }              /* 手機用滑的＋頁碼圓點 */
  .pd-dots { display: flex; }
  .pd-thumbs { display: none; }           /* 縮圖不擠滿手機畫面 */
  .pd-title { font-size: 24px; }
  .pd-content { margin-top: 48px; }
  .pd-block { margin-bottom: 44px; }
  .pd-actions { flex-direction: column; align-items: stretch; }
  .pd-actions .btn-dark, .pd-actions .btn-outline, .pd-actions .cmp-add {
    width: 100%; justify-content: center; text-align: center; min-height: 48px;
  }
}
