/* --- Backdrop --- */
.modal-custom-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 1050;
  transition: opacity 260ms ease;
  backdrop-filter: blur(2px);
}

/* --- Modal animado desde arriba --- */
.modal-custom {
  position: fixed;
  left: 50%;
  top: 0%; /* inicia fuera de la pantalla */
  transform: translate(-50%, -30%); /* un poco más arriba */

  max-width: 720px;
  width: calc(100% - 48px);
  max-height: 70vh;

  background: #fff;
  border-radius: 14px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.28);
  z-index: 1060;
  overflow: hidden;

  opacity: 0;
  visibility: hidden;
  pointer-events: none;

  transition:
    opacity 300ms ease,
    transform 420ms cubic-bezier(0.16, 1, 0.3, 1); /* animación suave con rebote */
}

/* --- Mostrar modal --- */
.modal-show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;

  top: 50%;
  transform: translate(-50%, -50%); /* baja suavemente al centro */
}

/* --- Mostrar backdrop --- */
.backdrop-show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Imagen */
.modal-custom img.modal-image {
  width: 100%;
  height: auto;
  display: block;
}

/* --- Botón cerrar mejorado --- */
.modal-close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  
  /* width: 40px;
  height: 40px; */

  border: none;
  /* border-radius: 10px; */

  background: transparent;
  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;

  font-size: 17px;
  font-weight: bold;
  color: white;
  opacity: 0.5;

  /* box-shadow: 0 4px 18px rgba(0,0,0,0.18); */
  transition: background 180ms, transform 150ms;
}

.modal-close-btn:hover {
  /* background: #f1f1f1; */
  transform: scale(1.08);
}

.modal-close-btn:active {
  transform: scale(0.92);
}

/* Mobile */
@media (max-width: 520px) {
  .modal-custom {
    width: calc(100% - 16px);
    max-width: 640px;
    max-height: 78vh;
  }
}

.modal-close-btn {
  outline: none !important;
  box-shadow: none !important;
}
