/* configurator */
.cfg-head { padding-block: var(--s-7) var(--s-5); }
.cfg-head h1 { margin-bottom: var(--s-2); }
.cfg-head p { margin: 0; color: var(--ink-2); }
.configurator { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-6); align-items: start; padding-bottom: var(--s-7); }
@media (min-width: 900px) { .configurator { grid-template-columns: minmax(340px, 440px) minmax(0, 1fr); gap: var(--s-7); } }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: clamp(1.1rem, 3vw, 2rem); box-shadow: var(--shadow-sm);
  display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-5); container-type: inline-size; }
/* minmax(0, 1fr): a wide child (tabs, long film names) must never widen the column past the panel */
.panel fieldset { border: 0; padding: 0; margin: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-3); min-width: 0; }
.panel legend { padding: 0; font-weight: 700; font-size: var(--fs-sm); margin-bottom: var(--s-1); display: flex; align-items: center; gap: .6rem; }
.panel legend .n { display: inline-grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--ink); color: var(--bg); font-size: var(--fs-xs); }
.panel label { display: block; font-weight: 600; font-size: var(--fs-sm); margin-bottom: .35rem; }
.panel label .count { float: right; font-weight: 400; font-size: var(--fs-xs); color: var(--mute); }
.optional { color: var(--mute); font-weight: 400; }
/* text on the poster: one segmented choice (full / title only / films only / no text) */
.text-mode { display: inline-flex; justify-self: start; max-width: 100%; border: 1px solid var(--line-strong); border-radius: var(--r-pill); padding: 2px; }
.panel .text-mode__opt { position: relative; cursor: pointer; margin: 0; } /* .panel label adds a bottom margin */
.text-mode__opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.text-mode__opt span { display: block; padding: .4rem .9rem; border-radius: var(--r-pill); font: 600 var(--fs-xs) var(--font-sans); white-space: nowrap; }
.text-mode__opt input:checked + span { background: var(--ink); color: var(--bg); }
/* focus ring inside the pill, so it never overlaps the track's border */
.text-mode__opt input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: -4px; }
/* the panel is only ~375 px wide on desktop too, so wrap by the panel's width, not the viewport's (one row needs ~430 px) */
@container (max-width: 440px) { /* options share the full width and wrap onto a second row when the labels do not fit */
  .text-mode { display: flex; flex-wrap: wrap; width: 100%; box-sizing: border-box; border-radius: 1.3rem; }
  .text-mode__opt { flex: 1 1 auto; min-width: 0; }
  .text-mode__opt span { padding: .45rem .6rem; text-align: center; font-size: .8rem; }
  .text-mode[data-count="4"] .text-mode__opt { flex-basis: 40%; } /* 2 x 2 */
}
.search { position: relative; }
.search input { padding-left: 2.6rem; background: var(--surface-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='none' stroke='%236b655b' stroke-width='1.8'%3E%3Ccircle cx='8' cy='8' r='6'/%3E%3Cpath d='m13 13 4 4'/%3E%3C/svg%3E") no-repeat .85rem center; }
.results { position: absolute; z-index: 5; left: 0; right: 0; margin: .35rem 0 0; padding: .35rem; list-style: none; background: var(--surface-2);
  border: 1px solid var(--line-strong); border-radius: var(--r); box-shadow: var(--shadow-lg); max-height: 320px; overflow: auto; }
.results button { display: block; width: 100%; text-align: left; padding: .6rem .75rem; border: 0; background: none; border-radius: var(--r-sm); font: inherit; cursor: pointer; color: var(--ink); }
.results button:hover, .results button:focus-visible { background: var(--bg-deep); outline-offset: -2px; }
.chosen { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s-2); }
.chosen:empty { display: none; }
.chosen li { display: inline-flex; align-items: center; gap: .15rem; padding: .25rem .25rem .25rem .85rem; background: var(--bg-deep); border-radius: var(--r-pill); font-size: var(--fs-sm); font-weight: 600; }
.chosen button { display: grid; place-items: center; width: 2rem; height: 2rem; border: 0; border-radius: 50%; background: none; cursor: pointer; color: var(--ink-2); font-size: 1.1rem; line-height: 1; }
.chosen button:hover { background: var(--ink); color: var(--bg); }
.chosen button:disabled { opacity: .3; cursor: default; background: none; color: var(--ink-2); }
/* 2+ films: a numbered, sortable list (order = order on the poster) */
.chosen.is-sortable { flex-direction: column; flex-wrap: nowrap; }
.chosen.is-sortable li { display: flex; border-radius: var(--r-md); padding-left: .5rem; cursor: grab; }
.chosen.is-sortable li > span:not(.chosen__pos) { flex: 1; min-width: 0; }
.chosen__pos { display: grid; place-items: center; width: 1.5rem; height: 1.5rem; margin-right: .35rem; border-radius: 50%;
  background: var(--bg); color: var(--ink-2); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; }
.chosen li.is-dragging { opacity: .45; }
.chosen li.is-over { box-shadow: inset 0 2px 0 var(--ink); }
.hint { margin: 0; color: var(--mute); font-size: var(--fs-xs); }
/* quick picks while no film is chosen */
.quick { display: grid; gap: var(--s-2); }
.quick[hidden] { display: none; }
.quick__label { margin: 0; font-size: var(--fs-xs); font-weight: 600; color: var(--ink-2); }
.quick__chips { list-style: none; margin: 0 0 var(--s-1); padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { display: inline-flex; align-items: baseline; gap: .35rem; padding: .5rem .8rem; border: 1px solid var(--line-strong); border-radius: var(--r-pill);
  background: var(--surface-2); font: 600 var(--fs-xs) var(--font-sans); color: var(--ink); text-decoration: none; cursor: pointer; }
.chip:hover { border-color: var(--ink); background: var(--bg-deep); color: var(--ink); } /* components.css hover sets light text */
.chip__n { font-weight: 400; color: var(--mute); }
.hint:empty { display: none; }
.stage { position: sticky; top: calc(var(--header-h) + var(--s-4)); display: grid; place-items: center; padding: clamp(1.25rem, 4vw, 3.5rem);
  background: radial-gradient(120% 90% at 50% 0%, #efe9dc 0%, var(--wall) 60%, #d6cfbf 100%); border-radius: var(--r-lg);
  min-height: min(70vh, 640px); }
#preview { max-width: min(100%, 520px); max-height: 74vh; width: auto; height: auto; box-shadow: var(--shadow-poster); transition: opacity .2s var(--ease); background: var(--bg); }
#preview.loading { opacity: .55; }
#preview.is-example { opacity: .75; }
.stage__badge { margin: 0 0 var(--s-3); padding: .35rem .9rem; border-radius: var(--r-pill);
  background: var(--ink); color: var(--bg); font-size: var(--fs-xs); font-weight: 600; white-space: nowrap; z-index: 1; }
.stage__badge[hidden] { display: none; }
.stage__msg { margin: 0; text-align: center; color: var(--ink-2); max-width: 28ch; font-family: var(--font-serif); font-size: var(--fs-lg); }
.stage__msg[hidden], #preview[hidden] { display: none; }
.stage__note { position: absolute; bottom: var(--s-3); left: 0; right: 0; text-align: center; font-size: var(--fs-xs); color: var(--mute); margin: 0; }
@media (max-width: 899px) {
  .stage { position: sticky; top: var(--header-h); z-index: 4; order: -1; min-height: 0; padding: var(--s-3); height: 36vh; border-radius: var(--r); }
  #preview { max-height: calc(36vh - var(--s-5)); }
  .stage__note { display: none; }
  .stage__badge { position: absolute; bottom: .5rem; left: 50%; transform: translateX(-50%); margin: 0; }
}

/* preview-only frame toggle under the stage (frames are not sold), price, add to cart */
.stage__frames { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--s-2); margin-top: var(--s-3); }
.stage__frames-label { font-size: var(--fs-xs); color: var(--mute); }
.frame-opt { position: relative; display: flex; align-items: center; gap: .4rem; padding: .3rem .7rem; margin: 0; border: 1px solid var(--line-strong);
  border-radius: var(--r); cursor: pointer; text-align: center; background: var(--surface-2); font-weight: 600; }
.frame-opt input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.frame-opt:has(input:checked) { border-color: var(--ink); box-shadow: 0 0 0 2px var(--ink); }
.frame-opt:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.frame-opt__swatch { width: 14px; height: 18px; border-radius: 2px; background: var(--bg-deep); border: 3px solid var(--line-strong); }
.frame-opt--black .frame-opt__swatch { border-color: #1c1b1a; }
.frame-opt--white .frame-opt__swatch { border-color: #fbfaf7; outline: 1px solid var(--line-strong); }
.frame-opt--none .frame-opt__swatch { border: 1px dashed var(--line-strong); }
.frame-opt__name { font-size: var(--fs-xs); }
/* phones: the stage is a fixed-height sticky box, so the toggle can't flow below the poster (it spilled
   over the form). Swatch-only column at the right edge, names kept for screen readers. */
@media (max-width: 899px) {
  .stage__frames { position: absolute; right: .5rem; top: 50%; transform: translateY(-50%); margin: 0; z-index: 1;
    flex-direction: column; flex-wrap: nowrap; gap: .4rem; }
  .stage__frames-label, .frame-opt__name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .frame-opt { width: 2.5rem; height: 2.5rem; padding: 0; justify-content: center; border-radius: 50%; }
}
/* full screen preview (phones): the stage becomes a fixed overlay; tabs, frames and close-up keep working */
.stage__btn { display: none; place-items: center; width: 2.5rem; height: 2.5rem; padding: 0; border: 1px solid var(--line-strong); border-radius: 50%;
  background: rgb(255 255 255 / .85); color: var(--ink); cursor: pointer; z-index: 2; }
.stage__btn[hidden] { display: none !important; }
@media (max-width: 899px) {
  .stage__btn { display: grid; position: absolute; }
  .stage__expand { right: .5rem; bottom: .5rem; }
  #preview { cursor: zoom-in; }
  /* tabs wrap (no clipped, sideways-scrolling row), frame toggle moves to a row at the bottom, so the image
     is centred and can use the full width */
  .stage.is-full { position: fixed; inset: 0; z-index: 100; height: 100dvh; border-radius: 0; padding: 5.5rem .75rem 4.5rem; }
  .stage.is-full #preview, .stage.is-full #preview.is-room { max-height: calc(100dvh - 10rem); max-width: 100%; cursor: default; }
  .stage.is-full #preview.is-room { cursor: zoom-in; }
  .stage.is-full #preview.is-room.is-close { cursor: zoom-out; }
  .stage.is-full .stage__tools { position: absolute; width: auto; margin: 0; top: .5rem; left: .5rem; right: 3.5rem; padding-inline: 0; flex-wrap: wrap; overflow: visible;
    justify-content: flex-start; }
  .stage.is-full .stage__frames { top: auto; right: auto; bottom: .75rem; left: 50%; transform: translateX(-50%);
    flex-direction: row; }
  .stage.is-full .stage__badge { bottom: 4.5rem; }
  .stage__close { top: .5rem; right: .5rem; }
}
html.no-scroll { overflow: hidden; }
.buy { display: grid; gap: var(--s-3); padding-top: var(--s-4); border-top: 1px solid var(--line); }
.buy__price { display: grid; gap: .1rem; }
.buy__label { font-size: var(--fs-xs); color: var(--mute); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.buy__price strong { font-family: var(--font-serif); font-size: var(--fs-xl); line-height: 1.1; }
.buy__vat { font-size: var(--fs-xs); color: var(--mute); }
.buy__row { display: flex; gap: var(--s-3); align-items: end; flex-wrap: wrap; }
.buy__qty { width: 5.5rem; }
.buy__qty input { width: 100%; }
.buy__row .btn { flex: 1 1 12rem; }
.buy__status { margin: 0; padding: .7rem .9rem; border-radius: var(--r); font-size: var(--fs-sm); font-weight: 600; }
.buy__status[hidden] { display: none; }
.buy__status.is-ok { background: var(--ok-soft); color: #1d4a2a; }
.buy__status.is-err { background: #f7dfdb; color: #7a1d14; }
.buy__status a { color: inherit; text-decoration: underline; white-space: nowrap; }
.buy__xmas { margin: 0; padding: .5rem .75rem; font-size: var(--fs-sm); background: var(--warn-soft); color: #4f3608; border-radius: var(--r); }
.buy__reprint { margin: 0; font-size: var(--fs-sm); color: var(--ink-2); font-weight: 600; }
.buy__legal { margin: 0; font-size: .7rem; line-height: 1.45; color: var(--mute); }
.buy__share { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); }
.stage__tools { position: absolute; top: var(--s-3); left: 0; right: 0; display: flex; justify-content: center; gap: var(--s-2); flex-wrap: wrap; z-index: 1; }
.seg { padding: .5rem .9rem; border: 1px solid var(--line-strong); border-radius: var(--r-pill); background: rgb(255 255 255 / .7); font: 600 var(--fs-xs) var(--font-sans); color: var(--ink); cursor: pointer; }
.seg.is-on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.stage__sep { width: 1px; align-self: stretch; margin: .2rem var(--s-1); background: var(--line-strong); }
.stage { padding-top: 3.5rem; }
/* flat preview with a CSS frame so the choice is visible without the room scene */
#preview[data-frame="black"]:not(.is-room) { border: clamp(6px, 1.2vw, 12px) solid #1c1b1a; }
#preview[data-frame="white"]:not(.is-room) { border: clamp(6px, 1.2vw, 12px) solid #fbfaf7; }
#preview.is-room { max-width: 100%; max-height: 80vh; cursor: zoom-in; }  /* portrait room photos */
#preview.is-room.is-close { cursor: zoom-out; }
.seg[hidden], .stage__sep[hidden] { display: none; }
@media (max-width: 899px) {
  /* preview buttons sit above the image in the flow and wrap onto a second row when they do not fit (all five need
     ~400px, a phone has 330-360); the image gets the rest of the fixed-height stage */
  .stage { padding-top: var(--s-3); grid-template-rows: auto minmax(0, 1fr); }
  .stage__tools { position: static; grid-row: 1; width: 100%; justify-content: center; margin-bottom: var(--s-2); }
  #preview, #preview.is-room { grid-row: 2; min-height: 0; max-width: 100%; max-height: 100%; }
  .stage__msg { grid-row: 2; }
}
@media (max-width: 480px) {
  .stage__tools { gap: var(--s-1); }
  .seg { padding: .5rem .5rem; font-size: .75rem; }
  .stage__sep { display: none; } /* the buttons wrap here: a divider would end up alone at a line break */
}

/* design cards: the poster itself is the choice (a dropdown of names told nobody what "Sediment" looks like).
   Only the kind that fits the films is shown; before configure.js runs that is the single designs. */
.dcards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-2); }
.designs:not([data-kind="group"]) .dcard[data-kind="group"], .designs[data-kind="group"] .dcard[data-kind="single"] { display: none; }
.panel .dcard { position: relative; display: grid; gap: .35rem; margin: 0; cursor: pointer; font-weight: 600; }
.dcard input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.dcard__img { display: block; padding: 8%; border-radius: var(--r); background: var(--bg-deep); border: 1px solid var(--line);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease); }
.dcard__img img { display: block; width: 100%; height: auto; aspect-ratio: 5 / 7; object-fit: cover; box-shadow: 0 2px 8px rgb(0 0 0 / .14); background: var(--bg); }
.dcard__name { font-size: var(--fs-xs); line-height: 1.25; text-align: center; }
.dcard:hover .dcard__img { border-color: var(--ink-2); }
.dcard:has(input:checked) .dcard__img { border-color: var(--ink); box-shadow: 0 0 0 2px var(--ink); }
.dcard:has(input:focus-visible) .dcard__img { outline: 3px solid var(--focus); outline-offset: 3px; }
.dcards__short { margin: 0; font-size: var(--fs-sm); color: var(--ink-2); }
.dcards__short:empty { display: none; }
.dkind { margin: -.5rem 0 0; font-size: var(--fs-xs); color: var(--mute); }
.dkind[hidden], .dkind [hidden] { display: none; }
.link-btn { display: inline-flex; align-items: center; min-height: 44px; padding: 0 .1rem; margin-left: .15rem; border: 0; background: none; font: 600 var(--fs-xs) var(--font-sans); color: var(--ink);
  text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link-btn::after { content: " →"; }

/* size and background as chips: every option and its price visible at once */
.sizes { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .35rem; }
.look__label { display: block; margin: 0 0 .35rem; font-weight: 600; font-size: var(--fs-sm); }
.look__theme { flex: 1 1 11rem; }
.panel .opt { position: relative; margin: 0; cursor: pointer; }
.opt input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.opt > span { display: grid; place-items: center; gap: .05rem; min-height: 44px; padding: .45rem .15rem; border: 1px solid var(--line-strong); border-radius: var(--r);
  background: var(--surface-2); text-align: center; line-height: 1.2; }
.opt b { font-size: var(--fs-xs); font-weight: 700; white-space: nowrap; }
.opt small { font-size: .72rem; font-weight: 400; color: var(--mute); font-variant-numeric: tabular-nums; }
.opt small:empty { display: none; }
.opt:hover > span { border-color: var(--ink-2); }
.opt input:checked + span { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); background: var(--bg-deep); }
.opt input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.look { display: flex; flex-wrap: wrap; align-items: end; gap: var(--s-3); }
.themes { display: grid; grid-template-columns: 1fr 1fr; gap: .4rem; }
.opt--theme > span { display: flex; justify-content: center; gap: .45rem; font-size: var(--fs-xs); font-weight: 600; }
.swatch { width: .9rem; height: 1.15rem; border-radius: 2px; border: 1px solid var(--line-strong); }
.swatch--light { background: #f6f3ec; }
.swatch--dark { background: #1c1b1a; }
.look__lang { flex: 1 1 8rem; }
.look__lang select { width: 100%; height: 44px; padding-block: 0; padding-inline: .7rem 1.6rem; } /* same height as the theme buttons */

/* fixed buy bar (shown by configure.js while the real add-to-cart button is off screen): phones, and desktop too,
   where the long panel pushes price and button below the fold */
.buybar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; align-items: center; justify-content: space-between; gap: var(--s-3);
  padding: var(--s-2) var(--s-4) calc(var(--s-2) + env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--line-strong);
  box-shadow: 0 -4px 16px rgb(0 0 0 / .08); }
.buybar[hidden] { display: none; }
.buybar__summary { display: none; }
.buybar__price { display: grid; gap: 0; min-width: 0; }
.buybar__label { font-size: .7rem; color: var(--mute); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.buybar__price strong { font-family: var(--font-serif); font-size: var(--fs-lg); line-height: 1.1; white-space: nowrap; }
.buybar__btn { flex: 1 1 auto; max-width: 16rem; min-height: 48px; }
/* room so the bar never covers the last content or the footer */
html.has-buybar body { padding-bottom: calc(4.5rem + env(safe-area-inset-bottom)); }
@media (min-width: 900px) {
  .buybar { padding-inline: max(var(--gutter), calc((100vw - var(--maxw)) / 2)); gap: var(--s-5); }
  .buybar__summary { display: block; flex: 1 1 auto; min-width: 0; margin: 0; font-weight: 600; font-size: var(--fs-sm);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .buybar__price { text-align: right; }
  .buybar__btn { flex: 0 0 auto; min-width: 14rem; }
}
