#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-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;
}

#popup-modal[data-link] { cursor: pointer; }

.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); }

.popup-content { margin-top: 10px; text-align: center; }

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

#popup-modal.popup-visible { opacity: 1; transform: translate(-50%, -50%) scale(1); }
#popup-overlay.popup-visible { opacity: 1; }
