/* Shared 3D product showroom (/furniture/, /accessories/). Each page sets its palette on .sr-page:
   --sr-bg1/--sr-bg2 (backdrop), --sr-ink, --sr-muted, --sr-accent, --sr-card, --sr-card-ink, --f-display. */
.sr-page { --sr-card: rgba(255, 255, 255, .9); --sr-card-ink: #1d1a17; }

.sr-stage {
  position: relative; height: min(90svh, 920px); min-height: 560px; overflow: hidden; color: var(--sr-ink);
  background: radial-gradient(120% 90% at 62% 40%, var(--sr-bg1), var(--sr-bg2) 75%);
  transition: background-color .8s;
}
.sr-stage::after { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .9s;
  background: radial-gradient(60% 55% at 62% 45%, rgba(255, 170, 80, .16), rgba(10, 6, 3, .82) 75%); }
.sr-stage.is-lamp-on::after { opacity: 1; }
.sr-stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: pan-y; z-index: 1; }
.sr-stage canvas:active { cursor: grabbing; }

/* Product info (left) */
.sr-info { position: absolute; z-index: 3; left: max(24px, (100vw - 1240px) / 2); top: 50%; translate: 0 -50%; width: min(24rem, 32vw); pointer-events: none; transition: color .8s; }
.sr-info > * { pointer-events: auto; }
.sr-stage.is-lamp-on .sr-info { color: #f6ece0; }
.sr-kick { font: 500 .72rem var(--f-mono); letter-spacing: .18em; text-transform: uppercase; color: var(--sr-accent); margin: 0 0 .8rem; }
.sr-page .sr-name { font: var(--sr-name-weight, 400) clamp(2.4rem, 4.6vw, 4.2rem)/1 var(--f-display); letter-spacing: var(--sr-name-track, -.02em); margin: 0; color: inherit; text-transform: none; }
.sr-price { font: 600 1.15rem var(--f-body); margin: .9rem 0 0; }
.sr-price small { font-weight: 400; opacity: .7; font-size: .8rem; }
.sr-blurb { margin: .8rem 0 0; color: var(--sr-muted); line-height: 1.55; transition: color .8s; }
.sr-stage.is-lamp-on .sr-blurb { color: rgba(246, 236, 224, .72); }
.sr-colours { margin-top: 1.5rem; }
.sr-colours[hidden] { display: none; }
.sr-label { display: block; font-size: .85rem; color: var(--sr-muted); margin-bottom: .6rem; }
.sr-label b { color: var(--sr-ink); font-weight: 600; }
.sr-swatches { display: flex; flex-wrap: wrap; gap: .65rem; }
.sr-swatches button { width: 32px; height: 32px; border-radius: 50%; border: 0; padding: 0; cursor: pointer; background: var(--sw);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15), 0 0 0 3px transparent; transition: transform .2s, box-shadow .2s; }
.sr-swatches button:hover { transform: scale(1.08); }
.sr-swatches button[aria-checked="true"] { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .15), 0 0 0 3px var(--sr-bg2), 0 0 0 4.5px var(--sr-ink); }
.sr-switch { margin-top: 1.5rem; display: inline-flex; align-items: center; gap: .7rem; padding: .7rem 1.2rem .7rem .8rem; border-radius: 999px; cursor: pointer;
  border: 1px solid currentColor; background: none; color: inherit; font: 600 .9rem var(--f-body); }
.sr-switch[hidden] { display: none; }
.sr-switch i { width: 34px; height: 20px; border-radius: 99px; background: rgba(0, 0, 0, .18); position: relative; transition: background .3s; }
.sr-switch i::after { content: ""; position: absolute; left: 3px; top: 3px; width: 14px; height: 14px; border-radius: 50%; background: #fff; transition: translate .3s; }
.sr-switch[aria-pressed="true"] i { background: #ffb867; }
.sr-switch[aria-pressed="true"] i::after { translate: 14px 0; }
.sr-hint { margin: 1.6rem 0 0; font: 500 .68rem var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--sr-muted); display: flex; gap: .55rem; align-items: center; }
.sr-hint::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--sr-accent); box-shadow: inset 0 0 0 3px var(--sr-bg2), inset 0 0 0 7px var(--sr-accent); }
.sr-load { position: absolute; z-index: 4; left: 50%; top: 50%; translate: -50% -50%; font: 500 .72rem var(--f-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--sr-muted); opacity: 0; transition: opacity .4s; pointer-events: none; }
.sr-load.on { opacity: 1; }

