/* ---- product: gallery + buy box ---- */

.pdp {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) minmax(300px, 340px);
  column-gap: 12px;
  padding: var(--gutter);
  align-items: start;
}

.thumbs {
  display: grid;
  gap: 12px;
  position: sticky;
  top: var(--gutter);
}

.thumb {
  display: block;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--surface);
  outline: 1px solid transparent;
  outline-offset: -1px;
}

.thumb img {
  height: 100%;
  object-fit: cover;
}

.thumb[aria-current='true'] {
  outline-color: var(--ink);
}

.thumb:not([aria-current='true']):hover img {
  opacity: 0.8;
}

.stage {
  position: relative;
  aspect-ratio: 4 / 5;
}

/* Effect 2 of 2: crossfade between stacked images */
.stage img {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition:
    opacity 320ms ease-out,
    transform 400ms var(--ease-out);
}

.stage img.is-active {
  opacity: 1;
}

/* One image: no rail, the stage takes its column */
.pdp--single {
  grid-template-columns: minmax(0, 1fr) minmax(300px, 340px);
}

.pdp--single .thumbs {
  display: none;
}

.crumb:hover {
  color: var(--ink);
}

/* Load settle: the lead image eases down from a slight zoom */
.motion [data-settle] img {
  scale: 1.06;
  transition:
    opacity 320ms ease-out,
    transform 400ms var(--ease-out),
    scale 1600ms var(--ease-out);
}

.motion.is-loaded [data-settle] img {
  scale: 1;
}




.zoom {
  position: absolute;
  right: 16px;
  bottom: 16px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  background: var(--bg);
  border: 1px solid var(--rule);
}

.zoom:hover {
  border-color: var(--ink);
}

.buy {
  position: sticky;
  top: var(--gutter);
  margin-left: 24px;
  display: grid;
  gap: 28px;
}

.buy-head {
  display: grid;
  gap: 14px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--rule);
}

.buy-head h1 {
  font-size: clamp(44px, 4.4vw, 64px);
}

.price {
  font-size: 18px;
  font-weight: 500;
}

.option {
  display: grid;
  gap: 12px;
}

.option-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.swatch {
  width: 36px;
  height: 36px;
  border: 1px solid var(--rule);
  outline: 1px solid transparent;
  outline-offset: 3px;
}

.swatch[aria-pressed='true'] {
  outline-color: var(--ink);
}

.size {
  width: 52px;
  height: 52px;
  border: 1px solid var(--rule);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
}

.size:hover {
  border-color: var(--ink);
}

.size[aria-pressed='true'] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

.buy .button {
  width: 100%;
}

.details {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}

.details summary {
  display: flex;
  justify-content: space-between;
  padding: 18px 0;
  cursor: pointer;
  list-style: none;
}

.details summary::-webkit-details-marker {
  display: none;
}

.details summary::after {
  content: '+';
  font-family: var(--font-mono);
}

.details[open] summary::after {
  content: '−';
}

.details ul {
  display: grid;
  gap: 4px;
  padding-bottom: 20px;
}

/* ---- related ---- */

.related {
  padding: clamp(64px, 8vw, 120px) var(--gutter) clamp(64px, 8vw, 120px);
}

.related-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  padding-bottom: 16px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--rule);
}

.related-head h2 {
  font-size: clamp(32px, 3.2vw, 48px);
}





@media (max-width: 1080px) {
  .pdp {
    grid-template-columns: 72px minmax(0, 1fr);
    row-gap: 40px;
  }

  .pdp--single {
    grid-template-columns: minmax(0, 1fr);
  }

  .buy {
    grid-column: 1 / -1;
    position: static;
    margin-left: 0;
  }
}

@media (max-width: 720px) {
  .pdp {
    grid-template-columns: 1fr;
    padding: 0 0 var(--gutter);
    row-gap: 12px;
  }

  .stage {
    order: -1;
  }

  .thumbs {
    position: static;
    grid-template-columns: repeat(4, 1fr);
    padding: 0 var(--gutter);
  }

  .buy {
    padding: 28px var(--gutter) 0;
  }

}

.added {
  min-height: 1.7em;
  margin-top: -16px;
}

.added a {
  color: var(--ink);
  border-bottom: 1px solid currentColor;
}
