/* ══════════════════════════════════════════════════
   LIGHTBOX — immagine a dimensioni reali
   ══════════════════════════════════════════════════ */
.pd-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .92);
  z-index: 9999;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px;
}
.pd-lightbox.active { display: flex; }

/* Wrap immagine: occupa tutto lo spazio disponibile */
.lightbox-img-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 0;
  width: 100%;
  overflow: hidden;
}

/* Immagine: dimensioni reali, ridimensionata solo se necessario */
.lightbox-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  display: block;
}

.lightbox-close {
  position: absolute;
  top: 16px; right: 20px;
  background: rgba(255,255,255,.15);
  border: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.lightbox-close:hover { background: rgba(255,255,255,.3); }

.lightbox-caption {
  color: rgba(255,255,255,.7);
  font-size: 13px;
  font-family: sans-serif;
  margin: 0;
  text-align: center;
  max-width: 600px;
}

.pd-lightbox-nav {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-shrink: 0;
}
.pd-lightbox-nav button {
  background: rgba(255,255,255,.15);
  border: none; color: #fff;
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 20px;
  cursor: pointer;
  transition: background .15s;
}
.pd-lightbox-nav button:hover { background: rgba(255,255,255,.3); }

.lightbox-counter {
  color: rgba(255,255,255,.6);
  font-size: 13px;
  font-family: sans-serif;
  min-width: 60px;
  text-align: center;
}

/* Thumbnails */
.pd-lightbox-thumbs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 90vw;
  flex-shrink: 0;
}
.pd-lightbox-thumbs img {
  width: 48px; height: 48px;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  opacity: .45;
  border: 2px solid transparent;
  transition: opacity .15s, border-color .15s;
}
.pd-lightbox-thumbs img:hover { opacity: .75; }
.pd-lightbox-thumbs img.active {
  opacity: 1;
  border-color: #fff;
}

/* Responsive */
@media (max-width: 600px) {
  .pd-lightbox { padding: 12px; gap: 8px; }
  .pd-lightbox-thumbs { display: none; }
  .pd-lightbox-nav button { padding: 6px 14px; font-size: 18px; }
}
