/* ==========================================================================
   Towly — hoja de estilos global
   Tipografía Montserrat autoalojada (sin llamadas externas a Google Fonts,
   así no se envían datos del visitante a terceros).
   ========================================================================== */

/* cyrillic-ext */
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url("../fonts/montserrat-cyrillic-ext.woff2") format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
/* cyrillic */
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url("../fonts/montserrat-cyrillic.woff2") format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* vietnamese */
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url("../fonts/montserrat-vietnamese.woff2") format('woff2');
  unicode-range: U+0102-0103, U+0110-0111, U+0128-0129, U+0168-0169, U+01A0-01A1, U+01AF-01B0, U+0300-0301, U+0303-0304, U+0308-0309, U+0323, U+0329, U+1EA0-1EF9, U+20AB;
}
/* latin-ext */
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url("../fonts/montserrat-latin-ext.woff2") format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
/* latin */
@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url("../fonts/montserrat-latin.woff2") format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---- paleta de marca ---- */
:root {
  --color-primary: #FFD110;   /* amarillo principal */
  --color-secondary: #DBB202; /* amarillo secundario (más oscuro) */
  --color-black: #000000;
  --color-white: #FFFFFF;
}

/* ---- reset y base ---- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: #F7F8FA; font-family: 'Montserrat', sans-serif; }
::selection { background: var(--color-primary); color: var(--color-black); }

/* ---- botones en amarillo principal: al interactuar pasan al amarillo secundario (más oscuro) ---- */
.nav-cta, .btn-yellow {
  transition: background-color 0.2s ease;
}
.nav-cta:hover, .btn-yellow:hover,
.nav-cta:active, .btn-yellow:active,
.nav-cta:focus-visible, .btn-yellow:focus-visible {
  background: var(--color-secondary) !important;
}

/* ---- animaciones ---- */
@keyframes heroFadeUp { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: translateY(0); } }
@keyframes floatSlow { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes bubble1 { 0%, 6% { opacity: 0; transform: translateY(8px); } 12%, 92% { opacity: 1; transform: translateY(0); } 98%, 100% { opacity: 0; transform: translateY(8px); } }
@keyframes bubble2 { 0%, 22% { opacity: 0; transform: translateY(8px); } 28%, 92% { opacity: 1; transform: translateY(0); } 98%, 100% { opacity: 0; transform: translateY(8px); } }
@keyframes bubble3 { 0%, 42% { opacity: 0; transform: translateY(8px); } 48%, 92% { opacity: 1; transform: translateY(0); } 98%, 100% { opacity: 0; transform: translateY(8px); } }
@keyframes bubble4 { 0%, 62% { opacity: 0; transform: translateY(8px); } 68%, 92% { opacity: 1; transform: translateY(0); } 98%, 100% { opacity: 0; transform: translateY(8px); } }
@keyframes pulseDot { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes photoFill { 0% { opacity: 0; transform: scale(0.8); } 12% { opacity: 1; transform: scale(1); } 88% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(0.8); } }
@keyframes checkPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.2); } }
@keyframes glowPulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 209, 16,0.45); } 50% { box-shadow: 0 0 0 12px rgba(255, 209, 16,0); } }
@keyframes signPulse { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }
@keyframes glowBreathe { 0%, 100% { transform: scale(1); opacity: 0.55; } 50% { transform: scale(1.08); opacity: 0.8; } }
@keyframes toastFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

/* ---- utilidades ---- */
.hidden { display: none !important; }

