/* ============================================================
   ARON · aron-configurator.css
   Product configurator: the 3D part on top, centred and kept in view
   while the option groups scroll beneath it. Reusable (Realise now, Conceive later). Uses the page's
   tokens: --white --black --red --surface --font-display --font-mono,
   and --nav-h (height of the sticky site nav, set by the page).
   Markup and behaviour: see aron-configurator.js.
   ============================================================ */

.cfg { --cfg-line: rgba(26,26,26,.18); }

/* ── The part: sticks under the nav while the options scroll ──
   Put .cfg-view and the options in one .cfg-body so the part lets go
   when the options end, and the price bar after it. */
.cfg-view {
  position: sticky; top: var(--nav-h, 74px); z-index: 6;
  padding-bottom: 12px; background: var(--white, #F7F7F5);
  transition: box-shadow .25s;
}
.cfg-view.is-stuck { box-shadow: 0 16px 16px -16px rgba(26,26,26,.3); }
.cfg-stage {
  position: relative; overflow: hidden; isolation: isolate;
  height: clamp(220px, 36vh, 440px); border-radius: 10px; background: var(--surface, #F2F2F0);
}
.cfg-stage .av-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity .6s cubic-bezier(.22,.61,.36,1); }
.cfg-stage .av-canvas.is-shown { opacity: 1; }
.cfg-stage .av-canvas:focus { outline: none; }
.cfg-stage .av-canvas:focus-visible { outline: 2px solid var(--red, #A52E22); outline-offset: -2px; border-radius: 10px; }

/* loading (three.js still arriving, or a part being prepared) */
.cfg-loading {
  position: absolute; inset: 0; z-index: 2; display: none;
  flex-direction: column; align-items: center; justify-content: center; gap: 14px;
  font-family: var(--font-mono); font-size: 12px;
}
.cfg-stage.is-loading .cfg-loading { display: flex; }
.cfg-loading::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.65) 50%, transparent 70%) var(--surface, #F2F2F0);
  background-size: 240% 100%; animation: cfgShimmer 1.4s ease-in-out infinite;
}
@keyframes cfgShimmer { from { background-position: 120% 0; } to { background-position: -120% 0; } }
.cfg-loading-shape { width: 84px; height: 84px; border-radius: 14px; background: rgba(26,26,26,.07); animation: cfgFloat 1.8s ease-in-out infinite; }
@keyframes cfgFloat { 0%, 100% { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(-8px) rotate(6deg); } }
.cfg-spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid rgba(26,26,26,.15); border-top-color: var(--red, #A52E22); animation: cfgSpin .8s linear infinite; display: inline-block; vertical-align: -2px; margin-right: 8px; }
@keyframes cfgSpin { to { transform: rotate(360deg); } }

/* small controls floating on the stage */
.cfg-stage-tools { position: absolute; left: 14px; right: 14px; bottom: 14px; z-index: 2; display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; pointer-events: none; }
.cfg-stage-tools > * { pointer-events: auto; }
.cfg-stage.is-loading .cfg-stage-tools { display: none; }
.cfg-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border: 0; border-radius: 999px;
  background: var(--white, #F7F7F5); color: var(--black, #1A1A1A); box-shadow: 0 0 0 1px rgba(26,26,26,.12), 0 2px 8px rgba(26,26,26,.06);
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .03em; white-space: nowrap; cursor: pointer;
  transition: opacity .3s, transform .3s cubic-bezier(.22,.61,.36,1);
}
.cfg-pill:hover { box-shadow: 0 0 0 1px rgba(26,26,26,.4), 0 2px 8px rgba(26,26,26,.06); }
.cfg-pill[hidden] { display: none; }
.cfg-stage-tools > span { display: inline-flex; gap: 6px; }
.cfg-pill.is-icon { width: 32px; height: 30px; justify-content: center; padding: 0; font-size: 15px; }
.cfg-hint { cursor: default; }
.cfg-hint:hover { box-shadow: 0 0 0 1px rgba(26,26,26,.12), 0 2px 8px rgba(26,26,26,.06); }
.cfg-hint.is-gone { opacity: 0; transform: translateY(6px); pointer-events: none; }
.cfg-nogl { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 2rem; text-align: center; font-size: 15px; font-weight: 600; }
.cfg-nogl[hidden] { display: none; }

/* under the stage: file, size, and (several files) which one is shown */
.cfg-meta { display: flex; align-items: center; gap: 8px 14px; padding: 10px 2px 0; min-width: 0; font-family: var(--font-mono); font-size: 12px; }
.cfg-meta-name { flex: none; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--font-display); font-size: 14px; font-weight: 700; }
.cfg-meta-dims { flex: none; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cfg-files { display: flex; gap: 6px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.cfg-files::-webkit-scrollbar { display: none; }
.cfg-files:empty { display: none; }
.cfg-file {
  flex: none; max-width: 180px; padding: 5px 12px; border: 1px solid var(--cfg-line); border-radius: 999px; background: none;
  color: var(--black, #1A1A1A); font-family: var(--font-mono); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  cursor: pointer; transition: background .2s, color .2s, border-color .2s;
}
.cfg-file:hover { border-color: var(--black, #1A1A1A); }
.cfg-file[aria-pressed="true"] { background: var(--black, #1A1A1A); color: var(--white, #F7F7F5); border-color: var(--black, #1A1A1A); }
.cfg-link { flex: none; margin-left: auto; font: inherit; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--black, #1A1A1A); background: none; border: 0; padding: 0; border-bottom: 1px solid currentColor; cursor: pointer; white-space: nowrap; }
.cfg-link:hover { color: var(--red, #A52E22); }

/* notes that are not a workflow step: red tint, no border */
.cfg-advisory { margin: 14px 0 0; padding: 12px 14px; border-radius: 6px; background: rgba(165,46,34,.08); color: var(--red-dk, #87271D); font-family: var(--font-mono); font-size: 12px; line-height: 1.55; }
.cfg-advisory[hidden] { display: none; }

/* ── Option groups ─────────────────────────────────────────── */
.cfg-options { counter-reset: cfg; padding-top: 1.25rem; }
.cfg-group { border: 0; margin: 0; padding: 2.2rem 0; min-inline-size: 0; border-top: 1px solid rgba(26,26,26,.1); }
.cfg-title { float: left; width: 100%; padding: 0; display: flex; align-items: baseline; gap: 12px; font-size: 16px; font-weight: 700; letter-spacing: -.01em; margin-bottom: .75rem; }
.cfg-title::before { counter-increment: cfg; content: counter(cfg, decimal-leading-zero); font-family: var(--font-mono); font-size: 11px; font-weight: 500; letter-spacing: .08em; color: var(--red, #A52E22); }
.cfg-title-value { margin-left: auto; font-family: var(--font-mono); font-size: 12px; font-weight: 400; letter-spacing: 0; }
.cfg-title-opt { font-family: var(--font-mono); font-size: 11px; font-weight: 400; letter-spacing: 0; }
.cfg-title + * { clear: both; }   /* whatever follows the floated title starts on its own line */

.cfg-why { margin: 0 0 1.1rem; }
.cfg-why summary { display: inline-flex; align-items: center; gap: 8px; list-style: none; cursor: pointer; font-family: var(--font-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; border-bottom: 1px solid currentColor; padding-bottom: 1px; }
.cfg-why summary::-webkit-details-marker { display: none; }
.cfg-why summary::after { content: '+'; font-size: 13px; letter-spacing: 0; transition: transform .2s; }
.cfg-why[open] summary::after { transform: rotate(45deg); }
.cfg-why summary:hover { color: var(--red, #A52E22); }
.cfg-why p { margin: .8rem 0 0; font-size: 14px; line-height: 1.6; max-width: 62ch; animation: cfgIn .3s ease both; }
.cfg-sub-label { margin: 1.1rem 0 .6rem; font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--red, #A52E22); }
.cfg-sub-label:first-of-type { margin-top: .2rem; }

/* option cards: fill black when chosen (site pattern) */
.cfg-cards { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.cfg-cards.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cfg-cards.cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.cfg-card {
  position: relative; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 4px;
  min-height: 68px; padding: 14px 16px; border: 1px solid var(--cfg-line); border-radius: 6px; background: var(--white, #F7F7F5);
  text-align: left; cursor: pointer; transition: border-color .15s, background .22s, color .22s, transform .15s cubic-bezier(.22,.61,.36,1);
}
.cfg-card:hover { border-color: var(--black, #1A1A1A); }
.cfg-card:active { transform: scale(.985); }
.cfg-card input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.cfg-card:has(input:checked) { background: var(--black, #1A1A1A); color: var(--white, #F7F7F5); border-color: var(--black, #1A1A1A); }
.cfg-card:has(input:focus-visible) { outline: 2px solid var(--red, #A52E22); outline-offset: 2px; }
.cfg-card-title { font-size: 14px; font-weight: 600; line-height: 1.3; }
.cfg-card-sub { font-family: var(--font-mono); font-size: 10.5px; line-height: 1.4; }
.cfg-card-delta { font-family: var(--font-mono); font-size: 11px; font-variant-numeric: tabular-nums; color: var(--red, #A52E22); }
.cfg-card:has(input:checked) .cfg-card-delta { color: #E8796B; }
.cfg-card-delta:empty { display: none; }
.cfg-cards.cols-6 .cfg-card { min-height: 48px; }

/* colour swatches */
.cfg-swatches { display: flex; flex-wrap: wrap; gap: 20px 16px; padding-top: .2rem; }
.cfg-swatch { position: relative; display: grid; justify-items: center; gap: 8px; width: 60px; cursor: pointer; }
.cfg-swatch input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.cfg-swatch-dot { width: 44px; height: 44px; border-radius: 50%; background: var(--sw); box-shadow: inset 0 0 0 1px rgba(26,26,26,.14); transition: transform .2s cubic-bezier(.22,.61,.36,1), box-shadow .2s; }
.cfg-swatch:hover .cfg-swatch-dot { transform: scale(1.07); }
.cfg-swatch:has(input:checked) .cfg-swatch-dot { box-shadow: inset 0 0 0 1px rgba(26,26,26,.14), 0 0 0 3px var(--white, #F7F7F5), 0 0 0 5px var(--black, #1A1A1A); }
.cfg-swatch:has(input:focus-visible) .cfg-swatch-dot { outline: 2px solid var(--red, #A52E22); outline-offset: 7px; }
.cfg-swatch-name { font-family: var(--font-mono); font-size: 10.5px; white-space: nowrap; }

/* quantity stepper */
.cfg-stepper { display: inline-flex; align-items: center; border: 1px solid var(--cfg-line); border-radius: 8px; overflow: hidden; }
.cfg-stepper button { width: 48px; height: 48px; border: 0; background: none; color: var(--black, #1A1A1A); font-size: 22px; line-height: 1; cursor: pointer; transition: background .15s; }
.cfg-stepper button:hover:not(:disabled) { background: rgba(26,26,26,.05); }
.cfg-stepper button:disabled { opacity: .3; cursor: default; }
.cfg-stepper button:focus-visible { outline: 2px solid var(--red, #A52E22); outline-offset: -2px; }
.cfg-stepper output { min-width: 52px; text-align: center; font-family: var(--font-mono); font-size: 19px; font-variant-numeric: tabular-nums; }

/* asking for an answer: a pulse on the group, a shake on the button */
@keyframes cfgAttn { 0% { box-shadow: 0 0 0 0 rgba(165,46,34,.5); } 100% { box-shadow: 0 0 0 14px rgba(165,46,34,0); } }
.cfg-attn { animation: cfgAttn 1s ease-out 2; border-radius: 8px; }
@keyframes cfgShake { 0%,100% { transform: none; } 20% { transform: translateX(-7px); } 40% { transform: translateX(7px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(4px); } }
.cfg-shake { animation: cfgShake .42s cubic-bezier(.36,.07,.19,.97); }
.cfg-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@keyframes cfgIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ── Tablet and phone ──────────────────────────────────────── */
@media (max-width: 860px) {
  .cfg-cards.cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cfg-cards.cols-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .cfg-stage { height: clamp(190px, 30vh, 300px); border-radius: 8px; }
  .cfg-meta { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name link" "dims dims" "files files"; gap: 4px 12px; }
  .cfg-meta-name { grid-area: name; max-width: none; }
  .cfg-meta-dims { grid-area: dims; }
  .cfg-files { grid-area: files; margin-top: 6px; }
  .cfg-meta .cfg-link { grid-area: link; margin-left: 0; }
  .cfg-cards.cols-4 { grid-template-columns: minmax(0, 1fr); }
  .cfg-cards.cols-4.keep-2, .cfg-cards.cols-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cfg-card { min-height: 0; padding: 12px 14px; }
  .cfg-swatches { gap: 18px 6px; }
  .cfg-swatch { width: 52px; }
  .cfg-stage-tools { left: 10px; right: 10px; bottom: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .cfg-loading::before, .cfg-loading-shape, .cfg-attn, .cfg-shake { animation: none; }
}
