/* Project001 — finish studio, minimal. Typography and colours inherit the site palette. */
#finiture > .wrap { width: min(100% - 2 * var(--gutter, 20px), 1440px); }
.finish-configurator {
  --fc-border: rgba(233, 225, 205, .13);
  --fc-ease: cubic-bezier(.22, .61, .36, 1);
  --fc-panels-w: 271px;
  --fc-card-h: 128px;
  min-width: 0;
}

/* ---- layout: render | panel (fixed width, height = render) ------------------------------ */
.fc-layout { display: grid; grid-template-columns: minmax(0, 1fr) 432px; grid-template-rows: auto auto; column-gap: 24px; row-gap: 14px; align-items: start; }
.fc-stage { grid-column: 1; grid-row: 1; }
.fc-photo-caption { grid-column: 1; grid-row: 2; }
.fc-controls { grid-column: 2; grid-row: 1; }

.fc-stage {
  position: relative; isolation: isolate; min-width: 0; overflow: hidden; aspect-ratio: 16 / 9;
  background: var(--navy-950, #040a1a); border: 1px solid rgba(235, 211, 145, .28); border-radius: 3px;
  box-shadow: 0 24px 60px -26px rgba(0, 0, 0, .65), 0 0 0 5px rgba(235, 211, 145, .018);
}
.fc-stage::after { content: ""; position: absolute; inset: 0; z-index: 3; pointer-events: none; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08); }
.fc-image { display: block; width: 100%; height: 100%; object-fit: contain; opacity: 1; }
/* Only JavaScript animates the outgoing layer. The new base always stays opaque. */
.fc-image-outgoing { position: absolute; inset: 0; z-index: 2; pointer-events: none; width: 100%; height: 100%; object-fit: contain; }
.fc-image-incoming { opacity: 1; }
.fc-loading { position: absolute; right: 17px; bottom: 17px; z-index: 5; width: 24px; height: 24px; border: 2px solid rgba(235, 211, 145, .2); border-top-color: var(--gold-hi, #ebd391); border-radius: 50%; background: rgba(4, 10, 26, .55); opacity: 0; pointer-events: none; transition: opacity .2s; }
.finish-configurator[data-loading="true"] .fc-loading { opacity: 1; animation: fc-spin .9s linear infinite; }

/* ---- hover mask on the render (inline SVG per category, viewBox 1920x1080) --------------- */
.fc-mask-layer { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.fc-mask-layer svg { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity .22s var(--fc-ease); }
.fc-mask-layer svg.is-on { opacity: 1; transition-duration: .18s; }
.fc-mask-dim { fill: rgba(4, 10, 26, .52); fill-rule: evenodd; }
.fc-mask-line { fill: none; stroke: var(--gold-hi, #ebd391); stroke-width: 1.75px; stroke-linejoin: round; vector-effect: non-scaling-stroke; }

/* ---- caption row: label | 144 combinations + reset --------------------------------------- */
.fc-photo-caption { display: flex; justify-content: space-between; align-items: center; gap: 14px; min-width: 0; color: var(--muted, #9aa7c4); font: 400 .65rem/1.45 var(--font-mono, monospace); }
.fc-photo-caption-label { display: inline-flex; align-items: center; gap: 10px; }
.fc-photo-caption-label::before { content: ""; width: 22px; height: 1px; background: rgba(201, 162, 74, .65); }
.fc-caption-end { display: inline-flex; align-items: center; gap: 4px; flex: none; }
.fc-badge { color: var(--gold-hi, #ebd391); font-size: .61rem; letter-spacing: .04em; }
.fc-reset { appearance: none; display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; margin: -12px -10px -12px 0; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--muted, #9aa7c4); cursor: pointer; transition: color .2s var(--fc-ease); }
.fc-reset-icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; transition: transform .35s var(--fc-ease); }
.fc-reset:hover { color: var(--gold-hi, #ebd391); }
.fc-reset:hover .fc-reset-icon { transform: rotate(-35deg); }

/* ---- right part: categories | finishes ---------------------------------------------------- */
.fc-controls { position: relative; min-width: 0; align-self: stretch; border: 1px solid rgba(233, 225, 205, .14); border-radius: 3px; background: rgba(7, 17, 42, .5); overflow: hidden; }
.fc-controls-in { position: absolute; inset: 0; }
.fc-categories { position: absolute; top: 0; bottom: 0; left: 0; width: 100%; display: flex; flex-direction: column; min-width: 0; transition: width .55s var(--fc-ease); }
.finish-configurator[data-fc-open="true"] .fc-categories { width: calc(100% - var(--fc-panels-w)); }
.fc-category {
  appearance: none; position: relative; flex: 1 1 0; min-height: 44px; max-height: 100px; display: flex; align-items: center; gap: 14px; width: 100%;
  padding: 0 14px 0 16px; border: 0; border-left: 2px solid transparent; text-align: left; background: transparent; color: var(--ink-soft, #cdd4e4);
  font: 500 .86rem/1.35 var(--font-body, sans-serif); cursor: pointer; transition: background-color .25s var(--fc-ease), color .25s var(--fc-ease), border-color .25s var(--fc-ease);
}
.fc-category::after { content: ""; position: absolute; inset-inline: 16px; bottom: 0; height: 1px; background: linear-gradient(90deg, rgba(233, 225, 205, .12), transparent); pointer-events: none; }
.fc-category:last-child::after { display: none; }
.fc-icon { flex: none; width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.fc-category-name { min-width: 0; overflow-wrap: anywhere; }
.fc-category:hover { color: var(--ink, #f5f1e8); background: rgba(235, 211, 145, .035); }
.fc-category[aria-selected="true"] { color: var(--gold-hi, #ebd391); border-left-color: var(--gold, #c9a24a); background: linear-gradient(90deg, rgba(201, 162, 74, .12), rgba(201, 162, 74, .01)); }

.fc-panels { position: absolute; top: 0; right: 0; bottom: 0; width: var(--fc-panels-w); padding: 14px 12px; border-left: 1px solid var(--fc-border); overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: rgba(201, 162, 74, .4) transparent; transition: opacity .4s var(--fc-ease) .12s, transform .5s var(--fc-ease) .08s, visibility 0s; }
.finish-configurator[data-fc-open="false"] .fc-panels { opacity: 0; visibility: hidden; transform: translateX(18px); transition: none; }
.fc-panel { height: 100%; }
.fc-panel[hidden] { display: none; }
.fc-options { display: flex; flex-direction: column; gap: 10px; height: 100%; }
.fc-option {
  appearance: none; position: relative; flex: 0 1 var(--fc-card-h); min-height: 72px; display: flex; align-items: stretch; gap: 14px; width: 100%; padding: 8px;
  border: 1px solid rgba(233, 225, 205, .14); border-radius: 3px; text-align: left; color: var(--ink-soft, #cdd4e4); background: rgba(255, 255, 255, .015);
  font-family: var(--font-body, sans-serif); cursor: pointer; transition: border-color .25s var(--fc-ease), background-color .25s var(--fc-ease), transform .25s var(--fc-ease);
}
.fc-option:hover { transform: translateY(-1px); border-color: rgba(235, 211, 145, .5); background: rgba(235, 211, 145, .04); }
.fc-option[aria-pressed="true"] { border: 2px solid var(--gold, #c9a24a); padding: 7px; color: var(--ink, #f5f1e8); background: linear-gradient(110deg, rgba(201, 162, 74, .13), rgba(201, 162, 74, .03)); }
.fc-thumb { position: relative; flex: none; align-self: stretch; aspect-ratio: 1 / 1; overflow: hidden; border-radius: 2px; background: var(--fc-swatch, #c8c0ae); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .14); }
.fc-thumb img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
.fc-option[aria-pressed="true"] .fc-thumb { box-shadow: 0 0 0 2px var(--navy-900, #07112a), 0 0 0 4px rgba(201, 162, 74, .55); }
.fc-option-copy { align-self: center; min-width: 0; }
.fc-option-name { display: block; font-size: .83rem; font-weight: 500; line-height: 1.35; overflow-wrap: anywhere; }
.fc-option-type { display: block; margin-top: 5px; color: var(--muted, #9aa7c4); font: 400 .69rem/1.4 var(--font-mono, monospace); letter-spacing: .05em; text-transform: uppercase; overflow-wrap: anywhere; }
.fc-panel-entering .fc-option, .fc-opening .fc-panel:not([hidden]) .fc-option { animation: fc-option-in .34s var(--fc-ease) both; }
.fc-panel-entering .fc-option:nth-child(2), .fc-opening .fc-panel:not([hidden]) .fc-option:nth-child(2) { animation-delay: .05s; }
.fc-panel-entering .fc-option:nth-child(3), .fc-opening .fc-panel:not([hidden]) .fc-option:nth-child(3) { animation-delay: .1s; }
.fc-opening .fc-panel:not([hidden]) .fc-option { animation-delay: .2s; }
.fc-opening .fc-panel:not([hidden]) .fc-option:nth-child(2) { animation-delay: .27s; }
.fc-opening .fc-panel:not([hidden]) .fc-option:nth-child(3) { animation-delay: .34s; }

/* ---- feedback: announced to screen readers, visible only on errors ----------------------- */
.fc-feedback { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.finish-configurator[data-error="true"] .fc-feedback { position: static; display: flex; align-items: baseline; gap: 12px; width: auto; height: auto; overflow: visible; clip-path: none; white-space: normal; margin-top: 14px; color: var(--gold-hi, #ebd391); font-size: .75rem; line-height: 1.6; }
.fc-status { flex: 1; min-width: 0; margin: 0; }
.fc-retry { appearance: none; flex: none; min-height: 32px; padding: 0; border: 0; background: transparent; color: var(--gold-hi, #ebd391); font: 400 .75rem/1.3 var(--font-body, sans-serif); text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
.fc-noscript { margin-top: 14px; color: var(--ink-soft, #cdd4e4); font-size: .85rem; }
.finish-configurator:not([data-ready="true"]) .fc-controls { display: none; }
.finish-configurator:not([data-ready="true"]) .fc-layout { grid-template-columns: minmax(0, 1fr); }
.finish-configurator button:focus-visible { position: relative; z-index: 4; outline: 2px solid var(--gold-hi, #ebd391); outline-offset: -3px; }
@keyframes fc-spin { to { transform: rotate(360deg); } }
@keyframes fc-option-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* Label width = the width available in the open state, so names wrap the same way before and after the opening (no reflow). */
@media (min-width: 1121px) {
  .fc-category-name { flex: none; width: 89px; }
}

/* ---- stacked layout: categories row + finishes under the render --------------------------- */
@media (max-width: 1120px) {
  .finish-configurator { --fc-card-h: 96px; }
  .fc-layout { grid-template-columns: minmax(0, 1fr); row-gap: 12px; }
  .fc-reset { width: 44px; height: 44px; margin: -14px -12px -14px 0; }
  .fc-controls { grid-column: 1; grid-row: 3; align-self: start; border: 0; background: transparent; overflow: visible; margin-top: 8px; }
  .fc-controls-in { position: static; }
  .fc-categories { position: static; width: auto !important; flex-direction: row; transition: none; border: 1px solid rgba(233, 225, 205, .14); border-radius: 3px; background: rgba(7, 17, 42, .5); }
  .fc-category { flex: 1 1 0; max-height: none; min-height: 76px; flex-direction: column; justify-content: center; gap: 8px; padding: 10px 4px; border-left: 0; border-bottom: 2px solid transparent; text-align: center; font-size: .78rem; line-height: 1.25; }
  .fc-category::after { inset: 14px 0 14px auto; width: 1px; height: auto; background: linear-gradient(180deg, transparent, rgba(233, 225, 205, .12), transparent); }
  .fc-category[aria-selected="true"] { border-left-color: transparent; border-bottom-color: var(--gold, #c9a24a); background: linear-gradient(0deg, rgba(201, 162, 74, .12), rgba(201, 162, 74, .01)); }
  /* the finishes are always in place (reserved height); opening only animates their appearance */
  .fc-panels { position: static; width: auto; min-height: calc(var(--fc-card-h) + 16px); padding: 16px 0 0; border-left: 0; overflow: visible; }
  .finish-configurator[data-fc-open="false"] .fc-panels { transform: translateY(10px); }
  .fc-panel { height: auto; }
  .fc-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; height: auto; }
  .fc-option { flex: none; min-height: var(--fc-card-h); }
}
@media (max-width: 720px) {
  .finish-configurator { --fc-card-h: 88px; }
  .fc-photo-caption { gap: 10px; font-size: .56rem; }
  .fc-photo-caption-label { gap: 7px; }
  .fc-photo-caption-label::before { width: 14px; }
  .fc-badge { font-size: .54rem; }
  .fc-categories { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .fc-category { min-height: 76px; border-bottom: 0; }
  .fc-category:nth-child(-n+3) { border-bottom: 1px solid rgba(233, 225, 205, .1); }
  .fc-category::after { inset: 14px 0 14px auto; }
  .fc-category:nth-child(3n)::after { display: none; }
  .fc-category[aria-selected="true"] { box-shadow: inset 0 -2px 0 var(--gold, #c9a24a); }
  .fc-panels { min-height: calc(3 * var(--fc-card-h) + 2 * 10px + 16px); }
  .fc-options { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .fc-option { gap: 12px; }
  .fc-option-name { font-size: .85rem; }
}
@media (max-width: 380px) {
  .fc-photo-caption { font-size: .51rem; gap: 6px; }
  .fc-photo-caption-label::before { width: 10px; }
  .fc-badge { font-size: .5rem; }
  .finish-configurator { --fc-card-h: 80px; }
  .fc-category { padding: 10px 2px; font-size: .72rem; }
  .fc-option { gap: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .finish-configurator *, .finish-configurator *::before, .finish-configurator *::after { animation: none !important; transition: none !important; }
  .fc-option:hover { transform: none; }
}
