/* Rabin-Interiors & Woods: Wardrobe Configurator. Themed through the --riw-* variables in core.css.
   The script draws the carcass and interiors in the SVG and lays the shutters over it as HTML, so a finish can be
   any CSS background (wood grain, texture). Each shutter carries its place inline as --x, --y, --w, --h (in %). */

.riw-wd { display: grid; grid-template-columns: 1.35fr .65fr; gap: 20px; }

/* Stage: a pale wall and a wooden floor, with the wardrobe drawn on it */
.riw-wd-stage { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 16px 20px 20px; border-radius: var(--riw-radius); overflow: hidden; background: #e9e4dc; color: #1c1712; }
.riw-wd-stage::before { content: ""; position: absolute; inset: 0; background: var(--riw-noise); opacity: .16; mix-blend-mode: multiply; pointer-events: none; }
.riw-wd-stage > * { position: relative; }
.riw-wd-bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; z-index: 2; }
.riw-wd-open { font-size: .8rem; font-weight: 600; line-height: 1.2; padding: .6rem 1rem; border-radius: 999px; border: 1px solid rgba(0,0,0,.1); background: rgba(255,255,255,.85); color: #1c1712; cursor: pointer; transition: background .3s, color .3s; }
.riw-wd-open:hover { background: #fff; }
.riw-wd-open.is-on { background: #1c1712; color: #f6f1e9; border-color: #1c1712; }
.riw-wd-hint { font-size: .68rem; letter-spacing: .16em; text-transform: uppercase; color: #6b655c; }

/* The drawing sits at the bottom of the stage; its floor (from the plinth line, 505 of 560) runs to the stage's edges */
.riw-wd-canvas { position: relative; width: 100%; aspect-ratio: 700 / 560; margin-top: auto; }
.riw-wd-canvas::before { content: ""; position: absolute; top: 90.18%; bottom: -40px; left: -40px; right: -40px; background: repeating-linear-gradient(90deg, transparent 0 110px, rgba(0,0,0,.07) 110px 111px), linear-gradient(180deg, #b99a76, #a88a66); }
.riw-wd-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; overflow: visible; }
.riw-wd-bay { cursor: pointer; outline: none; }
.riw-wd-hl { fill: none; stroke: var(--riw-accent); stroke-width: 4; opacity: 0; transition: opacity .2s; }
.riw-wd-bay:hover .riw-wd-hl { opacity: .45; }
.riw-wd-bay.is-sel .riw-wd-hl { opacity: 1; }
.riw-wd-dims { fill: #4a3a28; font-size: 16px; letter-spacing: .06em; font-family: var(--riw-font); }

/* Shutters */
.riw-wd-doors { position: absolute; inset: 0; perspective: 1600px; pointer-events: none; }
.riw-wd-door { position: absolute; left: var(--x); top: var(--y); width: var(--w); height: var(--h); background: #c9a272; border-radius: 2px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.18), inset 0 0 18px rgba(0,0,0,.06); transition: transform .9s cubic-bezier(.6,0,.2,1), left .8s cubic-bezier(.6,0,.2,1), filter .9s; }
.riw-wd-door::after { content: ""; position: absolute; top: 40%; width: 4px; height: 13%; border-radius: 2px; background: linear-gradient(180deg, #b28a4a, #e8c98a, #b28a4a); box-shadow: 0 1px 2px rgba(0,0,0,.35); }
.riw-wd-door--l { transform-origin: left center; }
.riw-wd-door--l::after { right: 9%; }
.riw-wd-door--r { transform-origin: right center; }
.riw-wd-door--r::after { left: 9%; }
.riw-wd-door--slide::after { left: 5%; height: 15%; }
.riw-wd-door--slide { box-shadow: inset 0 0 0 1px rgba(0,0,0,.18), -4px 0 10px -6px rgba(0,0,0,.4); }
.riw-wd-door--loft { transition: none; }
.riw-wd-door--loft::after { top: auto; bottom: 14%; left: 50%; width: 30%; height: 4px; transform: translateX(-50%); background: linear-gradient(90deg, #b28a4a, #e8c98a, #b28a4a); }
.riw-wd-door.is-glass { opacity: .58; }
.riw-wd-door.is-glass::after { background: linear-gradient(180deg, #c9a46a, #f1d9a6, #c9a46a); }
.riw-wd-track { position: absolute; left: var(--x); top: var(--y); width: var(--w); height: 5px; background: linear-gradient(180deg, #9a9a9a, #6c6c6c); border-radius: 2px; }
.riw-wd.is-open .riw-wd-door--l { transform: rotateY(-78deg); filter: brightness(.82); }
.riw-wd.is-open .riw-wd-door--r { transform: rotateY(78deg); filter: brightness(.82); }

/* Panel */
.riw-wd-panel { background: var(--riw-card); border: 1px solid var(--riw-line); border-radius: var(--riw-radius); padding: 1.6rem; display: flex; flex-direction: column; gap: 1.3rem; }
.riw-wd-panel h4 { font-family: var(--riw-font-display); font-size: .76rem; letter-spacing: .18em; text-transform: uppercase; color: var(--riw-muted); font-weight: 600; line-height: 1.4; margin-bottom: .7rem; display: flex; justify-content: space-between; gap: .5rem; }
.riw-wd-panel h4 em { font-style: normal; color: var(--riw-text); letter-spacing: 0; text-transform: none; font-family: var(--riw-font); font-weight: 500; text-align: right; }
.riw-wd-range { width: 100%; margin: 0; accent-color: var(--riw-accent); cursor: pointer; }

.riw-wd-bays { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: .7rem; }
.riw-wd-bays button { min-width: 34px; height: 34px; padding: 0 .5rem; border-radius: 999px; border: 1px solid var(--riw-line-strong); background: var(--riw-bg); color: var(--riw-text); font-size: .8rem; font-weight: 600; cursor: pointer; transition: all .25s; }
.riw-wd-bays button:hover { border-color: var(--riw-accent); }
.riw-wd-bays button.is-on { background: var(--riw-ink); color: #f6f1e9; border-color: var(--riw-ink); }
.riw--dark .riw-wd-bays button.is-on { background: var(--riw-accent-soft); color: #1c1712; border-color: var(--riw-accent-soft); }

.riw-wd-int { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.riw-wd-int button { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: .6rem .25rem; border-radius: 14px; border: 1px solid var(--riw-line-strong); background: var(--riw-bg); color: var(--riw-text); font-size: .7rem; font-weight: 600; line-height: 1.2; text-align: center; cursor: pointer; transition: all .25s; }
.riw-wd-int button:hover { border-color: var(--riw-accent); }
.riw-wd-int button.is-on { border-color: var(--riw-accent); background: var(--riw-tint); box-shadow: inset 0 0 0 1px var(--riw-accent); }
.riw-wd-int svg { width: 24px; height: 32px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }

.riw-wd-row { display: flex; gap: 8px; align-items: stretch; }
.riw-wd-seg { flex: 1; display: flex; background: var(--riw-tint); border-radius: 999px; padding: 4px; }
.riw-wd-seg button { flex: 1; padding: .55rem; border-radius: 999px; border: 0; background: none; cursor: pointer; font-size: .82rem; color: var(--riw-muted); transition: all .3s; }
.riw-wd-seg button.is-on { background: var(--riw-accent-soft); color: #1c1712; }
.riw-wd-loft { padding: .55rem 1rem; border-radius: 999px; border: 1px solid var(--riw-line-strong); background: none; color: var(--riw-muted); font-size: .82rem; cursor: pointer; transition: all .3s; white-space: nowrap; }
.riw-wd-loft.is-on { background: var(--riw-accent-soft); border-color: var(--riw-accent-soft); color: #1c1712; }

.riw-wd-sws { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.riw-wd-sws button { aspect-ratio: 1; border-radius: 12px; border: 0; cursor: pointer; background: #ccc; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); transition: transform .3s var(--riw-ease); }
.riw-wd-sws button:hover { transform: translateY(-3px) scale(1.04); }
.riw-wd-sws button.is-on { box-shadow: 0 0 0 2px var(--riw-card), 0 0 0 4px var(--riw-accent-soft); }

.riw-wd-tot { border-top: 1px solid var(--riw-line); padding-top: 1rem; margin-top: auto; }
.riw .riw-wd-break { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; font-size: .84rem; color: var(--riw-muted); }
.riw-wd-break li { display: flex; justify-content: space-between; gap: 1rem; }
.riw-wd-break li b { font-weight: 500; color: var(--riw-text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.riw-wd-amt { font-family: var(--riw-font-display); font-size: clamp(2rem, 3.4vw, 2.8rem); font-weight: 700; letter-spacing: -.03em; line-height: 1; margin-top: .9rem; font-variant-numeric: tabular-nums; }
.riw-wd-panel .riw-btn { justify-content: center; }
.riw .riw-wd-note { font-size: .72rem; color: var(--riw-dim); text-align: center; line-height: 1.5; margin-top: -.5rem; }

@media (max-width: 1100px) {
	.riw-wd { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
	.riw-wd-stage { padding: 12px 10px 14px; }
	.riw-wd-hint { display: none; }
	.riw-wd-panel { padding: 1.2rem; }
	.riw-wd-int { grid-template-columns: repeat(3, 1fr); }
	.riw-wd-sws { grid-template-columns: repeat(5, 1fr); }
	.riw-wd-row { flex-direction: column; }
}
@media (prefers-reduced-motion: reduce) {
	.riw-wd * { transition: none !important; }
}