/* Hotspots pinned to the model (positioned by JS each frame) */
.sr-spots { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.sr-spot {
  position: absolute; left: 0; top: 0; width: 44px; height: 44px; margin: -22px 0 0 -22px; border: 0; padding: 0; background: none; cursor: pointer;
  display: grid; place-items: center; pointer-events: auto; opacity: 0; transition: opacity .35s;
}
.sr-spots.in .sr-spot { opacity: 1; transition-delay: calc(var(--i) * 90ms + 300ms); }
.sr-spots.in .sr-spot.is-hidden { opacity: 0; pointer-events: none; transition-delay: 0s; }
.sr-spot::before, .sr-spot::after { content: ""; position: absolute; inset: 7px; border-radius: 50%; border: 2px solid #fff; }
.sr-spot::before { background: rgba(0, 0, 0, .25); box-shadow: 0 3px 12px rgba(0, 0, 0, .35); backdrop-filter: blur(2px); }
.sr-spot::after { border-color: rgba(255, 255, 255, .9); animation: sr-ripple 2.4s cubic-bezier(.2, .6, .3, 1) infinite; animation-delay: calc(var(--i) * .35s); }
.sr-spot i { position: relative; z-index: 1; width: 10px; height: 10px; border-radius: 50%; background: var(--sr-accent); box-shadow: 0 0 10px var(--sr-accent); animation: sr-breathe 2.4s ease-in-out infinite; animation-delay: calc(var(--i) * .35s); }
@keyframes sr-ripple { 0% { transform: scale(1); opacity: .9; } 100% { transform: scale(2.3); opacity: 0; } }
@keyframes sr-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.35); } }
.sr-spot:hover::before, .sr-spot:focus-visible::before { transform: scale(1.12); background: rgba(0, 0, 0, .45); transition: transform .25s; }
.sr-spot:focus-visible { outline: none; }
.sr-spot:focus-visible::before { box-shadow: 0 0 0 3px var(--sr-accent); }
.sr-spot.is-seen i { background: #fff; box-shadow: none; animation: none; }
.sr-spot.is-seen::after { animation: none; opacity: 0; }
.sr-spot[aria-expanded="true"]::before { background: var(--sr-accent); transform: scale(1.25); }
.sr-spot[aria-expanded="true"] i { background: #fff; animation: none; }
.sr-stage.is-card .sr-spot:not([aria-expanded="true"]) { opacity: .45; }

/* Card */
.sr-card {
  position: absolute; z-index: 5; left: 0; top: 0; width: 320px; padding: 1rem 1.15rem .95rem; border-radius: 18px;
  background: var(--sr-card); color: var(--sr-card-ink); backdrop-filter: blur(16px) saturate(1.3); -webkit-backdrop-filter: blur(16px) saturate(1.3);
  box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .5); animation: sr-card-in .45s cubic-bezier(.2, .9, .3, 1.2);
}
.sr-card[hidden] { display: none; }
@keyframes sr-card-in { from { opacity: 0; scale: .9; } to { opacity: 1; scale: 1; } }
.sr-card__top { display: flex; justify-content: space-between; align-items: center; margin-bottom: .35rem; }
.sr-card__n { font: 500 .66rem var(--f-mono); letter-spacing: .14em; color: var(--sr-accent); }
.sr-card__x { width: 28px; height: 28px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .08); color: inherit; font-size: 1.1rem; cursor: pointer; }
.sr-page .sr-card h3 { font: var(--sr-name-weight, 400) 1.35rem/1.15 var(--f-display); margin: 0 0 .45rem; color: inherit; letter-spacing: -.01em; }
.sr-card p { margin: 0 0 .8rem; font-size: .93rem; line-height: 1.55; opacity: .85; }
.sr-card strong { display: inline-flex; padding: .32rem .7rem; border-radius: 99px; background: color-mix(in srgb, var(--sr-accent) 20%, transparent); font: 600 .78rem var(--f-body); }
.sr-card__body > * { animation: sr-rise .5s cubic-bezier(.2, .8, .2, 1) both; }
.sr-card__body > :nth-child(2) { animation-delay: .06s; }
.sr-card__body > :nth-child(3) { animation-delay: .12s; }
@keyframes sr-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.sr-card__nav { display: flex; justify-content: space-between; margin-top: .85rem; padding-top: .65rem; border-top: 1px solid rgba(128, 128, 128, .25); }
.sr-card__nav button { border: 0; background: none; color: var(--sr-accent); font: 600 .82rem var(--f-body); cursor: pointer; }

