/* WEARHR Runway: scroll-driven "Try the Look". Uses the theme's tokens (--ink canvas, --bone text). */
.rw { position: relative; height: calc(100svh + (var(--rw-n, 5) - 1) * var(--rw-step, 62svh)); border-bottom: 1px solid var(--line); background: var(--ink); }
.rw-sticky { position: sticky; top: 0; height: 100svh; overflow: hidden; perspective: 1400px; --rw-h: min(64svh, 760px); --rw-panel: min(380px, 30vw); }

.rw-ghost { position: absolute; left: 0; top: calc(var(--header-h) + 9svh); width: calc(var(--rw-n, 5) * 100vw); display: flex; pointer-events: none; will-change: transform; }
.rw-ghost span { flex: 0 0 100vw; padding-left: 3vw; font-family: var(--serif); font-weight: 800; letter-spacing: -0.06em; font-size: clamp(80px, 17vw, 300px); line-height: 0.85; white-space: nowrap; color: transparent; -webkit-text-stroke: 1px rgba(17, 17, 17, 0.14); }
.rw-glow { position: absolute; left: -10%; right: -10%; bottom: -16svh; height: 44svh; background: radial-gradient(60% 70% at 38% 40%, rgba(230, 212, 242, 0.9), transparent 70%), radial-gradient(50% 60% at 72% 55%, rgba(246, 217, 196, 0.9), transparent 70%); opacity: 0.85; pointer-events: none; }

.rw-head { position: absolute; z-index: 15; left: var(--gutter); top: calc(var(--header-h) + clamp(12px, 2.4svh, 28px)); pointer-events: none; }
.rw-head h1, .rw-head h2 { font-family: var(--serif); font-weight: 500; font-size: clamp(34px, 4.2vw, 68px); letter-spacing: -0.045em; line-height: 0.95; margin: 0; }
.rw-head p { margin: 10px 0 0; color: var(--bone-3); font-size: 13px; }
.rw-kicker { display: inline-flex; align-items: center; gap: 9px; margin-bottom: 14px; padding: 7px 14px 7px 11px; border: 1px solid var(--line-strong); border-radius: 999px; background: rgba(246, 245, 242, 0.85); font-size: 10px; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase; }
.rw-kicker i { width: 7px; height: 7px; border-radius: 50%; background: var(--ember); box-shadow: 0 0 0 0 rgba(217, 67, 42, 0.5); animation: rwlive 2s ease-out infinite; }
@keyframes rwlive { 0% { box-shadow: 0 0 0 0 rgba(217, 67, 42, 0.5); } 70%, 100% { box-shadow: 0 0 0 9px rgba(217, 67, 42, 0); } }
.rw-shop { display: inline-flex; align-items: center; gap: 8px; margin-left: 6px; padding: 11px 18px; border-radius: 999px; background: var(--bone); color: var(--ink); font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; white-space: nowrap; transition: transform 0.4s var(--ease); }
.rw-shop:hover { transform: translateX(4px); }

.rw-cast { position: absolute; inset: 0; pointer-events: none; }
.rw-fig { position: absolute; left: 0; bottom: 13svh; width: calc(var(--rw-h) * 0.4); height: var(--rw-h); padding: 0; background: none; border: 0; display: flex; align-items: flex-end; justify-content: center; pointer-events: auto; transform-origin: 50% 100%; will-change: transform, opacity; transition: filter 0.5s var(--ease); -webkit-tap-highlight-color: transparent; }
.rw-fig.is-far { filter: blur(4px); }
.rw-fig img, .rw-fig > svg, .rw-fig .outfit { width: 100%; height: 100%; object-fit: contain; object-position: 50% 100%; pointer-events: none; -webkit-user-drag: none; user-select: none; }
.rw-shadow { position: absolute; left: 4%; right: 4%; bottom: -2.4svh; height: 4svh; background: radial-gradient(closest-side, rgba(0, 0, 0, 0.32), transparent); z-index: -1; }
.rw-tag { position: absolute; top: 22%; left: 100%; display: flex; align-items: center; gap: 10px; white-space: nowrap; font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--bone); opacity: 0; transition: opacity 0.5s var(--ease) 0.15s; }
.rw-tag::before { content: ""; width: 46px; height: 1px; background: var(--bone); transform: scaleX(0); transform-origin: left; transition: transform 0.7s var(--ease) 0.1s; }
.rw-fig.is-active .rw-tag { opacity: 1; }
.rw-fig.is-active .rw-tag::before { transform: none; }
.rw-fig:focus-visible { outline: 1px solid var(--bone); outline-offset: 6px; }

