/* ============================================================
   SISTEMAS LEAL — SHARED COMPONENTS
   Nav, footer, botones y chat widget comunes a todas las páginas.
   Debe cargarse DESPUÉS de tokens.css + base.css.
   ============================================================ */

/* ---------- Navegación (fixed top) ---------- */
nav.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: var(--z-nav);
  padding: 16px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.4s var(--ease-out);
}
nav.site-nav.scrolled {
  background: rgba(11, 61, 76, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 12px 40px;
  box-shadow: 0 2px 20px rgba(0,0,0,0.15);
}
.nav-logo { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.nav-logo img { width: 40px; height: 40px; object-fit: contain; border-radius: 8px; }
.nav-logo .brand-name { font-size: 18px; font-weight: 700; color: var(--white); letter-spacing: -0.3px; }
.nav-links { display: flex; align-items: center; gap: 32px; flex: 1; justify-content: center; }
.nav-links a { color: rgba(255,255,255,0.8); text-decoration: none; font-size: 14px; font-weight: 500; transition: color var(--duration-fast); }
.nav-links a:hover { color: var(--white); }
.nav-links a.active { color: var(--sol); }
.nav-cta {
  background: var(--sol);
  color: var(--white);
  padding: 10px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  transition: all var(--duration-base) var(--ease-out);
  border: none;
  cursor: pointer;
}
.nav-cta:hover { background: var(--sol-hover); transform: translateY(-1px); box-shadow: var(--shadow-glow-sol); }

/* Language toggle pill */
.lang-toggle { display: flex; gap: 4px; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15); border-radius: var(--radius-pill); padding: 3px; margin-right: 12px; }
.lang-toggle a { padding: 4px 10px; border-radius: var(--radius-pill); font-size: 12px; font-weight: 600; color: rgba(255,255,255,0.7); text-decoration: none; transition: all var(--duration-fast); }
.lang-toggle a.active { background: var(--sol); color: var(--white); }
.lang-toggle a:hover:not(.active) { color: var(--white); }

/* ---------- Hamburger (mobile) ---------- */
.nav-burger { display: none; background: transparent; border: 0; cursor: pointer; padding: 8px; z-index: calc(var(--z-nav) + 1); }
.nav-burger span { display: block; width: 26px; height: 2px; background: var(--white); margin: 5px 0; border-radius: 2px; transition: transform var(--duration-base) var(--ease-out), opacity var(--duration-fast); }
.nav-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-burger.open span:nth-child(2) { opacity: 0; }
.nav-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu { position: fixed; inset: 0; background: linear-gradient(160deg, var(--ocean) 0%, var(--ocean-deep) 100%); z-index: var(--z-nav); opacity: 0; pointer-events: none; transition: opacity var(--duration-base) var(--ease-out); display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 28px; padding: 40px; }
.mobile-menu.open { opacity: 1; pointer-events: auto; }
.mobile-menu a { color: var(--white); font-size: 24px; font-weight: 600; text-decoration: none; }
.mobile-menu a.serif-accent { color: var(--sol); font-family: 'Instrument Serif', serif; font-style: italic; font-weight: 400; }

/* ---------- Botones base ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 14px 28px; border-radius: var(--radius-sm); font-weight: 600; font-size: 15px; text-decoration: none; cursor: pointer; border: none; transition: all var(--duration-base) var(--ease-out); }
.btn-primary { background: var(--sol); color: var(--white); }
.btn-primary:hover { background: var(--sol-hover); transform: translateY(-2px); box-shadow: var(--shadow-glow-sol); }
.btn-secondary { background: transparent; color: var(--white); border: 1.5px solid rgba(255,255,255,0.3); }
.btn-secondary:hover { background: rgba(255,255,255,0.1); border-color: var(--white); }

/* ---------- Back to top ---------- */
.back-to-top {
  position: fixed;
  left: 20px;
  bottom: 20px;
  width: 44px; height: 44px;
  border-radius: var(--radius-pill);
  background: var(--ocean);
  color: var(--white);
  border: 1px solid rgba(255,255,255,0.15);
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: 0;
  transform: translateY(20px);
  transition: all var(--duration-base) var(--ease-out);
  z-index: var(--z-backtop);
  box-shadow: var(--shadow-md);
}
.back-to-top.visible { opacity: 1; transform: translateY(0); }
.back-to-top:hover { background: var(--teal); transform: translateY(-3px); }

/* ---------- Responsive base ---------- */
@media (max-width: 900px) {
  nav.site-nav { padding: 12px 20px; }
  .nav-links { display: none; }
  .nav-cta { display: none; }
  .nav-burger { display: block; }
}

/* ============================================================
   SISTEMA DE CARDS UNIFICADO (2026-05-21)
   Reemplaza las 16 clases dispersas (case-card, metric-card,
   resultado-card, svc-card, svc-visual-card, cap-card, value-card,
   why-card, ind-card, build-card, diff-card, size-card,
   problem-card, testi-card, m-card, card-num).

   Uso: <div class="card"> base
        <div class="card card--dark"> sobre fondos ocean
        <div class="card card--metric"> para números/stats
        <div class="card card--testimonial"> citas con avatar
        <div class="card card--feature"> con icono SVG arriba

   Modificadores combinables: card--hover-lift, card--accent-sol, card--compact

   Migración: ver docs/AUDIT-CARDS.md para plan de reemplazo
   gradual de las 16 clases viejas (drift inline).
   ============================================================ */

.card {
  background: var(--white);
  border: 1px solid var(--arena);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  transition: all var(--duration-base) var(--ease-out);
  position: relative;
}
.card.card--hover-lift:hover {
  border-color: var(--teal);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}
.card.card--compact { padding: var(--space-5); }

/* Variant: dark — para fondos ocean */
.card.card--dark {
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--white);
}
.card.card--dark.card--hover-lift:hover {
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.25);
}

