/* Product page */
.product { max-width: var(--max); margin: 0 auto; padding: var(--s5) var(--gutter) var(--s8); }
.product-grid { display: grid; gap: var(--s6); grid-template-columns: minmax(0, 1fr); }
/* minmax(0, ...) + min-width 0: a long thumbnail strip (it scrolls on its own) must not widen the column past the viewport */
.product-grid > * { min-width: 0; }
@media (min-width: 900px) {
  .product-grid { grid-template-columns: minmax(0, 58fr) minmax(0, 42fr); gap: var(--s7); align-items: start; }
  .pi-sticky { position: sticky; top: calc(var(--header-h) + var(--s5)); }
}

/* gallery */
.pg-main { position: relative; background: var(--bg-2); }
.pg-slide[hidden] { display: none; }
.pg-slide .pic, .pg-slide .img-ph { aspect-ratio: 4 / 5; width: 100%; }
.pg-fit .pic { background-image: none !important; }   /* the LQIP is cover-sized: blobs around a contained image */
.pg-fit .pic img { object-fit: contain; }
.pg-thumbs { list-style: none; margin: var(--s3) 0 0; padding: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(64px, 1fr);
  gap: var(--s2); overflow-x: auto; scrollbar-width: none; }
.pg-thumbs::-webkit-scrollbar { display: none; }
.pg-thumb { display: block; width: 100%; opacity: .55; transition: opacity var(--dur) var(--ease); border-radius: var(--radius); }
.pg-thumb:hover, .pg-thumb[aria-current="true"] { opacity: 1; }
.pg-thumb .pic, .pg-thumb .img-ph { aspect-ratio: 1; }
.pg-empty .pg-ph { aspect-ratio: 4 / 5; display: grid; place-items: center; border: 1px solid var(--line);
  background: radial-gradient(55% 45% at 50% 45%, color-mix(in srgb, var(--swatch) 55%, transparent), transparent 75%), var(--bg-2); }
.pg-ph span { color: var(--fg-dim); font-size: 13px; letter-spacing: .08em; }
.pg-caption { margin-top: var(--s3); font: 500 11px/1.4 var(--font-ui); letter-spacing: .16em; text-transform: uppercase; color: var(--fg-dim); }

/* info */
.pi-name { font-size: clamp(40px, 5vw, 64px); }
.pi-dims { margin-top: var(--s3); color: var(--fg-dim); font-size: 14px; font-variant-numeric: tabular-nums; }
.pi-sep { margin: 0 .35em; }
.pi-price-row { margin-top: var(--s5); display: flex; align-items: center; gap: var(--s4); }
.pi-price { font-family: var(--font-display); font-size: 36px; line-height: 1; font-variant-numeric: tabular-nums lining-nums; }
[data-price] { transition: opacity 180ms var(--ease); }
[data-price].is-fading { opacity: 0; }
.tag { display: inline-block; padding: 4px 8px; border: 1px solid var(--line); border-radius: 999px;
  font: 500 10px/1 var(--font-ui); letter-spacing: .14em; text-transform: uppercase; color: var(--fg-dim); vertical-align: middle; }
.tag-tbd { border-color: rgba(201,138,75,.5); color: var(--accent); }

.wood { margin: var(--s5) 0 0; padding: 0; border: 0; min-width: 0; }
.wood-legend { padding: 0; margin-bottom: var(--s3); font: 500 11px/1.4 var(--font-ui); letter-spacing: .16em; text-transform: uppercase; color: var(--fg-dim); }
.wood-chips { display: flex; flex-wrap: wrap; gap: var(--s2); }
.chip { position: relative; display: inline-flex; align-items: center; gap: var(--s2); min-height: 44px; padding: 0 var(--s4) 0 var(--s2);
  border: 1px solid var(--line); border-radius: 999px; cursor: pointer; font-size: 14px;
  transition: border-color var(--dur) var(--ease), background-color var(--dur) var(--ease); }
