/* 裏物 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-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-dim {
  margin: 0; padding: 30px 28px 22px;
  background: #faf9f6; border: 1px solid var(--line, #e3e0da);
  border-radius: 16px;
}
.pd-dim-official img, .pd-dim-official picture { display: block; width: 100%; height: auto; border-radius: 10px; }
.pd-dim-grid {
  display: grid; grid-template-columns: minmax(0, 1fr);
  gap: 12px 16px; max-width: 620px; margin: 0 auto;
  grid-template-areas: "photo" "railh";
}
.pd-dim-photo { grid-area: photo; }
.pd-dim-photo img, .pd-dim-photo picture { display: block; width: 100%; height: auto; border-radius: 10px; }
/* 標線：細線＋兩端刻度，貼著照片的邊 */
.pd-dim-rail-h { grid-area: railh; position: relative; height: 34px; }
.pd-dim-rail-h i {
  position: absolute; left: 0; right: 0; top: 8px; height: 1px; background: #9a948b;
}
.pd-dim-rail-h i::before, .pd-dim-rail-h i::after {
  content: ''; position: absolute; top: -5px; width: 1px; height: 11px; background: #9a948b;
}
.pd-dim-rail-h i::before { left: 0; }
.pd-dim-rail-h i::after { right: 0; }
.pd-dim-rail-h span {
  position: absolute; left: 50%; top: 14px; transform: translateX(-50%);
  font-family: var(--wide, 'Jost', sans-serif); font-size: 13px; color: #6e6e6e;
  background: #faf9f6; padding: 0 10px; white-space: nowrap;
}
.pd-dim-chips {
  text-align: center; font-family: var(--wide, 'Jost', sans-serif);
  font-size: 13px; color: #6e6e6e; margin: 14px 0 0;
}

/* ── 相關商品／最近看過：沿用列表卡片樣式，整張卡是連結 ── */
.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;
  }
}
