/* رِدا — راك العبايات */
.rail { position: relative; isolation: isolate; width: 100%; }
.rail-stage { position: relative; width: 100%; touch-action: pan-y; user-select: none; overflow-x: clip; }

/* brass rod */
.rail-bar { position: absolute; inset-inline: 0; z-index: 0; pointer-events: none; }
.rail-rod { position: absolute; inset: 0; border-radius: 999px;
  background: linear-gradient(to bottom, color-mix(in oklab, var(--rail, #1b3264) 80%, white) 0%, color-mix(in oklab, var(--rail, #1b3264) 25%, white) 20%, color-mix(in oklab, var(--rail, #1b3264) 70%, white) 40%, var(--rail, #1b3264) 64%, color-mix(in oklab, var(--rail, #1b3264) 55%, black) 100%);
  box-shadow: 0 1px 0 rgba(12,31,69,.2); }
.rail-shadow { position: absolute; inset-inline: 0; top: calc(100% + 2px); height: 12px; border-radius: 999px; background: rgba(12,31,69,.12); filter: blur(5px); }
.rail-end { position: absolute; top: 50%; left: 6px; width: 16px; height: 28px; transform: translateY(-50%); border-radius: 3px;
  background: linear-gradient(to right, color-mix(in oklab, var(--rail, #1b3264) 70%, white), var(--rail, #1b3264) 55%, color-mix(in oklab, var(--rail, #1b3264) 55%, black)); box-shadow: 0 3px 6px rgba(12,31,69,.2); }
.rail-end.r { left: auto; right: 6px; }

/* a garment */
.ri { position: absolute; left: 0; padding: 0; border: 0; background: none; cursor: pointer; border-radius: 12px; outline: none; -webkit-tap-highlight-color: transparent; }
.ri:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }
.ri-swing, .ri-side, .ri-turn, .ri-face, .ri-drape, .ri-shadow-wrap { position: absolute; inset: 0; display: block; }
.ri-swing { transform-origin: 50% 1.29%; }
.ri-shadow-wrap { pointer-events: none; }
.ri-shadow { position: absolute; display: block; background: #000; opacity: .16; }
.ri-turn { transform-style: preserve-3d; border-radius: 8px; }
.ri-face { backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.ri-face.back { transform: rotateY(180deg); }
.ri-drape { transform-origin: top; transform: skewX(var(--drape, 0deg)); }
.ri-face.back .ri-drape { transform: skewX(calc(var(--drape, 0deg) * -1)); }
.ri-hanger { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.ri-photo, .ri-photo-box { position: absolute; left: 0; right: 0; top: 8%; height: 92%; width: 100%; }
.ri-photo { object-fit: contain; object-position: top; pointer-events: none; -webkit-user-drag: none; }
.ri-shade { display: block; background: #000; pointer-events: none; opacity: .2; }

/* hang tag */
.ri-tag { position: absolute; left: 50%; top: 10.6%; transform-origin: top; pointer-events: none; transform: rotate(-12deg); z-index: 2; }
.ri-tag i { display: block; width: 1px; height: 16px; margin-left: 3px; background: rgba(12,31,69,.35); }
.ri-tag b { position: relative; display: block; white-space: nowrap; transform: translateX(-50%); margin-left: 3px;
  padding: 8px 7px 4px; border-radius: 3px; border: 1px solid rgba(12,31,69,.08); background: var(--paper);
  font: 700 10px/1 var(--f-body); color: var(--ink); box-shadow: 0 2px 6px rgba(12,31,69,.18); }
.ri-tag b::before { content: ""; position: absolute; left: 50%; top: 3px; width: 3px; height: 3px; margin-left: -1.5px; border-radius: 50%; background: rgba(12,31,69,.3); }

/* carousel dots + caption */
.rail-dots { display: none; justify-content: center; gap: 6px; margin-top: 4px; position: relative; z-index: 5; }
.rail[data-mode="carousel"] .rail-dots { display: flex; }
.rail-dots button { width: 6px; height: 6px; padding: 0; border: 0; border-radius: 999px; background: rgba(12,31,69,.25); cursor: pointer; transition: width .3s, background .3s; position: relative; }
.rail-dots button::after { content: ""; position: absolute; inset: -10px -4px; }
.rail-dots button[aria-current="true"] { width: 24px; background: var(--ink); }
.rail-caption { min-height: 4.4rem; text-align: center; padding: 14px 16px 0; }
.rc-name { margin: 0; font-family: var(--f-head); font-size: 24px; font-weight: 400; }
.rc-desc { margin: 4px auto 0; max-width: 46ch; font-size: 14px; color: var(--muted); }

/* detail dialog */
.rail-detail { position: fixed; inset: 0; z-index: 90; display: flex; align-items: center; justify-content: center; padding: 24px; overflow-y: auto; color: var(--ink); }
.rd-backdrop { position: absolute; inset: 0; background: rgba(255,255,255,.92); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); opacity: 0; transition: opacity .3s; }
.rd-close { position: absolute; top: 20px; inset-inline-end: 20px; z-index: 2; display: inline-flex; gap: 8px; align-items: center; min-height: 44px; padding: 0 16px;
  border: 1px solid var(--line); border-radius: 999px; background: var(--paper); cursor: pointer; font-size: 14px; color: var(--muted); opacity: 0; transition: opacity .3s, color .2s; }
.rd-close:hover { color: var(--ink); }
.rd-close svg { width: 14px; height: 14px; }
.rd-grid { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 24rem); gap: 48px; align-items: center; width: 100%; max-width: 1040px; padding-top: 40px; }
.rd-figure { position: relative; margin: 0 auto; aspect-ratio: 200 / 310; height: min(66vh, 600px); max-width: 100%; transform-origin: top; }
.rd-wire { position: absolute; left: 50%; top: calc(-40vh + 1.29%); width: 3px; height: 40vh; transform: translateX(-50%); border-radius: 999px; background: linear-gradient(to right, color-mix(in oklab, var(--rail, #1b3264) 50%, white), var(--rail, #1b3264), color-mix(in oklab, var(--rail, #1b3264) 55%, black)); }
.rd-grab { position: absolute; inset: 0; perspective: 1400px; cursor: grab; touch-action: pan-y; }
.rd-grab:active { cursor: grabbing; }
.rd-spin { position: absolute; inset: 0; transform-style: preserve-3d; }
.rd-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.rd-face.back { transform: rotateY(180deg); }
.rd-face .ri-photo { filter: drop-shadow(0 24px 30px rgba(12,31,69,.18)); }
.rd-info { display: flex; flex-direction: column; gap: 12px; opacity: 0; transform: translateY(8px); transition: opacity .5s .15s, transform .5s .15s; }
.rd-count { margin: 0; font-size: 14px; letter-spacing: .2em; color: var(--muted); }
.rd-info h3 { font-size: clamp(32px, 4vw, 46px); }
.rd-price { margin: 0; font-size: 22px; font-weight: 700; }
.rd-desc { margin: 0; color: #3c4a66; line-height: 1.8; }
.rd-chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 4px 0 0; }
.rd-chips li { padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; color: var(--muted); }
.rd-faces { display: inline-flex; gap: 24px; margin-top: 6px; }
.rd-faces button { position: relative; min-height: 40px; padding: 0 0 6px; border: 0; background: none; cursor: pointer; font-size: 15px; color: var(--muted); }
.rd-faces button[aria-pressed="true"] { color: var(--ink); font-weight: 600; }
.rd-faces button::after { content: ""; position: absolute; inset-inline: 0; bottom: 0; height: 1px; background: var(--ink); transform: scaleX(0); transition: transform .3s; }
.rd-faces button[aria-pressed="true"]::after { transform: scaleX(1); }
.rd-actions { margin-top: 8px; }
.rd-hint { margin: 0; font-size: 12px; color: var(--muted); }
.rail-detail.shown .rd-backdrop, .rail-detail.shown .rd-close { opacity: 1; }
.rail-detail.shown .rd-info { opacity: 1; transform: none; }
@media (max-width: 820px) {
  .rd-grid { grid-template-columns: 1fr; gap: 24px; text-align: center; }
  .rd-figure { height: min(52vh, 460px); }
  .rd-chips, .rd-faces { justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .rd-backdrop, .rd-close, .rd-info { transition: none; }
}
