/* Shop — overview grid + product page. Accent: --accent-shop. */

/* --- Overview ------------------------------------------------ */

.shop-page h1 {
  text-align: left;
  margin-inline: 0;
}

/* Roomier image than the news cards (16 / 8.7) */
.shop-card .card__media {
  position: relative;
  aspect-ratio: 4 / 3;
}

@media (prefers-reduced-motion: no-preference) {
  .shop-card .card__media img {
    transition: transform var(--dur-slow) var(--ease-out);
  }

  .shop-card:hover .card__media:not(.shop-media--empty) img {
    transform: scale(1.03);
  }
}

/* No product image: the partner logo stands in on the muted tile.
   The box is wide and flat so wordmarks and square logos read equally large. */
.shop-media--empty {
  position: relative;
}

.shop-card .shop-media--empty img,
.product__media.shop-media--empty img {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 44%;
  height: 26%;
  object-fit: contain;
}

/* Offer label, e.g. "Limited Edition" — white pill with the Shop dot.
   Sits in the card body, never on the photo: partner images vary too much. */
.shop-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 11px 6px 9px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--color-bg-elevated);
  color: var(--color-text);
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  font-size: var(--fs-xs);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
}

.shop-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-shop);
}

.shop-card__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2) var(--sp-3);
  min-height: 28px;
  margin-bottom: var(--sp-3);
}

.shop-card__top .card__meta {
  margin: 0;
}

.shop-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  min-height: 32px;
  margin-top: auto;
  padding-top: var(--sp-3);
}

.shop-card .card__more {
  font-family: var(--font-display);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-sm);
  color: var(--accent-shop);
  white-space: nowrap;
}

.shop-card:hover .card__more {
  text-decoration: underline;
}

.shop-card__logo {
  flex: 0 1 92px;
  min-width: 0;
  height: 32px;
  object-fit: contain;
  object-position: right center;
}

/* The lead sits right above the grid — no toolbar in between as on News */
.shop-page .section+.section {
  padding-top: var(--sp-5);
}

/* --- Product page -------------------------------------------- */

.shop-back {
  display: inline-block;
  margin-bottom: var(--sp-5);
  font-size: var(--fs-sm);
  color: var(--color-text-subtle);
}

.shop-back:hover {
  color: var(--color-text);
  text-decoration: underline;
}

/* Images left, buy box right. Source order is hero → info → gallery so the
   title and button follow the first image on small screens. */
.product,
.product-details__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  column-gap: clamp(var(--sp-6), 5vw, var(--sp-9));
  align-items: start;
}

.product {
  row-gap: var(--sp-3);
}

.product__hero {
  grid-column: 1;
  grid-row: 1;
}

.product__gallery {
  grid-column: 1;
  grid-row: 2;
  display: grid;
  gap: var(--sp-3);
}

.product__info {
  grid-column: 2;
  grid-row: 1 / span 2;
  position: sticky;
  top: 100px;
  /* clears the sticky nav */
}

/* Each tile grows by its own aspect ratio, so the tiles in a row always end
   up equally tall — portrait film next to landscape photo included. The
   max-width keeps a row from outgrowing the screen without cropping anything. */
.product__row {
  display: flex;
  justify-content: center;
  gap: var(--sp-3);
}

.product__media {
  position: relative;
  display: block;
  flex: var(--ratio, 1) 1 0%;
  min-width: 0;
  max-width: calc(min(82vh, 780px) * var(--ratio, 1));
  aspect-ratio: var(--ratio, 1);
  margin: 0;
  border-radius: var(--radius-lg);
  background: var(--color-surface-muted);
  overflow: hidden;
}

.product__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product__media.shop-media--empty {
  --ratio: 4 / 3;
}

/* Video tile: poster + play button, opens the dialog */
.product__media--video {
  background: var(--c-black);
}

.product__play {
  position: absolute;
  inset: 0;
  width: 64px;
  height: 64px;
  margin: auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  color: var(--c-black);
  box-shadow: var(--shadow-lg);
  transition: transform var(--dur-fast) var(--ease-out), background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}

