/* Fondo oscuro del modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  display: none; /* Cambiar a flex con JS para mostrar */
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

/* Contenedor del contenido */
.modal-content {
  background-color: white;
  padding: 0;
  border-radius: 8px;
  position: relative;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
  max-width: 500px;
  max-height: 90vh;
  width: auto;
  height: auto;
  overflow: visible; /* Permite que el botón flotante no se corte */
}

/* Imagen dentro del modal */
.modal-image {
  display: block;
  width: 100%;
  max-height: calc(100vh - 160px);
  object-fit: contain;
}

/* Botón de cierre */
.modal-close-btn {
  position: absolute;
  top: -20px;
  right: -20px;
  background-color: #ff8c00;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid white;
  color: white;
  font-size: 20px;
  font-weight: bold;
  cursor: pointer;
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 0;
  margin: 0;
  line-height: 1;
  box-sizing: border-box;
}

/* Corregida la sintaxis del :hover */
.modal-close-btn:hover {
  background-color: #e67600;
}

/* Media Queries para diseño responsivo */
@media (max-width: 600px) {
  .modal-content {
    max-width: 90%;
    height: auto;
  }
}

@media (max-height: 700px) {
  .modal-content {
    transform: scale(0.95);
  }
}