/* Lock background scroll when popup is open */
body.no-scroll { overflow: hidden; }

/* Modal container */
.popup {
  position: fixed;
  inset: 0;
  display: flex;                 /* keep flex always; we toggle visibility/opacity */
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.95);
  z-index: 9999;

  /* fade behavior */
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 300ms ease, visibility 300ms ease;
}

/* Visible state */
.popup--visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Image scales to fit without cropping */
.popup__image {
  max-width: 100vw;
  max-height: 100vh;
  width: auto;
  height: auto;
  object-fit: contain;
  pointer-events: none; /* image doesn't intercept clicks */
  user-select: none;
}

/* Close button (top-right) */
.popup__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 9999px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  font-size: 22px;
  line-height: 44px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (max-width: 480px) {
  .popup__close {
    top: 8px; right: 8px;
    width: 48px; height: 48px; font-size: 24px;
  }
}