.product__play svg {
  margin-left: 3px;
  /* optical centering of the triangle */
}

.product__media--video:hover .product__play,
.product__media--video:focus-visible .product__play {
  transform: scale(1.08);
  background: var(--accent-shop);
  color: #fff;
}

@media (prefers-reduced-motion: no-preference) {
  .product__media img {
    transition: transform var(--dur-slow) var(--ease-out);
  }

  a.product__media:hover img {
    transform: scale(1.03);
  }
}

/* Hairline so packshots on white still read as tiles */
.product__media::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
  pointer-events: none;
}

.product__brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  min-height: 44px;
  margin-bottom: var(--sp-5);
}

.product__logo {
  width: 132px;
  height: 44px;
  object-fit: contain;
  object-position: left center;
}

.product__partner {
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  font-size: var(--fs-sm);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.product__title {
  margin: 0 0 var(--sp-4);
  font-size: clamp(2rem, 3vw, 2.9rem);
  line-height: 1.12;
  text-align: left;
  text-wrap: balance;
}

.product__summary {
  margin: 0;
  max-width: 56ch;
  font-size: var(--fs-lead);
  color: var(--color-text-muted);
}

.product__highlights {
  display: grid;
  gap: var(--sp-3);
  margin: var(--sp-6) 0 0;
  padding: var(--sp-5) 0 0;
  border-top: 1px solid var(--color-border);
  list-style: none;
}

.product__highlights li {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  line-height: 1.4;
}

.product__highlights svg {
  flex: none;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  color: var(--accent-shop);
}

.product__buy {
  margin-top: var(--sp-6);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--color-border);
}

.product__price {
  margin: 0 0 var(--sp-4);
  font-family: var(--font-display);
  font-weight: var(--fw-bold);
  font-size: 1.5rem;
  letter-spacing: var(--ls-snug);
  line-height: 1;
}

.product__cta {
  width: 100%;
  padding: 20px 28px;
  font-size: 1.2rem;
  background: var(--accent-shop);
  border-color: var(--accent-shop);
  color: #fff;
}

.product__cta:hover {
  background: var(--c-black);
  border-color: var(--c-black);
  color: #fff;
}

.product__note {
  margin: var(--sp-3) 0 0;
  max-width: none;
  font-size: var(--fs-sm);
  color: var(--color-text-subtle);
  text-align: center;
}

/* Optional long text — heading left, copy in the buy-box column */
.product-details__inner {
  padding-top: clamp(var(--sp-6), 5vw, var(--sp-8));
  border-top: 1px solid var(--color-border);
  row-gap: var(--sp-5);
}

.product-details h2 {
  max-width: 18ch;
  margin: 0;
  font-size: clamp(2rem, 3.4vw, 2.8rem);
  font-weight: var(--fw-medium);
  text-wrap: balance;
}

.product-details .prose {
  font-size: 1.1rem;
}

.product-details .prose h3 {
  margin-top: var(--sp-7);
}

.product-details .prose h3:first-child {
  margin-top: 0;
}

.product-details .prose a.btn {
  text-decoration: none;
}

.product-details .prose a.btn:hover {
  opacity: 1;
}

.product-more h2 {
  margin-bottom: var(--sp-6);
}

/* --- Lightbox: all photos and films of a product --------------- */

a.product__media {
  cursor: zoom-in;
}

a.product__media--video {
  cursor: pointer;
}

/* Fills the viewport: counter + close on top, the picture with its arrows in
   the middle, thumbnails at the bottom. A click beside the picture closes. */
.shop-gallery {
  --bar: 64px;
  --strip: 92px;
  width: 100vw;
  max-width: none;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
}

.shop-gallery--single {
  --strip: 24px;
}

.shop-gallery[open] {
  display: grid;
  grid-template-rows: var(--bar) minmax(0, 1fr) var(--strip);
  animation: shop-gallery-in var(--dur-med) var(--ease-out);
}

