/* 商品詳情頁樣式 */
.detail-main { max-width: 1120px; margin: 0 auto; padding: 32px 20px 64px; }

.breadcrumb { font-size: 13px; color: var(--ink-soft); margin-bottom: 24px; }
.breadcrumb a { color: var(--ink-soft); text-decoration: none; }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb span { color: var(--ink); }

.detail-layout {
  display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start;
}
.detail-img {
  width: 100%; border-radius: 20px; box-shadow: var(--shadow);
  aspect-ratio: 1; object-fit: cover;
  transition: opacity .25s ease;
}

/* 商品圖集縮略圖 */
.detail-thumbs {
  display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap;
}
.detail-thumb {
  width: 72px; height: 72px; padding: 0; border: 2px solid var(--border);
  border-radius: 12px; overflow: hidden; cursor: pointer; background: none;
  transition: border-color .15s ease, transform .15s ease;
}
.detail-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.detail-thumb:hover { transform: translateY(-2px); }
.detail-thumb.active { border-color: var(--primary); box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 25%, transparent); }
.detail-name { font-size: 30px; line-height: 1.3; margin: 8px 0 16px; }
.detail-price { font-size: 28px; font-weight: 700; color: var(--primary-dark); margin-bottom: 16px; }
.detail-desc { color: var(--ink-soft); margin-bottom: 24px; }

.detail-meta {
  border-top: 1px solid var(--border); padding-top: 18px; margin-bottom: 28px;
  display: grid; gap: 10px; font-size: 14px;
}
.detail-meta > div { display: flex; gap: 16px; }
.detail-meta dt { color: var(--ink-soft); min-width: 72px; }
.detail-meta dd { margin: 0; }
.detail-meta code { background: var(--bg); padding: 2px 8px; border-radius: 6px; font-size: 13px; }
.stock-in { color: var(--success); }
.stock-out { color: var(--ink-soft); }

.detail-actions { display: flex; gap: 12px; align-items: stretch; flex-wrap: wrap; }
.qty-picker {
  display: flex; align-items: center; border: 1px solid var(--border);
  border-radius: 12px; overflow: hidden; background: var(--surface);
}
.qty-picker button {
  width: 42px; height: 46px; border: none; background: none;
  font-size: 18px; color: var(--ink);
}
.qty-picker button:hover { background: var(--accent); }
.qty-picker span { min-width: 40px; text-align: center; font-weight: 600; }
#buy-now { background: var(--ink); color: #fff; }
#buy-now:hover { background: #000; }

.detail-missing { text-align: center; padding: 80px 0; display: grid; gap: 16px; justify-items: center; }
.detail-missing h2 { font-size: 24px; }
.detail-missing p { color: var(--ink-soft); }

.related { margin-top: 72px; }
.related .section-title { margin-bottom: 28px; }
.product-name a { color: inherit; text-decoration: none; }
.product-name a:hover { color: var(--primary); }
.product-card > a { display: block; }

/* 商品詳情區塊 */
.detail-content { margin-top: 72px; }
.detail-content .section-title { margin-bottom: 24px; }
.detail-content-body {
  background: var(--surface); border: 1px solid var(--border); border-radius: 20px;
  padding: 32px 36px; line-height: 1.9; color: var(--ink-soft); font-size: 15px;
}
.detail-content-body h2, .detail-content-body h3, .detail-content-body h4 {
  color: var(--ink); margin: 22px 0 10px; line-height: 1.4;
}
.detail-content-body h2:first-child, .detail-content-body h3:first-child, .detail-content-body h4:first-child { margin-top: 0; }
.detail-content-body h3 { font-size: 19px; }
.detail-content-body p { margin: 10px 0; }
.detail-content-body ul, .detail-content-body ol { padding-left: 22px; margin: 10px 0; }
.detail-content-body li { margin: 6px 0; list-style: disc; }
.detail-content-body ol li { list-style: decimal; }
.detail-content-body strong { color: var(--ink); }
.detail-content-body img { max-width: 100%; border-radius: 14px; margin: 12px 0; }
.detail-content-body table { border-collapse: collapse; width: 100%; margin: 14px 0; font-size: 14px; }
.detail-content-body th, .detail-content-body td { border: 1px solid var(--border); padding: 10px 14px; text-align: left; }
.detail-content-body th { background: var(--bg); color: var(--ink); }

@media (max-width: 800px) {
  .detail-layout { grid-template-columns: 1fr; gap: 24px; }
  .detail-name { font-size: 24px; }
}
