/* Showroom. Plain CSS on top of dist/output.css (base, fonts) so the whole
   page lives in showroom.html + src/showroom* without rebuilding Tailwind.
   The ?v= of every url() here is written by scripts/stamp-showroom.mjs. */

.sr-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 76rem;
  margin: 0 auto;
  padding: 1.25rem 1rem;
}

.sr-logo img {
  display: block;
  height: 1.25rem;
  width: auto;
}

.sr-page {
  max-width: 76rem;
  margin: 0 auto;
  padding: 0 1rem 4rem;
}

.sr-intro {
  max-width: 40rem;
  padding: 1.5rem 0 1.75rem;
}

.sr-eyebrow {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #ff5e5e;
}

.sr-intro h1 {
  margin-top: 0.5rem;
  font-size: clamp(2.25rem, 6vw, 3.75rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.045em;
}

/* --- Stage --------------------------------------------------------------- */

.sr-stage {
  position: relative;
  height: min(64svh, 36rem);
  min-height: 26rem;
  overflow: hidden;
  border-radius: 2rem;
  /* Poster of the resting rack (docs/showroom/verify.mjs --poster) as the first
     paint; the canvas fades in over it. Anchored left, like the camera. */
  background: #0b0b0b url('/public/showroom/poster.webp?v=59e86b782f') left center / cover no-repeat;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05);
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

@media (min-width: 768px) {
  .sr-stage {
    height: auto;
    aspect-ratio: 16 / 9;
    max-height: 42rem;
  }
}

.sr-stage canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.sr-stage[data-state='ready'] canvas {
  opacity: 1;
}

.sr-stage.is-dragging canvas {
  cursor: grabbing;
}

.sr-unsupported {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 2rem;
  text-align: center;
  color: #71717a;
  font-size: 0.875rem;
  pointer-events: none;
}

/* Only for screen readers: the poster already shows what is coming. */
.sr-loading {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.sr-unsupported,
.sr-stage[data-state='ready'] .sr-loading,
.sr-stage[data-state='unsupported'] .sr-loading,
.sr-stage[data-state='unsupported'] canvas,
.sr-stage[data-state='unsupported'] .sr-labels,
.sr-stage[data-state='unsupported'] .sr-tag,
.sr-stage[data-state='unsupported'] .sr-control,
.sr-stage[data-state='unsupported'] .sr-hint {
  display: none;
}

/* No WebGL, or the GPU context was lost: just the message, the list follows. */
.sr-stage[data-state='unsupported'] {
  height: auto;
  min-height: 0;
  aspect-ratio: auto;
  background-image: none;
}

.sr-stage[data-state='unsupported'] .sr-unsupported {
  position: static;
  display: block;
}

/* Category labels, positioned from JS over the bar. */
.sr-labels {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.sr-label {
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  line-height: 1.15;
  white-space: nowrap;
  transition: opacity 0.35s ease;
  will-change: transform;
}

.sr-label strong {
  font-size: clamp(1rem, 2.2vw, 1.5rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

.sr-label span {
  font-size: 0.75rem;
  color: #a1a1aa;
}

.sr-label.is-hidden {
  opacity: 0;
}

/* Paper tag under the garment facing front. */
.sr-tag {
  --x: 50%;
  --y: 70%;
  --tilt: 0deg;
  position: absolute;
  top: 0;
  left: 0;
  width: 10.5rem;
  padding: 1.1rem 1rem 0.9rem;
  border-radius: 0.375rem;
  background: #f4f1ea;
  color: #111;
  text-align: center;
  box-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.8);
  pointer-events: none;
  opacity: 0;
  transform: translate(var(--x), var(--y)) translate(-50%, 8px) rotate(var(--tilt)) scale(0.96);
  transform-origin: 50% 0;
  transition: opacity 0.25s ease, scale 0.25s ease;
}

/* Punched hole. */
.sr-tag::before {
  content: '';
  position: absolute;
  top: 0.4rem;
  left: 50%;
  width: 0.4rem;
  height: 0.4rem;
  margin-left: -0.2rem;
  border-radius: 50%;
  background: #0b0b0b;
}

.sr-tag.is-visible {
  opacity: 1;
}

.sr-tag__meta {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #71717a;
}

.sr-tag__name {
  margin-top: 0.35rem;
  font-size: 1.125rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
}

.sr-tag__foot {
  margin-top: 0.6rem;
  padding-top: 0.55rem;
  border-top: 2px solid #e60000;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #3f3f46;
}

/* While zoomed in, the tag docks in a corner instead of following the garment. */
.sr-stage.is-inspecting .sr-tag {
  transform: translate(1.25rem, 1.25rem);
  transform-origin: 0 0;
}

/* --- Controls -------------------------------------------------------------- */

.sr-control {
  position: absolute;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 999px;
  background: rgba(22, 22, 22, 0.8);
  color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: background-color 0.2s ease, opacity 0.2s ease;
}

/* Hover only where it exists: a tap leaves :hover stuck and would grey out
   the pressed zoom button. */
@media (hover: hover) {
  .sr-control:hover:not(:disabled) {
    background: rgba(40, 40, 40, 0.9);
  }
}

.sr-control:focus-visible {
  outline: 2px solid #ff5e5e;
  outline-offset: 2px;
}

.sr-control:disabled {
  opacity: 0.35;
  cursor: default;
}

.sr-control svg {
  width: 1.25rem;
  height: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sr-control--prev,
.sr-control--next {
  top: 50%;
  margin-top: -1.375rem;
}

.sr-control--prev {
  left: 1rem;
}

.sr-control--next {
  right: 1rem;
}

.sr-control--zoom {
  right: 1rem;
  bottom: 1rem;
}

/* Flip to the back, only while inspecting. */
.sr-control--flip {
  display: none;
  right: 4.25rem;
  bottom: 1rem;
}

.sr-stage.is-inspecting .sr-control--flip {
  display: grid;
}

.sr-control--zoom[aria-pressed='true'] {
  background: #e60000;
  box-shadow: none;
}

.sr-control--zoom[aria-pressed='true'] .sr-zoom-plus {
  d: path('M8.5 11h5');
}

.sr-hint {
  position: absolute;
  left: 1.25rem;
  right: 4.5rem;
  bottom: 1.6rem;
  font-size: 0.75rem;
  color: #a1a1aa;
  pointer-events: none;
}

/* Inspecting, the stage owns every gesture: one finger turns, two pinch. */
.sr-stage.is-inspecting {
  touch-action: none;
}

.sr-stage.is-inspecting .sr-hint {
  right: 8rem;
}

/* --- Product list (also the no-WebGL fallback) ------------------------------ */

.sr-list {
  margin-top: 2.5rem;
}

.sr-list h2 {
  font-size: 1.125rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.sr-list section {
  margin-top: 1.25rem;
}

.sr-list h3 {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #71717a;
}

.sr-list ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.sr-list button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.5rem;
  padding: 0.4rem 0.9rem 0.4rem 0.5rem;
  border-radius: 999px;
  background: #141414;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
  font-size: 0.8125rem;
  color: #e4e4e7;
  transition: background-color 0.2s ease;
}

.sr-list button:hover {
  background: #1d1d1d;
}

.sr-list button:focus-visible {
  outline: 2px solid #ff5e5e;
  outline-offset: 2px;
}

.sr-swatch {
  width: 1.5rem;
  height: 1.5rem;
  flex: none;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.sr-noscript {
  max-width: 76rem;
  margin: 0 auto;
  padding: 1rem;
  color: #a1a1aa;
}
