* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Nunito', sans-serif;
  background-color: #f0f4f8;
  color: #1a202c;
}

/* ==========================================
   CABECERA Y NAVEGACIÓN
   ========================================== */
.header {
  background: #0b132b;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 32px;
  box-shadow: 0 4px 15px rgba(11, 19, 43, 0.25);
  border-bottom: 2px solid #00c9ff;
}

.logo-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.logo-img {
  height: 48px;
  width: auto;
  border-radius: 8px;
  display: block;
}

.logo-text {
  font-family: 'Fredoka', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 0.5px;
}

.logo-text span {
  color: #00e5ff;
}

.nav a {
  margin-left: 20px;
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
  color: #e0e6ed;
  transition: color 0.2s ease;
}

.nav a:hover {
  color: #00e5ff;
}

/* ==========================================
   HERO / BANNER PRINCIPAL
   ========================================== */
.hero {
  text-align: center;
  padding: 55px 20px;
  background: linear-gradient(135deg, #0b132b 0%, #1c2541 60%, #2a1b4e 100%);
  color: #ffffff;
  position: relative;
  overflow: hidden;
}

.hero h1 {
  font-family: 'Fredoka', sans-serif;
  font-size: 34px;
  background: linear-gradient(90deg, #00f2fe 0%, #4facfe 50%, #c471ed 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 12px;
}

.hero p {
  font-size: 17px;
  color: #cbd5e1;
  max-width: 620px;
  margin: 0 auto;
  line-height: 1.5;
}

/* ==========================================
   CONTENEDOR Y TARJETAS DINÁMICAS
   ========================================== */
.container {
  max-width: 1100px;
  margin: 30px auto 50px auto;
  padding: 0 20px;
}

.container h2 {
  font-family: 'Fredoka', sans-serif;
  font-size: 26px;
  color: #0b132b;
  margin-bottom: 26px;
  text-align: center;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 320px));
  justify-content: center;
  gap: 28px;
}

.card {
  background: #ffffff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 6px 18px rgba(11, 19, 43, 0.08);
  position: relative;
  display: flex;
  flex-direction: column;
  border: 1px solid #e2e8f0;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 25px rgba(11, 19, 43, 0.14);
}

.badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: linear-gradient(135deg, #00c9ff, #92fe9d);
  color: #0b132b;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  z-index: 2;
}

.card-img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
  object-position: top center;
  display: block;
}

.card-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-body h3 {
  font-family: 'Fredoka', sans-serif;
  font-size: 20px;
  margin-bottom: 10px;
  color: #0b132b;
  line-height: 1.3;
}

.card-body p {
  font-size: 14.5px;
  color: #4a5568;
  margin-bottom: 20px;
  flex-grow: 1;
  line-height: 1.5;
}

/* ==========================================
   BOTÓN DE DESCARGA
   ========================================== */
.btn-download {
  display: block;
  text-align: center;
  background: linear-gradient(90deg, #0288d1 0%, #0097a7 100%);
  color: #ffffff;
  padding: 12px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 800;
  font-size: 15px;
  border: none;
  cursor: pointer;
  transition: opacity 0.2s ease, transform 0.1s ease;
  box-shadow: 0 4px 12px rgba(2, 136, 209, 0.3);
}

.btn-download:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

/* ==========================================
   FOOTER INSTITUCIONAL
   ========================================== */
.footer {
  text-align: center;
  padding: 28px 20px;
  background: #0b132b;
  border-top: 2px solid #1c2541;
  color: #94a3b8;
  font-size: 14px;
}

/* ==========================================
   GESTIÓN DE ANUNCIOS (ADSTERRA)
   ========================================== */

/* 1. Anuncio Nativo Superior (index.html): Centrado y adaptable a móviles y PC */
.ad-native-top {
  width: 100%;
  max-width: 900px;
  margin: 0 auto 30px auto;
  min-height: 90px;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  background: transparent !important;
  overflow: hidden;
}

/* 2. Anuncio Centrado Inferior (300x250) */
.ad-banner-movil {
  width: 100%;
  max-width: 300px;
  min-height: 250px;
  margin: 40px auto 15px auto;
  text-align: center;
  background: transparent !important;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

.ad-banner-movil iframe,
.ad-native-top iframe {
  border: none !important;
  background: transparent !important;
}

/* 3. Anuncio Lateral Flotante para PC (160x600):
   Solo se muestra en monitores mayores a 1420px para que NO tape las tarjetas */
.ad-sidebar-desktop {
  display: none;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  overflow: hidden;
}

.ad-sidebar-desktop iframe {
  border: none !important;
  background: transparent !important;
}

@media (min-width: 1420px) {
  .ad-sidebar-desktop {
    display: block;
    position: fixed;
    right: 25px;
    top: 140px;
    width: 160px;
    height: 600px;
    z-index: 99;
  }
}