/* ============================================================
   1. VARIABLES CSS GLOBALES
   ============================================================ */
:root {
  /* Paleta de colores principal */
  --color-azul-oscuro:    #0E2666;
  --color-azul-medio:     #336198;
  --color-azul-claro:     #3F79AC;
  --color-azul-gradiente: #4F92C8;
  --color-azul-suave:     #93CDE9;
  --color-gris-header:    #939AA2;
  --color-texto-oscuro:   #2D353C;
  --color-fondo-seccion:  #EDEDED;
  --color-fondo-card:     #F5F5F5;
  --color-blanco:         #FFFFFF;
  --color-negro:          #111111;

  /* Gradiente formulario */
  --gradiente-form: linear-gradient(135deg, #93CDE9 0%, #4F92C8 50%, #336198 100%);

  /* Tipografía */
  --fuente-principal: 'Poppins', sans-serif;

  /* Tamaños de fuente */
  --fs-hero:    clamp(2.5rem, 5vw, 4.375rem);   /* 70px desktop */
  --fs-h1:      clamp(2rem,   4vw, 3rem);
  --fs-h2:      clamp(1.5rem, 3vw, 2.25rem);
  --fs-h3:      clamp(1.25rem,2vw, 1.75rem);
  --fs-h4:      clamp(1rem,   1.5vw, 1.25rem);
  --fs-body:    1rem;
  --fs-small:   0.875rem;

  /* Espaciados */
  --espacio-xs:  0.5rem;
  --espacio-sm:  1rem;
  --espacio-md:  2rem;
  --espacio-lg:  4rem;
  --espacio-xl:  6rem;
  --espacio-xxl: 8rem;

  /* Contenedor máximo */
  --max-width:       1440px;
  --max-width-inner: 1200px;

  /* Bordes */
  --radio-sm:  4px;
  --radio-md:  8px;
  --radio-lg:  16px;
  --radio-xl:  24px;
  --radio-full: 9999px;

  /* Sombras */
  --sombra-sm:  0 2px 8px rgba(14,38,102,0.1);
  --sombra-md:  0 4px 20px rgba(14,38,102,0.15);
  --sombra-lg:  0 8px 40px rgba(14,38,102,0.2);
  --sombra-card:0 2px 16px rgba(0,0,0,0.08);

  /* Transiciones */
  --transicion:    0.3s ease;
  --transicion-lg: 0.5s ease;

  /* Header — Figma node 1675:3310 */
  --header-height:      100px;   /* nav bar */
  --barra-top-height:   30px;    /* top bar */
  --header-total:       calc(var(--header-height) + var(--barra-top-height));

  /* Figma design tokens extra */
  --color-lima:         #afd81a; /* verde lima — ítem activo, números verdes */
  --color-azul-nav:     #0d2666; /* navy — texto nav items */
  --color-gris-top:     #939aa2; /* top bar reposo */
  --gradiente-top-bar:  linear-gradient(to right, #c0eafe, #336198); /* top bar expandido */
  --fuente-nav:         'Montserrat', sans-serif; /* nav items desktop */
  --sombra-header:      0 4px 4px 0 rgba(0,0,0,0.25); /* Figma shadow */

  /* Z-index */
  --z-base:    1;
  --z-dropdown:10;
  --z-header:  100;
  --z-overlay: 200;
  --z-modal:   300;
  --z-chat:    400;
}


/* ============================================================
   2. RESET & BASE
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--fuente-principal);
  font-weight: 400;
  color: var(--color-texto-oscuro);
  background-color: var(--color-blanco);
  line-height: 1.6;
  overflow-x: hidden;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

img {
  height: auto;
  object-fit: cover;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transicion);
}

ul,
ol {
  list-style: none;
}

button {
  cursor: pointer;
  font-family: var(--fuente-principal);
  border: none;
  background: none;
}

input,
textarea,
select {
  font-family: var(--fuente-principal);
  font-size: var(--fs-body);
}

/* Contenedor global */
.andes-container {
  width: 100%;
  max-width: var(--max-width-inner);
  margin-inline: auto;
  padding-inline: var(--espacio-md);
}

.andes-container--wide {
  max-width: var(--max-width);
  padding-inline: 0;
}

/* Ocultar visualmente pero accesible */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* Espaciado entre secciones */
.andes-seccion {
  padding-block: var(--espacio-xl);
}

.andes-seccion--sm {
  padding-block: var(--espacio-lg);
}


/* ============================================================
   3. TIPOGRAFÍA
   ============================================================ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--fuente-principal);
  line-height: 1.2;
  color: var(--color-azul-oscuro);
}

h1 { font-size: var(--fs-h1); font-weight: 700; }
h2 { font-size: var(--fs-h2); font-weight: 600; }
h3 { font-size: var(--fs-h3); font-weight: 600; }
h4 { font-size: var(--fs-h4); font-weight: 500; }

p {
  font-size: var(--fs-body);
  color: var(--color-texto-oscuro);
  line-height: 1.7;
}

.andes-titulo-seccion {
  font-size: var(--fs-h2);
  font-weight: 700;
  color: var(--color-azul-oscuro);
  margin-bottom: var(--espacio-sm);
}

.andes-subtitulo-seccion {
  font-size: var(--fs-body);
  color: var(--color-gris-header);
  max-width: 600px;
  margin-inline: auto;
}

.andes-titulo-seccion--centrado {
  text-align: center;
}

/* Botones */
.andes-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--espacio-xs);
  padding: 0.875rem 2rem;
  border-radius: var(--radio-full);
  font-family: var(--fuente-principal);
  font-size: var(--fs-body);
  font-weight: 600;
  transition: all var(--transicion);
  cursor: pointer;
  white-space: nowrap;
}

