.product-main-image.is-expandable {
  position: relative;
  width: 100%;
  padding: 0;
  appearance: none;
  font: inherit;
  cursor: zoom-in;
}

.product-main-image.is-expandable img {
  transition: transform .25s ease;
}

.product-main-image.is-expandable:hover img {
  transform: scale(1.015);
}

.product-main-image.is-expandable:focus-visible,
.product-thumbnails button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--p) 55%, transparent);
  outline-offset: 3px;
}

.product-image-zoom {
  position: absolute;
  right: 18px;
  bottom: 18px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 40px;
  padding: 0 13px;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 12px;
  background: rgba(12, 14, 25, .78);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .22);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .2s ease, transform .2s ease;
  pointer-events: none;
  backdrop-filter: blur(9px);
}

.product-main-image.is-expandable:hover .product-image-zoom,
.product-main-image.is-expandable:focus-visible .product-image-zoom {
  opacity: 1;
  transform: translateY(0);
}

.product-thumbnails button {
  position: relative;
}

.product-thumbnail-zoom {
  position: absolute;
  right: 5px;
  bottom: 5px;
  width: 21px;
  height: 21px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: rgba(12, 14, 25, .76);
  color: #fff;
  font-size: 12px;
  opacity: 0;
  transition: opacity .2s ease;
  pointer-events: none;
}

.product-thumbnails button:hover .product-thumbnail-zoom,
.product-thumbnails button:focus-visible .product-thumbnail-zoom {
  opacity: 1;
}

body.product-lightbox-open {
  overflow: hidden;
}

.product-lightbox[hidden] {
  display: none;
}

.product-lightbox-nav[hidden] {
  display: none;
}

.product-lightbox {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  box-sizing: border-box;
  z-index: 10000;
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
  padding: 24px 84px 20px;
  background: rgba(5, 7, 15, .94);
  animation: product-lightbox-in .18s ease-out;
  backdrop-filter: blur(14px);
}

@keyframes product-lightbox-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.product-lightbox-figure {
  width: min(1500px, calc(100vw - 185px));
  height: calc(100vh - 54px);
  height: calc(100dvh - 54px);
  max-height: calc(100dvh - 54px);
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 12px;
  margin: 0;
}

.product-lightbox-figure > img {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
  border-radius: 16px;
  background: rgba(255, 255, 255, .035);
  user-select: none;
  -webkit-user-drag: none;
}

.product-lightbox-figure figcaption {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 30px;
  color: #fff;
  font-size: 13px;
}

.product-lightbox-figure figcaption strong {
  max-width: min(620px, 70vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-lightbox-figure figcaption span {
  flex: 0 0 auto;
  padding: 5px 9px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
  color: rgba(255, 255, 255, .78);
  font-weight: 800;
}

.product-lightbox button {
  position: fixed;
  z-index: 2;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .2);
  background: rgba(255, 255, 255, .1);
  color: #fff;
  cursor: pointer;
  transition: background .18s ease, transform .18s ease;
  backdrop-filter: blur(10px);
}

.product-lightbox button:hover,
.product-lightbox button:focus-visible {
  background: var(--p);
}

.product-lightbox button:focus-visible {
  outline: 3px solid rgba(255, 255, 255, .45);
  outline-offset: 3px;
}

.product-lightbox-close {
  top: 18px;
  right: 20px;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  font-size: 25px;
}

.product-lightbox-nav {
  top: 50%;
  width: 52px;
  height: 72px;
  border-radius: 16px;
  font-size: 32px;
  transform: translateY(-50%);
}

.product-lightbox-nav:hover,
.product-lightbox-nav:focus-visible {
  transform: translateY(-50%) scale(1.04);
}

.product-lightbox-nav.previous { left: 18px; }
.product-lightbox-nav.next { right: 18px; }

@media (max-width: 700px) {
  .product-image-zoom {
    right: 12px;
    bottom: 12px;
    opacity: 1;
    transform: none;
  }

  .product-lightbox {
    padding: 68px 10px 12px;
  }

  .product-lightbox-figure {
    width: calc(100vw - 20px);
    height: calc(100vh - 82px);
    height: calc(100dvh - 82px);
    max-height: calc(100dvh - 82px);
    gap: 8px;
  }

  .product-lightbox-figure > img {
    border-radius: 12px;
  }

  .product-lightbox-figure figcaption {
    justify-content: space-between;
    padding: 0 4px;
  }

  .product-lightbox-close {
    top: 12px;
    right: 12px;
    width: 44px;
    height: 44px;
  }

  .product-lightbox-nav {
    top: 50%;
    bottom: auto;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    font-size: 27px;
    transform: translateY(-50%);
  }

  .product-lightbox-nav:hover,
  .product-lightbox-nav:focus-visible {
    transform: translateY(-50%) scale(1.04);
  }

  .product-lightbox-nav.previous { left: 8px; }
  .product-lightbox-nav.next { right: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .product-lightbox { animation: none; }
  .product-main-image.is-expandable img,
  .product-image-zoom,
  .product-lightbox button { transition: none; }
}

.product-detail-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr);
  align-items: start;
}

.product-media-stack,
.product-gallery,
.product-info {
  min-width: 0;
  max-width: 100%;
}

.product-media-stack {
  display: grid;
  align-content: start;
}

.product-main-image {
  width: 100%;
  max-width: 100%;
  height: auto;
  min-height: 360px;
  aspect-ratio: 16 / 9;
}

.product-main-image img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.product-thumbnails {
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 6px;
  scrollbar-gutter: stable;
}

.product-thumbnails button {
  flex: 0 0 75px;
}

@media (max-width: 980px) {
  .product-detail-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .product-main-image {
    min-height: 300px;
  }
}

@media (max-width: 700px) {
  .product-main-image {
    min-height: 220px;
  }
}