.shop-gallery::backdrop {
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(6px);
}

@keyframes shop-gallery-in {
  from { opacity: 0; transform: scale(0.98); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .shop-gallery[open] {
    animation: none;
  }
}

html:has(.shop-gallery[open]) {
  overflow: hidden;
}

.shop-gallery__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-inline: var(--sp-4);
}

.shop-gallery__count {
  font-family: var(--font-display);
  font-weight: var(--fw-semibold);
  font-size: var(--fs-sm);
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
}

.shop-gallery__btn {
  flex: none;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #fff;
  color: var(--c-black);
  cursor: pointer;
}

.shop-gallery__btn:hover {
  background: var(--accent-shop);
  color: #fff;
}

.shop-gallery__main {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-4);
  min-height: 0;
  padding-inline: var(--sp-4);
}

/* As large as the space allows in the item's own format, portrait or landscape */
.shop-gallery__stage {
  --avail-h: calc(100dvh - var(--bar) - var(--strip));
  --avail-w: calc(100vw - 2 * 44px - 4 * var(--sp-4));
  width: min(var(--avail-w), var(--avail-h) * var(--ratio, 1.7778), 1600px);
  aspect-ratio: var(--ratio, 1.7778);
  border-radius: var(--radius-lg);
  background: var(--c-black);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.shop-gallery__stage img,
.shop-gallery__stage video,
.shop-gallery__stage iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  object-fit: contain;
  user-select: none;
}

.shop-gallery__thumbs {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  /* "safe" keeps the first thumbnails reachable once the strip overflows */
  justify-content: safe center;
  padding: 0 var(--sp-4);
  overflow-x: auto;
  scrollbar-width: none;
}

.shop-gallery__thumb {
  position: relative;
  flex: none;
  width: 56px;
  height: 56px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: #222;
  overflow: hidden;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity var(--dur-fast) var(--ease-out);
}

.shop-gallery__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.shop-gallery__thumb:hover,
.shop-gallery__thumb[aria-current="true"] {
  opacity: 1;
}

.shop-gallery__thumb[aria-current="true"] {
  outline: 2px solid #fff;
  outline-offset: -2px;
}

/* Small play mark on film thumbnails */
.shop-gallery__thumb--video::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 0;
  height: 0;
  border-left: 10px solid #fff;
  border-block: 6px solid transparent;
  transform: translateX(2px);
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.6));
}

.shop-gallery--single .shop-gallery__nav,
.shop-gallery--single .shop-gallery__count,
.shop-gallery--single .shop-gallery__thumbs {
  visibility: hidden;
}

/* Phones: the picture gets the full width and the arrows sit on its edges;
   swiping does the main work there. */
@media (max-width: 700px) {
  .shop-gallery__main {
    position: relative;
    padding-inline: var(--sp-2);
  }

  .shop-gallery__stage {
    --avail-w: calc(100vw - 2 * var(--sp-2));
    border-radius: var(--radius-md);
  }

  .shop-gallery__nav {
    position: absolute;
    top: 50%;
    z-index: 1;
    width: 40px;
    height: 40px;
    margin-top: -20px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: var(--shadow-md);
  }

  .shop-gallery__nav[data-gallery-prev] {
    left: var(--sp-3);
  }

  .shop-gallery__nav[data-gallery-next] {
    right: var(--sp-3);
  }
}

@media (max-width: 980px) {

  .product,
  .product-details__inner {
    grid-template-columns: 1fr;
  }

  .product {
    row-gap: var(--sp-5);
  }

  .product__hero,
  .product__gallery,
  .product__info {
    grid-column: 1;
    grid-row: auto;
  }

  .product__info {
    position: static;
  }

  .product__media.shop-media--empty {
    --ratio: 2 / 1;
  }

  .product__play {
    width: 52px;
    height: 52px;
  }

  .product-details h2 {
    max-width: none;
  }
}
