:root {
  --azul-fondo: #1E3A8A;
  --gris-nav: #4B5563;
  --verde-link: #34D399;
  --blanco-texto: #ffffff;
  --fondo-cajas: aliceblue;
  --color-gris-hielo: #E5E7EB;
}

/* 🎨 ESTILOS GENERALES */
body {
  background-color: var(--azul-fondo);
  color: var(--blanco-texto);
  font-family: 'Segoe UI', sans-serif;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
}

/* 🧭 NAVEGACIÓN */
nav {
  background: var(--gris-nav);
  border-bottom: 1px solid black;
  padding: 0.5rem 1rem;
}

nav ul {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  padding: 0;
  margin: 0;
  list-style: none;
}

nav ul li {
  margin: 5px 10px;
}

nav ul li a {
  color: var(--blanco-texto);
  text-decoration: none;
  font-weight: bold;
  transition: color 0.3s ease;
}

nav ul li a:hover {
  color: var(--verde-link);
}

/* 🧠 TÍTULO PRINCIPAL */
h1 {
  text-align: center;
  font-size: 4vw;
  margin: 1.5rem 0;
  line-height: 1.2;
}

/* 📦 CONTENEDOR FLEX (GRID ADAPTATIVO) */
.flex-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 15px;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px;
}

/* 🧊 CAJAS EDUCATIVAS */
.caja {
  background-color: var(--fondo-cajas);
  text-align: center;
  border: 1px solid #464545;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  cursor: pointer;
  aspect-ratio: 1 / 1;
  transition: transform 0.4s ease, box-shadow 0.4s ease;
}

/* 🎨 CAJAS CON IMAGEN DE FONDO */
.c1, .c2, .c3, .c4 {
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
}

.c1:hover, .c2:hover, .c3:hover, .c4:hover {
  transform: scale(1.05);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

/* 🌆 FONDOS */
.c1 { background-image: url('../imagenes/aula_secundaria_profe_atractivo.png'); }
.c2 { background-image: url('../imagenes/aula_facultad_matematicas_profesor_barba.png'); }
.c3 { background-image: url('../imagenes/aula_colores_metalicos_maestra_sexy.png'); }
.c4 { background-image: url('../imagenes/aula_preparatoria_futurista_pitagoras.png'); }

/* 🏷️ TEXTO EN CAJAS */
.c1 h4, .c2 h4, .c3 h4, .c4 h4 {
  color: white;
  font-size: 1.5rem;
  text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.7);
}

.c1 span, .c2 span, .c3 span, .c4 span {
  background-color: rgba(0, 0, 0, 0.4);
  padding: 8px 16px;
  border-radius: 8px;
}

/* 🧩 TEXTO INTERNO */
section div span {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 1rem;
  color: #FDF6EC;
}

section div span h4 {
  margin: 0;
}

/* 🚗 SVG Y ANIMACIÓN */
.svg-wrapper {
  position: relative;
  width: fit-content;
  margin: 2rem auto;
}

svg {
  width: 80vw;
  max-width: 500px;
  height: auto;
}

.car {
  width: 20px;
  height: 25px;
  background-color: yellow;
  border-radius: 70%;
  position: absolute;
  top: 0;
  left: 0;
}

/* 🦶 PIE DE PÁGINA */
footer {
  background: var(--color-gris-hielo);
  color: var(--azul-fondo);
  text-align: center;
  padding: 1rem;
  font-size: 1rem;
}

a {
  text-decoration: none;
  /* color: azure; */
}

.link_green {
  color: var(--verde-link);
  font-weight: bold;
}

/* 💻💡 MEDIA QUERIES RESPONSIVAS */

/* Tablets (hasta 992px) */
@media (max-width: 992px) {
  h1 {
    font-size: 3rem;
  }

  .flex-container {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
  }

  .caja {
    aspect-ratio: 1 / 1;
  }

  svg {
    width: 90vw;
  }
}

/* Móviles medianos (hasta 768px) */
@media (max-width: 768px) {
  nav ul {
    flex-direction: column;
    text-align: center;
  }

  nav {
    padding: 1rem;
  }

  h1 {
    font-size: 2rem;
    margin: 1rem;
  }

  section div span h4 {
    font-size: 1.3rem;
  }

  footer {
    font-size: 0.9rem;
  }
}

/* Móviles pequeños (hasta 480px) */
@media (max-width: 480px) {
  h1 {
    font-size: 1.7rem;
  }

  nav ul li {
    margin: 6px 0;
  }

  .caja {
    aspect-ratio: auto;
    height: 220px;
  }

  section div span h4 {
    font-size: 1.1rem;
  }

  svg {
    width: 95vw;
  }

  footer img {
    width: 40px;
    height: 40px;
  }
}