.chip:hover { border-color: rgba(239,230,216,.3); }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
/* wood swatch (2026-10-27): a real crop of the board the lamps are rendered from (site/static/wood/, scripts/wood-swatches.mjs),
   over the flat colour (--c) as fallback while it loads. Default = 36 px circle, colour-graded "mid" crop (60 mm of wood),
   oiled sheen. Dev builds: keys 1-0 on a product page try other sizes / crops / shapes (js/devwood.js sets html[data-sw-*]). */
.chip-disc { position: relative; overflow: hidden; width: var(--sw, 36px); height: var(--sw, 36px); border-radius: var(--sw-r, 50%); flex: none;
  background: var(--c) center / cover no-repeat; box-shadow: inset 0 0 0 1px rgba(255,255,255,.14); }
.chip-disc[data-disc="maple"] { background-image: url(/wood/maple-mid-g.webp); }
.chip-disc[data-disc="walnut"] { background-image: url(/wood/walnut-mid-g.webp); }
.chip-disc[data-disc="mahogany"] { background-image: url(/wood/mahogany-mid-g.webp); }
.chip-disc::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(120% 90% at 28% 18%, rgba(255,255,255,.26), rgba(255,255,255,.05) 42%, rgba(0,0,0,.2) 100%);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.12), inset 0 -2px 4px rgba(0,0,0,.35); }
html[data-sw-sheen="0"] .chip-disc::after { display: none; }
html[data-sw-plain="1"] .chip-disc { background-image: none !important; }
.chip-price { color: var(--fg-dim); font-variant-numeric: tabular-nums; margin-left: .25em; }
.chip:has(input:checked) { border-color: var(--fg); background: rgba(239,230,216,.06); }
.chip:has(input:checked) .chip-price { color: var(--fg); }
.chip:has(input:focus-visible) { outline: 1.5px solid var(--accent); outline-offset: 3px; }
.wood-current { display: none; font-size: 14px; color: var(--fg); white-space: nowrap; }
.wood-current small { color: var(--fg-dim); font-variant-numeric: tabular-nums; margin-left: .35em; }
/* ---- dev picker layouts (html[data-sw-layout], js/devwood.js). Each chip also carries --chip-img (its wood). ---- */
/* shared: a cream check badge on the chosen wood (layouts opt in with data-sw-check) */
html[data-sw-check="1"] .chip:has(input:checked) .chip-disc::before { content: ''; position: absolute; right: 4px; bottom: 4px; width: 16px; height: 16px; border-radius: 50%; z-index: 1;
  background: var(--fg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2 5 8.6l4.5-5' fill='none' stroke='%230a0907' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 11px no-repeat;
  box-shadow: 0 1px 3px rgba(0,0,0,.5); }
.chip[data-wood="maple"] { --ink: #2a2016; --ink-dim: rgba(42,32,22,.7); } .chip { --ink: #fff; --ink-dim: rgba(255,255,255,.8); }
/* 1 squares (compact): 40 px rounded wood squares, name + price once */
html[data-sw-layout="squares"] .wood-legend, html[data-sw-layout="hero"] .wood-legend, html[data-sw-layout="bare"] .wood-legend, html[data-sw-layout="swap"] .wood-legend { display: none; }
html[data-sw-layout="squares"] .wood, html[data-sw-layout="hero"] .wood, html[data-sw-layout="bare"] .wood, html[data-sw-layout="swap"] .wood { margin-top: var(--s4); }
html[data-sw-layout="squares"] .wood-chips { align-items: center; gap: 6px; }
html[data-sw-layout="squares"] .chip, html[data-sw-layout="squares"] .chip:has(input:checked) { padding: 0; border: 0; min-height: 0; background: none; border-radius: 9px; }
html[data-sw-layout="squares"] .chip-disc { --sw: 40px; --sw-r: 9px; }
html[data-sw-layout="squares"] .chip:has(input:checked) .chip-disc { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--fg); }
html[data-sw-layout="squares"] .chip-label, html[data-sw-layout="hero"] .chip-label, html[data-sw-layout="swap"] .chip:not(:has(input:checked)) .chip-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
html[data-sw-layout="squares"] .wood-current { display: inline; margin-left: 2px; }
/* 2 coins: 44 px wood circles with the name under each */
html[data-sw-layout="coins"] .wood-chips { gap: 14px; }
html[data-sw-layout="coins"] .chip, html[data-sw-layout="coins"] .chip:has(input:checked) { flex-direction: column; gap: 6px; padding: 0; border: 0; min-height: 0; background: none; border-radius: 10px; width: 64px; text-align: center; }
html[data-sw-layout="coins"] .chip-disc { --sw: 48px; }
html[data-sw-layout="coins"] .chip:has(input:checked) .chip-disc { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--fg); }
html[data-sw-layout="coins"] .chip-label { font-size: 12px; line-height: 1.25; color: var(--fg-dim); display: flex; flex-direction: column; }
html[data-sw-layout="coins"] .chip:has(input:checked) .chip-label { color: var(--fg); }
html[data-sw-layout="coins"] .chip-price { margin: 0; font-size: 11px; }
/* 3 swap (compact): one pill shows the chosen wood (flush left end), tap it to open the other two */
html[data-sw-layout="swap"] .chip { padding-left: 0; overflow: hidden; gap: 10px; min-height: 44px; }
html[data-sw-layout="swap"] .chip-disc { --sw: 44px; width: 52px; border-radius: 0; box-shadow: none; -webkit-mask-image: linear-gradient(90deg, #000 70%, transparent); mask-image: linear-gradient(90deg, #000 70%, transparent); }
html[data-sw-layout="swap"] .wood:not(.is-open) .chip:not(:has(input:checked)) { display: none; }
html[data-sw-layout="swap"] .wood:not(.is-open) .chip:has(input:checked) .chip-label::after { content: ''; display: inline-block; width: 7px; height: 7px; margin: 0 2px 2px 10px; border: solid var(--fg-dim); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
html[data-sw-layout="swap"] .wood.is-open .chip:not(:has(input:checked)) .chip-label { position: static; width: auto; height: auto; clip: auto; }
/* 4 tile (kept): a card with the wood across the top, name and price under */
html[data-sw-layout="tile"] .chip { flex-direction: column; align-items: stretch; text-align: center; gap: 8px; padding: 0 0 9px; width: 112px; border-radius: 12px; overflow: hidden; }
html[data-sw-layout="tile"] .chip-disc { --sw: 100%; height: 72px; border-radius: 0; box-shadow: none; }
html[data-sw-layout="tile"] .chip-price { display: block; margin: 0; }
/* 5 tile-sm: the same card, small (64 px wide) */
html[data-sw-layout="tile-sm"] .chip { flex-direction: column; align-items: stretch; text-align: center; gap: 5px; padding: 0 0 6px; width: 68px; border-radius: 9px; overflow: hidden; }
html[data-sw-layout="tile-sm"] .chip-disc { --sw: 100%; height: 44px; border-radius: 0; box-shadow: none; }
html[data-sw-layout="tile-sm"] .chip-label { font-size: 11px; line-height: 1.2; display: flex; flex-direction: column; }
html[data-sw-layout="tile-sm"] .chip-price { margin: 0; }
/* 6 segment: one bar of the three woods, true colour, name in a badge; chosen = cream frame + cream badge */
html[data-sw-layout="segment"] .wood-chips { gap: 0; border-radius: 12px; overflow: hidden; flex-wrap: nowrap; }
html[data-sw-layout="segment"] .chip, html[data-sw-layout="segment"] .chip:has(input:checked) { flex: 1; min-width: 0; border: 0; border-radius: 0; justify-content: center; padding: 0 6px; min-height: 60px; background: var(--chip-img, none) center / cover no-repeat; }
html[data-sw-layout="segment"] .chip:not(:has(input:checked))::before { content: ''; position: absolute; inset: 0; background: rgba(10,9,7,.22); }
html[data-sw-layout="segment"] .chip:has(input:checked) { box-shadow: inset 0 0 0 3px var(--fg); z-index: 1; }
html[data-sw-layout="segment"] .chip-disc { display: none; }
html[data-sw-layout="segment"] .chip-label { position: relative; display: flex; gap: 6px; align-items: baseline; padding: 4px 10px; border-radius: 999px; background: rgba(10,9,7,.72); color: #fff; font-size: 13px; white-space: nowrap; }
html[data-sw-layout="segment"] .chip:has(input:checked) .chip-label { background: var(--fg); color: var(--bg); }
html[data-sw-layout="segment"] .chip-price, html[data-sw-layout="segment"] .chip:has(input:checked) .chip-price { color: inherit; opacity: .75; margin: 0; }
/* 7 bare (compact, one line): 30 px wood square + name, no pills */
html[data-sw-layout="bare"] .wood-chips { gap: 4px 18px; align-items: center; }
html[data-sw-layout="bare"] .chip, html[data-sw-layout="bare"] .chip:has(input:checked) { padding: 0; border: 0; min-height: 0; background: none; border-radius: 6px; gap: 8px; color: var(--fg-dim); }
html[data-sw-layout="bare"] .chip:has(input:checked) { color: var(--fg); }
html[data-sw-layout="bare"] .chip-disc { --sw: 30px; --sw-r: 7px; }
html[data-sw-layout="bare"] .chip:has(input:checked) .chip-disc { box-shadow: 0 0 0 2px var(--bg), 0 0 0 3.5px var(--fg); }
html[data-sw-layout="bare"] .chip-price { font-size: 12px; }
/* 8 tabs: the chosen wood fills its pill; the others are text with a small wood dot */
html[data-sw-layout="tabs"] .wood-chips { gap: 4px; align-items: center; }
html[data-sw-layout="tabs"] .chip { border: 0; min-height: 40px; padding: 0 12px 0 6px; gap: 8px; color: var(--fg-dim); }
html[data-sw-layout="tabs"] .chip-disc { --sw: 22px; }
html[data-sw-layout="tabs"] .chip:has(input:checked) { background: var(--chip-img, none) center / cover no-repeat; color: var(--ink); padding: 0 16px 0 44px; min-height: 44px; box-shadow: 0 0 0 1.5px var(--fg); }
html[data-sw-layout="tabs"] .chip:has(input:checked) .chip-disc { display: none; }
html[data-sw-layout="tabs"] .chip:has(input:checked) .chip-label { position: relative; font-weight: 500; text-shadow: 0 0 6px rgba(0,0,0,.15); }
html[data-sw-layout="tabs"] .chip:has(input:checked) .chip-price { color: var(--ink-dim); }
html[data-sw-layout="tabs"] .chip:has(input:checked)::before { content: ''; position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; margin-top: -9px; border-radius: 50%; background: var(--fg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2 5 8.6l4.5-5' fill='none' stroke='%230a0907' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px no-repeat; }
/* 9 hero (compact): the chosen wood big (52 px) with the two others as 24 px coins beside it; name + price once */
html[data-sw-layout="hero"] .wood-chips { align-items: center; gap: 6px; }
html[data-sw-layout="hero"] .chip, html[data-sw-layout="hero"] .chip:has(input:checked) { padding: 0; border: 0; min-height: 0; background: none; border-radius: 50%; transition: none; }
html[data-sw-layout="hero"] .chip-disc { --sw: 26px; }
html[data-sw-layout="hero"] .chip:has(input:checked) { order: -1; margin-right: 6px; }
html[data-sw-layout="hero"] .chip:has(input:checked) .chip-disc { --sw: 54px; box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--fg); }
html[data-sw-layout="hero"] .wood-current { display: inline; margin-left: 2px; }
/* 0 mini-card: wood 44 px flush left, name and price stacked beside, borderless */
html[data-sw-layout="minicard"] .wood-chips { gap: 8px; }
html[data-sw-layout="minicard"] .chip { padding: 0 12px 0 0; border-color: transparent; overflow: hidden; border-radius: 10px; gap: 9px; min-height: 44px; background: rgba(239,230,216,.04); }
html[data-sw-layout="minicard"] .chip:has(input:checked) { border-color: var(--fg); background: rgba(239,230,216,.08); }
html[data-sw-layout="minicard"] .chip-disc { --sw: 44px; border-radius: 0; box-shadow: none; }
html[data-sw-layout="minicard"] .chip-label { display: flex; flex-direction: column; line-height: 1.2; font-size: 13px; }
html[data-sw-layout="minicard"] .chip-price { margin: 0; font-size: 12px; }

.btn-add { margin-top: var(--s5); width: 100%; }
.specs { margin: var(--s6) 0 0; border-top: 1px solid var(--line); }
.spec { display: grid; grid-template-columns: 9.5em 1fr; gap: var(--s4); padding: var(--s3) 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.spec dt { color: var(--fg-dim); }
.spec dd { margin: 0; font-variant-numeric: tabular-nums; }
@media (max-width: 420px) { .spec { grid-template-columns: 1fr; gap: 2px; } }
.pi-foot, .pi-notes { margin-top: var(--s3); color: var(--fg-dim); font-size: 12px; }

/* detailed specs disclosure: closed by default (no layout shift); height animates where ::details-content is supported, else opens instantly */
.specs-detail { margin-top: var(--s4); interpolate-size: allow-keywords; }
.sd-summary { display: inline-flex; align-items: center; gap: .5em; min-height: 44px; cursor: pointer; list-style: none;
  font: 500 11px/1.4 var(--font-ui); letter-spacing: .16em; text-transform: uppercase; color: var(--fg-dim);
  transition: color var(--dur) var(--ease); -webkit-user-select: none; user-select: none; }
.sd-summary::-webkit-details-marker { display: none; }
.sd-summary::marker { content: ''; }
.sd-summary:hover, .specs-detail[open] .sd-summary { color: var(--fg); }
.sd-summary:focus-visible { outline: 1.5px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
.sd-chev { flex: none; transition: transform var(--dur) var(--ease); }
.specs-detail[open] .sd-chev { transform: rotate(180deg); }
.specs-detail::details-content { block-size: 0; overflow: hidden;
  transition: block-size 320ms var(--ease), content-visibility 320ms allow-discrete; }
.specs-detail[open]::details-content { block-size: auto; }
.specs-more { margin-top: var(--s2); }
.sd-body { padding-bottom: var(--s2); }
@media (prefers-reduced-motion: reduce) {
  .sd-chev, .specs-detail::details-content { transition: none; }
}

/* related */
.related { margin-top: var(--s8); }
.related-h { margin-bottom: var(--s6); padding-bottom: var(--s4); border-bottom: 1px solid var(--line); }
.related-grid { list-style: none; margin: 0; padding: 0; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }
@media (max-width: 899px) { .related-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s5) var(--s4); }
  .related-grid .card-name { font-size: 19px; } .related-grid .card-price { font-size: 15px; } }

/* mobile sticky buy bar */
.buybar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; align-items: center; justify-content: space-between;
  gap: var(--s4); padding: var(--s3) var(--gutter) calc(var(--s3) + env(safe-area-inset-bottom));
  background: rgba(20,17,16,.78); -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2);
  border-top: 1px solid var(--line); transform: translateY(100%); transition: transform var(--dur) var(--ease); }
.buybar.is-shown { transform: none; }
.buybar[hidden] { display: none; }
.buybar-meta { display: grid; line-height: 1.2; }
.buybar-name { font-family: var(--font-display); font-size: 18px; }
.buybar-price { font-family: var(--font-display); font-size: 16px; color: var(--fg-dim); font-variant-numeric: tabular-nums lining-nums; }
.btn-sm { min-height: 44px; padding: 0 var(--s5); }
@media (min-width: 900px) { .buybar { display: none !important; } }
@media (max-width: 899px) { .page-product .site-footer { padding-bottom: calc(var(--s8) + env(safe-area-inset-bottom)); } }
.buybar .btn-add { margin-top: 0; width: auto; flex: none; }
@media (max-width: 899px) { .related-grid .card-body { grid-template-columns: 1fr; } }

/* polish pass 2026-10-25: thumbnails are one size on every lamp (4 thumbs no longer balloon, 13 no longer clip at the edge);
   phones/tablets keep a swipeable strip, desktop wraps it into rows. Chips a touch tighter so three fit on one desktop row. */
.pg-thumbs { grid-auto-columns: 72px; }
@media (min-width: 900px) { .pg-thumbs { grid-auto-flow: row; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); overflow: visible; } }
.chip { gap: 7px; padding-right: 14px; }

/* wood-filtered gallery (2026-10-25): a wood change cross-fades main image, thumbs and caption (product.js swapTo) */
.pg-thumbs li[hidden] { display: none; }
.pg-main, .pg-thumbs, .pg-caption { transition: opacity 200ms var(--ease); }
.product-gallery.is-swapping .pg-main, .product-gallery.is-swapping .pg-thumbs, .product-gallery.is-swapping .pg-caption { opacity: 0; }
@media (prefers-reduced-motion: reduce) { .pg-main, .pg-thumbs, .pg-caption { transition: none; } }

/* product copy block (website improver 2026-10-27; site/lib/pcopy.mjs, four dev-swappable variants) */
/* 2026-10-30: was s8 + s7 (176px) -> read as a blank black band under the collapsed "Detailed specs" (the disclosure itself reserves 0px) */
.product-copy { margin-top: var(--s5); padding-top: var(--s6); border-top: 1px solid var(--line); }
.pc { max-width: 62ch; font-size: 16px; line-height: 1.6; }
.pc p + p { margin-top: 1.1em; }
.pc-h { font-size: clamp(26px, 3vw, 40px); margin-bottom: var(--s5); text-wrap: balance; max-width: 22em; }
.pc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s3); }
.pc-list li { padding: var(--s3) 0; border-top: 1px solid var(--line); color: var(--fg-dim); }
.pc-list li:last-child { border-bottom: 1px solid var(--line); }
.pc-list strong { color: var(--fg); font-weight: 500; }
.pc-qa dl { margin: 0; }
.pc-q { padding: var(--s4) 0; border-top: 1px solid var(--line); }
.pc-q:last-child { border-bottom: 1px solid var(--line); }
.pc-q dt { font-family: var(--font-display); font-size: 22px; line-height: 1.2; }
.pc-q dd { margin: var(--s2) 0 0; color: var(--fg-dim); }
.pc-long .pc-x { font-size: 22px; margin: var(--s6) 0 var(--s3); }
@media (min-width: 900px) { .product-copy { margin-left: calc((100% - var(--s7)) * .58 + var(--s7)); } .pc-h { max-width: none; } }
.pc .nowrap { white-space: nowrap; }

/* 2026-10-30: desktop copy sits directly under the info column. Before, it was a sibling below the whole two-column grid,
   so the gallery's extra height (115-245px) plus the copy's own top spacing left a blank black band under the collapsed
   "Detailed specs". The wrapper becomes the grid (.product-grid -> display: contents), gallery spans both rows. */
@media (min-width: 900px) {
  .product { display: grid; grid-template-columns: minmax(0, 58fr) minmax(0, 42fr); column-gap: var(--s7); align-items: start; }
  .product-grid { display: contents; }
  .product-gallery { grid-column: 1; grid-row: 1 / span 2; }
  .product-info { grid-column: 2; grid-row: 1; }
  .product-copy { grid-column: 2; grid-row: 2; margin-left: 0; }
  .related { grid-column: 1 / -1; }
}
