/* ==========================================================================
   stepwise-common-2026.css
   全商品の price-v2/*-stepwise.html で読み込む共通スタイル。
   pamphlet-stepwise の改修 (2026-05-08) で確定したルックを全商品に展開する。

   - マトリックスのセル右寄せ / 価格水色 / ホバー時 primary 塗り + 白文字
   - マトリックスの内枠スクロール廃止 (ページ全体で縦スクロール)
   - マトリックス周りの枠線 / 影 / 角丸 / padding を撤去
   - タイトル: 大きく + 左縦バー + マージン拡大 (下線は使わない)
   - 左 spec パネル: 各項目に区切り線 + クリック領域拡張
   - 左サイド画像エリア (商品画像/サイズ画像) の枠
   - ホバー価格パネル: aside 幅で画面下に fixed 追従、薄ピンクヘッダ
   - ホバー時「注文へ →」ヒントを左下へ移動
   - スマホ (≤768px) ではホバーパネル非表示
   ========================================================================== */

/* ----------------------------------------------------------------
   左サイド spec aside の余白とトップ揃え
   ---------------------------------------------------------------- */
.tsw-spec {
  padding: 0 18px;
  display: flex;
  flex-direction: column;
}
.tsw-spec__title {
  padding-left: 4px;
}
.tsw-spec__list { flex: 0 0 auto; }
.tsw-spec__change-all { flex: 0 0 auto; }

@media (max-width: 768px) {
  .tsw-spec { padding: 0 4px; }
}

/* 左サイドの仕上がり画像 (商品によっては存在しない) */
.tsw-spec__image {
  margin: 0 0 18px;
  padding: 0;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  display: block;
  box-shadow: 0 0 0 1px rgba(180, 140, 140, .12);
}
.tsw-spec__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: right center;
  display: block;
}

/* ----------------------------------------------------------------
   選択中の仕様パネル — 各項目に区切り線 + クリック領域拡張
   ---------------------------------------------------------------- */
.tsw-spec__list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.tsw-spec__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  cursor: pointer;
  border: 0;
  background: linear-gradient(180deg, transparent calc(100% - 1px), rgba(199, 139, 139, .18) calc(100% - 1px));
  transition: background-color .12s ease;
}
.tsw-spec__item:first-child {
  background: linear-gradient(180deg, rgba(199, 139, 139, .18) 1px, transparent 1px) ,
              linear-gradient(180deg, transparent calc(100% - 1px), rgba(199, 139, 139, .18) calc(100% - 1px));
}
.tsw-spec__item:hover {
  background: linear-gradient(180deg, transparent calc(100% - 1px), rgba(199, 139, 139, .18) calc(100% - 1px)),
              rgba(199, 139, 139, .06);
}
.tsw-spec__num {
  flex: 0 0 28px;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--c-primary, #c78b8b);
  color: #fff;
  font-size: .76rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.tsw-spec__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.tsw-spec__label {
  font-size: .7rem;
  color: var(--c-text-muted);
  font-weight: 500;
  letter-spacing: .04em;
}
.tsw-spec__val {
  font-size: .92rem;
  font-weight: 700;
  color: var(--c-text);
  line-height: 1.3;
}
.tsw-spec__edit {
  flex: 0 0 auto;
  font-size: .72rem;
  color: var(--c-primary-ink, #b14f6a);
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(199, 139, 139, .12);
}
.tsw-spec__item:hover .tsw-spec__edit {
  background: var(--c-primary, #c78b8b);
  color: #fff;
}

/* ----------------------------------------------------------------
   マトリックスの内枠スクロール廃止 + 周りの border/shadow 撤去
   ---------------------------------------------------------------- */
.tsw-matrix-wrap,
#tswMatrixWrap {
  max-height: none !important;
  overflow: visible !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
}
/* matrix-scroll は overflow を完全に visible にする
   (overflow-x: auto を残すとスクロールコンテナとなり、
    内部 thead の position: sticky がページスクロールに対して効かなくなる) */
.tsw-matrix-wrap .matrix-scroll {
  max-height: none !important;
  overflow: visible !important;
  border: 0 !important;
  box-shadow: none !important;
  border-radius: 0 !important;
}
.tsw-matrix-scroll-hint { display: none !important; }
.tsw-matrix-note { color: var(--c-text-muted); font-size: .8rem; }

/* ----------------------------------------------------------------
   価格表タイトル — 大きく / 左にアクセント縦バー / マージン拡大
   ---------------------------------------------------------------- */
.tsw-matrix-head {
  margin: 0 0 28px;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  position: relative;
}
.tsw-matrix-title {
  font-size: clamp(1.5rem, 2.6vw, 2.1rem) !important;
  font-weight: 700;
  line-height: 1.3;
  margin: 0 !important;
  color: var(--c-text);
  font-family: var(--font-serif, "Noto Serif JP", serif);
  padding-left: 18px;
  position: relative;
}
.tsw-matrix-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 8%;
  bottom: 8%;
  width: 4px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--c-primary, #c78b8b) 0%, var(--c-primary-ink, #b14f6a) 100%);
}
.tsw-matrix-title em {
  font-style: normal;
  color: var(--c-primary-ink, #b14f6a);
}
.tsw-matrix-hint {
  font-size: .78rem;
  color: var(--c-text-muted);
}
#priceMatrixContainer {
  margin-top: 10px;
}

/* 左サイドと右マトリックスの上ラインを揃える */
.tsw-grid {
  align-items: start;
}
.tsw-spec__image,
#tswMatrixWrap {
  margin-top: 0 !important;
}
#tswMatrixWrap .tsw-matrix-head {
  margin-top: 0 !important;
  padding-top: 0;
  min-height: 48px;
}

