/* rail.css: what the coat rail and the bag rail share (js/interactions/try-on.js). */

.try-on-rail {
  position: absolute;
  left: 0;
  right: 0;
  display: flex;
  align-items: flex-start;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.try-on-rail::-webkit-scrollbar {
  display: none;
}

.try-on-item {
  flex: none;
  border: 0;
  background: none;
  -webkit-tap-highlight-color: transparent; /* no dark box on a phone when tapped */
  scroll-snap-align: center;
  scroll-snap-stop: always;
  opacity: var(--faded);
  transform: translateY(var(--faded-drop, 3cqh)) scale(0.9);
}

/* On arrival (js/interactions/first-look.js): an empty spot in front of the model, and the rail
   does not scroll or snap until the first swipe or tap has closed the spot. */
.try-on-spot {
  flex: none;
}

.try-on-rail[data-resting] {
  overflow-x: hidden;
  scroll-snap-type: none;
  touch-action: none;
}

.try-on-item img,
.try-on-item canvas {
  width: 100%;
}

/* The coats and bags not worn look as if seen through glassine paper, only within their own
   shape: --glassine is one of the SVG filters of js/effects/glassine.js, at random per item.
   The one on the model is shown as it is. Comment this line out to turn the effect off. */
.try-on-item:not([aria-pressed='true']) > * {
  filter: var(--glassine);
}

.try-on-item[aria-pressed='true'] {
  opacity: 1;
  transform: none;
}

/* The slight overshoot makes the item "click" onto the model. */
@media (prefers-reduced-motion: no-preference) {
  .try-on-item {
    transition:
      opacity var(--motion-snap) ease-out,
      transform var(--motion-snap) cubic-bezier(0.3, 1.4, 0.5, 1);
  }
}
