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

.lightbox-trigger {
  display: block;
  max-width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  cursor: zoom-in;
  font: inherit;
}
.lightbox-trigger:focus-visible { outline: 3px solid var(--lilac, #b98cff); outline-offset: 5px; }
.lightbox-trigger img { cursor: zoom-in; }

.product-figure > .lightbox-trigger { position: relative; z-index: 1; width: min(100%, 475px); }
.product-figure > .lightbox-trigger img {
  width: 100%;
  max-height: 530px;
  object-fit: contain;
  mix-blend-mode: screen;
  filter: drop-shadow(0 0 1px #b98cff)
          drop-shadow(0 0 2px #b98cff)
          drop-shadow(0 0 3px rgba(185, 140, 255, .65));
  transform-origin: center;
  scale: 1;
  animation: cleverloot-product-pulse 4.8s ease-in-out infinite;
}
.spotlight-image > .lightbox-trigger { width: min(75%, 330px); height: 390px; display: grid; place-items: center; }
.spotlight-image > .lightbox-trigger img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: screen; }

.lightbox-dialog {
  width: min(96vw, 1120px);
  max-width: none;
  max-height: 94dvh;
  padding: 0;
  border: 1px solid rgba(185, 140, 255, .35);
  border-radius: 16px;
  color: #fff;
  background: #0a0e1d;
  box-shadow: 0 24px 90px rgba(0, 0, 0, .55);
}
.lightbox-dialog::backdrop { background: rgba(5, 8, 21, .84); backdrop-filter: blur(4px); }
.lightbox-frame { position: relative; padding: 52px 22px 18px; }
.lightbox-frame figure { display: grid; justify-items: center; gap: 12px; margin: 0; }
.lightbox-frame img { display: block; width: auto; max-width: 100%; max-height: calc(94dvh - 116px); object-fit: contain; }
.lightbox-frame figcaption { max-width: 70ch; color: #c9cedd; font-size: .82rem; line-height: 1.45; text-align: center; }
.lightbox-close { position: absolute; top: 10px; right: 10px; z-index: 1; display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid rgba(185, 140, 255, .45); border-radius: 50%; color: #fff; background: rgba(255,255,255,.08); font: 1.6rem/1 system-ui, sans-serif; cursor: pointer; }
.lightbox-close:hover { background: rgba(185, 140, 255, .22); }
.lightbox-close:focus-visible { outline: 3px solid #b98cff; outline-offset: 3px; }

@media (max-width: 850px) {
  .product-figure > .lightbox-trigger { width: min(100%, 360px); }
  .product-figure > .lightbox-trigger img { max-height: 390px; }
}
@media (max-width: 620px) {
  .spotlight-image > .lightbox-trigger { width: min(85%, 285px); height: 320px; }
  .lightbox-dialog { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); border-radius: 12px; }
  .lightbox-frame { padding: 54px 12px 14px; }
  .lightbox-frame img { max-height: calc(100dvh - 126px); }
  .lightbox-frame figcaption { font-size: .76rem; }
}

@media (prefers-reduced-motion: reduce) {
  .product-figure > .lightbox-trigger img { animation: none; }
}
