/* ===================== MODAL DE PRIVACIDAD ===================== */
#privacyModal {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  padding: 20px;
  overflow-y: auto; /* Scroll en todo el modal si es muy largo en mobile */
  animation: fadeIn 0.4s ease-out;
}

.modal-content {
  background: white;
  max-width: 580px;
  width: 100%;
  border-radius: 16px;
  box-shadow: 0 15px 40px rgba(0,0,0,0.3);
  overflow: hidden;
  font-family: 'Segoe UI', Arial, sans-serif;
  max-height: 90vh; /* Máximo 90% de la pantalla para mobile, evita overflow fuera */
  display: flex;
  flex-direction: column;
}

.modal-header {
  background: linear-gradient(135deg, #003366, #004080);
  color: white;
  padding: 20px 25px;
  text-align: center;
}

.modal-header i {
  font-size: 42px;
  margin-bottom: 10px;
}

.modal-header h2 {
  margin: 0;
  font-size: 24px;
}

.modal-body {
  padding: 25px;
  line-height: 1.6;
  color: #333;
  flex-grow: 1; /* Crece para ocupar espacio */
  overflow-y: auto; /* Scroll interno si el contenido es largo (ej. mobile) */
  max-height: 50vh; /* Limita altura para que quepa en mobile y active scroll */
}

.modal-body p {
  margin: 12px 0;
}

.modal-footer {
  padding: 20px 25px;
  background: #f8f9fa;
  text-align: center;
}

.btn-primary {
  background: #004080;
  color: white;
  border: none;
  padding: 12px 32px;
  font-size: 16px;
  border-radius: 8px;
  cursor: pointer;
  margin: 0 8px;
  transition: all 0.3s;
}

.btn-primary:hover {
  background: #003366;
  transform: translateY(-2px);
}

.btn-secondary {
  background: transparent;
  color: #004080;
  border: 2px solid #004080;
}

.btn-secondary:hover {
  background: #e6f0ff;
}

.link-pdf {
  color: #004080;
  font-weight: 600;
  text-decoration: underline;
}

/* Para mobile: ajusta paddings y tamaños */
@media (max-width: 600px) {
  .modal-content {
    max-width: 95%;
    max-height: 95vh;
  }

  .modal-header {
    padding: 15px 20px;
  }

  .modal-header i {
    font-size: 32px;
  }

  .modal-header h2 {
    font-size: 20px;
  }

  .modal-body {
    padding: 20px;
    max-height: 40vh; /* Más scroll en mobile para caber */
  }

  .modal-footer {
    padding: 15px 20px;
  }

  .btn-primary {
    padding: 10px 24px;
    font-size: 14px;
    width: 100%; /* Botones full-width en mobile */
    margin: 8px 0;
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Bloquear scroll del body mientras el modal está activo */
body.modal-open {
  overflow: hidden;
}