/* E20: a garment can switch between its full form and the print it carries.
   The shared lightbox keeps ownership of focus, Escape and Lenis state. */
.cc-lightbox__merch-frame { display: contents; }
.cc-lightbox__merch-tools { display: none; }

.cc-lightbox.is-merch {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr) auto;
  place-items: center;
  align-content: center;
  row-gap: 16px;
  overflow: auto;
  overscroll-behavior: contain;
}
.cc-lightbox.is-merch .cc-lightbox__merch-frame {
  display: block;
  width: min(86vw, 1120px);
  height: min(74svh, 780px);
  overflow: hidden;
}
.cc-lightbox.is-merch .cc-lightbox__img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: contain;
  transform: none;
  transform-origin: 50% 50%;
  opacity: 1;
  transition: transform 0.28s var(--ease-out);
}
.cc-lightbox.is-merch.is-merch-crop .cc-lightbox__img {
  object-fit: cover;
  transform: scale(var(--merch-crop-scale, 1)) translate(
    calc(50% - var(--merch-crop-x, 50%)),
    calc(50% - var(--merch-crop-y, 50%))
  );
}
.cc-lightbox.is-merch.is-merch-zoom .cc-lightbox__merch-frame { transform: scale(1.14); }
.cc-lightbox.is-merch .cc-lightbox__merch-tools {
  display: flex;
  grid-row: 2;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}
.cc-lightbox.is-merch .cc-lightbox__merch-tools[hidden] { display: none; }
.cc-lightbox__merch-btn {
  min-height: 44px;
  padding: 0 16px;
  border: 2px solid var(--ink);
  border-radius: 0;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}
.cc-lightbox__merch-btn[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.cc-lightbox__merch-btn:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
@media (hover: hover) {
  .cc-lightbox__merch-btn:not([aria-pressed="true"]):hover { background: var(--orange); }
}

@media (max-width: 760px) {
  .cc-lightbox.is-merch {
    display: flex;
    align-items: stretch;
    justify-content: flex-start;
    gap: 14px;
    padding: 84px 16px 20px;
  }
  .cc-lightbox.is-merch .cc-lightbox__merch-frame {
    width: 100%;
    height: min(64svh, 620px);
  }
  .cc-lightbox.is-merch.is-merch-zoom .cc-lightbox__merch-frame { transform: scale(1.06); }
  .cc-lightbox.is-merch .cc-lightbox__merch-tools { justify-content: flex-start; }
  .cc-lightbox__merch-btn { flex: 1 1 auto; padding: 0 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .cc-lightbox.is-merch .cc-lightbox__img,
  .cc-lightbox.is-merch .cc-lightbox__merch-frame { transition: none; }
}