.andes-btn--primario {
  background: var(--color-azul-oscuro);
  color: var(--color-blanco);
  border: 2px solid var(--color-azul-oscuro);
}

.andes-btn--primario:hover {
  background: var(--color-azul-medio);
  border-color: var(--color-azul-medio);
}

.andes-btn--secundario {
  background: transparent;
  color: var(--color-azul-oscuro);
  border: 2px solid var(--color-azul-oscuro);
}

.andes-btn--secundario:hover {
  background: var(--color-azul-oscuro);
  color: var(--color-blanco);
}

.andes-btn--verde {
  background: #2E8B57;
  color: var(--color-blanco);
  border: 2px solid #2E8B57;
}

.andes-btn--verde:hover {
  background: #236B43;
  border-color: #236B43;
}

.andes-btn--blanco {
  background: var(--color-blanco);
  color: var(--color-azul-oscuro);
  border: 2px solid var(--color-blanco);
}

.andes-btn--blanco:hover {
  background: transparent;
  color: var(--color-blanco);
}

.andes-btn--grande {
  padding: 1.125rem 2.5rem;
  font-size: 1.125rem;
}


/* ============================================================
   19. POP-UP PUBLICITARIO
   ============================================================ */
.andes-popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--espacio-md);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transicion);
}

.andes-popup-overlay.activo {
  opacity: 1;
  visibility: visible;
}

.andes-popup {
  background: var(--color-blanco);
  border-radius: var(--radio-xl);
  overflow: hidden;
  max-width: 532px;
  width: 100%;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
  transform: scale(0.9);
  transition: transform var(--transicion);
}

.andes-popup-overlay.activo .andes-popup {
  transform: scale(1);
}

/* IMAGEN POPUP: máximo 200kb, 532×300px
   Exportar desde Figma: ventana-publicidad */
.andes-popup__imagen {
  width: 100%;
  aspect-ratio: 532/300;
  overflow: hidden;
}

.andes-popup__imagen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.andes-popup__cuerpo {
  padding: var(--espacio-md) var(--espacio-lg);
}

.andes-popup__titulo {
  font-size: var(--fs-h3);
  font-weight: 700;
  color: var(--color-azul-oscuro);
  margin-bottom: var(--espacio-xs);
}

.andes-popup__texto {
  font-size: var(--fs-small);
  color: var(--color-gris-header);
  margin-bottom: var(--espacio-md);
}

.andes-popup__cerrar {
  position: absolute;
  top: var(--espacio-sm);
  right: var(--espacio-sm);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0,0,0,0.5);
  color: var(--color-blanco);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.25rem;
  transition: background var(--transicion);
  border: none;
  z-index: 1;
}

.andes-popup__cerrar:hover {
  background: rgba(0,0,0,0.8);
}


/* ============================================================
   20. WIDGET CHAT FLOTANTE "Santiago"
   ============================================================ */
.andes-chat-widget {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: var(--z-chat);
}

.andes-chat-widget__boton {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: transparent;
  padding: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--sombra-lg);
  transition: all var(--transicion);
  border: none;
}

