/* 3D 商品コンフィギュレーター ── 既定のスタイル。
   色と間隔は --pc-* で変えられます。`.pc` でも、その祖先（`:root` や `body`）でも構いません。
   既定値は使う場所ごとに `var(--pc-x, 既定値)` の形で持たせています。

   使える変数と既定値:
     --pc-bg: #faf8f3;        全体の下地
     --pc-fg: #1c1a15;        文字
     --pc-muted: #6a665d;     薄い文字
     --pc-brand: #4a6b7d;     選んだ状態・主ボタン
     --pc-on-brand: #ffffff;  主ボタンの文字
     --pc-line: rgba(28, 26, 21, 0.18);  枠線
     --pc-surface: #ffffff;   操作列の下地
     --pc-radius: 1rem;       角の丸み
     --pc-font: inherit;

   3D の中の色（背景・床）は CSS ではなく設定（scene）で渡します。 */

.pc {
  display: grid;
  gap: 1rem;
  color: var(--pc-fg, #1c1a15);
  background: var(--pc-bg, #faf8f3);
  font-family: var(--pc-font, inherit);
  line-height: 1.6;
}
.pc *, .pc *::before, .pc *::after { box-sizing: border-box; }
.pc [hidden] { display: none !important; }

@media (min-width: 60rem) {
  .pc { grid-template-columns: minmax(0, 3fr) minmax(18rem, 2fr); align-items: start; }
}

/* ---- 3D の枠 ---- */
.pc-stage {
  position: relative;
  aspect-ratio: 4 / 3;
  max-width: 100%;
  border-radius: var(--pc-radius, 1rem);
  overflow: hidden;
  border: 1px solid var(--pc-line, rgba(28, 26, 21, 0.18));
}
.pc-stage canvas { display: block; width: 100% !important; height: 100% !important; touch-action: none; }
.pc-stage-message {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 1rem;
  text-align: center;
  color: var(--pc-muted, #6a665d);
  pointer-events: none;
}
.pc-missing {
  position: absolute;
  left: 0.75rem;
  top: 0.75rem;
  margin: 0;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  border-radius: 0.5rem;
  background: rgba(255, 255, 255, 0.85);
  color: #8a2f2f;
}
.pc-hint {
  position: absolute;
  left: 0.75rem;
  right: 0.75rem;
  bottom: 0.5rem;
  margin: 0;
  font-size: 0.75rem;
  color: var(--pc-muted, #6a665d);
  pointer-events: none;
}

/* ---- 操作列 ---- */
.pc-panel {
  display: grid;
  gap: 1rem;
  padding: 1.25rem;
  border-radius: var(--pc-radius, 1rem);
  background: var(--pc-surface, #ffffff);
  border: 1px solid var(--pc-line, rgba(28, 26, 21, 0.18));
}
.pc-title { margin: 0; font-size: 1.125rem; font-weight: 700; }
.pc-group { margin: 0; padding: 0; border: 0; min-width: 0; }
.pc-group-title { padding: 0; margin-bottom: 0.5rem; font-size: 0.875rem; font-weight: 700; }
.pc-options { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.pc-chip, .pc-swatch, .pc-button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  border: 1px solid var(--pc-line, rgba(28, 26, 21, 0.18));
  border-radius: 999px;
  background: transparent;
  padding: 0.375rem 0.875rem;
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  line-height: 1.4;
}
.pc-chip[aria-pressed="true"], .pc-swatch[aria-pressed="true"] {
  border-color: var(--pc-brand, #4a6b7d);
  box-shadow: 0 0 0 2px var(--pc-brand, #4a6b7d) inset;
  font-weight: 700;
}
.pc-swatch-dot {
  width: 1.125rem;
  height: 1.125rem;
  border-radius: 50%;
  background: var(--pc-swatch, #888888);
  border: 1px solid rgba(28, 26, 21, 0.25);
}
.pc-option-price { font-size: 0.75rem; color: var(--pc-muted, #6a665d); white-space: nowrap; }

.pc-field { display: flex; align-items: center; gap: 0.5rem; }
.pc-input {
  flex: 1 1 auto;
  min-width: 0;
  font: inherit;
  color: inherit;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--pc-line, rgba(28, 26, 21, 0.18));
  border-radius: 0.5rem;
  background: var(--pc-surface, #ffffff);
}
.pc-input[aria-invalid="true"] { border-color: #8a2f2f; }
.pc-count { font-size: 0.75rem; color: var(--pc-muted, #6a665d); }
.pc-file { display: flex; align-items: center; gap: 0.5rem; font-size: 0.875rem; }
.pc-file input { font: inherit; max-width: 100%; }
.pc-preview { margin: 0.25rem 0 0; font-size: 0.8125rem; color: var(--pc-muted, #6a665d); }
.pc-link {
  font: inherit;
  font-size: 0.8125rem;
  color: var(--pc-brand, #4a6b7d);
  background: none;
  border: 0;
  padding: 0 0 0 0.5rem;
  cursor: pointer;
  text-decoration: underline;
}
.pc-error { margin: 0.25rem 0 0; font-size: 0.8125rem; color: #8a2f2f; }

/* ---- 価格とボタン ---- */
.pc-price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--pc-line, rgba(28, 26, 21, 0.18));
}
.pc-price-label { font-size: 0.875rem; color: var(--pc-muted, #6a665d); }
.pc-price-total { font-size: 1.5rem; }
.pc-price-delta, .pc-price-note { font-size: 0.8125rem; color: var(--pc-muted, #6a665d); }
.pc-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.pc-button { background: var(--pc-brand, #4a6b7d); color: var(--pc-on-brand, #ffffff); border-color: transparent; }
.pc-button:disabled { opacity: 0.5; cursor: not-allowed; }
.pc-button-quiet { background: transparent; color: inherit; border-color: var(--pc-line, rgba(28, 26, 21, 0.18)); }
.pc-notice { margin: 0; min-height: 1.5em; font-size: 0.8125rem; color: var(--pc-muted, #6a665d); }

.pc :focus-visible { outline: 2px solid var(--pc-brand, #4a6b7d); outline-offset: 2px; }
