/* Ajustes finales de navegación y ancho para móviles. */
@media (max-width: 680px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .site-header {
    left: 50%;
    right: auto;
    width: calc(100vw - 24px);
    max-width: calc(100vw - 24px);
    transform: translateX(-50%);
    z-index: 100;
  }

  .site-header .menu-toggle {
    position: relative;
    z-index: 2;
    flex: 0 0 auto;
  }

  .site-header .main-nav {
    display: none;
    position: absolute;
    inset: calc(100% + 8px) 0 auto;
    width: 100%;
    max-height: calc(100dvh - 82px);
    overflow-y: auto;
    overscroll-behavior: contain;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 12px 16px 16px;
    box-sizing: border-box;
    border: 1px solid rgba(226, 234, 240, .96);
    border-radius: 18px;
    background: rgba(255, 255, 255, .98);
    box-shadow: 0 16px 38px rgba(30, 47, 77, .16);
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .site-header .main-nav.open {
    display: flex;
  }

  .site-header .main-nav > .nav-link,
  .site-header .main-nav > .nav-cta,
  .site-header .nav-drop-button {
    width: 100%;
    min-height: 42px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 8px;
    box-sizing: border-box;
    text-align: left;
    font-size: 14px;
  }

  .site-header .main-nav > .nav-cta {
    width: fit-content;
    min-height: 40px;
    margin: 7px 0 0;
    padding: 9px 16px;
  }

  .site-header .nav-dropdown {
    width: 100%;
    min-width: 0;
  }

  .site-header .nav-menu {
    display: none;
    position: static;
    width: 100%;
    max-height: none;
    margin: 2px 0 5px;
    padding: 3px 0 3px 8px;
    border: 0;
    border-left: 1px solid #dfe6ec;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .site-header .nav-dropdown.open .nav-menu {
    display: flex;
    flex-direction: column;
  }

  .site-header .nav-menu a {
    min-height: 38px;
    gap: 10px;
    padding: 8px 10px;
    white-space: normal;
  }

  .site-header .nav-menu small {
    margin: 0 2px 0 auto;
    text-align: right;
  }

  .site-header .nav-whatsapp {
    align-self: flex-start;
    margin-top: 8px;
  }

  .hero,
  .section,
  main > section {
    max-width: 100%;
  }

  .hero-content {
    width: 100%;
    min-width: 0;
  }

  .hero-services {
    display: flex;
    width: 100%;
    max-width: 100%;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 7px;
  }

  .hero-services span {
    max-width: 100%;
    white-space: normal;
    line-height: 1.25;
  }

  .hero-actions {
    max-width: 100%;
    flex-wrap: wrap;
    gap: 12px 18px;
  }

  .hero-hex-field,
  #consbi-hex-canvas {
    max-width: 100vw;
  }

  .capability-section {
    overflow: hidden;
  }
}

@media (prefers-reduced-motion: reduce) {
  .stack-track,
  .hero-services span {
    animation: none !important;
  }
}

@media (max-width: 680px) { .scroll-hint { display: none !important; } }

/* Refuerzo móvil del hero: primero el mensaje y luego la animación, sin solapes. */
@media (max-width: 680px) {
  html, body { width: 100%; max-width: 100%; overflow-x: clip; }
  .hero.section {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 0 !important;
    height: auto !important;
    margin: 0 !important;
    padding: 78px 20px 34px !important;
    overflow: hidden !important;
  }
  .hero-content {
    order: 0 !important;
    position: relative !important;
    inset: auto !important;
    z-index: 2 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    padding: 0 !important;
    translate: none !important;
  }
  .hero h1 {
    max-width: 100%;
    font-size: clamp(42px, 12vw, 54px) !important;
    line-height: .99 !important;
    overflow-wrap: normal;
  }
  .hero-services {
    display: flex !important;
    width: 100% !important;
    max-width: 100% !important;
    flex-wrap: wrap !important;
    align-items: flex-start !important;
    justify-content: flex-start !important;
    gap: 7px !important;
    margin: 0 0 16px !important;
  }
  .hero-services span {
    display: inline-flex !important;
    flex: 0 1 auto !important;
    max-width: 100% !important;
    min-height: 27px !important;
    padding: 4px 9px !important;
    border: 1px solid rgba(83, 116, 142, .24) !important;
    border-radius: 999px !important;
    background: rgba(255, 255, 255, .78) !important;
    white-space: normal !important;
    line-height: 1.25 !important;
    font-size: 11px !important;
  }
  .hero-actions { width: 100%; flex-wrap: wrap !important; align-items: center; gap: 12px 18px !important; }
  .hero-actions > * { max-width: 100%; }
  .hero-visual.hero-hex-field {
    order: 1 !important;
    position: relative !important;
    inset: auto !important;
    display: block !important;
    width: calc(100% + 40px) !important;
    max-width: calc(100% + 40px) !important;
    height: 220px !important;
    min-height: 220px !important;
    margin: 18px -20px 0 !important;
    overflow: hidden !important;
    transform: none !important;
    translate: none !important;
  }
  .hero-visual.hero-hex-field canvas,
  .hero-visual.hero-hex-field #consbi-hex-canvas { max-width: 100% !important; }
  .hero-content .hero-glow { max-width: 100vw; }
  .site-header { max-width: calc(100vw - 24px) !important; }
}