.andes-chat-widget__boton:hover {
  transform: scale(1.1);
}

.andes-chat-widget__burbuja {
  position: absolute;
  bottom: calc(100% + 1rem);
  right: 0;
  background: var(--color-blanco);
  border-radius: var(--radio-lg) var(--radio-lg) 0 var(--radio-lg);
  padding: var(--espacio-sm) var(--espacio-md);
  box-shadow: var(--sombra-md);
  white-space: nowrap;
  opacity: 0;
  transform: translateY(8px);
  transition: all var(--transicion);
  pointer-events: none;
}

.andes-chat-widget:hover .andes-chat-widget__burbuja {
  opacity: 1;
  transform: translateY(0);
}

.andes-chat-widget__burbuja p {
  font-size: var(--fs-small);
  color: var(--color-texto-oscuro);
  font-weight: 500;
}

.andes-chat-widget__burbuja strong {
  color: var(--color-azul-oscuro);
}

.andes-chat-widget__panel {
  position: absolute;
  bottom: calc(100% + 1rem);
  right: 0;
  width: 320px;
  background: var(--color-blanco);
  border-radius: var(--radio-xl);
  box-shadow: var(--sombra-lg);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.95) translateY(10px);
  transform-origin: bottom right;
  transition: all var(--transicion);
}

.andes-chat-widget__panel.activo {
  opacity: 1;
  visibility: visible;
  transform: scale(1) translateY(0);
}

.andes-chat-widget__header {
  background: var(--color-azul-oscuro);
  padding: 1rem var(--espacio-sm);
  display: flex;
  align-items: center;
  gap: var(--espacio-xs);
}

.andes-chat-widget__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.andes-chat-widget__nombre {
  color: var(--color-blanco);
  font-weight: 600;
  font-size: 0.9375rem;
}

.andes-chat-widget__estado {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.7);
}

.andes-chat-widget__mensajes {
  padding: var(--espacio-sm);
  min-height: 200px;
  max-height: 300px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--espacio-xs);
}

.andes-chat-widget__mensaje {
  background: var(--color-fondo-seccion);
  border-radius: var(--radio-md) var(--radio-md) var(--radio-md) 0;
  padding: 0.75rem 1rem;
  font-size: var(--fs-small);
  color: var(--color-texto-oscuro);
  max-width: 85%;
}

.andes-chat-widget__input-wrap {
  padding: var(--espacio-xs) var(--espacio-sm);
  border-top: 1px solid var(--color-fondo-seccion);
  display: flex;
  gap: var(--espacio-xs);
}

.andes-chat-widget__input {
  flex: 1;
  padding: 0.625rem 1rem;
  border: 1px solid var(--color-fondo-seccion);
  border-radius: var(--radio-full);
  font-size: var(--fs-small);
  outline: none;
}

.andes-chat-widget__enviar {
  padding: 0.625rem 1rem;
  background: var(--color-azul-medio);
  color: var(--color-blanco);
  border: none;
  border-radius: var(--radio-full);
  cursor: pointer;
  font-size: var(--fs-small);
  font-weight: 600;
  transition: background var(--transicion);
}

.andes-chat-widget__enviar:hover {
  background: var(--color-azul-oscuro);
}


/* ============================================================
   25. IMÁGENES RESPONSIVE — object-fit global
   ============================================================ */
picture {
  display: block;
}

picture img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Imágenes de logos — no distorsionar */
.andes-cliente-logo picture img,
.andes-header__logo picture img,
.andes-cert-card img,
.andes-porque-card__icono picture img,
.andes-acordeon__icono-servicio,
.andes-card-servicio__icono picture img {
  object-fit: contain;
}


/* ============================================================
   CRITICAL FIX — Blanco en mobile/tablet
   CAUSA: .andes-animar inicia con opacity:0 y espera JS.
   Si el IntersectionObserver no dispara, todo queda invisible.
   Solución: deshabilitar animaciones en ≤1024px.
   ============================================================ */
