/* 「1セット〜」の見出しと、カタログの形の価格表。商品ナビの既存トークン(paper/line/accent/soft)だけを使う */
.set-price { background:var(--surface); border-left:2px solid var(--accent); padding:var(--space-md) var(--pad) }
.set-price p { margin:0 }
.set-label { font-size:var(--label-size); color:var(--ink-sub) }
.set-amount { font-size:var(--price-size); font-weight:700; line-height:1.4 }
.set-amount .unit { font-size:var(--label-size); font-weight:400; color:var(--ink-sub); margin-right:.6em }
.set-amount .yen { font-size:var(--label-size); font-weight:400; margin-left:.2em }
.set-spec { font-size:var(--label-size); color:var(--ink) }
.set-contents { font-size:var(--label-size) }
.set-from, .set-none { font-size:var(--source-size); color:var(--muted) }
.set-price.none .set-none { font-size:var(--label-size); color:var(--ink-sub) }
.set-hold { margin:var(--space-sm) 0 0; padding-left:1.2rem; font-size:var(--source-size); color:var(--muted) }
.cat-h { margin:var(--section-space) 0 var(--space-sm); font-size:1rem }
figure.catalog { margin:0 0 var(--space-md); background:var(--surface); border:1px solid var(--line); border-radius:var(--radius) }
figure.catalog figcaption { display:flex; flex-wrap:wrap; gap:.4rem 1rem; align-items:baseline;
    padding:var(--space-sm) var(--space-md); border-bottom:1px solid var(--line); background:var(--soft) }
figure.catalog .cap { font-weight:700; flex:1 1 20rem }
figure.catalog .tax, figure.catalog .legend { font-size:var(--source-size); color:var(--ink-sub) }
.mto-key { display:inline-block; width:1.4em; height:.9em; vertical-align:-.05em; margin-right:.3em;
    background:repeating-linear-gradient(135deg,var(--line) 0 2px,var(--surface) 2px 6px); border:1px solid var(--line) }
table.cat { font-variant-numeric:tabular-nums; font-size:.92rem }
table.cat th, table.cat td { border:1px solid var(--line); padding:.35rem .6rem }
table.cat thead th { text-align:center; vertical-align:bottom; line-height:1.4 }
table.cat td { text-align:right; white-space:nowrap }
table.cat thead th small, table.cat tbody th small { display:block; font-weight:400; font-size:var(--source-size); color:var(--muted) }
table.cat thead th.color { font-weight:400; font-size:var(--source-size); white-space:nowrap }
table.cat .corner { text-align:left; vertical-align:middle; font-weight:400; font-size:var(--source-size) }
table.cat tbody th { text-align:left; font-weight:400; background:var(--surface) }
table.cat tbody th.sec { writing-mode:vertical-rl; text-align:center; background:var(--paper); font-size:var(--source-size) }
table.cat tr.set-row th, table.cat tr.set-row td { font-weight:700; background:var(--paper); border-bottom:2px solid var(--accent) }
table.cat td.mto { background:repeating-linear-gradient(135deg,var(--line) 0 2px,var(--surface) 2px 6px) }
.sr { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); white-space:nowrap }
.cat-notes { margin:0; padding:var(--space-sm) var(--space-md) var(--space-sm) 2rem; font-size:var(--source-size); color:var(--ink-sub) }
.cat-source { display:flex; flex-wrap:wrap; gap:.3rem 1rem; margin:0; padding:var(--space-sm) var(--space-md);
    font-size:var(--source-size); color:var(--muted); border-top:1px solid var(--line) }