/* ---- carrusel de funcionalidades: 3 visibles, avanza de 1 en 1 ---- */
.features-carousel {
  display: flex;
  align-items: center;
  gap: 14px;
}
.features-viewport {
  overflow: hidden;
  flex: 1;
  min-width: 0;
}
.features-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 40px) / 3);
  gap: 20px;
  width: 100%;
  align-items: stretch;
  will-change: transform;
  transition: transform 0.4s ease;
}
.features-track > .feature-card {
  box-sizing: border-box;
  min-width: 0;
  height: 100%;
}
.features-arrow {
  flex-shrink: 0;
  align-self: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid #E4E7EC;
  background: #FFFFFF;
  color: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  box-shadow: 0 8px 18px -12px rgba(18,24,31,0.35);
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
}
.features-arrow:hover,
.features-arrow:focus-visible {
  background: var(--color-primary);
  border-color: var(--color-primary);
  outline: none;
}
.features-arrow:active {
  transform: scale(0.96);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

/* ---- evitar cualquier desbordamiento horizontal en todo el sitio ---- */
html, body { max-width: 100%; overflow-x: hidden; }
img, svg { max-width: 100%; }

/* ---- menú móvil: estructura base (se activa en la media query) ---- */
.nav-menu { display: contents; }

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  cursor: pointer;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.nav-toggle span {
  position: relative;
  display: block;
  width: 22px;
  height: 2px;
  background: #000000;
  border-radius: 2px;
  transition: opacity 0.2s ease;
}
.nav-toggle span::before,
.nav-toggle span::after {
  content: '';
  position: absolute;
  left: 0;
  width: 22px;
  height: 2px;
  background: #000000;
  border-radius: 2px;
  transition: transform 0.25s ease, top 0.25s ease;
}
.nav-toggle span::before { top: -7px; }
.nav-toggle span::after { top: 7px; }
.nav-toggle.open span { opacity: 0; }
.nav-toggle.open span::before { top: 0; transform: rotate(45deg); }
.nav-toggle.open span::after { top: 0; transform: rotate(-45deg); }

/* ---- breakpoint de navegación: header nunca se rompe en varias líneas ---- */
@media (max-width: 900px) {
  .nav-toggle { display: flex !important; }
  .nav-inner { flex-wrap: nowrap !important; }
  .nav-logo img { height: 46px !important; }

  .nav-menu {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 6px !important;
    position: absolute !important;
    top: 100% !important;
    left: 0;
    right: 0;
    background: #F7F8FA;
    border-bottom: 1px solid #E4E7EC;
    box-shadow: 0 22px 34px -20px rgba(18,24,31,0.28);
    padding: 10px 20px 20px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: max-height 0.3s ease, opacity 0.25s ease;
  }
  .nav-menu.open {
    max-height: calc(100vh - 70px);
    overflow-y: auto;
    opacity: 1;
    pointer-events: auto;
  }
  .nav-links {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 2px !important;
    width: 100%;
  }
  .nav-links a {
    display: block !important;
    width: 100%;
    text-align: center !important;
    padding: 13px 0 !important;
    font-size: 15.5px !important;
    border-radius: 10px;
  }
  .nav-links a:active { background: rgba(0, 0, 0,0.05); }
  .nav-cta {
    width: 100% !important;
    text-align: center !important;
    margin-top: 8px !important;
    padding: 14px 20px !important;
    display: block !important;
  }
}

/* ==========================================================================
   Mobile general (<=760px): márgenes, centrado y ocultar mockup del hero
   ========================================================================== */
@media (max-width: 760px) {

  /* ---- margen lateral garantizado, nada pegado a los bordes ---- */
  section, footer { padding-left: 20px !important; padding-right: 20px !important; }
  .nav-inner { padding-left: 20px !important; padding-right: 20px !important; }

  /* ---- hero: se oculta el mockup y se centra el contenido ---- */
  .hero-mockup { display: none !important; }
  .hero-section { min-height: auto !important; }
  .hero-inner { justify-content: center !important; gap: 0 !important; }
  .hero-content {
    align-items: center !important;
    text-align: center !important;
    max-width: 100% !important;
  }
  .hero-content p { max-width: 100% !important; }
  .hero-badge { align-self: center !important; text-align: center; }
  .hero-buttons { justify-content: center !important; width: 100%; }
  .hero-buttons a { flex: 1 1 auto; text-align: center; }

  /* ---- utilidad genérica: centra bloques de texto que quedan en columna única ---- */
  .center-on-mobile { align-items: center !important; text-align: center !important; }
  .center-on-mobile p { max-width: 100% !important; }
  .center-on-mobile .btn-yellow { align-self: center !important; }
  .badge-mobile-center { align-self: center !important; }
  .fleet-promo { justify-content: center !important; text-align: center; }

  /* ---- agente IA: se centra el bloque de texto ---- */
  .ia-content { align-items: center !important; text-align: center !important; max-width: 100% !important; }
  .ia-content p { max-width: 100% !important; }
  .ia-badges, .ia-tags { justify-content: center !important; }

  /* ---- contacto: se centra el bloque de texto y el email ---- */
  .contact-info-row { align-items: center !important; }
  .contact-info-row > div { justify-content: center !important; }

  /* ---- grids a una sola columna, sin overflow ---- */
  .features-grid, .steps-grid { grid-template-columns: 1fr !important; }

  .features-carousel { gap: 8px; }
  .features-arrow { width: 38px; height: 38px; }
  .features-track {
    grid-auto-columns: 100% !important;
    gap: 16px !important;
  }

  /* ---- tarjetas: contenido centrado (icono + título + texto) ---- */
  .feature-card, .step-card, .role-card {
    align-items: center !important;
    text-align: center !important;
  }

  /* ---- footer: columnas centradas y apiladas ---- */
  .footer-inner { flex-direction: column !important; align-items: center !important; text-align: center !important; gap: 32px !important; }
  .footer-brand { align-items: center !important; text-align: center !important; }
  .footer-col { flex: 1 1 100% !important; align-items: center !important; text-align: center !important; }
  .footer-bottom { flex-direction: column !important; text-align: center !important; gap: 8px !important; }

  /* ---- formulario de contacto: nombre y empresa comparten fila, más compactos ---- */
  #demo-form { padding: 22px !important; gap: 10px !important; }
  .form-row { flex-wrap: nowrap !important; gap: 8px !important; }
  .form-input-half { flex: 1 1 0 !important; }
  .form-field { padding-top: 8px !important; padding-bottom: 8px !important; font-size: 13.5px !important; }
}

/* ==========================================================================
   Mobile pequeño (<=480px): ajustes finos de espaciado
   ========================================================================== */
@media (max-width: 480px) {
  section, footer { padding-left: 16px !important; padding-right: 16px !important; }
  .nav-inner { padding-left: 16px !important; padding-right: 16px !important; }

  .compare-card, .feature-card, .step-card, .role-card, .dashboard-mock-pad {
    padding: 20px !important;
  }

  #demo-form { padding: 18px !important; }
  .form-row { gap: 6px !important; }
  .form-input-half { padding-left: 10px !important; padding-right: 10px !important; }
  .form-field { padding-top: 7px !important; padding-bottom: 7px !important; }

  .footer-col { flex-basis: 100% !important; }
}
