/* Product page: two-column intro, gallery, lightbox, documents. */
.product-grid {
  display: grid;
  gap: var(--space-6);
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 960px) {
  .product-grid {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: var(--space-7);
    align-items: start;
  }
}

.product-body {
  max-width: none;
}

.product-body > :last-child {
  margin-bottom: 0;
}

.product-body ul,
.product-features {
  padding-left: 1.25rem;
}

.product-body li,
.product-features li {
  margin-bottom: var(--space-2);
}

.product-features {
  list-style: none;
  padding-left: 0;
}

.product-features li {
  position: relative;
  padding-left: 1.5rem;
}

.product-features li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--accent, var(--color-primary));
}

.product-subtitle {
  margin-top: var(--space-5);
  font-size: var(--text-xl);
}

/* Media column */
.product-media > .product-placeholder {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius);
}

.product-figure {
  margin: 0;
}

.gallery-link {
  display: block;
  overflow: hidden;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-top: 4px solid var(--accent, var(--color-primary));
  border-radius: var(--radius);
}

.gallery-link img {
  width: 100%;
  max-height: 32rem;
  object-fit: contain;
  margin-inline: auto;
}

.js .gallery-link {
  cursor: zoom-in;
}

.product-media figcaption {
  padding-top: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
  margin: var(--space-4) 0 0;
  padding: 0;
  list-style: none;
}

.gallery figure {
  margin: 0;
}

.gallery .gallery-link {
  border-top-width: 1px;
}

.gallery .gallery-link img {
  aspect-ratio: 4 / 3;
  max-height: none;
}

.product-media .gallery figcaption {
  font-size: 0.8125rem;
}

/* Documents */
.document-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.document-list li + li {
  margin-top: var(--space-2);
}

.document-list a {
  display: inline-flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.document-list__meta {
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}

.product-specs h2,
.related h2,
.product-documents h2 {
  margin-bottom: var(--space-5);
}

/* Lightbox (<dialog>) */
.lightbox {
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #fff;
}

.lightbox::backdrop {
  background: rgb(10 20 30 / 0.92);
}

.lightbox[open] {
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox__figure {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
  max-width: min(92vw, 1400px);
  margin: 0;
}

.lightbox__img {
  max-width: 100%;
  max-height: 78vh;
  object-fit: contain;
  background: #fff;
  border-radius: var(--radius);
}

.lightbox__caption {
  max-width: 70ch;
  text-align: center;
  font-size: var(--text-base);
}

.lightbox__btn {
  position: absolute;
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgb(255 255 255 / 0.16);
  color: #fff;
  font-size: 1.25rem;
  transition: background var(--duration) var(--ease);
}

.lightbox__btn:hover {
  background: rgb(255 255 255 / 0.3);
}

.lightbox :focus-visible {
  outline-color: var(--color-focus-on-brand);
}

.lightbox__close {
  top: var(--space-4);
  right: var(--space-4);
}

.lightbox__prev,
.lightbox__next {
  top: 50%;
  margin-top: -1.5rem;
}

.lightbox__prev {
  left: var(--space-3);
}

.lightbox__next {
  right: var(--space-3);
}

.lightbox__prev .icon {
  transform: rotate(90deg);
}

.lightbox__next .icon {
  transform: rotate(-90deg);
}

.lightbox--single .lightbox__prev,
.lightbox--single .lightbox__next {
  display: none;
}

body:has(dialog.lightbox[open]) {
  overflow: hidden;
}

@media (max-width: 639px) {
  .lightbox__prev,
  .lightbox__next {
    top: auto;
    bottom: var(--space-4);
    margin-top: 0;
  }
}
