@charset "UTF-8";

/* 商品詳細ページ（issue #14）。WooCommerce の商品を templates/single-product.html と product-detail ブロックで出す。
   設計図の画面は無く、お客様の資料（新版フィードバック 221026 の第26ページ）の参考図をもとにした。
   左に画像（メイン画像とサムネイルの帯）、右に品名・型番・説明・見積りボタン、下に関連製品を並べる。
   編集画面は全ページの CSS を同時に読むので、クラスは pd と pd-related で始めて、ほかのページと重ならないようにしている。 */

.pd { padding-block: 72px 96px; }

.pd__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}

/* ---------- 画像 ---------- */
.pd__stage {
  overflow: hidden;
  border-radius: var(--r-md);
  background: var(--c-panel-alt);
}
.pd__main {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: contain;
}

.pd__thumbs {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  padding: 0;
  list-style: none;
  /* 狭い幅では横にはみ出さないよう、折り返して並べる */
  flex-wrap: wrap;
}
.pd__thumbs li { flex: 0 0 auto; }
.pd__thumb {
  display: block;
  width: 76px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: var(--r-sm);
  background: var(--c-panel-alt);
  overflow: hidden;
  cursor: pointer;
  transition: border-color .18s ease, opacity .18s ease;
}
.pd__thumb img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
}
.pd__thumb:hover { opacity: .8; }
.pd__thumb[aria-pressed="true"] { border-color: var(--c-blue); }

/* ---------- 品名・型番・説明 ---------- */
.pd__name {
  font-size: clamp(22px, 2.2vw, 30px);
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: .08em;
  color: var(--c-ink);
}
.pd__model {
  margin-top: 4px;
  font-size: clamp(26px, 2.8vw, 38px);
  line-height: 1.3;
  letter-spacing: .04em;
  color: var(--c-blue);
}

.pd__desc {
  margin-top: 32px;
  font-size: 16px;
  line-height: 1.8;
  letter-spacing: .04em;
  color: var(--c-ink-body);
}
.pd__desc :is(h2, h3, h4) {
  margin-top: 20px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.8;
  color: var(--c-ink);
}
.pd__desc > :first-child { margin-top: 0; }
.pd__desc p + p { margin-top: 12px; }
.pd__desc :is(ul, ol) { padding-left: 1.4em; }
.pd__desc img { max-width: 100%; height: auto; }

.pd__actions { margin-top: 40px; }
.pd__quote { min-width: 240px; min-height: 54px; }

/* ---------- 関連製品 ---------- */
.pd-related { margin-top: 96px; }
.pd-related__title {
  font-size: clamp(22px, 2.4vw, 32px);
  font-weight: 500;
  line-height: 1.5;
  letter-spacing: .1em;
  text-align: center;
  color: var(--c-ink);
}
.pd-related__list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(0, 300px));
  justify-content: center;
  gap: 32px 24px;
  margin-top: 40px;
  padding: 0;
  list-style: none;
}
.pd-related__card {
  display: flex;
  flex-direction: column;
  color: inherit;
  text-decoration: none;
}
.pd-related__photo {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--r-sm);
  background: var(--c-panel-alt);
  transition: opacity .18s ease;
}
.pd-related__card:hover .pd-related__photo { opacity: .85; }
.pd-related__name {
  margin-top: 12px;
  font-size: 15px;
  line-height: 1.6;
  letter-spacing: .04em;
  color: var(--c-ink);
}
.pd-related__model {
  font-size: 17px;
  line-height: 1.5;
  color: var(--c-ink);
}
.pd-related__card:hover .pd-related__name { color: var(--c-blue); }

/* 編集画面の見本（テンプレートの編集画面では、商品の内容の代わりに置き場所だけを示す） */
.pd__placeholder {
  display: grid;
  place-items: center;
  min-height: 120px;
  padding: 16px;
  font-size: 14px;
  text-align: center;
  color: var(--c-ink-faint);
}
.pd__stage.pd__placeholder { aspect-ratio: 3 / 2; }

/* ============================================================
   タブレット以下（1024px 以下）：画像を上、説明を下に重ねる
   ============================================================ */
@media (max-width: 1024px) {
  .pd { padding-block: 48px 72px; }
  .pd__grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .pd-related { margin-top: 72px; }
  .pd-related__list { grid-template-columns: repeat(auto-fit, minmax(0, 220px)); }
}

/* ============================================================
   スマートフォン（767px 以下）
   ============================================================ */
@media (max-width: 767px) {
  .pd { padding-block: 32px 56px; }
  .pd__thumb { width: 60px; }
  .pd__desc { margin-top: 24px; font-size: 15px; }
  .pd__actions { margin-top: 32px; }
  .pd__quote { width: 100%; }
  .pd-related { margin-top: 56px; }
  .pd-related__list { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 16px; margin-top: 24px; }
}