/* Product tabs */
.sr-tabs { position: absolute; z-index: 4; left: 50%; bottom: 22px; translate: -50% 0; display: flex; gap: .3rem; padding: .35rem; border-radius: 999px;
  background: color-mix(in srgb, var(--sr-bg2) 70%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: 0 10px 30px -14px rgba(0, 0, 0, .4); }
.sr-tabs button { border: 0; background: none; border-radius: 999px; padding: .65rem 1.1rem; font: 600 .86rem var(--f-body); color: var(--sr-muted); cursor: pointer; white-space: nowrap; transition: background .3s, color .3s; }
.sr-tabs button:hover { color: var(--sr-ink); }
.sr-tabs button[aria-selected="true"] { background: var(--sr-ink); color: var(--sr-bg1); }

@media (max-width: 800px) {
  .sr-stage { height: calc(100svh - 52px); min-height: 600px; }
  .sr-info { top: 18px; translate: none; left: 16px; right: 16px; width: auto; }
  .sr-page .sr-name { font-size: 2.2rem; }
  .sr-blurb, .sr-hint { display: none; }
  .sr-colours { margin-top: .9rem; }
  .sr-swatches button { width: 28px; height: 28px; }
  .sr-switch { margin-top: .8rem; }
  .sr-card { left: 12px !important; right: 12px; top: auto !important; bottom: 80px; width: auto; transform: none !important; }
  .sr-tabs { left: 12px; right: 12px; translate: none; bottom: 14px; overflow-x: auto; scrollbar-width: none; justify-content: space-between; }
  .sr-tabs button { padding: .6rem .8rem; font-size: .8rem; }
}
@media (prefers-reduced-motion: reduce) { .sr-spot::after, .sr-spot i { animation: none; } }

/* Static fallback when WebGL is off */
.sr-fallback { display: none; }
html:not(.sr-on) .sr-stage canvas, html:not(.sr-on) .sr-spots, html:not(.sr-on) .sr-tabs, html:not(.sr-on) .sr-colours, html:not(.sr-on) .sr-hint { display: none; }
html:not(.sr-on) .sr-fallback { display: block; position: absolute; right: 6%; top: 50%; translate: 0 -50%; width: min(52%, 640px); }

/* zoom: +/- buttons (right edge) and the "hold Ctrl to zoom" tip shown when a plain wheel passes over the stage */
.sr-zoom { position: absolute; z-index: 4; right: max(20px, (100vw - 1240px) / 2); bottom: 22px; display: flex; flex-direction: column; gap: .3rem; padding: .3rem; border-radius: 999px;
  background: var(--sr-card); box-shadow: 0 10px 30px -18px rgba(0, 0, 0, .5); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.sr-zoom button { width: 2.3rem; height: 2.3rem; border: 0; border-radius: 50%; background: transparent; color: var(--sr-card-ink); font: 400 1.35rem/1 var(--f-body); cursor: pointer; transition: background .2s; }
.sr-zoom button:hover, .sr-zoom button:focus-visible { background: rgba(127, 127, 127, .18); }
.sr-ztip { position: absolute; z-index: 5; left: 50%; top: 50%; translate: -50% -50%; padding: .7rem 1.1rem; border-radius: 12px; background: rgba(12, 13, 16, .78); color: #fff;
  font: 500 .9rem var(--f-body); pointer-events: none; opacity: 0; transition: opacity .3s; white-space: nowrap; }
.sr-ztip.on { opacity: 1; }
html:not(.sr-on) .sr-zoom { display: none; }
@media (max-width: 800px) { .sr-zoom { display: none; } .sr-ztip { display: none; } }
