/* =====================================================
   VARIABLES GLOBALES
===================================================== */
:root {
  --primary: #2F5468;
  --primary-dark: #203A47;
  --accent: #E83837;
  --accent-light: #ff6d6b;

  --bg: #f4f5fb;
  --card-bg: #ffffff;
  --border: #dde1f0;

  --text: #111827;
  --muted: #6b7280;
}

/* =====================================================
   RESET BÁSICO
===================================================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a {
  text-decoration: none;
  color: inherit;
}

/* =====================================================
   CONTAINER GLOBAL
===================================================== */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 16px;
}

/* =====================================================
   HEADER GLOBAL (ÚNICA FUENTE DE VERDAD)
===================================================== */
header {
  background: #ffffff;
  border-bottom: 1px solid var(--border);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  gap: 16px;
}

/* Logo */
.logo img,
.logo-img {
  height: 56px;
  width: auto;
  display: block;
}

/* Navegación */
.nav-links {
  display: flex;
  gap: 18px;
  font-size: 14px;
}

.nav-links a {
  color: var(--primary);
  position: relative;
  padding: 4px 0;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.2s ease;
}

.nav-links a:hover {
  color: var(--accent);
}

.nav-links a:hover::after {
  width: 100%;
}

/* Acciones del header */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Botón login */
.btn-login {
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--primary);
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

.btn-login:hover {
  background: rgba(47, 84, 104, 0.06);
}

/* Botón principal header */
.btn-header {
  font-size: 13px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #ffffff;
  cursor: pointer;
}

.btn-header:hover {
  background: #d83232;
}

/* =====================================================
   FOOTER GLOBAL
===================================================== */
footer {
  padding: 24px 0 32px;
  font-size: 13px;
  color: var(--muted);
  border-top: 1px solid var(--border);
  background: #ffffff;
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-copy {
  margin: 0;
  text-align: center;
}

footer span {
  color: var(--primary);
  font-weight: 600;
}

.footer-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-link {
  color: var(--muted);
  font-size: 13px;
  transition: color 0.2s ease;
  position: relative;
}

.footer-link::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.2s ease;
}

.footer-link:hover {
  color: var(--accent);
}

.footer-link:hover::after {
  width: 100%;
}

.footer-link:not(:last-child)::before {
  content: "";
  position: absolute;
  right: -11px;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 12px;
  background: var(--border);
}

/* =====================================================
   ANIMACIONES DE SCROLL (GLOBALES)
===================================================== */

/* Reveal genérico */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Animación escalonada para cards - ESPECÍFICA POR SECCIÓN */
#soluciones .card,
#areas-gestion .card,
#cursos .card {
  opacity: 0 !important;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

#soluciones .card:nth-child(1),
#areas-gestion .card:nth-child(1),
#cursos .card:nth-child(1) { transition-delay: 0.1s; }

#soluciones .card:nth-child(2),
#areas-gestion .card:nth-child(2),
#cursos .card:nth-child(2) { transition-delay: 0.2s; }

#areas-gestion .card:nth-child(3),
#cursos .card:nth-child(3) { transition-delay: 0.3s; }

#areas-gestion .card:nth-child(4) { transition-delay: 0.4s; }
#areas-gestion .card:nth-child(5) { transition-delay: 0.5s; }

#soluciones .card.is-visible,
#areas-gestion .card.is-visible,
#cursos .card.is-visible {
  opacity: 1 !important;
  transform: translateY(0);
}

/* Stats del hero con fade-in */
.hero-stats {
  opacity: 0;
  transition: opacity 0.5s ease-out;
}

