/* Overlay full-screen, centrat vertical și orizontal */
.custom-lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.85);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  overflow: hidden;
  opacity: 0;
  transition: opacity 0.4s ease;
}

/* Când e deschis, afișează flex și fade-in */
.custom-lightbox-overlay.open {
  display: flex;
  opacity: 1;
}

/* Wrapper interior pentru animație scale */
.custom-lightbox-overlay .lightbox-inner {
  position: relative;
  transition: transform 0.4s ease;
  transform: scale(0.8);
}

/* Scale up la deschidere */
.custom-lightbox-overlay.open .lightbox-inner {
  transform: scale(1);
}

/* Imaginea mare: inițial transparentă, apare cu fade */
.custom-lightbox-overlay .lightbox-inner img {
  max-width: 90%;
  max-height: 90%;
  display: block;
  box-shadow: 0 0 30px rgba(0,0,0,0.7);
  opacity: 0;
  transition: opacity 0.4s ease, box-shadow 0.3s ease;
  margin: auto; /* asigură centrare absolută în wrapper */
}

/* După încărcare, clasa .visible o face opacă */
.custom-lightbox-overlay .lightbox-inner img.visible {
  opacity: 1;
}

/* Hover pe imagine: reflexie ușoară */
.custom-lightbox-overlay .lightbox-inner img:hover {
  box-shadow: 0 0 60px rgba(255,255,255,0.2);
  cursor: pointer;
}

/* Buton aproape de marginea din dreapta-sus */
.custom-lightbox-overlay .lightbox-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 32px;
  height: 32px;
  cursor: pointer;
  background: url('data:image/svg+xml;base64,PHN2ZyBmaWxsPSIjZmZmIiB2aWV3Qm94PSIwIDAgMzIgMzIiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTE5LjU4IDE2bDUuNzktNS43OWExIDEgMCAxIDAtMS40MS0xLjQxbC01Ljc5IDUuNzktNS43OS01Ljc5YTEgMSAwIDEgMC0xLjQxIDEuNDFsNS43OSA1Ljc5LTUuNzkgNS43OWExIDEgMCAxIDAgMS40MSAxLjQxbDUuNzktNS43OSA1Ljc5IDUuNzlhMSAxIDAgMSAwIDEuNDEtMS40MWwtNS43OS01Ljc5eiIvPjwvc3ZnPg==') no-repeat center center;
  background-size: contain;
  opacity: 0.8;
  transition: opacity 0.2s;
}
.custom-lightbox-overlay .lightbox-close:hover {
  opacity: 1;
}

/* Butoane Prev/Next pe laturile laterale */
.custom-lightbox-overlay .lightbox-prev,
.custom-lightbox-overlay .lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border: none;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.2s, transform 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.custom-lightbox-overlay .lightbox-prev:hover,
.custom-lightbox-overlay .lightbox-next:hover {
  background: rgba(255,255,255,0.3);
  transform: translateY(-50%) scale(1.1);
}
.custom-lightbox-overlay .lightbox-prev {
  left: 30px;
}
.custom-lightbox-overlay .lightbox-next {
  right: 30px;
}

/* Responsive: butoane sub imagine, coloană */
@media (max-width: 600px) {
  .custom-lightbox-overlay {
    flex-direction: column;
  }
  .custom-lightbox-overlay .lightbox-inner {
    margin-bottom: 10px;
  }
  .custom-lightbox-overlay .lightbox-prev,
  .custom-lightbox-overlay .lightbox-next {
    position: static;
    width: auto;
    height: auto;
    margin: 5px;
    background: rgba(255,255,255,0.2);
    font-size: 1.2rem;
    border-radius: 4px;
    transform: none;
  }
  .custom-lightbox-overlay .lightbox-prev { order: 2; }
  .custom-lightbox-overlay .lightbox-inner { order: 1; }
  .custom-lightbox-overlay .lightbox-next { order: 3; }
}
