/* ==========================================================================
   Oversia Solutions — Landing corporativa
   Hoja de estilos compartida por / (ES) y /en/ (EN)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens
   -------------------------------------------------------------------------- */
:root {
  /* Color */
  --accent: #2563eb;
  --accent-light: #3b9eff;
  --accent-dark: #1741a6;
  --navy: #0b1830;
  --navy-soft: #16264a;
  --bg: #ffffff;
  --bg-alt: #f5f7fb;
  --text: #0b1830;
  --text-muted: #566179;
  --border: #e4e9f2;
  --border-strong: #d3dae7;

  /* Forma */
  --radius: 10px;
  --radius-sm: 6px;
  --maxw: 1160px;

  /* Tipografía */
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Source Serif 4', Georgia, 'Times New Roman', serif;

  /* Sombras — muy suaves, uso corporativo */
  --shadow-sm: 0 1px 2px rgba(11, 24, 48, 0.04);
  --shadow-md: 0 2px 8px rgba(11, 24, 48, 0.06);
  --shadow-lg: 0 8px 28px rgba(11, 24, 48, 0.08);

  /* Ritmo vertical */
  --section-y: 88px;
}

/* --------------------------------------------------------------------------
   2. Reset y base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  /* Compensa el header sticky al saltar a un ancla */
  scroll-padding-top: 88px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-dark);
}

/* Incluye ol: los pasos de "Cómo trabajamos" numeran con .step__num,
   no con los marcadores nativos de la lista. */
ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Títulos display (serif) */
h1,
h2 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.18;
  color: var(--text);
  margin: 0;
}

h3,
h4 {
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.35;
  color: var(--text);
  margin: 0;
}

p {
  margin: 0;
}

/* Foco visible y consistente en todo el sitio (accesibilidad) */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* Enlace de salto para lectores de pantalla / teclado */
.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 200;
  padding: 10px 18px;
  background: var(--navy);
  color: #fff;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 12px;
  color: #fff;
}

/* Sólo visible para tecnologías de asistencia */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* --------------------------------------------------------------------------
   3. Layout: contenedor y secciones
   -------------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

.section {
  padding: var(--section-y) 0;
}

/* Alternancia de fondos entre secciones */
.section--alt {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

/* Encabezado de sección */
.section-head {
  max-width: 680px;
  margin-bottom: 52px;
}

.section-head--center {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.section-label {
  display: inline-block;
  margin-bottom: 14px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.section-title {
  font-size: clamp(1.75rem, 3.4vw, 2.4rem);
}

.section-subtitle {
  margin-top: 16px;
  font-size: 1.05rem;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   4. Botones
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.18s ease, border-color 0.18s ease,
    color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.btn:active {
  transform: translateY(1px);
}

/* Primario — azul sólido */
.btn--primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.btn--primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  color: #fff;
}

/* Secundario — contorno sobre fondo claro */
.btn--outline {
  background: var(--bg);
  border-color: var(--border-strong);
  color: var(--text);
}

.btn--outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Sobre fondo navy (sección de contacto) */
.btn--light {
  background: #fff;
  border-color: #fff;
  color: var(--navy);
}

.btn--light:hover {
  background: #eaf1ff;
  border-color: #eaf1ff;
  color: var(--navy);
}

.btn--ghost-light {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.35);
  color: #fff;
}

.btn--ghost-light:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.65);
  color: #fff;
}

.btn--sm {
  padding: 9px 16px;
  font-size: 0.88rem;
}

.btn--lg {
  padding: 14px 26px;
  font-size: 1rem;
}

.btn__icon {
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   5. Header sticky
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.82);
  border-bottom: 1px solid var(--border);
  transition: box-shadow 0.2s ease, background-color 0.2s ease;
}

@supports (backdrop-filter: blur(12px)) or (-webkit-backdrop-filter: blur(12px)) {
  .site-header {
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    backdrop-filter: saturate(180%) blur(12px);
  }
}

/* Clase agregada por JS al hacer scroll */
.site-header.is-scrolled {
  box-shadow: var(--shadow-md);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 72px;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.logo img {
  height: 32px;
  width: auto;
}

/* Navegación principal */
.main-nav {
  margin-left: auto;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 30px;
}

.nav-list a {
  position: relative;
  font-size: 0.94rem;
  font-weight: 500;
  color: var(--text-muted);
  transition: color 0.18s ease;
}

.nav-list a:hover {
  color: var(--text);
}

/* Sección activa según scroll (marcada por JS) */
.nav-list a.is-active {
  color: var(--accent);
}

.nav-list a.is-active::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

/* Acciones del header: idioma + CTA */
.header-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

/* Selector de idioma ES | EN */
.lang-switch {
  display: flex;
  align-items: center;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg);
}

.lang-switch a {
  padding: 6px 11px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  transition: background-color 0.18s ease, color 0.18s ease;
}