.hero-stats .stat {
  opacity: 0;
  transform: translateY(15px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.hero-stats .stat:nth-child(1) { transition-delay: 0.2s; }
.hero-stats .stat:nth-child(2) { transition-delay: 0.3s; }
.hero-stats .stat:nth-child(3) { transition-delay: 0.4s; }
.hero-stats .stat:nth-child(4) { transition-delay: 0.5s; }

.hero-stats.is-visible {
  opacity: 1;
}

.hero-stats.is-visible .stat {
  opacity: 1;
  transform: translateY(0);
}

/* Testimonios con efecto sutil */
#testimonios .testimonial {
  opacity: 0 !important;
  transform: translateY(20px) scale(0.98);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

#testimonios .testimonial:nth-child(1) { transition-delay: 0.1s; }
#testimonios .testimonial:nth-child(2) { transition-delay: 0.2s; }
#testimonios .testimonial:nth-child(3) { transition-delay: 0.3s; }

#testimonios .testimonial.is-visible {
  opacity: 1 !important;
  transform: translateY(0) scale(1);
}

/* Respeta preferencias de accesibilidad */
@media (prefers-reduced-motion: reduce) {
  .reveal,
  #soluciones .card,
  #areas-gestion .card,
  #cursos .card,
  .hero-stats .stat,
  #testimonios .testimonial {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* =====================================================
   HELPERS GLOBALES
===================================================== */
.text-center {
  text-align: center;
}

.hidden {
  display: none !important;
}

/* =====================================================
   EFECTO PULSO PARA BOTÓN CTA HEADER
   Agregar esto a tu global.css
===================================================== */

.btn-header {
  position: relative;
  animation: pulse-border 2s ease-in-out infinite;
}

@keyframes pulse-border {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(232, 56, 55, 0.6);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(232, 56, 55, 0);
  }
}

/* Pausar animación en hover para no distraer al hacer clic */
.btn-header:hover {
  animation: none;
  box-shadow: 0 4px 14px rgba(232, 56, 55, 0.4);
}
/* =====================================================
   RESPONSIVE GLOBAL
===================================================== */
@media (max-width: 900px) {
  .nav-links {
    display: none;
  }

  .nav-actions {
    gap: 6px;
  }

  .btn-header,
  .btn-login {
    font-size: 12px;
    padding: 7px 12px;
  }
}

header + section {
  margin-top: 0;
}

/* Footer responsive */
@media (max-width: 600px) {
  .footer-content {
    flex-direction: column;
    text-align: center;
  }
  
  .footer-links {
    justify-content: center;
  }
  
  .footer-link:not(:last-child)::before {
    display: none;
  }
}

/* =====================================================
   MENÚ MÓVIL HAMBURGUESA
   Agregar al final de global.css
===================================================== */

/* Botón hamburguesa - oculto en desktop */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 1001;
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--primary-dark);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.menu-toggle span:nth-child(1) {
  margin-bottom: 6px;
}

.menu-toggle span:nth-child(3) {
  margin-top: 6px;
}

/* Estado activo del botón hamburguesa */
.menu-toggle.is-active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 6px);
}

.menu-toggle.is-active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.is-active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -6px);
}

/* Overlay del menú móvil */
.mobile-menu-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-menu-overlay.is-active {
  opacity: 1;
}

/* Panel del menú móvil */
.mobile-menu {
  display: none;
  position: fixed;
  top: 0;
  right: -100%;
  width: 280px;
  max-width: 85%;
  height: 100vh;
  background: #ffffff;
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  transition: right 0.3s ease;
  overflow-y: auto;
}

.mobile-menu.is-active {
  right: 0;
}

.mobile-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.mobile-menu-logo img {
  height: 40px;
  width: auto;
}

.mobile-menu-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #f4f5fb;
  color: var(--primary-dark);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.mobile-menu-close:hover {
  background: #e8eaf0;
}

.mobile-menu-nav {
  padding: 20px;
}

.mobile-menu-nav a {
  display: block;
  padding: 14px 16px;
  font-size: 15px;
  color: var(--primary-dark);
  border-radius: 10px;
  margin-bottom: 4px;
  transition: background 0.2s ease, color 0.2s ease;
}

.mobile-menu-nav a:hover {
  background: #f4f5fb;
  color: var(--accent);
}

.mobile-menu-actions {
  padding: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mobile-menu-actions .btn-login {
  width: 100%;
  text-align: center;
  padding: 12px 16px;
}

.mobile-menu-actions .btn-header {
  width: 100%;
  text-align: center;
  padding: 12px 16px;
}

/* =====================================================
   MENÚ MÓVIL HAMBURGUESA
   Agregar al final de global.css
===================================================== */

/* Botón hamburguesa - oculto en desktop */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 1001;
  position: relative;
  flex-shrink: 0;
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--primary-dark);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.menu-toggle span:nth-child(1) {
  margin-bottom: 6px;
}

.menu-toggle span:nth-child(3) {
  margin-top: 6px;
}

/* Estado activo del botón hamburguesa */
.menu-toggle.is-active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 6px);
}

.menu-toggle.is-active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.is-active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -6px);
}

/* Overlay del menú móvil */
.mobile-menu-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.mobile-menu-overlay.is-active {
  opacity: 1;
}

/* Panel del menú móvil */
.mobile-menu {
  display: none;
  position: fixed;
  top: 0;
  right: -100%;
  width: 280px;
  max-width: 85%;
  height: 100vh;
  background: #ffffff;
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  transition: right 0.3s ease;
  overflow-y: auto;
}

.mobile-menu.is-active {
  right: 0;
}

.mobile-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.mobile-menu-logo img {
  height: 40px;
  width: auto;
}

.mobile-menu-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #f4f5fb;
  color: var(--primary-dark);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.mobile-menu-close:hover {
  background: #e8eaf0;
}

.mobile-menu-nav {
  padding: 20px;
}

.mobile-menu-nav a {
  display: block;
  padding: 14px 16px;
  font-size: 15px;
  color: var(--primary-dark);
  border-radius: 10px;
  margin-bottom: 4px;
  transition: background 0.2s ease, color 0.2s ease;
}

.mobile-menu-nav a:hover {
  background: #f4f5fb;
  color: var(--accent);
}

