/* 7VOID · Six-cutout rotating fit view
   The standard gallery remains garment-only. In fit mode six independent
   people rotate through the center while five remain visible. */

.elin-fit-view {
  overflow: hidden;
  background: #fff;
  isolation: isolate;
}

/* On product pages the gallery runs underneath the fixed header. The header
   itself masks that top slice, so no second white spacer is visible before
   the first product image. */
body.template-product #lfdy-header-spacer {
  height: 0 !important;
  margin-top: 0 !important;
  transition: none !important;
}

.elin-fit-view__product,
.elin-fit-view__models {
  transition: opacity 220ms ease;
}

.lfdy-pdp-gallery__slide.is-color-hidden,
.elin-fit-view__person[hidden],
.elin-fit-view__toggle[hidden] {
  display: none !important;
}

.elin-fit-view__models {
  display: none;
  position: relative;
  background: #fff;
}

.elin-fit-view.is-fit-mode .elin-fit-view__product {
  display: none;
}

.elin-fit-view.is-fit-mode .elin-fit-view__models {
  display: block;
}

.elin-fit-view__stage {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: #fff;
  cursor: grab;
  touch-action: pan-y pinch-zoom;
  user-select: none;
  -webkit-user-select: none;
}

.elin-fit-view__stage.is-dragging {
  cursor: grabbing;
}

.elin-fit-view__person {
  position: absolute;
  top: 54.5%;
  display: block;
  height: 58%;
  width: 25%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  transform: translate(-50%, -50%);
  transform-origin: center center;
  transition:
    left 440ms cubic-bezier(.2, .74, .24, 1),
    width 440ms cubic-bezier(.2, .74, .24, 1),
    height 440ms cubic-bezier(.2, .74, .24, 1),
    opacity 300ms ease,
    filter 300ms ease;
  will-change: left, width, height, opacity;
}

.elin-fit-view__person:focus-visible {
  outline: 2px solid #111;
  outline-offset: 4px;
}

.elin-fit-view__person img {
  display: block;
  width: 100%;
  height: 100%;
  /* The source cutouts sit on portrait canvases. Cover lets the tall model
     fill its slot and only trims empty canvas at the sides. */
  object-fit: cover;
  object-position: center bottom;
  mix-blend-mode: multiply;
  pointer-events: none;
  -webkit-user-drag: none;
}

.elin-fit-view__person.is-slot-center {
  left: 50%;
  z-index: 5;
  width: 34%;
  height: 86%;
  opacity: 1;
  filter: none;
}

/* Sixth view sits directly behind the active center model, matching the
   reference: five views are visible while all six participate in rotation. */
.elin-fit-view__person.is-slot-hidden {
  left: 50%;
  z-index: 1;
  width: 34%;
  height: 86%;
  opacity: 0;
  pointer-events: none;
}

.elin-fit-view__person.is-slot-left {
  left: 15%;
  z-index: 3;
  width: 19%;
  height: 50%;
  opacity: 1;
  filter: none;
}

.elin-fit-view__person.is-slot-left-ghost {
  left: 32%;
  z-index: 2;
  width: 14.5%;
  height: 38%;
  opacity: .22;
  filter: saturate(.72);
}

.elin-fit-view__person.is-slot-right-ghost {
  left: 68%;
  z-index: 2;
  width: 14.5%;
  height: 38%;
  opacity: .22;
  filter: saturate(.72);
}

.elin-fit-view__person.is-slot-right {
  left: 85%;
  z-index: 3;
  width: 19%;
  height: 50%;
  opacity: 1;
  filter: none;
}

.elin-fit-view__toggle {
  position: absolute;
  top: calc(
    var(--lf-ann-h, 0px)
    + var(--lf-header-height-mobile, 52px)
    + var(--lf-header-pad-top-mobile, 0px)
    + var(--lf-header-pad-bottom-mobile, 0px)
    + 8px
  );
  right: 12px;
  z-index: 8;
  width: 56px;
  height: 56px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid #cfcfcf;
  border-radius: 0;
  background: #fff;
  box-shadow: 0 4px 22px rgba(0, 0, 0, .06);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.elin-fit-view__toggle:focus-visible {
  outline: 2px solid #111;
  outline-offset: 3px;
}

.elin-fit-view__toggle-model,
.elin-fit-view__toggle-product {
  position: absolute;
  inset: 0;
  display: block;
  background: #fff;
}

.elin-fit-view__toggle-product,
.elin-fit-view.is-fit-mode .elin-fit-view__toggle-model {
  opacity: 0;
  visibility: hidden;
}

.elin-fit-view.is-fit-mode .elin-fit-view__toggle-product {
  opacity: 1;
  visibility: visible;
}

.elin-fit-view__toggle img,
.elin-fit-view__toggle svg.placeholder-svg {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.elin-fit-view__toggle-model img {
  mix-blend-mode: multiply;
}

.elin-fit-view__toggle-product img {
  object-fit: cover;
}

.elin-fit-view__toggle-mark {
  position: absolute;
  right: 4px;
  bottom: 4px;
  display: grid;
  width: 16px;
  height: 16px;
  place-items: center;
  border-radius: 50%;
  background: #111;
  color: #fff;
  transition: transform 180ms ease;
}

.elin-fit-view.is-fit-mode .elin-fit-view__toggle-mark {
  transform: rotate(180deg);
}

.elin-fit-view__toggle-mark svg {
  width: 10px;
  height: 10px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

@media (min-width: 769px) {
  .elin-fit-view__toggle {
    top: calc(
      var(--lf-ann-h, 0px)
      + var(--lf-header-height-desktop, 64px)
      + var(--lf-header-pad-top-desktop, 0px)
      + var(--lf-header-pad-bottom-desktop, 0px)
      + 10px
    );
    right: 16px;
    width: 64px;
    height: 64px;
  }
}

@media (max-width: 420px) {
  .elin-fit-view__toggle {
    top: calc(
      var(--lf-ann-h, 0px)
      + var(--lf-header-height-mobile, 52px)
      + var(--lf-header-pad-top-mobile, 0px)
      + var(--lf-header-pad-bottom-mobile, 0px)
      + 6px
    );
    right: 10px;
    width: 50px;
    height: 50px;
  }

  .elin-fit-view__person.is-slot-center {
    width: 36%;
    height: 87%;
  }

  .elin-fit-view__person.is-slot-left,
  .elin-fit-view__person.is-slot-right {
    width: 20%;
    height: 52%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .elin-fit-view__product,
  .elin-fit-view__models,
  .elin-fit-view__person,
  .elin-fit-view__toggle-mark {
    transition: none;
  }
}
