/* 商品內頁（2026-11-19 新設計）
   照 Edwin 給的參考：左邊淺灰藍大圖、左上小縮圖；右邊名稱、規格膠囊、價格、按鈕、摺疊列
   共用的顏色、按鈕、選單在 front.css */

.th-pd { padding-bottom: 12px; }
.th-crumb { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 8px 0 20px; font-size: .8125rem; color: var(--soft); }
.th-crumb a { margin: 0 !important; padding: 0 !important; }
.th-crumb a:hover { color: var(--blue); }
.th-crumb [aria-current] { color: var(--ink); }
.th-pd__notices:empty { display: none; }
.th-pd__notices { margin-bottom: 16px; }

.th-pd__main { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(320px, 1fr); gap: clamp(24px, 3vw, 48px); align-items: start; }

/* 左：大圖 */
.th-pd__gallery { position: sticky; top: 16px; border-radius: var(--r-lg); background: #e3eaf2; aspect-ratio: 1 / .92; overflow: hidden; }
.th-pd__stage { position: absolute; inset: 0; display: grid; place-items: center; padding: clamp(32px, 6%, 72px); }
.th-pd__stage img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.th-pd__thumbs { position: absolute; z-index: 1; top: 16px; left: 16px; display: flex; gap: 8px; max-width: calc(100% - 32px); overflow-x: auto; scrollbar-width: none; }
.th-pd__thumb {
  flex: none; width: 76px; height: 76px; padding: 6px; border-radius: 14px; cursor: pointer;
  background-color: rgba(255, 255, 255, .55) !important; border: 1px solid rgba(15, 35, 64, .08);
  transition: border-color .3s var(--ease), background-color .3s var(--ease);
}
.th-pd__thumb img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.th-pd__thumb[aria-pressed="true"] { border-color: var(--ink); background-color: #fff !important; }
.th-pd__thumb:hover { background-color: #fff !important; }

/* 右：購買資訊 */
.th-pd__info { position: sticky; top: 16px; display: grid; gap: 22px; }
.th-pd__head { display: grid; gap: 10px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.th-pd__title { font-size: clamp(1.625rem, 2.3vw, 2.25rem); font-weight: 500; line-height: 1.3; letter-spacing: .01em; color: var(--ink); text-wrap: balance; }
.th-pd__title > span { display: block; }
.th-pd__title .th-soft { color: var(--soft-head); font-weight: 400; }

.th-pd__buy { display: grid; gap: 16px; }
.th-pd__opt { border: 0; margin: 0; padding: 0; min-width: 0; }
.th-pd__opt legend { padding: 0; margin-bottom: 8px; font-size: .8125rem; color: var(--soft); }
.th-pd__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.th .th-chip {
  min-height: 38px; padding: 0 14px; border-radius: 10px; cursor: pointer; font-size: .875rem;
  border: 1px solid rgba(15, 35, 64, .16); background-color: #fff !important; color: var(--ink) !important;
  transition: border-color .25s var(--ease), background-color .25s var(--ease), color .25s var(--ease);
}
.th .th-chip:hover { border-color: var(--ink); }
.th .th-chip[aria-pressed="true"] { background-color: var(--ink) !important; color: #fff !important; border-color: var(--ink); }
.th .th-chip:disabled { opacity: .38; cursor: not-allowed; text-decoration: line-through; }

.th-pd__price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px; padding-top: 6px; }
.th-pd__price .th-card__badge { align-self: center; order: 3; }
.th-pd__price strong { font-size: clamp(1.75rem, 2.4vw, 2.25rem); font-weight: 400; color: var(--ink); }
.th-pd__price del { font-size: .9375rem; color: var(--soft); }
.th-pd__hint { min-height: 1.4em; font-size: .8125rem; color: var(--blue); }
.th-pd__hint:empty { display: none; }

.th-pd__actions { display: grid; grid-template-columns: auto 1fr; gap: 8px; }
.th-qty { display: inline-flex; align-items: center; height: 52px; border-radius: 14px; border: 1px solid rgba(15, 35, 64, .16); background: #fff; }
.th .th-qty button { width: 44px; height: 100%; border: 0; cursor: pointer; font-size: 1.125rem; text-align: center; color: var(--ink) !important; }
.th-qty input { width: 44px; height: 100%; border: 0; text-align: center; font: 500 1rem 'Sora', sans-serif; color: var(--ink); background: transparent; -moz-appearance: textfield; }
.th-qty input::-webkit-outer-spin-button, .th-qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.th .th-pd__cart { min-height: 52px; border-radius: 14px; font-size: 1rem; background-color: var(--ink) !important; color: #fff !important; }
.th .th-pd__cart:hover:not(:disabled) { background-color: var(--blue) !important; }
.th .th-pd__now { min-height: 52px; width: 100%; border-radius: 14px; font-size: 1rem; border-color: rgba(15, 35, 64, .22); color: var(--ink) !important; }
.th .th-pd__now:hover:not(:disabled) { background-color: var(--mist) !important; }
.th .th-pd__buy button:disabled { opacity: .45; cursor: not-allowed; }

/* 摺疊列 */
.th-pd__more { display: grid; gap: 6px; }
.th-pd__more details { border-radius: 14px; background: #edf2f7; }
.th-pd__more summary {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 0 18px;
  font-size: .9375rem; font-weight: 500; color: var(--ink); cursor: pointer; list-style: none;
}
.th-pd__more summary::-webkit-details-marker { display: none; }
.th-pd__plus { position: relative; width: 14px; height: 14px; flex: none; }
.th-pd__plus::before, .th-pd__plus::after { content: ""; position: absolute; left: 0; top: 6px; width: 14px; height: 1.6px; background: var(--ink); transition: transform .3s var(--ease); }
.th-pd__plus::after { transform: rotate(90deg); }
.th-pd__more details[open] .th-pd__plus::after { transform: rotate(0); }
.th-pd__more details > :not(summary) { padding: 0 18px 18px; }
.th-pd__more details img { padding: 0 12px 12px; border-radius: 18px; }
.th-pd__sku { font-size: .8125rem; color: var(--soft); padding: 6px 4px 0; }

/* 商品規格、特色等後台填的文字 */
.th-pd__rich { color: var(--ink-2); font-size: .9375rem; line-height: 1.9; overflow-wrap: anywhere; }
.th-pd__rich :where(p, ul, ol) { margin: 0 0 .8em; }
.th-pd__rich :where(ul, ol) { padding-left: 1.2em; list-style: disc; }
.th-pd__rich img { max-width: 100%; height: auto; border-radius: 16px; margin: 12px auto; }
.th-pd__rich :where(h2, h3, h4) { margin: 1.4em 0 .6em; font-size: 1.125rem; font-weight: 500; color: var(--ink); }
.th-pd__rich a { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }
.th-pd__rich iframe { max-width: 100%; border-radius: 16px; }

/* 下方各段 */
.th-pd__jump {
  position: sticky; top: 8px; z-index: 5; display: flex; gap: 4px; margin-top: clamp(56px, 8vw, 104px); padding: 5px;
  width: max-content; max-width: calc(100% - 2 * var(--gutter)); overflow-x: auto; scrollbar-width: none;
  border-radius: 999px; background: rgba(255, 255, 255, .86); border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.th-pd__jump a { flex: none; padding: 10px 18px; border-radius: 999px; font-size: .9375rem; color: var(--ink-2); transition: background-color .3s var(--ease), color .3s var(--ease); }
.th-pd__jump a:hover, .th-pd__jump a.is-on { background: var(--blue); color: #fff; }
.th-pd__sec { scroll-margin-top: 80px; padding-top: clamp(48px, 6vw, 80px); display: grid; grid-template-columns: minmax(0, 15em) minmax(0, 1fr); gap: 24px; }
.th-pd__sec > .th-h2 { font-size: clamp(1.375rem, 2vw, 1.75rem); }
.th-pd__body { max-width: 860px; }
.th-pd__body > picture img { border-radius: var(--r-lg); }

/* 佈景原本的評論與問答區塊，配合新設計 */
.th .qa-section { margin: 0; padding: 0; max-width: none; }
.th .qa-list { display: grid; gap: 8px; margin: 0; }
.th .qa-item { border: 0; border-radius: 14px; background: #edf2f7; overflow: hidden; }
.th .qa-item:hover { box-shadow: none; }
.th .qa-question { display: flex; align-items: center; gap: 12px; padding: 16px 18px; background: transparent; cursor: pointer; }
.th .qa-question:hover { background: transparent; }
.th .qa-question-icon { width: 28px; height: 28px; flex: none; display: grid; place-items: center; border-radius: 50%; background: var(--blue); color: #fff; font: 500 .8125rem 'Sora', sans-serif; }
.th .qa-question-text { flex: 1; font-size: .9375rem; font-weight: 500; color: var(--ink); }
.th .qa-arrow svg { fill: var(--ink); }
.th .qa-answer { max-height: 0; overflow: hidden; transition: max-height .4s var(--ease); background: transparent; }
.th .qa-item.active .qa-answer { max-height: 1200px; }
.th .qa-answer-content { padding: 0 18px 18px 58px; border: 0; color: var(--ink-2); line-height: 1.85; }
.th .taincom-reviews-section { margin: 0; padding: 0; }
.th .taincom-review-form :where(input[type=text], input[type=email], textarea) { border: 1px solid rgba(15, 35, 64, .16) !important; border-radius: 12px !important; background: #fff; }
.th .taincom-review-form button[type=submit] { background-color: var(--ink) !important; color: #fff !important; border-radius: 999px !important; padding: 12px 24px !important; }
.th .taincom-review-form button[type=submit]:hover { background-color: var(--blue) !important; }
.th .taincom-reviews-section button.taincom-page-btn { color: var(--ink) !important; }

.th-pd__related { padding-top: clamp(72px, 9vw, 120px); }
.th-pd .th-cta { padding-top: clamp(72px, 9vw, 120px); }

@media (max-width: 1000px) {
  .th-pd__main { grid-template-columns: 1fr; }
  .th-pd__gallery { position: relative; top: auto; }
  .th-pd__info { position: static; }
  .th-pd__sec { grid-template-columns: 1fr; gap: 16px; }
}
@media (max-width: 760px) {
  .th-pd__gallery { margin: 0 calc(-1 * var(--gutter) + 8px); border-radius: 20px; aspect-ratio: 1 / 1.05; }
  .th-pd__thumbs { top: auto; bottom: 12px; left: 12px; }
  .th-pd__thumb { width: 60px; height: 60px; border-radius: 12px; }
  .th-pd__jump { top: 4px; }
  .th-pd__jump a { padding: 9px 14px; font-size: .875rem; }
  .th .qa-answer-content { padding-left: 18px; }
}
.th .taincom-reviews-section [style*="9ca3af"] { color: var(--soft) !important; } /* 舊評論區塊寫死的淺灰字太淡 */

/* 評論：星星是 WordPress 內建的圖示字型，不能被共用的「繼承字型」蓋掉 */
.th .dashicons, .th .dashicons::before { font-family: dashicons !important; }
/* 評論上傳鈕：瀏覽器預設是英文，改成中文膠囊按鈕 */
.th .taincom-upload { position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: 0 20px; border-radius: 999px; border: 1px solid rgba(46, 100, 164, .35); color: var(--blue); font-size: .9375rem; cursor: pointer; }
.th .taincom-upload:hover { background: var(--mist); }
.th .taincom-upload input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.th .taincom-upload:focus-within { outline: 2px solid var(--blue); outline-offset: 3px; }