@media (max-width: 1024px) {
  .andes-animar,
  .andes-animar--izquierda,
  .andes-animar--derecha {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  html { overflow-x: hidden !important; }
  body { overflow-x: hidden !important; }

  img {
    max-width: 100% !important;
    height: auto !important;
  }

  .andes-nav              { display: none !important; }
  .andes-header__hamburger { display: flex !important; }
}

@media (max-width: 480px) {
  .andes-hero {
    min-height: 100svh !important;
    height: auto !important;
  }

  .andes-hero__contenido {
    padding: 2rem 1rem !important;
    width: 100% !important;
  }

  section, .andes-seccion {
    width: 100% !important;
    overflow: hidden !important;
    padding-inline: 1rem !important;
  }
}


/* ============================================================
   26. RESPONSIVE — MOBILE (max 480px)
   ============================================================ */
@media (max-width: 480px) {
  :root {
    --header-height:    64px;
    --barra-top-height: 0px;   /* barra oculta en mobile → no suma al padding */
    --espacio-xl: 3rem;
    --espacio-lg: 2rem;
  }

  /* Header */
  .andes-header__hamburger { display: flex; }
  .andes-nav               { display: none; }
  .andes-header__logo img  { height: 44px; max-width: 130px; }
  .andes-header__nav-inner { padding-inline: 1rem; }

  /* Empuje correcto: solo la nav bar (barra-top hidden) */
  .andes-main-wrap { padding-top: var(--header-height); }

  /* Contenedor */
  .andes-container { padding-inline: 1rem; }

  /* Hero */
  .andes-hero          { min-height: 100svh; }
  .andes-hero__titulo  { font-size: 2rem; }
  .andes-hero__cta     { flex-direction: column; align-items: center; }
  .andes-hero__subtitulo { font-size: 1rem; }

  /* Grids → 1 columna */
  .andes-servicios__inner   { grid-template-columns: 1fr; }
  .andes-servicios__imagen  { display: none; }          /* solo texto en mobile */
  .andes-contacto__inner    { grid-template-columns: 1fr; }
  /* footer responsive handled in section 14 */
  .andes-precios__grid      { grid-template-columns: 1fr; }
  .andes-cards-servicios    { grid-template-columns: 1fr; }
  .andes-blog__grid         { grid-template-columns: 1fr; }
  .andes-beneficios__grid   { grid-template-columns: 1fr 1fr; }
  .andes-descargas__grid    { grid-template-columns: 1fr; }

  /* Tarjetas precio */
  .andes-precio-card--destacado { transform: none; order: -1; }

  /* CTA firma */
  .andes-cta-firma__contenido { grid-template-columns: 1fr; text-align: center; }
  .andes-cta-firma__botones   { flex-direction: row; justify-content: center; }

  /* Carrusel */
  .andes-ecosistema__carrusel-wrap { padding-inline: var(--espacio-sm); }

  /* Formulario compra */
  .andes-compra__paso-nombre { display: none; }

  /* Chat */
  .andes-chat-widget { bottom: 1rem; right: 1rem; }

  /* Imágenes generales */
  img, picture { max-width: 100%; }
}


/* ============================================================
   27. RESPONSIVE — TABLET (481px – 1024px)
   ============================================================ */
@media (min-width: 481px) and (max-width: 1024px) {
  :root {
    --header-height:    72px;
    /* --barra-top-height ya es 0px por el bloque @media (max-width:1024px) de sección 5 */
    --espacio-xl: 4rem;
  }

  /* Header */
  .andes-header__hamburger { display: flex; }
  .andes-nav               { display: none; }
  .andes-header__logo img  { height: 50px; max-width: 140px; }

  /* Empuje correcto: solo nav bar (barra-top hidden) */
  .andes-main-wrap { padding-top: var(--header-height); }

  /* Contenedor */
  .andes-container { padding-inline: 1.5rem; }

  /* Hero */
  .andes-hero         { min-height: 100svh; }
  .andes-hero__titulo { font-size: 2.5rem; }

  /* Grids */
  .andes-servicios__inner { grid-template-columns: 1fr; gap: var(--espacio-md); }
  .andes-servicios__imagen { aspect-ratio: 16/7; max-height: 360px; }
  /* footer responsive handled in section 14 */
  .andes-contacto__inner  { grid-template-columns: 1fr; }
  .andes-precios__grid    { grid-template-columns: 1fr; max-width: 480px; margin-inline: auto; }
  .andes-precio-card--destacado { transform: none; }
  .andes-cards-servicios  { grid-template-columns: repeat(2, 1fr); }
  .andes-blog__grid       { grid-template-columns: repeat(2, 1fr); }
  .andes-beneficios__grid { grid-template-columns: repeat(2, 1fr); }
  .andes-descargas__grid  { grid-template-columns: repeat(2, 1fr); }

  /* CTA firma */
  .andes-cta-firma__contenido { grid-template-columns: 1fr; }
  .andes-cta-firma__botones   { flex-direction: row; margin-top: var(--espacio-md); }
}


/* ============================================================
   28. RESPONSIVE — DESKTOP GRANDE (1440px+)
   ============================================================ */
@media (min-width: 1440px) {
  .andes-container {
    max-width: 1320px;
  }

  .andes-hero__titulo {
    font-size: 4.375rem;
  }

  .andes-precios__grid {
    align-items: center;
  }
}


/* ============================================================
   ANULACIONES ESPECÍFICAS DE ASTRA
   (override del tema padre cuando sea necesario)
   ============================================================ */
.ast-container,
.ast-grid-right-left,
#masthead {
  display: none !important; /* Ocultamos el header de Astra — usamos el nuestro */
}

