/* Background overlay */
#popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: none;
  z-index: 9998;
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Popup window */
#popup-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.85);
  background: #fff;
  padding: 25px;
  max-width: 600px;
  width: 90%;
  z-index: 9999;
  display: none;

  border-radius: 12px;
  box-shadow: 0 14px 35px rgba(0,0,0,0.45);

  opacity: 0;
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
}

/* Cursor pointer only when popup is clickable */
#popup-modal[data-link] {
  cursor: pointer;
}

/* Close button */
.popup-close {
  position: absolute;
  right: 12px;
  top: 12px;
  background: rgba(0,0,0,0.5);
  color: white;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  text-align: center;
  line-height: 28px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.popup-close:hover {
  background: rgba(0,0,0,0.7);
}

/* Content area */
.popup-content {
  margin-top: 10px;
  text-align: center;
}

/* Images responsive */
#popup-modal .popup-content img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 10px auto;
  border-radius: 8px;
}

/* Hover zoom only if popup is clickable */
#popup-modal[data-link]:hover {
  transform: translate(-50%, -50%) scale(0.90);
}

/* Fade-in animation */
#popup-modal.popup-visible {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

#popup-overlay.popup-visible {
  opacity: 1;
}
