/* overlay permite clicks al contenido detrás salvo el popup */
#overlay{
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  background: transparent;
  pointer-events: none; /* deja pasar clicks fuera del popup (menu funciona) */
}

/* popup sí recibe clicks */
#popup{
  position: relative;
  transform-origin: center center;
  animation: popin 920ms cubic-bezier(.2,.9,.2,1) forwards;
  z-index: 10000;
  pointer-events: auto;
}

/* imagen */
#popup img{
  max-width: 90vw;
  max-height: 90vh;
  display: block;
  background: transparent;
  z-index: 1;
}

/* botón de cierre visible y clickeable */
#closeBtn{
  position: absolute;
  top: -10px;
  right: -10px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(0,0,0,0.08);
  background: rgba(255,255,255,0.95);
  cursor: pointer;
  font-size: 20px;
  line-height: 34px;
  text-align: center;
  padding: 0;
  z-index: 10001;
  pointer-events: auto;
}

/* animaciones */
@keyframes popin {
  0% { transform: scale(0.06); opacity: 0; }
  60% { transform: scale(1.06); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
.closing { animation: popout 220ms ease-in forwards; }
@keyframes popout { to { transform: scale(0.04); opacity: 0; } }