/* ----------------------------------------------------------------
   価格マトリックスのセル右寄せ + 水色 + ホバー強調
   ---------------------------------------------------------------- */
.price-matrix-table .matrix-cell {
  text-align: right !important;
  padding-right: 14px !important;
}
.price-matrix-table .matrix-price {
  color: #2b9bd1 !important;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.price-matrix-table .matrix-cell.is-hovered-col,
.price-matrix-table .matrix-lt-header.is-hovered-col {
  background: rgba(199, 139, 139, .26) !important;
}
.price-matrix-table .matrix-cell.is-hovered-row,
.price-matrix-table .matrix-qty-header.is-hovered-row {
  background: rgba(199, 139, 139, .26) !important;
}
.price-matrix-table .matrix-cell.is-hovered-col.is-hovered-row {
  background: rgba(199, 139, 139, .42) !important;
}
.price-matrix-table .matrix-cell:hover {
  background: var(--c-primary, #c78b8b) !important;
  cursor: pointer;
}
.price-matrix-table .matrix-cell:hover .matrix-price {
  color: #fff !important;
}

/* ホバー時の「注文へ →」ヒントは右下→左下へ */
.price-matrix-table .matrix-cell .tsw-cta-hint {
  right: auto !important;
  left: 8px !important;
  bottom: 3px !important;
  text-align: left;
}

/* ----------------------------------------------------------------
   ホバー価格パネル — 画面下に fixed (JS で aside の left/width に同期)
   ---------------------------------------------------------------- */
.tsw-hover-panel--sticky {
  position: fixed;
  bottom: 16px;
  z-index: 50;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow:
    0 14px 36px rgba(140, 90, 90, .18),
    0 4px 10px rgba(140, 90, 90, .10),
    0 0 0 1px rgba(199, 139, 139, .16);
  font-size: .88rem;
  /* JS が left/width を埋める。フォールバックで左下固定 */
  left: 24px;
  width: 280px;
  max-width: calc(100vw - 48px);
}

.tsw-hover-panel--sticky .tsw-hover-panel__head {
  margin: 0;
  padding: 6px 14px;
  background: linear-gradient(135deg, #f4cfd3 0%, #e9b6bd 100%);
  color: var(--c-primary-ink, #b14f6a);
  font-weight: 700;
  font-size: .9rem;
  letter-spacing: .02em;
  line-height: 1.4;
}
.tsw-hover-panel--sticky .tsw-hover-panel__sep {
  margin: 0 6px;
  opacity: .6;
}

.tsw-hover-panel--sticky .tsw-hover-panel__rows {
  padding: 8px 14px 10px;
}
.tsw-hover-panel--sticky .tsw-hover-panel__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 3px 0;
  font-size: .8rem;
}
.tsw-hover-panel--sticky .tsw-hover-panel__label {
  color: var(--c-text-muted);
}
.tsw-hover-panel--sticky .tsw-hover-panel__value {
  color: var(--c-text);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.tsw-hover-panel--sticky .tsw-hover-panel__row--total {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid rgba(199, 139, 139, .25);
}
.tsw-hover-panel--sticky .tsw-hover-panel__row--total .tsw-hover-panel__label {
  color: var(--c-text);
  font-weight: 600;
}
.tsw-hover-panel--sticky .tsw-hover-panel__row--total .tsw-hover-panel__label small {
  font-weight: 400;
  color: var(--c-text-muted);
  font-size: .68rem;
}
.tsw-hover-panel--sticky .tsw-hover-panel__value--total {
  color: #c9303f !important;
  font-size: 1.06rem !important;
  font-weight: 800 !important;
}
/* foot: 税込・送料無料を一行 (横並び) */
.tsw-hover-panel--sticky .tsw-hover-panel__foot {
  margin-top: 6px;
  display: flex;
  flex-direction: row;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  font-size: .68rem;
  color: var(--c-text-muted);
  line-height: 1.3;
}
.tsw-hover-panel--sticky .tsw-hover-panel__shipping {
  color: var(--c-primary-ink, #b14f6a);
  font-weight: 600;
  text-align: right;
}
.tsw-hover-panel--sticky .tsw-hover-panel__hint {
  margin: 0;
  font-size: .74rem;
  color: var(--c-text-muted);
  text-align: center;
  padding: 12px 12px;
  line-height: 1.5;
}
/* hint と rows の出し分け */
.tsw-hover-panel[data-state="empty"] .tsw-hover-panel__head,
.tsw-hover-panel[data-state="empty"] .tsw-hover-panel__rows {
  display: none;
}
.tsw-hover-panel:not([data-state="empty"]) .tsw-hover-panel__hint {
  display: none;
}

/* スマホでは hover panel 非表示 */
@media (max-width: 768px) {
  .tsw-hover-panel--sticky { display: none !important; }
}

/* ----------------------------------------------------------------
   マトリックス: ヘッダ行 (thead) をスクロール時に上部固定
   ---------------------------------------------------------------- */
.price-matrix-table thead th {
  position: sticky;
  top: 0;
  z-index: 10;
  background: #fff;
  box-shadow: 0 1px 0 rgba(199, 139, 139, .25);
}
.price-matrix-table thead th.matrix-corner {
  z-index: 11;
}
/* 1列目の qty ヘッダも sticky で左固定 (横スクロール時用) */
.price-matrix-table .matrix-qty-header {
  position: sticky;
  left: 0;
  z-index: 8;
  background: #fff;
  box-shadow: 1px 0 0 rgba(199, 139, 139, .15);
}
.price-matrix-table thead th.matrix-corner {
  position: sticky;
  left: 0;
  top: 0;
  z-index: 12;
  background: #fff;
}

/* ----------------------------------------------------------------
   画像エリア placeholder (画像未設定の商品で使用)
   ---------------------------------------------------------------- */
.tsw-spec__image[data-has-image="false"] img,
.tsw-spec__image img[src=""],
.tsw-spec__image img:not([src]),
.tsw-spec__image img[src="#"] {
  display: none !important;
  visibility: hidden;
}
.tsw-spec__image-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  text-align: center;
  background:
    repeating-linear-gradient(45deg, rgba(176,136,104,.08) 0 8px, transparent 8px 16px),
    linear-gradient(135deg, #fbf3ee 0%, #f7e8df 100%);
  color: #6e5544;
  padding: 16px;
  gap: 6px;
}
.tsw-spec__image-placeholder strong {
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .04em;
  color: #b14f6a;
}
.tsw-spec__image-placeholder small {
  font-size: 11px;
  color: #6e5544;
  line-height: 1.4;
}
.tsw-spec__image[data-has-image="true"] .tsw-spec__image-placeholder {
  display: none;
}