/* panel */
.rw-panel { position: absolute; z-index: 20; right: var(--gutter); top: 50%; transform: translateY(-46%); width: var(--rw-panel); max-height: calc(100svh - var(--header-h) - 28px); overflow: hidden; display: flex; flex-direction: column; background: rgba(246, 245, 242, 0.94); border: 1px solid var(--line); border-radius: 22px; padding: 24px; box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.25); }
.rw-panel > * { flex-shrink: 0; }
.rw-panel > .rw-pieces { flex-shrink: 1; }
.rw-k { display: flex; justify-content: space-between; font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--bone-3); }
.rw-title { margin: 12px 0 6px; overflow: hidden; font-family: var(--serif); font-weight: 800; font-size: clamp(32px, 3.4vw, 52px); letter-spacing: -0.05em; line-height: 0.98; }
.rw-title span { display: inline-block; }
.rw-sub { margin: 0; font-size: 13px; line-height: 1.45; color: var(--bone-2); min-height: 38px; }
.rw-pieces { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; margin: 14px 0 12px; border-top: 1px solid var(--line); }
.rw-piece { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); opacity: 0; transform: translateY(10px); }
.rw-panel.in .rw-piece { opacity: 1; transform: none; transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); transition-delay: calc(var(--i, 0) * 0.08s + 0.1s); }
.rw-thumb { position: relative; display: block; width: 52px; height: 58px; border-radius: 6px; overflow: hidden; background: var(--ink-3); }
.rw-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rw-thumb .ph { width: 100%; height: 100%; }
.rw-thumb .n { position: absolute; left: 4px; top: 3px; font-size: 9px; color: var(--bone-3); }
.rw-meta small { display: block; font-size: 9px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--bone-3); margin-bottom: 2px; }
.rw-meta a { display: block; font-size: 13px; font-weight: 600; line-height: 1.25; }
.rw-meta .price { font-size: 12px; color: var(--bone-2); }
.rw-add { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line-strong); display: grid; place-items: center; font-size: 18px; line-height: 1; transition: background 0.3s var(--ease), color 0.3s var(--ease); background: none; }
.rw-add:hover:not(:disabled) { background: var(--bone); color: var(--ink); }
.rw-add:disabled { opacity: 0.3; }
.rw-add.is-loading { opacity: 0.5; pointer-events: none; }
.rw-add.ok { background: var(--bone); color: var(--ink); }
.rw-sizes { display: grid; gap: 8px; margin: 0 0 12px; }
.rw-srow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.rw-sizes:empty { display: none; }
.rw-srow span { font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--bone-3); margin-right: 4px; min-width: 52px; }
.rw-sizes button { min-width: 36px; height: 30px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line-strong); background: none; font-size: 12px; font-weight: 600; transition: background 0.25s, color 0.25s, border-color 0.25s; }
.rw-sizes button.on { background: var(--bone); color: var(--ink); border-color: var(--bone); }
.rw-sizes.shake { animation: rwshake 0.45s; }
@keyframes rwshake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
.rw-bundle { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; margin-bottom: 12px; }
.rw-bundle[hidden] { display: none; }
.rw-bundle b { display: block; font-weight: 600; font-size: 13px; }
.rw-bundle small { color: var(--bone-3); font-size: 12px; }
.rw-totals { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rw-totals s { color: var(--bone-3); font-size: 13px; margin-right: 8px; }
.rw-totals strong { font-size: 24px; letter-spacing: -0.03em; font-weight: 700; }
.rw-cta { position: relative; display: flex; justify-content: space-between; align-items: center; width: 100%; border: 0; border-radius: 999px; padding: 16px 22px; background: var(--bone); color: var(--ink); font: 600 13px var(--sans); letter-spacing: 0.02em; overflow: hidden; will-change: transform; }
.rw-cta::before { content: ""; position: absolute; inset: 0; background: linear-gradient(100deg, #e6d4f2, #f6d9c4); transform: translateX(-101%); transition: transform 0.6s var(--ease); }
.rw-cta:hover::before { transform: none; }
.rw-cta:hover { color: var(--bone); }
.rw-cta > * { position: relative; }
.rw-cta.is-loading { opacity: 0.6; pointer-events: none; }
.rw-note { margin: 8px 0 0; min-height: 16px; font-size: 12px; color: var(--ember); }

/* HUD */
.rw-hud { position: absolute; z-index: 21; left: var(--gutter); bottom: clamp(16px, 4svh, 36px); display: flex; align-items: center; gap: 16px; font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; }
.rw-hud button { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line-strong); background: none; display: grid; place-items: center; transition: background 0.3s var(--ease), color 0.3s var(--ease); }
.rw-hud button:hover { background: var(--bone); color: var(--ink); }
.rw-rail { position: relative; width: 150px; height: 1px; background: var(--line-strong); }
.rw-rail i { position: absolute; left: 0; top: -1px; height: 3px; width: 0; background: var(--bone); }
.rw-hint { color: var(--bone-3); }

@media (max-width: 900px) {
	.rw-sticky { --rw-panel: auto; --rw-stack: 46svh; --rw-h: clamp(170px, calc(100svh - 142px - var(--rw-stack)), 52svh); }
	.rw-fig { bottom: calc(var(--rw-stack) + 6px); }
	.rw-head h1, .rw-head h2 { font-size: 30px; }
	.rw-head p { display: none; }
	.rw-head { display: flex; align-items: center; gap: 12px; right: var(--gutter); }
	.rw-kicker { margin: 0; font-size: 9px; padding: 6px 11px 6px 9px; }
	.rw-kicker .k-long { display: none; }
	.rw-panel { top: auto; bottom: 62px; left: 12px; right: 12px; transform: none; width: auto; max-height: 40svh; padding: 14px 16px; border-radius: 18px; background: rgba(246, 245, 242, 0.97); }
	.rw-title { font-size: 28px; margin: 6px 0 2px; }
	.rw-sub { display: none; }
	.rw-pieces { margin: 8px 0; max-height: 14svh; min-height: 58px; }
	.rw-piece { grid-template-columns: 40px 1fr auto; padding: 6px 0; }
	.rw-thumb { width: 40px; height: 44px; }
	.rw-hint { display: none; }
	.rw-rail { width: 70px; }
	.rw-shop { margin-left: auto; padding: 10px 14px; font-size: 10px; }
	.rw-hud { right: 12px; }
	.rw-hud { bottom: 12px; }
	.rw-tag { display: none; }
}
@media (prefers-reduced-motion: reduce) {
	.rw-kicker i { animation: none; }
	.rw-tag, .rw-tag::before, .rw-piece, .rw-cta::before { transition-duration: 0.01s !important; }
}

/* Phones: the "Add full look to bag" button must always sit fully inside the panel and stay tappable. */
@media (max-width: 900px) {
	.rw-pieces { min-height: 0; }
	.rw-note:empty { display: none; margin: 0; min-height: 0; }
}
@media (max-width: 900px) and (max-height: 780px) {
	.rw-panel { padding: 12px 14px; }
	.rw-pieces { display: none; }
	.rw-title { font-size: 24px; margin: 4px 0 6px; }
	.rw-sizes { gap: 6px; margin: 0 0 8px; }
	.rw-sizes button { height: 28px; min-width: 32px; }
	.rw-bundle { margin-bottom: 8px; }
	.rw-totals strong { font-size: 20px; }
	.rw-cta { padding: 13px 18px; }
}

/* Very short phones (about 600px tall or less): drop the extras so the model, sizes and button all fit. */
@media (max-width: 900px) and (max-height: 600px) {
	.rw-sticky { --rw-h: clamp(110px, calc(100svh - 76px - var(--rw-stack)), 40svh); }
	.rw-panel { max-height: none; }
	.rw-head, .rw-k { display: none; }
	.rw-title { font-size: 20px; margin: 0 0 6px; }
	.rw-ghost { display: none; }
}
