/* ==========================================================================
   Section: shop-the-look  →  assets/section-shop-the-look.css
   Figma 1387-2588: a full-bleed 1440×820 photo frame, 4px below the Promotional Banner (that
   grid's gap). Figma's photo is 1440×893, top-aligned with its lower edge cropped, under a 20%
   black tint. Hotspot: 24px frosted ring (30% white, 2px blur) around a 12px white dot. Card: the
   shared .product-tag (components/product-tag.css), placed 17px right of the hotspot and 11px
   above its top edge; this file only positions and reveals it.
   ========================================================================== */
.shop-the-look {
  padding-top: 4px;
}

.shop-the-look__inner {
  position: relative;
  display: block;
  aspect-ratio: 1440 / 820;
}

.shop-the-look__media {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--color-page-bg);
}

.shop-the-look__media > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--focal-x, 50%) var(--focal-y, 50%);
  transform: scale(var(--zoom, 1));
  transform-origin: var(--focal-x, 50%) var(--focal-y, 50%);
}

.shop-the-look__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, var(--overlay-opacity, 0.2));
  pointer-events: none;
}

/* One layer per hotspot, the size of the frame, so --x / --y place both the dot and its card */
.shop-the-look__item {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.shop-the-look__item.is-open {
  z-index: 1;
}

/* ---------------------------------------------------------------- hotspot */
.shop-the-look__hotspot {
  position: absolute;
  top: var(--y);
  left: var(--x);
  width: 24px;
  height: 24px;
  margin: -12px 0 0 -12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  pointer-events: auto;
  transition: background-color var(--duration-fast) ease;
}

.shop-the-look__hotspot:hover {
  background: rgba(255, 255, 255, 0.5);
}

.shop-the-look__hotspot:focus-visible {
  outline: 2px solid var(--color-white);
  outline-offset: 2px;
}

.shop-the-look__dot {
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: var(--color-white);
}

/* ------------------------------------------------------------------- card
   left = hotspot centre + 12px radius + 17px gap; top = hotspot top - 11px. The script flips a card
   that would run off the right edge (data-side="start") and nudges it back inside the frame
   vertically (--card-nudge). */
.shop-the-look__card {
  position: absolute;
  top: calc(var(--y) - 23px + var(--card-nudge, 0px));
  left: calc(var(--x) + 29px);
  opacity: 0;
  visibility: hidden;
  transform: translateY(4px);
  transition: opacity var(--duration-fast) ease, transform var(--duration-fast) var(--ease-out),
    visibility 0s linear var(--duration-fast);
  pointer-events: auto;
}

.shop-the-look__card[data-side="start"] {
  right: calc(100% - var(--x) + 29px);
  left: auto;
}

.shop-the-look__item.is-open .shop-the-look__card,
shop-the-look:not(:defined) .shop-the-look__item[data-open] .shop-the-look__card {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition-delay: 0s;
}

/* Phones: the frame is too short to float a card over it, so the open card sits under the photo */
@media (max-width: 749px) {
  .shop-the-look__inner {
    margin-bottom: 114px; /* 102px card + 12px gap */
  }

  .shop-the-look__card,
  .shop-the-look__card[data-side="start"] {
    top: calc(100% + 12px);
    right: var(--page-gutter);
    left: var(--page-gutter);
  }

  .shop-the-look__card .product-tag__info {
    flex: 1;
    width: auto;
    min-width: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .shop-the-look__hotspot,
  .shop-the-look__card {
    transition: none;
  }
}
