/* side-profile rack: one garment height for both views, one hook, real spacing */
.dm-rack { --h: clamp(200px, 27vw, 380px); --hook: calc(var(--h) * .13); position: relative; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; padding: 0 var(--dm-gutter) 6rem; }
.dm-rack::-webkit-scrollbar { display: none; }
.rk-bar { display: none; }
.rk-track::before { content: ""; position: absolute; left: -1.5rem; right: -1.5rem; top: 2px; height: 10px; border-radius: 5px;
  background: linear-gradient(180deg, #fbfbfb 0%, #c4c4c4 40%, #7a7a7a 70%, #dcdcdc 100%); box-shadow: 0 6px 12px rgba(0,0,0,.14); }
.rk-track { position: relative; display: flex; justify-content: center; align-items: flex-start; gap: clamp(1rem, 3.2vw, 3rem);
  width: max-content; min-width: 100%; padding-top: 14px; padding-inline: 1.5rem; }
.rk-item { --sa: .3; --fa: .8; position: relative; flex: none; display: block; color: inherit; text-decoration: none; outline: none;
  width: max(calc(var(--h) * var(--sa)), 2.6rem); transition: width .5s cubic-bezier(.22,1,.36,1); }
.rk-item.is-front { width: calc(var(--h) * var(--fa)); }
/* rail centre sits 7px below the item's top edge (track padding 14px, bar 2–12px) */
.rk-hook { position: absolute; left: var(--hx, 50%); transition: left .3s ease; top: -16px; width: 24px; height: calc(var(--hook) + 14px); transform: translateX(-50%); z-index: 2; pointer-events: none; }
.rk-hook svg { display: block; width: 24px; height: 30px; overflow: visible; filter: drop-shadow(0 1px 1px rgba(0,0,0,.25)); }
.rk-hook path { fill: none; stroke: #a7a7a7; stroke-width: 2.6; stroke-linecap: round; }
.rk-hook .rk-hk-back { stroke: #8a8a8a; }
.rk-hook::after { content: ""; position: absolute; left: 50%; top: 29px; bottom: 0; width: 2.6px; transform: translateX(-50%); border-radius: 2px;
  background: #a7a7a7; box-shadow: 0 1px 1px rgba(0,0,0,.2); }
.rk-pics { position: relative; display: block; height: var(--h); margin-top: calc(var(--hook) - 4px); }
.rk-side, .rk-front { position: absolute; top: 0; left: 50%; height: var(--h); width: auto; max-width: none; transform: translateX(-50%); }
.rk-side { filter: drop-shadow(0 12px 10px rgba(0,0,0,.15)); transition: opacity .3s ease; }
.rk-front { opacity: 0; transform: translateX(-50%) scale(.97); filter: drop-shadow(0 20px 20px rgba(0,0,0,.18));
  transition: opacity .35s ease, transform .5s cubic-bezier(.22,1,.36,1); }
.rk-item.is-front .rk-side { opacity: 0; }
.rk-item.is-front .rk-front { opacity: 1; transform: translateX(-50%) scale(1); }
.rk-cap { position: absolute; top: calc(var(--hook) + var(--h) + 1rem); left: 50%; width: max(100%, 15rem); transform: translate(-50%, 6px); text-align: center;
  font-size: .9rem; line-height: 1.3; opacity: 0; transition: opacity .3s ease .1s, transform .3s ease .1s; pointer-events: none; }
.rk-cap b { display: block; margin: .2rem 0; font-weight: 600; }
.rk-item.is-front .rk-cap { opacity: 1; transform: translate(-50%, 0); }
.rk-item:focus-visible .rk-pics { outline: 3px solid var(--dm-red); outline-offset: 4px; border-radius: 4px; }
@media (prefers-reduced-motion: reduce) { .rk-item, .rk-side, .rk-front, .rk-cap { transition: none; } }

/* brand tabs over the rack */
.rk-tabs { margin-bottom: 2.2rem; }
.dm-rack .rk-track { transition: opacity .22s ease; }
.dm-rack.is-swapping .rk-track { opacity: 0; }
.rk-morewrap { display: flex; justify-content: center; padding-inline: var(--dm-gutter); margin-top: -2.5rem; }
.rk-more { font-weight: 700; color: var(--dm-ink); text-decoration: none; border-bottom: 2px solid var(--dm-red); padding-bottom: 2px; }
.rk-more::after { content: " \2192"; }
.rk-more:hover, .rk-more:focus-visible { color: var(--dm-red); }
@media (max-width: 640px) { .rk-tabs { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; scrollbar-width: none; } .rk-tabs .dm-chip { flex: none; } }
/* pieces still waiting on a side profile hang front-on (cut out in the browser) */
.rk-item.is-flat .rk-front { opacity: 1; height: calc(var(--h) * .78); transform: translateX(-50%) scale(1); }
.rk-item.is-flat.is-loading .rk-front { opacity: 0; }
.rk-item.is-flat { width: calc(var(--h) * .78 * var(--fa)); }
.rk-item.is-flat.is-front .rk-front { transform: translateX(-50%) scale(1.04); }
.rk-empty { padding: 4rem 0; color: var(--dm-steel); }
.rk-track { min-height: calc(var(--hook) + var(--h)); }
.rk-morewrap { margin-top: .75rem; }
/* wide pieces (varsity jackets, boxy tees) are capped so the front view never runs off the rack */
.rk-item.is-front { width: calc(var(--h) * min(var(--fa), 1.15)); }
.rk-item .rk-front { height: calc(var(--h) * min(1, 1.15 / var(--fa))); }

.rk-item.is-front .rk-hook, .rk-item.is-flat .rk-hook { left: 50%; }

/* phone: the tapped piece opens in place (no sliding width), then glides to centre */
@media (max-width: 760px) {
  .rk-item { transition: none; }
}
