/* 3D section on the product page. Built from the page's own parts: the section head (rule + 48px title), the
   16-column split of the inquiry block (choices left, stage right), the PDP's .kv-chip choices (swatch fill, ring when
   chosen, square corners) and .kv-btn. The stage has no frame: the piece stands on the page's paper like the cut-outs. */

/* gallery corner: a link down to the section */
.kv-pdp__gallery[data-set="product"] { position: relative; }
.kv-3d-open {
	position: absolute; z-index: 3; top: 12px; right: 12px;
	display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px 8px 10px;
	background: var(--paper); color: var(--ink); text-decoration: none;
	font-size: 16px; line-height: 1.2; box-shadow: inset 0 0 0 1.5px color-mix(in srgb, currentColor 40%, transparent);
	transition: box-shadow 300ms var(--e-io), background 200ms var(--e-io), color 200ms var(--e-io);
}
.kv-3d-open svg { width: 22px; height: 22px; flex: none; }
.kv-3d-open:hover { box-shadow: inset 0 0 0 1.5px currentColor; }
.kv-3d-open:focus-visible { outline: 3px solid currentColor; outline-offset: 3px; }
/* phone/tablet: the gallery is a sideways strip; the link sits on the same box as the swipe counter (bottom left of the
   photo, counter bottom right) and stays put while the photos slide */
@media (max-width: 1023px) {
	.kv-pdp__media .kv-pdp__gallery[data-set="product"] { position: static; }
	.kv-3d-open { top: calc(var(--kv-hero-h) - 44px); left: 0; right: auto; padding: 6px 12px 6px 8px; font-size: 14px; }
	.kv-3d-open svg { width: 20px; height: 20px; }
}

/* the section */
.kv-pdp__3d { margin-top: var(--block); scroll-margin-top: calc(var(--header-h) + 8px); }
.kv-3d { display: grid; grid-template-columns: repeat(16, minmax(0, 1fr)); gap: var(--gut); align-items: start; }
.kv-3d__side { grid-column: 1 / span 5; display: grid; gap: 18px; align-content: start; }
.kv-3d__view { grid-column: 8 / span 9; display: grid; gap: 12px; position: sticky; top: calc(var(--header-h) + 16px); }  /* the stage stays in view while the longer room choices scroll */

.kv-3d__group { display: grid; gap: 6px; }
.kv-3d__label { margin: 0; font-size: 13px; line-height: 1.3; }
.kv-3d__label span { color: var(--ink-2); }
.kv-3d__label span::before { content: " · "; }
.kv-3d .kv-chips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }  /* three equal choices a row, on every screen */
.kv-3d .kv-chip { font: inherit; font-size: 13px; line-height: 1.2; padding: 6px 6px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; color: inherit; background: transparent; border: 0; border-radius: 0; cursor: pointer; }
.kv-3d .kv-chip.has-swatch { background: var(--sw); color: var(--sw-ink); padding: 6px 6px; }
.kv-3d .kv-chip.is-selected:not(.has-swatch) { background: var(--ink); color: var(--paper); }
.kv-3d .kv-chip.kv-3d__icon { display: inline-flex; align-items: center; gap: 6px; }
.kv-3d__icon svg { width: 15px; height: 15px; flex: none; }
.kv-3d .kv-chip.kv-3d__icon { padding: 6px 6px; gap: 4px; justify-content: center; }
.kv-3d__custom { position: relative; overflow: hidden; }
.kv-3d__custom input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.kv-3d__acts-row { margin-top: -10px; }
.kv-3d__acts .kv-btn { width: 100%; }
.kv-3d__acts .kv-btn svg { width: 20px; height: 20px; }
.kv-3d__note { display: flex; gap: 8px; margin: 0; font-size: 13px; line-height: 1.4; color: var(--ink-2); max-width: 40ch; }
.kv-3d__note svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }

.kv-3d__stage { position: relative; aspect-ratio: 4 / 3; max-height: calc(100vh - var(--header-h) - 200px); width: 100%; }  /* clear of the sticky buy bar */
.kv-3d__stage canvas { display: block; width: 100%; height: 100%; touch-action: pan-y; }
.kv-3d__zoom { position: absolute; right: 0; top: 0; display: flex; gap: 8px; }  /* top: the chat button sits bottom right of the screen */
.kv-3d__zoom .kv-chip { display: grid; place-items: center; width: 32px; height: 32px; padding: 0; background: var(--paper); }
.kv-3d__zoom svg { width: 16px; height: 16px; }
.kv-3d__load { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; pointer-events: none; opacity: 0; transition: opacity .25s var(--e-io); font-size: 16px; }
.kv-3d__load.is-on { opacity: 1; }
.kv-3d__load span::after { content: ""; display: inline-block; width: 1.2em; text-align: left; animation: kv3d-dots 1.2s steps(4) infinite; }
@keyframes kv3d-dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }
.kv-3d__hint { margin: 0; font-size: 14px; line-height: 1.35; color: var(--ink-2); transition: opacity .4s var(--e-io); }
.kv-3d__hint.is-dim { opacity: .55; }

@media (max-width: 1023px) {
	.kv-pdp > .kv-pdp__3d { order: 2; }
	.kv-3d__side, .kv-3d__view { grid-column: 1 / -1; }
	.kv-3d__view { order: -1; }
	.kv-3d__side { gap: 14px; }
	.kv-3d__view { position: static; }
	.kv-3d__stage { aspect-ratio: 1 / 1; max-height: 70vh; }
	.kv-3d .kv-chip, .kv-3d .kv-chip.has-swatch { font-size: 13px; padding: 6px 4px; }
}
@media (prefers-reduced-motion: reduce) { .kv-3d__load span::after { animation: none; } }
