/* ==========================================================================
   Section: product-of-the-week  →  assets/section-product-of-the-week.css
   Figma 1164-2444: 1320 wide inside the page width, 64px below the Marquee.
   Header row (38px: Heading/H3 title + 12px .tabs--sm on the bottom edge) → 24px →
   720px panel of two 658px columns, 4px apart:
     gallery  #f4f4f4, main image cover-cropped, 40×54 thumbnails 16px in, 4px apart
     info     #f6f6f6, 64px inset; details (472 wide, groups 32px apart) at the top,
              "VIEW DETAILS" on the bottom inset
   Settings — custom properties on .product-of-the-week
     --panel-height  720px   --info-inset  64px (shrinks below 1440)   --gallery-bg  #f4f4f4
   ========================================================================== */
.product-of-the-week {
  --panel-height: 720px;
  --info-inset: clamp(32px, 4.4445vw, 64px);
  --gallery-bg: #f4f4f4;
  --thumb-bg: #f8f8f8;

  padding-top: 64px;
}

.product-of-the-week__inner {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* Header row — the title's 38px line box is the row; the tabs sit on its bottom edge */
.product-of-the-week__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  height: 38px;
}

.product-of-the-week__title {
  font-family: var(--font-display);
  font-size: var(--text-display-s-size);
  font-weight: 500;
  line-height: 38px; /* Heading/H3 1.2, rounded to the whole-pixel box Figma lays out */
  color: var(--color-text-primary);
  white-space: nowrap;
}

/* Panel */
.product-of-the-week__panel {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  min-height: var(--panel-height);
}

.product-of-the-week__panel[hidden] {
  display: none;
}

/* --------------------------------------------------------------------------
   Gallery — media sets (one per colour) stacked; only the shown one is laid out
   -------------------------------------------------------------------------- */
.product-of-the-week__gallery {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--gallery-bg);
}

.product-of-the-week__media-set {
  position: absolute;
  inset: 0;
}

.product-of-the-week__media-set[hidden] {
  display: none;
}

.product-of-the-week__slide {
  position: absolute;
  inset: 0;
  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%);
  opacity: 0;
  transition: opacity var(--duration-base) ease;
}

.product-of-the-week__slide.is-active {
  opacity: 1;
}

/* Thumbnails — 1px #e2e2e2 frame (#080808 on the shown one); the photo fills the 38×52 inside */
.product-of-the-week__thumbs {
  position: absolute;
  z-index: 1;
  top: 16px;
  left: 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 40px;
}

.product-of-the-week__thumb {
  position: relative;
  display: block;
  width: 40px;
  height: 54px;
  overflow: hidden;
  border: 1px solid var(--color-border-tertiary);
  background: var(--thumb-bg);
  cursor: pointer;
  transition: border-color var(--duration-fast) ease;
}

.product-of-the-week__thumb 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%);
}

.product-of-the-week__thumb:hover {
  border-color: var(--color-border-default);
}

.product-of-the-week__thumb[aria-current='true'] {
  border-color: var(--color-border-strong);
}

.product-of-the-week__thumb:focus-visible {
  outline: 2px solid var(--color-black);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Info column
   -------------------------------------------------------------------------- */
.product-of-the-week__info {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
  padding: var(--info-inset);
  background: var(--color-surface-tertiary);
}

/* the shared product form (assets/css/components/product-info.css); this instance's
   "VIEW DETAILS" carries Button/M's 4% tracking, as Figma draws it here */
.product-of-the-week .product-info__more {
  letter-spacing: 0.04em;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 989px) {
  .product-of-the-week__panel {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
  }

  .product-of-the-week__gallery {
    aspect-ratio: 658 / 720;
  }

  .product-of-the-week__info {
    --info-inset: 40px;
  }
}

@media (max-width: 749px) {
  .product-of-the-week {
    padding-top: 48px;
  }

  .product-of-the-week__header {
    flex-wrap: wrap;
    row-gap: 12px;
    height: auto;
  }

  .product-of-the-week__thumbs {
    top: 12px;
    left: 12px;
    width: 32px;
  }

  .product-of-the-week__thumb {
    width: 32px;
    height: 43px;
  }

  .product-of-the-week__info {
    --info-inset: 32px 20px;
  }
}