.cat-source .ok { color:var(--ink-sub) }
.cat-source .ok::before { content:"✓ "; color:var(--accent) }
.cat-source a { color:var(--ink-sub); font-size:var(--source-size); text-decoration:underline }
.cat-unnamed { margin:0; padding:var(--space-sm) var(--space-md); font-size:var(--source-size); color:var(--ink-sub) }
.cat-unnamed a { color:var(--ink-sub); text-decoration:underline }
.pending-body { padding:var(--space-md) var(--pad) }
.pending-body p { margin:.2rem 0 }
a.button { display:inline-block; margin-top:var(--space-sm); padding:var(--control-pad) var(--space-md);
    border:1px solid var(--accent); border-radius:var(--radius); text-decoration:none; color:var(--ink) }
.scroll-hint { display:none; margin:0; padding:var(--space-xs) var(--space-md) 0; font-size:var(--source-size); color:var(--muted) }

/* 縦に長い表は見出しを残す */
/* position: 受注生産品の読み上げ用の文字(absolute)を表の箱の中に留め、スマホでページが横に広がらないようにする */
figure.catalog .price-table { position:relative; max-height:85vh; overflow:auto }
table.cat thead { position:sticky; top:0; z-index:3 }
table.cat thead th { background:var(--soft) }
table.cat thead th.sec { writing-mode:vertical-rl; text-align:center; padding:.35rem .2rem }

/* スマホ幅: 左の区分(24px)と品番(96〜104px)の列を外寸(border-box)で固定し、価格が2列見えるようにする */
@media(max-width:600px) {
    .scroll-hint { display:block }
    table.cat th, table.cat td { padding:.3rem 4px }
    /* 価格の列を押し広げる下の段の見出し(色や柱の名前)は、小さい文字で文字の間でも折り返す(金額は折り返さない) */
    table.cat thead th[scope=col]:not(.corner) { white-space:normal; overflow-wrap:anywhere; font-size:var(--badge-size) }
    table.cat thead th[scope=colgroup] { white-space:normal }
    table.cat tbody th[scope=row], table.cat thead th.corner.code, table.cat thead th.corner:not(.sec):not(.code) {
        box-sizing:border-box; width:96px; min-width:96px; max-width:104px; white-space:normal; overflow-wrap:normal; word-break:normal }
    table.cat tbody th[scope=row] { position:sticky; left:0; z-index:1; box-shadow:1px 0 0 var(--line) }
    table.cat thead .corner:first-child { position:sticky; left:0; z-index:2; background:var(--soft) }
    table.cat th.sec { position:sticky; left:0; z-index:2; box-sizing:border-box; width:24px; min-width:24px; max-width:24px; padding:.3rem 2px }
    table.cat thead .corner.sec { text-orientation:upright; letter-spacing:0; line-height:1.15; font-size:var(--source-size) }
    table.cat tbody th.code { position:sticky; left:24px; z-index:1 }
    table.cat thead th.code { position:sticky; left:24px; z-index:4 }
    table.cat thead th.sec { z-index:4 }
    /* 横に動かして上の段が隠れても、下の段だけで何の列か分かるように。折り返して列の最小幅を押し広げない */
    table.cat thead th.color[data-top]::before { content:attr(data-top); display:block; white-space:normal; overflow-wrap:normal; word-break:normal;
        line-height:1.3; font-size:var(--badge-size); color:var(--ink-sub) }
    /* 下に固定の相談領域の高さ(上下の余白+ボタン+罫線+セーフエリア)。表の高さ・ページ下の余白・スクロールの停止位置で同じ値を使う */
    :root { --consult-h:calc(2*var(--fixed-pad) + 2*var(--control-pad) + 1.6rem + 1px + env(safe-area-inset-bottom, 0px)) }
    .consult, .consult-clearance { padding-bottom:calc(var(--fixed-pad) + env(safe-area-inset-bottom, 0px)) }
    html { scroll-padding-bottom:var(--consult-h) }
    figure.catalog .price-table { scroll-padding-bottom:var(--space-md);
        max-height:min(85vh, calc(100vh - var(--consult-h) - 2*var(--space-md)));
        max-height:min(85dvh, calc(100dvh - var(--consult-h) - 2*var(--space-md))) }
}
