/* ================================
   JAIFORE — STUDIO GARMENT RAIL + GRAPHICS WHEEL
   frontend/styles/studio-rail.css
   Used with scripts/studio-rail.js. Everything here is additive.
   ================================ */

/* ── Garment rail ─────────────────────────────────── */
.rail-band {
  position: relative;
  margin: 1.5rem 0 0.5rem;
  padding: 1.6rem 0 0.6rem;
  background: radial-gradient(900px 260px at 50% 0, #33194d, #0b0710);
  color: var(--cream, #f8f6e0);
  overflow: hidden;
}
.rail-band[hidden] { display: none; }
.rail-rod {
  position: absolute; left: 4%; right: 4%; top: 1.4rem; height: 8px; border-radius: 4px;
  background: linear-gradient(#f2edf6, #7d7488 60%, #3d3447);
  box-shadow: 0 0 18px rgba(10, 237, 227, 0.25);
}
.rail-ring {
  position: relative; height: 230px; perspective: 1000px;
  transform-style: preserve-3d;
}
.rail-ring .rail-item {
  position: absolute; left: 50%; top: 10px; width: 112px; margin-left: -56px;
  padding: 0; border: 0; background: none; color: inherit; cursor: pointer;
  transform-origin: 50% 0; font: inherit; text-align: center;
}
.rail-hook { display: block; height: 34px; }
.rail-hook svg { width: 112px; height: 34px; overflow: visible; display: block; }
.rail-card {
  display: block; width: 100px; height: 110px; margin: -6px auto 0;
  border-radius: 10px; overflow: hidden; background: #fff;
  box-shadow: 0 10px 14px rgba(0, 0, 0, 0.45);
  transition: transform 0.45s cubic-bezier(0.3, 1.6, 0.5, 1);
}
.rail-card img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rail-tag {
  display: inline-block; margin-top: 8px; padding: 3px 9px; border-radius: 99px;
  background: var(--cream, #f8f6e0); color: #0b0710; font-size: 0.7rem; font-weight: 700;
  white-space: nowrap; opacity: 0; transition: opacity 0.25s;
}
.rail-item:hover .rail-card, .rail-item:focus-visible .rail-card { transform: translateY(8px) scale(1.12); }
.rail-item:hover .rail-tag, .rail-item:focus-visible .rail-tag, .rail-item.on .rail-tag { opacity: 1; }
.rail-item.on .rail-card { box-shadow: 0 0 0 2px #0aede3, 0 0 16px rgba(10, 237, 227, 0.6); }
.rail-ctrl { display: flex; justify-content: center; gap: 0.4rem; padding: 0.2rem 0 0.2rem; }
.rail-ctrl button {
  background: rgba(255, 255, 255, 0.1); color: inherit; border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 99px; padding: 0.3rem 0.8rem; font-size: 0.75rem; cursor: pointer;
}
.rail-ctrl button[hidden] { display: none; }

/* Phones and reduced motion: a plain swipe row, no 3D */
.rail-flat .rail-ring {
  display: flex; gap: 0.8rem; height: auto; perspective: none; overflow-x: auto;
  padding: 0 1rem 0.4rem; scroll-snap-type: x proximity; scrollbar-width: none;
}
.rail-flat .rail-ring::-webkit-scrollbar { display: none; }
.rail-flat .rail-ring .rail-item { position: static; flex: 0 0 112px; margin: 0; scroll-snap-align: center; transform: none; opacity: 1; }
.rail-flat .rail-tag { opacity: 1; }
.rail-flat .rail-item:hover .rail-card { transform: none; }

/* ── Graphics wheel ───────────────────────────────── */
.gd-drum {
  position: relative; height: 340px; margin-top: 0.5rem; border-radius: 16px; overflow: hidden;
  background: linear-gradient(90deg, #0b0710, #1a1024 50%, #0b0710);
  border: 1px solid rgba(255, 255, 255, 0.12); touch-action: none; outline-offset: 2px;
}
.gd-drum[hidden] { display: none; }
.gd-drum.grid-mode { height: auto; padding: 0.4rem; background: none; border: 0; overflow: visible; }
.gd-wheel { position: absolute; inset: 0; perspective: 620px; cursor: ns-resize; }
.gd-wheel[hidden] { display: none; }
.gd-slot {
  position: absolute; left: 50%; top: 50%; width: 120px; height: 80px; margin: -40px 0 0 -60px;
  display: grid; place-items: center; border-radius: 12px; background: #fff;
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.3s; cursor: pointer;
}
.gd-wheel.drag .gd-slot { transition: none; }
.gd-slot img { width: 72px; height: 72px; object-fit: contain; pointer-events: none; }
.gd-slot.c { box-shadow: 0 0 0 2px #0aede3, 0 0 22px rgba(10, 237, 227, 0.5); }
.gd-sel {
  position: absolute; left: 10px; right: 10px; top: 50%; height: 100px; margin-top: -50px;
  border-top: 2px solid rgba(10, 237, 227, 0.4); border-bottom: 2px solid rgba(10, 237, 227, 0.4);
  pointer-events: none;
}
.gd-sel[hidden], .gd-bar[hidden] { display: none; }
.gd-bar {
  position: absolute; left: 0; right: 0; bottom: 0; padding: 0.5rem 0.6rem;
  display: flex; align-items: center; justify-content: space-between; gap: 0.5rem;
  background: linear-gradient(transparent, rgba(11, 7, 16, 0.95) 40%); color: #f8f6e0;
}
.gd-cur { font-size: 0.75rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gd-switch {
  position: absolute; top: 8px; right: 8px; z-index: 20; border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(0, 0, 0, 0.4); color: #f8f6e0; border-radius: 99px; padding: 0.2rem 0.6rem;
  font-size: 0.7rem; cursor: pointer;
}
.gd-drum.grid-mode .gd-switch { position: static; margin: 0 0 0.4rem; color: inherit; border-color: currentColor; background: none; }

/* Faint live preview of the centred graphic on the garment */
.design-ghost { position: absolute; pointer-events: none; opacity: 0.55; z-index: 40; }
.design-ghost img { width: 100%; height: 100%; object-fit: contain; display: block; }

@media (prefers-reduced-motion: reduce) {
  .rail-card, .gd-slot { transition: none; }
}