/* Variant: metric — números grandes con label */
.card.card--metric {
  text-align: center;
  padding: var(--space-7) var(--space-5);
}
.card.card--metric .metric-num {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-size: 56px;
  line-height: 1;
  color: var(--sol);
  font-weight: 400;
  margin-bottom: var(--space-3);
  display: block;
}
.card.card--metric .metric-label {
  font-size: var(--text-sm);
  letter-spacing: 1.8px;
  text-transform: uppercase;
  color: var(--gray);
  font-weight: 500;
}

/* Variant: testimonial — cita con avatar + autor */
.card.card--testimonial {
  padding: var(--space-7);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}
.card.card--testimonial .testi-quote {
  font-family: 'Instrument Serif', serif;
  font-style: italic;
  font-size: var(--text-xl);
  line-height: 1.5;
  color: var(--ocean);
  font-weight: 400;
}
.card.card--testimonial .testi-author {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}
.card.card--testimonial .testi-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--arena);
  display: grid;
  place-items: center;
  font-weight: 600;
  color: var(--ocean);
  overflow: hidden;
}
.card.card--testimonial .testi-avatar img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.card.card--testimonial .testi-name {
  font-weight: 600;
  color: var(--ocean);
  font-size: var(--text-base);
}
.card.card--testimonial .testi-role {
  font-size: var(--text-sm);
  color: var(--gray);
}

/* Variant: feature — con icono SVG arriba */
.card.card--feature {
  padding: var(--space-6);
}
.card.card--feature .feature-icon {
  width: 40px; height: 40px;
  margin-bottom: var(--space-4);
  color: var(--teal);
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.card.card--feature.card--accent-sol .feature-icon { color: var(--sol); }
.card.card--feature.card--accent-agua .feature-icon { color: var(--agua); }
.card.card--feature .feature-title {
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--ocean);
  margin-bottom: var(--space-3);
}
.card.card--feature .feature-body {
  font-size: var(--text-base);
  color: var(--gray);
  line-height: 1.6;
}

/* Top accent line (aparece en hover) — comparte API con cards viejas */
.card.card--top-accent::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--teal);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--duration-base) var(--ease-out);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.card.card--top-accent:hover::before { transform: scaleX(1); }

/* Responsive */
@media (max-width: 900px) {
  .card { padding: var(--space-5); }
  .card.card--metric .metric-num { font-size: 42px; }
  .card.card--testimonial .testi-quote { font-size: var(--text-lg); }
}

/* ── Conversión 2026-06 ── */

/* ============================================================
   CONVERSIÓN HONESTA (2026-06)
   Chip "Kala en línea", microcopy de confianza bajo CTAs
   y enlaces de tarjeta de servicio. Compartido por las 6 páginas.
   ============================================================ */

/* Punto verde "en línea" (reusa keyframe pulse de base.css) */
.live-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #4ADE80;
  animation: pulse 1.6s ease infinite;
  flex-shrink: 0;
}
@media (prefers-reduced-motion: reduce) {
  .live-dot { animation: none; }
}

/* Chip clicable del hero-proof: abre el widget de Kala (#kala-bubble) */
.proof-live {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: var(--radius-pill);
  padding: 6px 14px;
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: border-color var(--duration-base) var(--ease-out), background var(--duration-base) var(--ease-out);
}
.proof-live:hover { border-color: var(--sol); background: rgba(255,255,255,0.12); }
.proof-live strong { color: #fff; font-weight: 600; }

/* Microcopy reductor de riesgo bajo botones primarios (fondos oscuros) */
.cta-trust {
  font-size: 13px;
  margin-top: 14px;
  color: rgba(255,255,255,0.75);
  position: relative;
}

/* Enlace "Ver cómo funciona" en tarjetas de servicio */
.svc-link {
  display: inline-block;
  margin-top: 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--teal);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}
.svc-link:hover { color: var(--agua); }

/* <button> que reusa los estilos .btn-primary / .btn-outline de cada página */
button.btn-primary,
button.btn-outline {
  font-family: inherit;
  cursor: pointer;
}
button.btn-primary { border: none; }

/* Dark mode */
html.dark-mode .svc-link { color: var(--agua); }
