/* ---------------------------------------------------------------------- */
/* VARIABLES GLOBALES */
/* ---------------------------------------------------------------------- */
:root{
  --bg:#0b1220; 
  --card:#0f172a; 
  --accent:#7c3aed; 
  --muted:#9ca3af; 
  --glass: rgba(255,255,255,0.03);
  --radius:12px;
}

/* ---------------------------------------------------------------------- */
/* RESET Y ESTILOS BASE */
/* ---------------------------------------------------------------------- */
*{box-sizing:border-box}
html,body{
  height:100%;
  margin:0;
  font-family:Inter,Segoe UI,Arial,sans-serif;
  background:linear-gradient(180deg,var(--bg),#071028);
  color:#fff;
}
a{color:var(--accent);text-decoration:none}
.container{
  max-width:1100px;
  margin:0 auto;
  padding:24px; /* Relleno uniforme para desktop */
  /* CAMBIO 1: Darle un z-index bajo para que se quede debajo del menú desplegable */
  position: relative; 
  z-index: 1; 
}
.muted{color:var(--muted)}

/* ---------------------------------------------------------------------- */
/* COMPONENTES */
/* ---------------------------------------------------------------------- */

.card{
  background:var(--card);
  padding:18px;
  border-radius:var(--radius);
  box-shadow:0 6px 18px rgba(2,6,23,0.6);
}

/* ---------------------------------------------------------------------- */
/* HEADER Y NAVEGACIÓN - CORRECCIÓN Z-INDEX */
/* ---------------------------------------------------------------------- */

.header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:24px; 
  /* Asegurar que el header siempre esté encima del contenido principal */
  position: relative; 
  z-index: 2; 
}
.logo{
  display:flex;
  align-items:center;
  gap:12px;
  flex-shrink: 0; 
}
.logo img{
  height:44px;
  width: auto; 
}
.logo div {
    display: flex;
    flex-direction: column;
    justify-content: center; 
}
.logo strong {
    font-size: 1.2rem;
    font-weight: 700;
    line-height: 1.2; 
}
.logo small {
    font-size: 0.8rem;
    line-height: 1.2;
}

.nav{
  display:flex;
  gap:8px; 
  flex-grow: 1; 
  justify-content: flex-end; 
}
.nav a{
  padding:8px 10px; 
  border-radius:8px;
  font-size: 0.9rem;
  white-space: nowrap; 
  transition: background-color 0.2s; 
}
.nav a:hover {
    background-color: rgba(124, 58, 237, 0.1); 
}

.hamburger{
  display:none; 
  background:var(--accent);
  color:white;
  border:none;
  padding:8px 14px;
  border-radius:var(--radius);
  cursor:pointer;
  font-size:1.2rem;
  z-index: 1000; /* Siempre debe estar encima para ser clicable */
}
/* Clase para mostrar el menú móvil (controlada por JS) */
.nav.active{
  display:flex;
  flex-direction: column;
  position: absolute;
  top: 90px; 
  right: 24px; 
  width: 250px;
  height: auto; 
  background: var(--card);
  padding: 16px;
  border-radius: var(--radius);
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
  /* CORRECCIÓN CLAVE: Asegurar que el menú esté en la capa superior */
  z-index: 1001; 
}


/* ---------------------------------------------------------------------- */
/* CONTENIDO PRINCIPAL (HERO Y GRID) */
/* ---------------------------------------------------------------------- */

.hero{
  display:grid;
  grid-template-columns:1fr 360px; 
  gap:20px;
  align-items:start;
  margin-top:24px;
}
.grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(180px,1fr)); 
  gap:16px;
  margin-top:16px;
}

/* ---------------------------------------------------------------------- */
/* IMÁGENES GLOBALES (HACERLAS FLUIDAS) */
/* ---------------------------------------------------------------------- */
img {
    max-width: 100%;
    height: auto;
}
.grid .card img {
    width: 160px;
    height: auto;
    border-radius: 8px;
    margin-top: 10px;
    display: block;
    margin-left: 0; 
}

/* ---------------------------------------------------------------------- */
/* FOOTER */
/* ---------------------------------------------------------------------- */

footer{
  margin-top:32px;
  padding:16px;
  text-align:center;
  color:var(--muted);
  font-size:14px;
}

/* ---------------------------------------------------------------------- */
/* MEDIA QUERIES (RESPONSIVIDAD MÓVIL) */
/* ---------------------------------------------------------------------- */

@media(max-width:800px){
  /* Reducir el padding general en dispositivos móviles */
  .container {
    padding: 12px;
  }
  
  /* HEADER: ocultar navegación y mostrar botón */
  .nav{
    display: none; 
  }
  .hamburger{
    display:block; 
  }
  
  /* LOGO: ajustes finos en móvil */
  .logo strong {
      font-size: 1rem;
  }
  .logo small {
      font-size: 0.75rem;
  }

  /* HERO: pasar a una sola columna */
  .hero{
    grid-template-columns:1fr; 
    padding-bottom:8px;
  }

  /* GRID: las tarjetas se pueden expandir más si es necesario */
  .grid{
    grid-template-columns:repeat(auto-fit,minmax(140px,1fr));
  }
  
  /* Ajustar imágenes para que se extiendan en tarjetas más pequeñas */
  .grid .card img {
      width: 100%; 
      max-width: 200px; 
      margin-left: auto;
      margin-right: auto;
  }
}

/* Estilo para pantallas muy pequeñas (ej. iPhone 5/SE o dispositivos de menos de 400px) */
@media(max-width:480px){
  .header {
    flex-wrap: wrap; 
    justify-content: center;
  }
  .logo {
    margin-bottom: 8px;
  }
  .hamburger {
      position: absolute;
      right: 12px; 
      top: 24px;
  }
  .nav.active {
      right: 12px; 
      top: 60px; 
      width: 200px; 
      height: auto; 
  }
}