#colophon {
  display: none !important; /* Ocultamos el footer de Astra — usamos el nuestro */
}

.entry-content,
.ast-entry-content-wrap {
  max-width: none !important;
  padding: 0 !important;
}

.site-content {
  padding-top: 0 !important;
}

/* Gutenberg blocks reset */
.wp-block-group {
  max-width: none;
}


/* ============================================================
   29. ANIMACIONES DE ENTRADA — Intersection Observer
   Elementos con .andes-animar aparecen al hacer scroll.
   El JS en main.js añade .andes-visible cuando son visibles.
   ============================================================ */
.andes-animar {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.andes-animar.andes-visible {
  opacity: 1;
  transform: translateY(0);
}

.andes-animar--izquierda {
  opacity: 0;
  transform: translateX(-40px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.andes-animar--izquierda.andes-visible {
  opacity: 1;
  transform: translateX(0);
}

.andes-animar--derecha {
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.andes-animar--derecha.andes-visible {
  opacity: 1;
  transform: translateX(0);
}

/* Delays escalonados para grids (hijos directos) */
.andes-porque__grid > .andes-animar:nth-child(1),
.andes-clientes__grid > .andes-animar:nth-child(1) { transition-delay: 0.05s; }
.andes-porque__grid > .andes-animar:nth-child(2),
.andes-clientes__grid > .andes-animar:nth-child(2) { transition-delay: 0.15s; }
.andes-porque__grid > .andes-animar:nth-child(3),
.andes-clientes__grid > .andes-animar:nth-child(3) { transition-delay: 0.25s; }
.andes-porque__grid > .andes-animar:nth-child(4),
.andes-clientes__grid > .andes-animar:nth-child(4) { transition-delay: 0.35s; }

/* Reducir movimiento para usuarios con preferencia */
@media (prefers-reduced-motion: reduce) {
  .andes-animar,
  .andes-animar--izquierda,
  .andes-animar--derecha {
    transition: opacity 0.3s ease;
    transform: none;
  }
}


/* ============================================================
   30. ESTADÍSTICAS / CONTADORES ANIMADOS
   Uso: <span data-contador="1500">0</span>
   ============================================================ */
.andes-stats {
  display: flex;
  flex-wrap: wrap;
  gap: var(--espacio-md);
  justify-content: center;
  margin-block: var(--espacio-md);
}

.andes-stat {
  text-align: center;
  min-width: 120px;
}

.andes-stat__numero {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  color: var(--color-azul-oscuro);
  line-height: 1;
  display: block;
}

.andes-stat__label {
  font-size: var(--fs-small);
  color: var(--color-gris-header);
  margin-top: 4px;
}


/* ============================================================
   31. FILTROS DE CATEGORÍA — Blog y Descargas
   Uso: botones con data-filtro-btn="slug"
   ============================================================ */
.andes-filtros {
  display: flex;
  flex-wrap: wrap;
  gap: var(--espacio-xs);
  margin-bottom: var(--espacio-lg);
}

.andes-filtro-btn {
  padding: 0.5rem 1.25rem;
  border-radius: var(--radio-full);
  font-size: var(--fs-small);
  font-weight: 600;
  border: 2px solid var(--color-fondo-seccion);
  background: var(--color-blanco);
  color: var(--color-texto-oscuro);
  cursor: pointer;
  transition: all var(--transicion);
  font-family: var(--fuente-principal);
}

.andes-filtro-btn:hover,
.andes-filtro-btn.activo {
  background: var(--color-azul-oscuro);
  border-color: var(--color-azul-oscuro);
  color: var(--color-blanco);
}