.mobile-menu-actions {
  padding: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mobile-menu-actions .btn-login {
  width: 100%;
  text-align: center;
  padding: 12px 16px;
}

.mobile-menu-actions .btn-header {
  width: 100%;
  text-align: center;
  padding: 12px 16px;
}

/* =====================================================
   MENÚ MÓVIL HAMBURGUESA
   Agregar al final de global.css
===================================================== */

/* Botón hamburguesa - oculto en desktop */
.menu-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 44px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 1001;
  position: relative;
  flex-shrink: 0;
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--primary-dark);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.menu-toggle span:nth-child(1) {
  margin-bottom: 6px;
}

.menu-toggle span:nth-child(3) {
  margin-top: 6px;
}

/* Estado activo del botón hamburguesa */
.menu-toggle.is-active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 6px);
}

.menu-toggle.is-active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.is-active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -6px);
}

/* Overlay del menú móvil */
.mobile-menu-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  z-index: 999;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-menu-overlay.is-active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Panel del menú móvil */
.mobile-menu {
  display: none;
  position: fixed;
  top: 0;
  right: -100%;
  width: 280px;
  max-width: 85%;
  height: 100vh;
  background: #ffffff;
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  transition: right 0.3s ease;
  overflow-y: auto;
}

.mobile-menu.is-active {
  right: 0;
}

.mobile-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.mobile-menu-logo img {
  height: 40px;
  width: auto;
}

.mobile-menu-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: #f4f5fb;
  color: var(--primary-dark);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}

.mobile-menu-close:hover {
  background: #e8eaf0;
}

.mobile-menu-nav {
  padding: 20px;
}

.mobile-menu-nav a {
  display: block;
  padding: 14px 16px;
  font-size: 15px;
  color: var(--primary-dark);
  border-radius: 10px;
  margin-bottom: 4px;
  transition: background 0.2s ease, color 0.2s ease;
}

.mobile-menu-nav a:hover {
  background: #f4f5fb;
  color: var(--accent);
}

.mobile-menu-actions {
  padding: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.mobile-menu-actions .btn-login {
  width: 100%;
  text-align: center;
  padding: 12px 16px;
}

.mobile-menu-actions .btn-header {
  width: 100%;
  text-align: center;
  padding: 12px 16px;
}

/* =====================================================
   RESPONSIVE MÓVIL - MOSTRAR MENÚ HAMBURGUESA
===================================================== */
@media (max-width: 900px) {
  /* Mostrar botón hamburguesa */
  .menu-toggle {
    display: flex;
  }

  /* Mostrar overlay y menú (pero inactivos por defecto) */
  .mobile-menu-overlay,
  .mobile-menu {
    display: block;
  }

  /* Ocultar navegación desktop */
  .nav-links {
    display: none !important;
  }

  /* Ajustar acciones del header en móvil */
  .nav-actions {
    gap: 8px;
    display: flex;
    align-items: center;
  }

  /* Ocultar botón login en header móvil (está en el menú) */
  .nav-actions .btn-login {
    display: none;
  }

  /* Asegurar que el botón CTA sea clickeable */
  .nav-actions .btn-header {
    position: relative;
    z-index: 10;
    pointer-events: auto;
  }

  /* Asegurar que el logo sea clickeable */
  .logo {
    position: relative;
    z-index: 10;
  }

  .logo a {
    display: block;
    pointer-events: auto;
  }
}

/* =====================================================
   AJUSTES RESPONSIVE PARA HOME - SECCIÓN SOLUCIONES
===================================================== */
@media (max-width: 768px) {
  /* Sección Soluciones - centrar textos */
  #soluciones .section-header {
    flex-direction: column;
    text-align: center;
    align-items: center;
    gap: 16px;
  }

  #soluciones .section-header > div {
    text-align: center;
  }

  #soluciones .section-subtitle {
    max-width: 100%;
  }

  #soluciones .section-link {
    margin-top: 8px;
  }
}

/* =====================================================
   AJUSTES RESPONSIVE PARA HOME - CTA FINAL
===================================================== */
@media (max-width: 768px) {
  /* CTA Final - centrar todo */
  #cta-contacto .cta-final {
    text-align: center;
  }

  #cta-contacto .cta-final > div:first-child {
    text-align: center;
  }

  #cta-contacto .cta-actions {
    justify-content: center;
  }

  #cta-contacto .cta-locations {
    text-align: center;
  }

  #cta-contacto .cta-phones {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
  }

  #cta-contacto .phone-item {
    text-align: center;
  }
}

/* =====================================================
   PREVENIR SCROLL CUANDO MENÚ ESTÁ ABIERTO
===================================================== */
body.menu-open {
  overflow: hidden;
}

/* Fix overflow horizontal */
html, body {
  overflow-x: hidden !important;
  max-width: 100vw !important;
}

*, *::before, *::after {
  max-width: 100vw;
}