/* Product gallery: focused lightbox with restrained, touch-friendly controls. */
.lightbox {
  width: min(1380px, calc(100vw - 40px));
  height: min(900px, calc(100dvh - 40px));
  max-width: none;
  max-height: none;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}

.lightbox::backdrop {
  background: rgba(4, 5, 7, .88);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.lightbox__inner {
  position: relative;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  width: 100%;
  height: 100%;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 18px;
  background: radial-gradient(circle at 50% 38%, #343a44 0, #232831 52%, #12151a 100%);
  box-shadow: 0 28px 80px rgba(0, 0, 0, .62), 0 0 0 1px rgba(0, 0, 0, .25);
  overflow: hidden;
}

.lightbox img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: none;
  padding: 44px 96px 28px;
  object-fit: contain;
  user-select: none;
}

.lightbox__caption {
  min-height: 58px;
  margin: 0;
  padding: 15px 84px;
  border-top: 1px solid rgba(255, 255, 255, .12);
  background: rgba(10, 12, 16, .86);
  color: #e2e5ea;
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .06em;
}

.lightbox__nav {
  position: absolute;
  top: 50%;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 50%;
  background: rgba(9, 11, 15, .66);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .25);
  color: #f5f6f8;
  font-size: 0;
  transform: translateY(-50%);
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, color .18s ease, transform .18s ease;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.lightbox__nav::before {
  content: "";
  width: 10px;
  height: 10px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
}

.lightbox__nav--prev::before { transform: translateX(2px) rotate(-135deg); }
.lightbox__nav--next::before { transform: translateX(-2px) rotate(45deg); }

.lightbox__nav:hover,
.lightbox__nav:focus-visible {
  border-color: var(--red-bright, #ff3a41);
  background: var(--red, #e11b22);
  color: #fff;
  outline: none;
  transform: translateY(-50%) scale(1.06);
}

.lightbox__nav:active {
  transform: translateY(-50%) scale(.98);
}

.lightbox__nav--prev { left: 24px; }
.lightbox__nav--next { right: 24px; }

.lightbox__close {
  z-index: 4;
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 50%;
  background: rgba(9, 11, 15, .66);
  color: #fff;
  font-size: 0;
  line-height: 1;
  cursor: pointer;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.lightbox__close::before,
.lightbox__close::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

.lightbox__close::before { transform: rotate(45deg); }
.lightbox__close::after { transform: rotate(-45deg); }

.lightbox__close:hover,
.lightbox__close:focus-visible {
  border-color: var(--red-bright, #ff3a41);
  background: var(--red, #e11b22);
  outline: none;
  transform: scale(1.06);
}

@media (max-width: 700px) {
  .lightbox {
    width: calc(100vw - 20px);
    height: calc(100dvh - 20px);
  }

  .lightbox__inner { border-radius: 14px; }
  .lightbox img { padding: 66px 52px 18px; }
  .lightbox__caption { min-height: 56px; padding: 14px 52px; font-size: 11px; }
  .lightbox__nav { width: 42px; height: 42px; }
  .lightbox__nav--prev { left: 8px; }
  .lightbox__nav--next { right: 8px; }
  .lightbox__close { top: 10px; right: 10px; width: 38px; height: 38px; }
}

@media (prefers-reduced-motion: reduce) {
  .lightbox__nav,
  .lightbox__close { transition: none; }
}