.lang-switch a:hover {
  background: var(--bg-alt);
  color: var(--text);
}

.lang-switch a[aria-current='true'] {
  background: var(--accent);
  color: #fff;
}

.lang-switch__sep {
  width: 1px;
  align-self: stretch;
  background: var(--border-strong);
}

/* Botón hamburguesa — sólo mobile */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text);
  cursor: pointer;
}

.nav-toggle:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* Alterna los íconos del hamburguesa según estado */
.nav-toggle .icon-close {
  display: none;
}

.nav-toggle[aria-expanded='true'] .icon-open {
  display: none;
}

.nav-toggle[aria-expanded='true'] .icon-close {
  display: block;
}

/* --------------------------------------------------------------------------
   6. Hero
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  padding: 104px 0 96px;
  background: var(--bg);
  overflow: hidden;
}

/* Halo azul muy tenue detrás del texto — decorativo */
.hero::before {
  content: '';
  position: absolute;
  top: -220px;
  right: -160px;
  width: 620px;
  height: 620px;
  background: radial-gradient(
    circle,
    rgba(59, 158, 255, 0.1) 0%,
    rgba(59, 158, 255, 0) 68%
  );
  pointer-events: none;
}

.hero__inner {
  position: relative;
  max-width: 800px;
}

.hero__title {
  font-size: clamp(2.1rem, 5.4vw, 3.5rem);
  letter-spacing: -0.03em;
}

.hero__title em {
  font-style: normal;
  color: var(--accent);
}

.hero__subtitle {
  max-width: 640px;
  margin-top: 24px;
  font-size: 1.12rem;
  color: var(--text-muted);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 38px;
}

/* Datos de apoyo bajo el hero */
.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  margin-top: 44px;
  padding-top: 30px;
  border-top: 1px solid var(--border);
}

.hero__meta-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.92rem;
  color: var(--text-muted);
}

.hero__meta-item svg {
  color: var(--accent);
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   7. Grid de servicios
   -------------------------------------------------------------------------- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.service-card {
  padding: 30px 28px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease,
    transform 0.2s ease;
}

.service-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.service-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-bottom: 20px;
  background: rgba(37, 99, 235, 0.08);
  border-radius: var(--radius-sm);
  color: var(--accent);
}

.service-card__title {
  font-size: 1.08rem;
  margin-bottom: 10px;
}

.service-card__text {
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   8. Soluciones / producto
   -------------------------------------------------------------------------- */

/* Grid preparado para sumar más productos en el futuro:
   con una sola tarjeta ocupa el ancho completo; al agregar
   una segunda, se acomodan en dos columnas automáticamente. */
.solutions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(440px, 1fr));
  gap: 24px;
}

.product-card {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 56px;
  padding: 48px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}

.product-card__header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.product-card__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  background: var(--navy);
  border-radius: var(--radius-sm);
  color: #fff;
  flex-shrink: 0;
}

.product-card__name {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.55rem;
  letter-spacing: -0.02em;
  margin: 0;
}

/* Chip de alcance regional (LATAM) */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.badge--region {
  background: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.2);
  color: var(--accent-dark);
}

.product-card__desc {
  font-size: 1.02rem;
  color: var(--text-muted);
}

.product-card__body {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.product-card__list {
  display: grid;
  gap: 14px;
  margin-bottom: 28px;
}

.product-card__list li {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  font-size: 0.95rem;
  color: var(--text);
}

.product-card__list svg {
  flex-shrink: 0;
  margin-top: 4px;
  color: var(--accent);
}

/* --------------------------------------------------------------------------
   9. Cómo trabajamos — pasos
   -------------------------------------------------------------------------- */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
  counter-reset: step;
}

.step {
  position: relative;
  padding: 30px 26px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.step__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin-bottom: 18px;
  background: var(--navy);
  border-radius: 50%;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.step__title {
  font-size: 1.05rem;
  margin-bottom: 10px;
}

.step__text {
  font-size: 0.94rem;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   10. Por qué Oversia
   -------------------------------------------------------------------------- */
.why-layout {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 64px;
  align-items: start;
}

.why-list {
  display: grid;
  gap: 12px;
}

.why-item {
  display: flex;
  gap: 18px;
  padding: 26px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s ease;
}

.why-item:hover {
  border-color: var(--border-strong);
}

.why-item__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: rgba(37, 99, 235, 0.08);
  border-radius: var(--radius-sm);
  color: var(--accent);
  flex-shrink: 0;
}

.why-item__title {
  font-size: 1.02rem;
  margin-bottom: 6px;
}

.why-item__text {
  font-size: 0.94rem;
  color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   11. Contacto (fondo navy)
   -------------------------------------------------------------------------- */
.contact {
  position: relative;
  padding: var(--section-y) 0;
  background: var(--navy);
  color: #fff;
  overflow: hidden;
}

/* Textura sutil detrás del bloque de contacto */
.contact::before {
  content: '';
  position: absolute;
  top: -180px;
  left: 50%;
  transform: translateX(-50%);
  width: 760px;
  height: 520px;
  background: radial-gradient(
    ellipse,
    rgba(59, 158, 255, 0.16) 0%,
    rgba(59, 158, 255, 0) 70%
  );
  pointer-events: none;
}

.contact__inner {
  position: relative;
  max-width: 680px;
  margin: 0 auto;
  text-align: center;
}

.contact .section-label {
  color: var(--accent-light);
}

.contact__title {
  font-size: clamp(1.8rem, 3.6vw, 2.5rem);
  color: #fff;
}

.contact__text {
  margin-top: 18px;
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.72);
}

.contact__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 36px;
}

