/* =========================================================
   FONDO DEL MODAL
   Cubre toda la pantalla y centra el contenido
   ========================================================= */

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 20px;
  background: rgba(0, 0, 0, 0.60);
}

/* Oculta completamente el modal */
.modal-overlay.oculto {
  display: none;
}


/* =========================================================
   CAJA PRINCIPAL DEL POPUP
   ========================================================= */

.popup-modal {
  width: min(100%, 980px);
  max-height: 90vh;
  overflow: hidden;

  background: #ffffff;
  border-radius: 8px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.35);

  animation: aparecer 0.25s ease;
}


/* =========================================================
   ANIMACIÓN DE ENTRADA
   ========================================================= */

@keyframes aparecer {
  from {
    opacity: 0;
    transform: translateY(-16px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* =========================================================
   CABECERA DEL MODAL
   Título y botón de cerrar
   ========================================================= */

.popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;

  padding: 20px 22px;
  background: #f7f7f7;
  border-bottom: 1px solid #dcdcdc;
}

.popup-header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  color: #333333;
}

.popup-close {
  border: none;
  background: transparent;
  color: #777777;
  font-size: 38px;
  line-height: 1;
  font-weight: 700;
  cursor: pointer;
}


/* =========================================================
   CUERPO DEL MODAL
   ========================================================= */

.popup-body {
  padding: 22px;
}

.popup-content {
  display: flex;
  align-items: stretch;
  gap: 28px;
}


/* =========================================================
   BLOQUE DE TEXTO
   ========================================================= */

.popup-texto {
  flex: 0.9;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.popup-texto h3 {
  margin: 0 0 22px;
  text-align: center;
  font-size: 22px;
  font-weight: 800;
  color: #333333;
}

.popup-subtitle {
  margin: 0 0 22px;
  text-align: center;
  font-size: 20px;
  line-height: 1.3;
  font-weight: 800;
  color: #333333;
}

.popup-text {
  margin: 0 0 24px;
  font-size: 16px;
  line-height: 1.8;
  text-align: justify;
  color: #333333;
}

.popup-date {
  margin-top: auto;
  text-align: center;
  font-size: 16px;
  color: #333333;
}


/* =========================================================
   BOTÓN PRINCIPAL
   ========================================================= */

.popup-btn-wrap {
  margin-bottom: 28px;
  text-align: center;
}

.popup-btn {
  display: inline-block;
  min-width: 170px;
  padding: 14px 26px;
  border-radius: 4px;

  background: #0a7c0a;
  color: #ffffff;
  text-decoration: none;
  font-size: 18px;
  font-weight: 700;
}


/* =========================================================
   BLOQUE DE IMAGEN
   ========================================================= */

.popup-image {
  flex: 1.1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.popup-image img {
  display: block;
  width: 100%;
  max-width: 100%;
  max-height: 65vh;
  object-fit: contain;

  background: #ffffff;
  border: 1px solid #d8d8d8;
  border-radius: 4px;
}


/* =========================================================
   TABLET
   Ajustes para pantallas medianas
   ========================================================= */

@media (max-width: 900px) {
  .popup-modal {
    width: min(100%, 760px);
  }

  .popup-content {
    gap: 20px;
  }

  .popup-texto h3 {
    font-size: 20px;
  }

  .popup-subtitle {
    font-size: 18px;
  }

  .popup-text {
    font-size: 15px;
  }
}


/* =========================================================
   MÓVIL
   El contenido se acomoda en columna
   ========================================================= */

@media (max-width: 640px) {
  .modal-overlay {
    padding: 14px;
  }

  .popup-modal {
    width: 100%;
    max-height: 92vh;
    overflow-y: auto;
  }

  .popup-body {
    padding: 16px;
  }

  .popup-content {
    flex-direction: column;
    gap: 18px;
  }

  .popup-texto h3 {
    margin-bottom: 16px;
    font-size: 18px;
  }

  .popup-btn-wrap {
    margin-bottom: 18px;
  }

  .popup-btn {
    min-width: 150px;
    padding: 12px 20px;
    font-size: 16px;
  }

  .popup-subtitle {
    margin-bottom: 16px;
    font-size: 18px;
  }

  .popup-text {
    margin-bottom: 18px;
    font-size: 15px;
    line-height: 1.7;
  }

  .popup-date {
    text-align: center;
  }

  .popup-image img {
    max-height: 320px;
  }
}