.niveles-wrapper {
  position: relative;
  width: 100%;
  padding: 120px 20px 120px 20px;
  background: #f8fafc;
  z-index: 1;
}

.niveles-container {
  max-width: 1200px;
  margin: 0 auto;
}

.nivel-body p {
  margin-bottom: 25px;
}

.aprendizajes {
  padding-left: 25px; /* mueve las vi�0�9etas hacia la derecha */
}

.section-title {
  text-align: center;
  font-size: 2.5rem;
  color: #1e3a8a;
  font-weight: 700;
  margin-bottom: 15px;
}

.section-subtitle {
  text-align: center;
  color: #475569;
  font-size: 1.1rem;
  margin-bottom: 50px;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

.niveles-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 40px;
}

.nivel-card {
  background: #fff;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 8px 25px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
}

.nivel-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(0,0,0,0.15);
}

.nivel-image img {
  width: 100%;
  height:470px;
  object-fit: cover;
}

.nivel-header {
  text-align: center;
  padding: 20px;
  color: white;
}

.nivel-header.inicial {
  background: linear-gradient(135deg, #2563eb, #1e3a8a);
}

.nivel-header.primaria {
  background: linear-gradient(135deg, #16a34a, #065f46);
}

.nivel-body {
  padding: 25px;
  flex: 1;
}

.mostrar-grados-btn button {
  background: #2563eb;
  color: white;
  border: none;
  padding: 8px 18px;
  border-radius: 25px;
  cursor: pointer;
  margin-bottom: 15px;
  margin-top: 20px; /* separa el botón del párrafo anterior */
}

.mostrar-grados-btn button:hover {
  background: #1e3a8a;
  transform: scale(1.05);
}

.grados-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 15px;
  margin-top: 10px;
}

.grado-card {
  background: #16a34a;
  color: white;
  padding: 15px;
  text-align: center;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.grado-card:hover {
  background: #065f46;
  transform: scale(1.05);
}

/* Modal */
.modal {
  display: none;
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0,0,0,0.6);
}

.modal-content {
  background: #fff;
  margin: 10% auto;
  padding: 20px;
  border-radius: 15px;
  width: 90%;
  max-width: 600px;
  text-align: center;
  position: relative;
}

.modal-content img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  margin-bottom: 15px;
}

.close-modal {
  position: absolute;
  top: 10px;
  right: 15px;
  font-size: 28px;
  cursor: pointer;
}

/* Responsive */
@media (max-width: 1024px) {
  .niveles-grid {
    grid-template-columns: 1fr;
  }
  .grados-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .grados-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================= */
/* SCROLL SUAVE NORMAL */
/* ============================= */

.animar-scroll {
  opacity: 0;
  transform: translateY(40px);
  transition: all 0.8s ease;
}

.animar-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}