/* === VARIABLES Y BASE === */
:root {
  --azul-conservador: #0033a0;
  --azul-oscuro: #001a4d;
  --blanco: #ffffff;
  --gris-claro: #f4f6fb;
  --texto: #222;
  --acento: #c8102e;
}

/* === CORRECCIÓN NAVEGACIÓN FLUIDA === */
html {
  scroll-behavior: smooth; /* Habilita el desplazamiento suave nativo */
}

/* Compensación para el menú fijo (Evita que tape el título) */
#como-votar {
  scroll-margin-top: 100px; /* Ajusta este valor si tu menú es más alto */
}


* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Open Sans', sans-serif;
  color: var(--texto);
  line-height: 1.6;
}

h1, h2, h3, h4, .nav-text, .numero-gigante {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
}

/* === NAVEGACIÓN === */
nav {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(0, 26, 77, 0.98);
  padding: 10px 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.nav-container {
  max-width: 1200px;
  margin: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: white;
}

.nav-logo-img {
  height: 40px;
  width: auto;
}

.nav-links a {
  color: white;
  text-decoration: none;
  margin-left: 20px;
  font-weight: 600;
}

.highlight-link {
  background: var(--acento);
  padding: 5px 15px;
  border-radius: 20px;
}

/* === HERO HEADER === */
header {
  height: 100vh;
  min-height: 700px;
  position: relative;
  background-image: url('img/hero-bg.jpg');
  background-size: cover;
  background-repeat: no-repeat;
  /* Por defecto (Móvil) centrado arriba */
  background-position: center top; 
  background-color: transparent;
  display: block; 
}

.hero-overlay {
  background: none !important;
  width: 100%;
  height: 100%;
  padding: 0;
  position: relative;
}

.hero-content {
  position: absolute;
  /* Valores base (se sobrescriben en media queries) */
  color: #ffffff;
  z-index: 5;
  margin: 0;
  padding: 0;
}

/* === ELEMENTOS INTERNOS DEL HERO === */
.pre-eslogan {
  font-family: 'Montserrat', sans-serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: #ffffff;
  text-transform: uppercase;
  margin-bottom: 5px;
  letter-spacing: 1px;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.9), 0 0 15px rgba(0,0,0,0.9);
}

.mas-destacado {
  font-family: 'Permanent Marker', cursive, sans-serif;
  color: #ffdd00;
  font-size: 1.3em;
  display: inline-block;
  text-shadow: 3px 3px 0px #001a4d;
  animation: latidoOrganico 2s infinite ease-in-out;
  position: relative;
  top: 2px;
  margin-left: 5px;
}

.eslogan-principal {
  font-size: 2.2rem;
  line-height: 1.2;
  margin-bottom: 20px;
  color: #ffffff;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.9), 0 0 20px rgba(0,0,0,0.9);
}

.resaltado { 
  color: #ffdd00;
  text-shadow: 0 2px 5px rgba(0,0,0,0.9);
}

.header-badges {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 15px;
  margin-bottom: 15px;
}

.hero-logo {
  height: 70px;
  filter: drop-shadow(0 4px 6px rgba(0,0,0,0.6));
}

.numero-gigante {
  font-size: 4.5rem;
  line-height: 1;
  color: #ffffff;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.9), 0 0 20px rgba(0,0,0,0.9);
}

.cargo-badge {
  display: inline-block;
  background-color: rgba(0, 26, 77, 0.4);
  padding: 8px 20px;
  border-radius: 4px;
  font-weight: 600;
  text-transform: uppercase;
  border: 1px solid rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
  color: #ffffff;
  font-size: 0.95rem;
  letter-spacing: 0.6px;
}

@keyframes latidoOrganico {
  0% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.15) rotate(-3deg); }
  100% { transform: scale(1) rotate(0deg); }
}

