/* Shared product/salvage-car detail gallery — click a thumbnail to swap the main
   image, click the main image to open a full-size lightbox (prev/next + Esc).
   Used by produs.php (all themes) and _masini_dezmembrate_detail.php. */

.pa-gallery-main {
  position: relative;
  width: 100%;
  padding-bottom: 66%;   /* fixed ~3:2 ratio, doesn't reflow when the shown image changes */
  background: #f3f4f6;
  border-radius: 8px;
  overflow: hidden;
}
.pa-gallery-main img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  cursor: zoom-in;
  display: block;
}
.pa-gallery-noimg {
  width: 100%; height: 300px; background: #f3f4f6;
  display: flex; align-items: center; justify-content: center;
  color: #d1d5db; font-size: 6rem; border-radius: 8px;
}
.pa-gallery-thumbs {
  display: flex; gap: 6px;
  margin-top: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.pa-thumb {
  flex: 0 0 auto;
  width: 80px; height: 60px;
  padding: 0; border: 2px solid transparent;
  background: #f3f4f6;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
}
.pa-thumb.active { border-color: #0d6efd; }
.pa-thumb img { width: 100%; height: 100%; object-fit: cover; }

/* Lightbox */
.pa-lightbox {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,.92);
  display: flex; align-items: center; justify-content: center;
}
.pa-lightbox img {
  max-width: 95vw; max-height: 95vh; object-fit: contain;
}
.pa-lightbox-close, .pa-lightbox-prev, .pa-lightbox-next {
  position: absolute; background: rgba(255,255,255,.1); color: #fff;
  border: none; font-size: 2rem; line-height: 1;
  width: 48px; height: 48px; border-radius: 50%;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.pa-lightbox-close { top: 20px; right: 20px; }
.pa-lightbox-prev  { left: 20px; top: 50%; transform: translateY(-50%); }
.pa-lightbox-next  { right: 20px; top: 50%; transform: translateY(-50%); }
.pa-lightbox-close:hover, .pa-lightbox-prev:hover, .pa-lightbox-next:hover {
  background: rgba(255,255,255,.25);
}