.contact__note {
  margin-top: 26px;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.5);
}

/* --------------------------------------------------------------------------
   12. Footer
   -------------------------------------------------------------------------- */
.site-footer {
  padding: 60px 0 32px;
  background: var(--navy-soft);
  color: rgba(255, 255, 255, 0.65);
}

.footer-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 40px;
  padding-bottom: 36px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-brand {
  max-width: 320px;
}

.footer-brand img {
  height: 32px;
  width: auto;
  margin-bottom: 18px;
}

.footer-brand__tagline {
  font-size: 0.94rem;
  color: rgba(255, 255, 255, 0.6);
}

.footer-cols {
  display: flex;
  flex-wrap: wrap;
  gap: 60px;
}

.footer-col__title {
  margin-bottom: 16px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.9);
}

.footer-col ul {
  display: grid;
  gap: 10px;
}

.footer-col a {
  font-size: 0.92rem;
  color: rgba(255, 255, 255, 0.65);
  transition: color 0.18s ease;
}

.footer-col a:hover {
  color: #fff;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding-top: 26px;
  font-size: 0.86rem;
  color: rgba(255, 255, 255, 0.45);
}

.footer-bottom a {
  color: rgba(255, 255, 255, 0.45);
}

.footer-bottom a:hover {
  color: #fff;
}

/* --------------------------------------------------------------------------
   13. Botón flotante de WhatsApp
   -------------------------------------------------------------------------- */
.whatsapp-fab {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 90;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  background: #25d366;
  border-radius: 50%;
  color: #fff;
  box-shadow: 0 6px 20px rgba(11, 24, 48, 0.22);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.whatsapp-fab:hover {
  color: #fff;
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 10px 26px rgba(11, 24, 48, 0.28);
}

.whatsapp-fab svg {
  width: 28px;
  height: 28px;
}

/* --------------------------------------------------------------------------
   14. Animación de entrada (progressive enhancement)
   -------------------------------------------------------------------------- */

/* Sólo se aplica si JS está activo: sin JS todo queda visible */
.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* --------------------------------------------------------------------------
   15. Responsive
   -------------------------------------------------------------------------- */

/* Tablet */
@media (max-width: 980px) {
  :root {
    --section-y: 68px;
  }

  .product-card {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 32px;
  }

  .why-layout {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .solutions-grid {
    grid-template-columns: 1fr;
  }
}

/* Mobile — nav colapsado */
@media (max-width: 860px) {
  .nav-toggle {
    display: inline-flex;
    order: 3;
  }

  .header-inner {
    gap: 12px;
  }

  .main-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    display: none;
    padding: 12px 24px 22px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
  }

  /* Abierto por JS */
  .main-nav.is-open {
    display: block;
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .nav-list li {
    border-bottom: 1px solid var(--border);
  }

  .nav-list li:last-child {
    border-bottom: 0;
  }

  .nav-list a {
    display: block;
    padding: 14px 2px;
    font-size: 1rem;
  }

  .nav-list a.is-active::after {
    display: none;
  }

  .header-actions {
    margin-left: auto;
  }

  /* El CTA del header se oculta en mobile: el hero y el FAB ya lo cubren */
  .header-actions .btn {
    display: none;
  }
}

/* Mobile chico */
@media (max-width: 560px) {
  .container {
    padding: 0 20px;
  }

  .hero {
    padding: 68px 0 60px;
  }

  .hero__meta {
    gap: 14px;
  }

  .hero__actions .btn {
    width: 100%;
  }

  .product-card {
    padding: 26px 22px;
  }

  .footer-cols {
    gap: 36px;
  }

  .contact__actions .btn {
    width: 100%;
  }

  .whatsapp-fab {
    right: 16px;
    bottom: 16px;
  }
}

/* --------------------------------------------------------------------------
   16. Preferencias del usuario
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
  }
}

/* Impresión */
@media print {
  .site-header,
  .whatsapp-fab,
  .hero__actions,
  .contact__actions {
    display: none;
  }
}