/* === RESTO DE ESTILOS === */
.jingle-bar { background: var(--gris-claro); border-left: 8px solid var(--azul-conservador); padding: 30px; text-align: center; font-style: italic; font-size: 1.2rem; font-weight: 600; color: var(--azul-oscuro); }
section { padding: 80px 20px; max-width: 1100px; margin: auto; }
.section-header { text-align: center; margin-bottom: 50px; }
.section-header h3 { color: var(--azul-conservador); font-size: 2rem; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 30px; }
.card { background: #f9f9f9; padding: 30px; border-top: 5px solid var(--azul-conservador); border-radius: 8px; box-shadow: 0 5px 15px rgba(0,0,0,0.05); }
.btn-leer-mas { background: none; border: 2px solid var(--azul-conservador); color: var(--azul-conservador); padding: 8px 20px; border-radius: 20px; cursor: pointer; font-weight: bold; margin-top: 15px; transition: all 0.3s; }
.btn-leer-mas:hover { background: var(--azul-conservador); color: white; }
.alerta-cedula { background-color: #ffebee; color: #d32f2f; text-align: center; padding: 15px; font-weight: 800; border: 2px solid #d32f2f; margin: 20px auto; max-width: 90%; border-radius: 8px; font-family: 'Montserrat', sans-serif; animation: pulseAlert 2s infinite; }
@keyframes pulseAlert { 0% { transform: scale(1); } 50% { transform: scale(1.02); } 100% { transform: scale(1); } }
.bg-voto { background-color: #eef2f9; }
.simulador-wrapper { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 50px; }
.tarjeton-demo { background: white; border: 2px solid #ccc; width: 100%; max-width: 450px; border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,0.15); overflow: hidden; position: relative; }
.tarjeton-header { background: #ddd; color: #333; text-align: center; font-size: 0.7rem; font-weight: bold; padding: 5px; letter-spacing: 1px; }
.tarjeton-body { display: flex; padding: 15px; }
.col-logo { width: 40%; border-right: 2px solid #aaa; display: flex; flex-direction: column; align-items: center; justify-content: center; padding-right: 15px; }
.logo-tarjeton { width: 90%; max-width: 100px; height: auto; object-fit: contain; margin-bottom: 0; }
.col-numeros.single-focus { width: 60%; padding-left: 15px; display: flex; justify-content: center; align-items: center; }
.casilla-objetivo { width: 80px; height: 60px; transform: scale(1.3); box-shadow: 0 4px 10px rgba(0,51,160, 0.15); border: 2px solid var(--azul-conservador); border-radius: 5px; display: flex; align-items: center; justify-content: center; font-weight: 800; color: var(--azul-conservador); font-size: 1.2rem; position: relative; background-color: rgba(0, 51, 160, 0.05); }
.logo-inline { height: 1.4em; vertical-align: middle; margin: 0 4px; display: inline-block; transform: translateY(-2px); }
.instruccion-item { display: flex; align-items: center; flex-wrap: wrap; margin-bottom: 15px; }
.step-num { background: var(--azul-conservador); color: white; border-radius: 50%; width: 25px; height: 25px; display: inline-block; text-align: center; line-height: 25px; margin-right: 10px; font-size: 0.9rem; flex-shrink: 0; }
.nota-legal { font-size: 0.8rem; color: #666; font-style: italic; margin-top: 20px; }
.grid-2-trayectoria { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 30px; max-width: 900px; margin: auto; }
.testimonio-card { background: white; padding: 30px; border-radius: 12px; box-shadow: 0 4px 20px rgba(0,0,0,0.06); border-left: 5px solid var(--azul-conservador); transition: transform 0.3s ease; display: flex; flex-direction: column; justify-content: space-between; }
.testimonio-card:hover { transform: translateY(-5px); }
.testimonio-header { display: flex; align-items: center; gap: 15px; margin-bottom: 20px; }
.avatar-circle { width: 50px; height: 50px; background-color: var(--azul-oscuro); color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: bold; font-family: 'Montserrat', sans-serif; font-size: 1.2rem; flex-shrink: 0; }
.testimonio-info h5 { margin: 0; color: var(--texto); font-size: 1.1rem; font-weight: 700; }
.testimonio-info .cargo { font-size: 0.85rem; color: #666; font-style: italic; }
.testimonio-text { font-style: italic; color: #444; line-height: 1.6; margin-bottom: 20px; }
.hidden-story { display: none; }
.active-story { display: flex; animation: fadeIn 0.5s ease-in; }
.acciones-historias { text-align: center; margin-top: 30px; display: flex; flex-direction: column; gap: 15px; align-items: center; }
.btn-secondary { background-color: #6c757d; color: white; border: none; padding: 10px 25px; border-radius: 5px; cursor: pointer; font-weight: bold; }
.btn-whatsapp-historia { background-color: #25d366; color: white; padding: 10px 25px; border-radius: 50px; text-decoration: none; font-weight: bold; display: inline-flex; align-items: center; gap: 10px; }
.btn-whatsapp-historia img { width: 20px; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.bg-dark { background: var(--azul-oscuro); color: white; text-align: center; }
.bg-dark h3 { color: white; }
.btn-whatsapp-group { display: inline-flex; align-items: center; justify-content: center; gap: 12px; background-color: white; color: #25d366; padding: 12px 35px; text-decoration: none; font-weight: 800; font-family: 'Montserrat', sans-serif; border-radius: 50px; font-size: 1.1rem; transition: all 0.3s ease; box-shadow: 0 4px 15px rgba(0,0,0,0.2); }
.btn-whatsapp-group:hover { background-color: #25d366; color: white; transform: translateY(-3px); }
.btn-whatsapp-group img { width: 28px; height: 28px; }
footer { background: #001030; color: #aaa; text-align: center; padding: 30px; }
.footer-logo { display: flex; justify-content: center; align-items: center; gap: 10px; margin-bottom: 10px; }
.bg-gris-suave { background-color: #f8f9fa; border-top: 1px solid #e9ecef; border-bottom: 1px solid #e9ecef; }

/* === ANIMACIÓN X ROBUSTA (CORREGIDA) === */
.x-animada { 
  position: absolute; top: 0; left: 0; width: 100%; height: 100%; 
  pointer-events: none; 
}

.x-animada path { 
  fill: none; 
  stroke: var(--acento);
  stroke-width: 12; /* Trazo más visible */
  stroke-linecap: round; 
  stroke-linejoin: round;
  stroke-dasharray: 130; 
  stroke-dashoffset: 130; 
  opacity: 0; 
  transition: opacity 0.3s ease;
}

.active-animation .trazo1 { 
  animation: dibujarTrazo 3s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  animation-delay: 0.2s;
}

.active-animation .trazo2 { 
  animation: dibujarTrazo 3s cubic-bezier(0.4, 0, 0.2, 1) infinite;
  animation-delay: 0.5s;
}

@keyframes dibujarTrazo {
  0% { stroke-dashoffset: 130; opacity: 0; }
  10% { opacity: 1; }
  30% { stroke-dashoffset: 0; }
  70% { stroke-dashoffset: 0; opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: 0; }
}

/* === MODALES (ESTILOS Y Z-INDEX) === */
.modal-overlay {
  display: none; 
  position: fixed; 
  top: 0; 
  left: 0; 
  width: 100%; 
  height: 100%;
  background: rgba(0,0,0,0.8);
  z-index: 2000;
  backdrop-filter: blur(3px);
}

.modal {
  display: none; 
  position: fixed; 
  top: 50%; 
  left: 50%; 
  transform: translate(-50%, -50%);
  background: white; 
  padding: 30px; 
  width: 90%; 
  max-width: 600px; 
  border-radius: 10px;
  z-index: 2001; 
  box-shadow: 0 10px 25px rgba(0,0,0,0.5); 
  border-top: 5px solid var(--azul-conservador);
  max-height: 85vh; 
  overflow-y: auto;
}

.active-modal { 
  display: block !important; 
  animation: fadeInModal 0.3s ease-out;
}

@keyframes fadeInModal {
  from { opacity: 0; transform: translate(-50%, -45%); }
  to { opacity: 1; transform: translate(-50%, -50%); }
}

.close-modal { position: absolute; top: 10px; right: 15px; font-size: 2rem; cursor: pointer; color: #999; }

/* === BREAKPOINTS DE PRECISIÓN === */

/* 1. MOBILE (<= 768px) */
@media (max-width: 768px) {
  header { 
    background-position: center top; 
  }
  
  /* CORRECCIÓN: Bajamos al 60% para que NO tape la cara (línea verde) */
  .hero-content {
    top: 60%; 
    left: 50%;
    transform: translate(-50%, 0); /* Caída libre hacia abajo */
    text-align: center;
    max-width: 95%;
    width: 90%;
  }
  
  .header-badges { justify-content: center; }
  
  .numero-gigante { font-size: 3.5rem; }
  .eslogan-principal { font-size: 1.7rem; margin-bottom: 10px; }
  .pre-eslogan { font-size: 1.2rem; }
  .hero-logo { height: 60px; }
  
  .menu-toggle { display: block; background: none; border: none; color: white; font-size: 1.8rem; cursor: pointer; }
  .nav-links { display: none; position: absolute; top: 100%; left: 0; width: 100%; background: var(--azul-conservador); flex-direction: column; padding: 20px; }
  .nav-links.active { display: flex; }
  .nav-links a { margin: 10px 0; text-align: center; }
}

/* 2. TABLET (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  header { background-position: center top; }
  
  /* CORRECCIÓN: Bajamos al 60% también en tablet */
  .hero-content {
    top: 60%; 
    left: 50%;
    transform: translate(-50%, 0);
    text-align: center;
    width: 90%;
  }
  
  .header-badges { justify-content: center; }
  
  .menu-toggle { display: block; background: none; border: none; color: white; font-size: 1.8rem; cursor: pointer; }
  .nav-links { display: none; position: absolute; top: 100%; left: 0; width: 100%; background: var(--azul-conservador); flex-direction: column; padding: 20px; }
  .nav-links.active { display: flex; }
  .nav-links a { margin: 10px 0; text-align: center; }
}

/* 3. DESKTOP (>= 1025px) - NO TOCAR (Como pediste) */
@media (min-width: 1025px) {
  header {
    /* Mantiene el ajuste de PC que ya estaba bien (foto a la derecha) */
    background-position: 80% 15%; 
  }
  
  /* Mantiene el texto a la izquierda sin invadir la cara */
  .hero-content {
    left: 5%;
    top: 50%;
    transform: translateY(-50%);
    text-align: left;
    max-width: 45%; 
  }
  
  .header-badges { justify-content: flex-start; }
  .menu-toggle { display: none; }
  .nav-links { display: flex !important; }
}

/* 4. ULTRAWIDE (> 1400px) */
@media (min-width: 1400px) {
  header { 
    background-position: 80% 10%; 
  }
  .hero-content {
    max-width: 600px;
  }
}

/* Asegura que el modal activo sea siempre visible y esté encima de todo */
.active-modal {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
  z-index: 9999 !important; /* Forzamos la capa superior */
  animation: fadeInModal 0.3s ease-out;
}

/* Asegura que el fondo oscuro también cubra todo */
.modal-overlay.active-modal {
  z-index: 9998 !important;
}

/* BLINDAJE DE MODALES */
.modal.active-modal {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    z-index: 10001 !important; /* Encima de todo */
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
}

.modal-overlay.active-modal {
    display: block !important;
    z-index: 10000 !important;
}