.modern-hero {
  position: relative; /* Para el patrón de fondo */
  background-color: var(--blue-primary);
  color: var(--white);
  padding: 70px 0;
  min-height: 30vh;
  display: flex;
  align-items: center;
  text-align: center;
  overflow: hidden; /* Para el patrón */
}

/* Patrón de puntos sutil (figura de fondo) */
.modern-hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  /* Usamos el azul secundario para los puntos */
  background-image: radial-gradient(
    circle,
    var(--blue-second) 1px,
    transparent 1px
  );
  background-size: 20px 20px;
  opacity: 0.3;
  z-index: 1;
}

.modern-hero .container {
  position: relative;
  z-index: 2; /* Por encima del patrón de puntos */
}

.modern-hero h1 {
  font-size: 42px;
  font-weight: 700;
  margin-bottom: 20px;
}

.modern-hero p {
  color: #e0e0e0;
  font-size: 18px;
  line-height: 1.6;
  max-width: 800px;
  margin: 0 auto;
}

.certificates-section {
  position: relative;
  background: var(--white);
  padding: 80px 0;
  overflow: hidden;
}

.certificates-section::before {
  content: "";
  position: absolute;
  z-index: 1;
  top: -150px;
  left: -150px;
  width: 400px;
  height: 400px;
  background: #006899;
  border-radius: 50%;
}

.certificates-section::after {
  content: "";
  position: absolute;
  z-index: 1;
  bottom: -200px;
  right: -100px;
  width: 500px;
  height: 500px;
  background: var(--blue-second);
  border-radius: 50%;
}

.certificates-section .container {
  position: relative;
  z-index: 2;
}

/* Título para la sección */
.certificates-section h2 {
  font-size: 32px;
  color: var(--blue-primary);
  text-align: center;
  margin-bottom: 50px;
}

.cert-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
  justify-content: center;
}

.cert-card {
  background: var(--white);
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 5px 15px rgba(0, 55, 100, 0.07);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  height: 220px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  border: 1px solid var(--border-gray);
  cursor: pointer;
}

.cert-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 55, 100, 0.12);
}
.cert-image-box {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 80%;
}
.cert-card img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: grayscale(100%);
  opacity: 0.8;
  transition: 0.3s ease;
}

.cert-card:hover img {
  filter: grayscale(0%);
  opacity: 1;
}
.cert-info {
  text-align: center;
  width: 100%;
  margin-top: 10px;
  padding-top: 5px;
  border-top: 1px solid #eee;
}

.cert-info h4 {
  font-size: 14px; /* Título un poco más pequeño */
  font-weight: 600;
  color: var(--text-dark-blue);
  margin: 0;
  line-height: 1.2;
}

.cert-card:hover .cert-info h4 {
  opacity: 1;
}
/* Contenedor principal (fondo oscuro) */
.modal {
  display: none; /* Oculto por defecto */
  position: fixed;
  z-index: 1000; /* Asegura que esté encima de todo */
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.6); /* Fondo semi-transparente */
  backdrop-filter: blur(5px); /* Efecto de desenfoque opcional */
}

/* Contenido del Modal */
.modal-content {
  background-color: #fefefe;
  margin: 10% auto; /* Centrado vertical y horizontalmente */
  padding: 30px;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 55, 100, 0.3);
  width: 90%; /* Ancho en móviles */
  max-width: 600px; /* Ancho máximo en escritorio */
  animation: modalopen 0.4s;
}

/* Animación de entrada */
@keyframes modalopen {
  from {
    opacity: 0;
    transform: translateY(-50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-body {
  text-align: center;
}

.modal-body #modalImage {
  max-width: 80%;
  object-fit: contain;
  margin-bottom: 20px;
}

.modal-body #modalTitle {
  font-size: 24px;
  color: var(--blue-primary);
  margin-top: 0;
  margin-bottom: 10px;
}

.modal-body #modalDescription {
  font-size: 16px;
  color: var(--text-dark-blue);
  line-height: 1.6;
}

/* Botón de cierre */
.close-btn {
  color: #aaa;
  float: right;
  font-size: 30px;
  font-weight: bold;
  cursor: pointer;
}

.close-btn:hover,
.close-btn:focus {
  color: var(--blue-second);
  text-decoration: none;
}

/* --- RESPONSIVE PARA CERTIFICADOS --- */

/* Tablet y Laptops Pequeñas (Max 1024px) */
@media screen and (max-width: 1024px) {
  .modern-hero h1 {
    margin-top: 5%;
  }
  /* Reducir columnas de 4 a 2 */
  .cert-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
  }

  /* Ajustar tamaño de figuras de fondo para que no invadan mucho */
  .certificates-section::before {
    width: 300px;
    height: 300px;
    top: -100px;
    left: -100px;
  }

  .certificates-section::after {
    width: 350px;
    height: 350px;
    bottom: -150px;
    right: -80px;
  }
}

/* Móviles (Max 600px) */
@media screen and (max-width: 600px) {
  /* --- HERO SECTION --- */
  .modern-hero {
    padding: 50px 0;
  }

  .modern-hero h1 {
    font-size: 28px; /* Título más pequeño */
    line-height: 1.2;
    margin-top: 20%;
  }

  .modern-hero p {
    font-size: 16px;
    padding: 0 15px; /* Margen lateral para que no toque los bordes */
  }

  /* --- GRID DE CERTIFICADOS --- */
  /* Reducir columnas de 2 a 1 (una tarjeta debajo de otra) */
  .cert-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .certificates-section h2 {
    font-size: 26px;
    margin-bottom: 30px;
  }

  /* --- FIGURAS DE FONDO --- */
  /* En móvil las hacemos casi transparentes para leer mejor */
  .certificates-section::before,
  .certificates-section::after {
    opacity: 0.3;
    transform: scale(0.7); /* Las hacemos más pequeñas */
  }

  /* --- MODAL --- */
  .modal-content {
    width: 95%; /* Ocupar casi todo el ancho */
    margin: 30% auto; /* Bajarlo un poco más */
    padding: 20px;
  }

  .modal-body #modalTitle {
    font-size: 20px;
  }
}
