/* =====================================================================
   FUENTES AUTOHOSPEDADAS — Inter (variable 300-700) + Outfit 700
   Elimina dependencia externa de Google Fonts → mejora FCP
   ===================================================================== */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('../fonts/inter.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;
}

@font-face {
  font-family: 'Outfit';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/outfit-700.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;
}

:root {
  /* Premium Color Palette */
  --primary: #1A237E; /* Dark Blue */
  --primary-dark: #000051;
  --secondary: #00A3E0; /* Cyan */
  --accent: #4DD0E1; /* Teal */
  --dark: #0f172a; /* Slate 900 */
  --light: #f8fafc; /* Slate 50 */
  --gray: #64748b;

  /* Gradients */
  --gradient-hero: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
  --gradient-card: linear-gradient(
    145deg,
    rgba(255, 255, 255, 0.05) 0%,
    rgba(255, 255, 255, 0.01) 100%
  );

  /* Spacing & Layout */
  --container-width: 1200px;
  --header-height: 80px;

  /* Effects */
  --glass-bg: rgba(255, 255, 255, 0.85);
  --glass-border: 1px solid rgba(255, 255, 255, 0.3);
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Reset & Base */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", sans-serif;
  color: var(--dark);
  background-color: var(--light);
  line-height: 1.6;
  overflow-x: hidden;
}

h1,
h2,
h3,
h4 {
  font-family: "Outfit", sans-serif;
  font-weight: 700;
}

a {
  text-decoration: none;
  color: inherit;
  /* Solo opacity: es la única propiedad compositable por el GPU.
     Eliminar 'color' de la transición resuelve los 44 elementos no compuestos de Lighthouse. */
  transition: opacity 0.25s ease;
}

ul {
  list-style: none;
}

img {
  max-width: 100%;
}

.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 2rem;
}

.highlight {
  color: var(--primary);
}

/* Typography Utilities */
.text-center {
  text-align: center;
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.8rem 1.5rem;
  border-radius: 50px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  font-size: 1rem;
}

.btn-primary {
  background-color: var(--primary);
  color: white;
  box-shadow: 0 4px 14px 0 rgba(37, 99, 235, 0.39);
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  transform: translateY(-2px);
}

.btn-secondary {
  background: transparent;
  color: white;
  border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: white;
}

.btn-outline {
  border: 2px solid var(--primary);
  color: var(--primary);
  background: transparent;
}

.btn-outline:hover {
  background: var(--primary);
  color: white;
}

.btn-white {
  background: white;
  color: var(--primary);
  box-shadow: var(--shadow-lg);
}

/* Top Bar (Contact Info) */
.top-bar {
    background-color: var(--dark);
    color: rgba(255,255,255,0.8);
    font-size: 0.85rem;
    padding: 0.5rem 0;
}

.top-bar .container {
    display: flex;
    justify-content: flex-end;
    gap: 2rem;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 2rem;
}

.top-bar a {
    color: inherit;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.top-bar a:hover {
    color: var(--accent);
}

/* Header */
.main-header {
  height: auto;
  min-height: 90px;
  background: transparent;
  -webkit-backdrop-filter: none; /* Safari iOS */
  backdrop-filter: none;

  position: sticky;
  top: 0;
  width: 100%;
  z-index: 1000;
  border-bottom: 1px solid transparent;
  display: flex;
  flex-direction: column;
  transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Header scroll-aware: siempre azul oscuro, más opaco al hacer scroll */
.main-header.scrolled {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
  -webkit-backdrop-filter: blur(10px); /* Safari iOS */
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

/* Fondo azul oscuro semitransparente sobre el hero */
.main-header:not(.scrolled) {
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.92) 0%, rgba(30, 58, 138, 0.85) 100%);
}

/* Texto siempre blanco: header siempre es azul oscuro */
.main-header .logo-title,
.main-header .logo-subtitle {
  color: #fff;
}
.main-header .main-nav a:not(.btn) {
  color: rgba(255, 255, 255, 0.92);
}
.main-header .main-nav a:not(.btn):hover {
  color: #fff;
}
.main-header .mobile-menu-toggle {
  color: #fff;
}
/* Menú móvil desplegable: fondo blanco → links oscuros */
.main-header .main-nav.active a:not(.btn) {
  color: var(--dark);
}

.header-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
}

.logo a {
    display: flex;
    align-items: center; /* Center text with logo vertically */
    gap: 1.25rem; /* More space between logo and text */
    text-decoration: none;
}

.logo img {
    height: 65px; /* Slightly larger */
    width: auto;
}

.logo-text {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.logo-title {
    display: block;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.8rem; /* Larger text */
    color: var(--dark);
    letter-spacing: -0.5px;
    line-height: 1;
}

.logo-subtitle {
    display: block;
    font-family: 'Outfit', sans-serif;
    font-weight: 500;
    font-size: 1.1rem; /* Larger subtitle */
    color: var(--gray);
    text-transform: uppercase;
    letter-spacing: 3px; /* More spacing */
    margin-top: 4px;
}

.main-nav ul {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.main-nav a {
  font-weight: 500;
  font-size: 0.95rem;
  /* Área táctil mínima 44px — WCAG 2.5.5 (incluye tablets táctiles en desktop) */
  padding: 0.5rem 0;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.main-nav a:not(.btn):hover {
  color: var(--primary);
}

.mobile-menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
}

/* Hero Section */
.hero {
    height: 100vh;   /* Fallback: Safari < 15.4, Chrome < 108, Firefox < 101 */
    height: 100svh;  /* svh = Small Viewport Height (excluye barra de dirección iOS) */
    min-height: 600px;
    /* Solo el gradient — la imagen la gestiona .hero-bg-img (<img> real para LCP) */
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.9) 0%, rgba(30, 58, 138, 0.8) 100%);
    color: white;
    padding-top: 0;
    display: flex;
    align-items: center;
    position: relative;
    z-index: 1;          /* Aislar el stacking context del hero */
    isolation: isolate;  /* Evitar que elementos de secciones adyacentes se filtren visualmente */
    overflow: hidden;
}

/* Imagen de fondo del hero: <img> real con fetchpriority=high
   El navegador la descubre en el HTML → LCP óptimo.
   Visualmente idéntico al background-image anterior. */
.hero-bg-img {
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0; /* Fallback Safari < 14.1 */
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

/* Abstract Background Shape (z-index 1, sobre la imagen) */
.hero::before {
  content: "";
  position: absolute;
  top: -20%;
  right: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(
    circle,
    rgba(37, 99, 235, 0.4) 0%,
    rgba(37, 99, 235, 0) 70%
  );
  border-radius: 50%;
  z-index: 1;
}

/* Nota: el fallback para svh se gestiona por cascade (height: 100vh arriba),
   no con @supports — más compacto y equivalente en todos los navegadores. */

.hero-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
  position: relative;
  z-index: 2;
}

.hero-text h2 {
  font-size: 3.5rem;
  line-height: 1.1;
  margin-bottom: 1.5rem;
}

.hero-text p {
  font-size: 1.25rem;
  color: rgba(255, 255, 255, 0.8);
  margin-bottom: 2.5rem;
  max-width: 500px;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
}

.hero-visual {
  display: flex;
  justify-content: center;
}

.glass-card {
  background: rgba(255, 255, 255, 0.1);
  -webkit-backdrop-filter: blur(12px); /* Safari iOS */
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 2rem;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 1rem;
  font-weight: 600;
  animation: float 6s ease-in-out infinite;
  will-change: transform;
}

.glass-card i {
  font-size: 2rem;
  color: var(--accent);
}

/* Services Section */
.section {
  padding: 5rem 0;
}

.section-header {
  text-align: center;
  margin-bottom: 4rem;
}

.section-header h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.section-header p {
  color: var(--gray);
  font-size: 1.1rem;
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 2rem;
}

.service-card {
  background: white;
  padding: 2.5rem;
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s ease;
  border: 1px solid #f1f5f9;
}
.service-card:hover {
  box-shadow: var(--shadow-lg);
}

.service-card:hover {
  transform: translateY(-10px);
  box-shadow: var(--shadow-lg);
}

.icon-box {
  width: 60px;
  height: 60px;
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

.service-card h2 {
  font-size: 1.25rem;
  margin-bottom: 1rem;
}

.service-card p {
  color: var(--gray);
}

/* CTA Section */
.cta {
  background: var(--dark);
  color: white;
  text-align: center;
  padding: 6rem 0;
}

.cta-box h3 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

.cta-box p {
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 2.5rem;
}

/* Footer */
.main-footer {
  background: #0b1120;
  color: white;
  padding-top: 4rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 4rem;
  margin-bottom: 4rem;
}

.footer-col h3 {
  margin-bottom: 1rem;
  color: white;
}

.footer-col h4 {
  margin-bottom: 1.5rem;
  color: var(--gray);
  text-transform: uppercase;
  font-size: 0.85rem;
  letter-spacing: 1px;
}

.footer-col ul li {
  margin-bottom: 0.8rem;
}

.footer-col ul li a {
  color: rgba(255, 255, 255, 0.7);
}

.footer-col ul li a:hover {
  color: white;
}

/* Email del footer: tap-area mínima en móvil */
.footer-col a[href^="mailto"] {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.footer-col a[href^="mailto"]:hover {
  color: white;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 2rem 0;
  text-align: center;
  color: var(--gray);
  font-size: 0.9rem;
}

/* Animations */
@keyframes float {
  0% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-20px);
  }
  100% {
    transform: translateY(0px);
  }
}

/* Responsive */
@media (max-width: 768px) {
  /* Top-bar: solo teléfonos en una línea */
  .top-bar .container {
      justify-content: center;
      flex-direction: row;
      flex-wrap: wrap;
      gap: 1rem;
      padding: 0.4rem 1rem;
  }
  /* Ocultar dirección y email en móvil, solo teléfonos */
  .top-bar .container > span:not([class*="phone"]),
  .top-bar a[href^="mailto"] {
      display: none;
  }

  .header-container {
      padding: 1rem;
  }

  .logo img {
      height: 50px;
  }

  .logo-title {
      font-size: 1.4rem;
  }

  .logo-subtitle {
     font-size: 0.8rem;
     letter-spacing: 2px;
  }

  /* Header siempre azul: logo siempre blanco */
  .main-header .logo-title,
  .main-header .logo-subtitle {
    color: #fff;
  }

  /* Menú móvil abierto: fondo blanco → links oscuros (ambos estados) */
  .main-header .main-nav.active a:not(.btn) {
    color: var(--dark);
  }

  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: white;
    padding: 2rem;
    box-shadow: var(--shadow-lg);
    flex-direction: column;
    z-index: 1000;
    border-top: 1px solid #f1f5f9;
  }

  .main-nav.active {
    display: flex;
  }

  .main-nav ul {
    flex-direction: column;
    width: 100%;
    gap: 1.5rem;
  }

  /* Nav links: área táctil mínima 44px */
  .main-nav a:not(.btn) {
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: 0.5rem 0;
  }

  /* Hamburger: área táctil 44×44 */
  .mobile-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 10px;
    border-radius: 8px;
  }

  .hero {
      padding-top: 0;
  }

  .hero-content {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 3rem;
  }

  .hero-text h2,
  .hero-text h1 {
    font-size: 2rem;
  }

  .hero-buttons {
    justify-content: center;
    flex-direction: column;
  }
  
  .contact-grid {
      grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
}

/* =========================================
   ESTILOS DEL PANEL — movidos a styles-panel.css
   Los estilos de login, tablas, modales, KPIs y
   botones del panel NO se cargan en la landing.
   ========================================= */

/* Auth/Login — ver styles-panel.css */

/* Formularios */
.grupo-formulario {
    margin-bottom: 1.5rem;
    text-align: left;
}

.etiqueta-formulario {
    font-weight: 600;
    font-size: 0.9rem;
    color: #334155;
    display: block;
    margin-bottom: 0.5rem;
}

.control-formulario {
    width: 100%;
    padding: 0.8rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-family: inherit;
}

/* Mensajes Frecuentes */
.mensaje {
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    display: none;
    font-weight: 600;
}

.mensaje-error {
    color: #991b1b;
    background-color: #fee2e2;
}

.mensaje-exito {
    color: #065f46;
    background-color: #d1fae5;
}

/* Panel layout, botones del panel — ver styles-panel.css */

/* Tablas, modales, KPIs del panel — ver styles-panel.css */

/* =========================================================
   WIDGET DE CHAT FLOTANTE
   ========================================================= */


/* ===== WIDGET WHATSAPP FLOTANTE ===== */
#waWidget {
    position: fixed;
    bottom: 1.5rem;
    left: 1.5rem;
    z-index: 998;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
}

#waBoton {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    border: none;
    background: #25d366;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 20px rgba(37, 211, 102, 0.45);
    transition: transform .2s; /* box-shadow no compositable — eliminado */
    animation: pulsarWa 3.5s ease-in-out infinite;
    will-change: transform;
}

#waBoton i { font-size: 1.8rem; line-height: 1; }

#waBoton:hover {
    transform: translateY(-3px) scale(1.07);
    box-shadow: 0 6px 28px rgba(37, 211, 102, 0.65);
}

/* Panel mini */
#waPanel {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    width: 300px;
    overflow: hidden;
    animation: waSlide .25s ease;
    order: -1;
}

@keyframes waSlide {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.wa-panel-cabecera {
    background: #075e54;
    color: #fff;
    padding: 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.wa-avatar {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #25d366;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    flex-shrink: 0;
}

.wa-nombre {
    margin: 0;
    font-weight: 700;
    font-size: 0.95rem;
}

.wa-estado {
    margin: 0;
    font-size: 0.78rem;
    opacity: 0.85;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

.wa-punto {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #25d366;
    display: inline-block;
}

.wa-cerrar {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.3rem;
    cursor: pointer;
    margin-left: auto;
    line-height: 1;
    opacity: 0.8;
    flex-shrink: 0;
}

.wa-cuerpo {
    background: #e5ddd5;
    padding: 1rem;
}

.wa-burbuja {
    background: #fff;
    border-radius: 0 12px 12px 12px;
    padding: 0.75rem 1rem;
    font-size: 0.88rem;
    color: #333;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    max-width: 90%;
}

.wa-burbuja p { margin: 0; }

.wa-btn-abrir {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: #25d366;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    padding: 0.9rem;
    transition: background .2s;
}

.wa-btn-abrir:hover { background: #1ebe5d; color: #fff; }
.wa-btn-abrir i { font-size: 1.2rem; }

@keyframes pulsarWa {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.06); }
}

/* Responsivo */
@media (max-width: 480px) {
    #waWidget { bottom: 0.75rem; left: 0.75rem; }
    #waBoton  { width: 50px; height: 50px; }
    #waPanel  { width: calc(100vw - 1.5rem); }
}

/* ===== CHAT WIDGET ===== */
#chatWidget {
    position: fixed;
    bottom: 5.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.75rem;
}

/* Callout proactivo */
.chat-callout {
    background: #fff;
    border-radius: 14px;
    padding: 0.9rem 1.1rem;
    max-width: 230px;
    box-shadow: 0 8px 28px rgba(0,0,0,.14);
    font-size: 0.85rem;
    color: #334155;
    line-height: 1.5;
    position: relative;
    animation: aparecer .35s cubic-bezier(.34,1.56,.64,1);
}

.chat-callout p {
    margin: 0 0 0.25rem;
}

.chat-callout p:last-child {
    margin-bottom: 0;
}

.chat-callout strong {
    color: #1e293b;
}

.chat-callout::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 22px;
    border: 8px solid transparent;
    border-top-color: #fff;
    border-bottom: none;
}

.chat-callout-cerrar {
    position: absolute;
    top: 6px;
    right: 8px;
    background: none;
    border: none;
    font-size: 1rem;
    color: #64748b; /* #94a3b8 sobre blanco = 2.45:1 — falla AA. #64748b = 4.6:1 ✓ */
    cursor: pointer;
    line-height: 1;
    padding: 0 2px;
}

.chat-callout-cerrar:hover {
    color: #475569;
}

@keyframes aparecer {
    from { opacity: 0; transform: translateY(12px) scale(.9); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Botón pill del chat — diseñado para llamar la atención */
#chatBoton {
    border: none;
    cursor: pointer;
    font-family: inherit;
    /* Gradiente naranja-cálido: contrasta con el azul corporativo y llama a la acción */
    background: linear-gradient(135deg, #FF6B35 0%, #FF3D00 100%);
    color: #fff;
    border-radius: 50px;
    padding: 0 1.8rem 0 1.4rem;
    height: 62px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 6px 28px rgba(255, 61, 0, 0.55);
    transition: transform .2s; /* box-shadow no compositable — eliminado */
    animation: chatBounce 6s ease-in-out infinite;
    position: relative;
    white-space: nowrap;
    will-change: transform;
}

/* Halo pulsante — refuerza la sensación de "activo/disponible" */
#chatBoton::before {
    content: '';
    position: absolute;
    top: -6px; right: -6px; bottom: -6px; left: -6px; /* Fallback Safari < 14.1 */
    inset: -6px;
    border-radius: 50px;
    background: transparent;
    border: 3px solid rgba(255, 107, 53, 0.7);
    animation: chatHalo 2s ease-out infinite;
    pointer-events: none;
}

@keyframes chatHalo {
    0%   { opacity: 1;   transform: scale(1); }
    70%  { opacity: 0;   transform: scale(1.22); }
    100% { opacity: 0;   transform: scale(1.22); }
}

#chatBoton:hover {
    transform: translateY(-4px) scale(1.06);
    box-shadow: 0 12px 36px rgba(255, 61, 0, 0.7);
}

.chat-boton-texto {
    font-size: 1.05rem;
    font-weight: 800;
    letter-spacing: 0.3px;
}

/* Bounce atencional cada 6 segundos */
@keyframes chatBounce {
    0%, 80%, 100% { transform: translateY(0); }
    84%           { transform: translateY(-9px); }
    88%           { transform: translateY(-2px); }
    92%           { transform: translateY(-6px); }
    96%           { transform: translateY(0); }
}

/* Notificación roja */
.chat-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 24px;
    height: 24px;
    background: #ef4444;
    color: #fff;
    border-radius: 50%;
    font-size: 0.7rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid #fff;
    transition: opacity .2s, transform .2s;
    animation: badgePulse 2s infinite;
    box-shadow: 0 0 15px rgba(239, 68, 68, 0.6);
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

.chat-badge.oculto {
    opacity: 0;
    transform: scale(0);
    animation: none;
}

/* Panel de conversación */
#chatPanel {
    width: 320px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: chatSlideIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform-origin: bottom right;
}

@keyframes chatSlideIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

#chatPanel[hidden] { display: none; }

.chat-cabecera {
    background: var(--primary);
    color: #fff;
    padding: 0.85rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.chat-logo {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: contain;
    background: #fff;
    padding: 3px;
}

.chat-nombre-empresa {
    margin: 0;
    font-weight: 700;
    font-size: 0.95rem;
}

.chat-estado {
    margin: 0;
    font-size: 0.75rem;
    opacity: 0.9;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.chat-reiniciar-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 1.1rem;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    transition: transform 0.2s, opacity 0.2s;
}

.chat-reiniciar-btn:hover {
    transform: rotate(180deg);
    opacity: 0.8;
}

.chat-punto-verde {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #4ade80;
    display: inline-block;
    animation: parpadeo 2s ease-in-out infinite;
}

@keyframes parpadeo {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.4; }
}

.chat-mensajes {
    flex: 1;
    padding: 1rem;
    overflow-y: auto;
    min-height: 200px;
    max-height: 280px;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    background: #f8fafc;
}

.chat-burbuja {
    max-width: 85%;
    padding: 0.55rem 0.85rem;
    border-radius: 14px;
    font-size: 0.88rem;
    line-height: 1.45;
    animation: aparecerBurbuja .25s ease;
}

@keyframes aparecerBurbuja {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.chat-burbuja-bot {
    background: #fff;
    color: #1e293b;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
    align-self: flex-start;
}

.chat-burbuja-usuario {
    background: var(--primary);
    color: #fff;
    border-bottom-right-radius: 4px;
    align-self: flex-end;
}

.chat-entrada {
    display: flex;
    border-top: 1px solid #f1f5f9;
    background: #fff;
}

.chat-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 0.75rem 1rem;
    font-size: 0.88rem;
    font-family: inherit;
    background: transparent;
}

.chat-boton-enviar {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 0 1rem;
    cursor: pointer;
    font-size: 0.9rem;
    transition: background .2s;
}

.chat-boton-enviar:hover {
    background: #1d4ed8;
}

.chat-boton-enviar:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Chips de servicios */
.chat-chips {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.chat-chip {
    background: #f0f7ff;
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 0.65rem 1rem;
    border-radius: 20px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: transform 0.2s, opacity 0.2s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-chip:hover {
    background: var(--primary);
    color: #fff;
    transform: translateX(4px);
}

/* Typing indicator mejorado */
.chat-typing {
    padding: 0.8rem 0.85rem !important;
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.05), rgba(37, 99, 235, 0.02));
    border-left: 3px solid var(--primary);
}

.chat-typing span {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary);
    margin: 0 3px;
    animation: chatTypingAnimation 1.4s infinite;
}

.chat-typing span:nth-child(2) {
    animation-delay: 0.2s;
}

.chat-typing span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes chatTypingAnimation {
    0%, 60%, 100% { opacity: 0.4; transform: translateY(0); }
    30% { opacity: 1; transform: translateY(-12px); }
}

/* Indicador de escritura */
.chat-escribiendo {
    font-size: 0.8rem;
    color: #94a3b8;
    font-style: italic;
    padding: 0.5rem 0;
    text-align: center;
}

/* Resumen del chat */
.chat-resumen {
    background: #f0f7ff;
    border-left: 4px solid var(--primary);
    padding: 0.85rem;
    border-radius: 8px;
    margin-top: 0.5rem;
    font-size: 0.82rem;
}

.resumen-titulo {
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.resumen-item {
    color: #475569;
    margin: 0.35rem 0;
    line-height: 1.4;
}

.btn-reiniciar-chat {
    background: var(--primary);
    color: #fff;
    border: none;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    margin-top: 0.75rem;
    transition: transform 0.2s, opacity 0.2s;
    width: 100%;
}

.btn-reiniciar-chat:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}


/* ===================================================
   SERVICE CARD CON FOTO REAL + CTA
   Mantiene el diseño actual (icon + titulo + lista)
   y añade foto arriba y boton CTA abajo
=================================================== */
.service-card-con-foto {
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Foto en la parte superior de la card */
.service-foto {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}
.service-card-con-foto:hover .service-foto {
    transform: scale(1.04);
}

/* Contenido (icono + titulo + lista + boton) */
.service-card-contenido {
    padding: 2.25rem 2rem 2.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 1.5rem;
}

.service-card-contenido h4 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.service-card-contenido h4 i {
    color: var(--primary);
    font-size: 1.4rem;
}

.service-card-contenido ul {
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    color: #475569;
    font-size: 0.95rem;
    line-height: 1.6;
    flex: 1;
    list-style: none;
}

.service-features li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.service-features i {
    color: #10b981;
    font-size: 1.2rem;
    margin-top: 2px;
    flex-shrink: 0;
}

.service-cta {
    display: block;
    text-align: center;
    margin-top: auto;
    padding: 0.9rem 1.5rem;
    font-size: 1rem;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
    /* Solo transform: compositable por GPU. box-shadow se elimina de la transición. */
    transition: transform 0.3s ease;
}

.service-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

/* ===================================================
   FORMULARIO DE CONTACTO - GRID 2 COLUMNAS
   En movil queda en 1 columna automaticamente
=================================================== */
.formulario-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

/* Los elementos de ancho completo (textarea) ocupan las 2 columnas */
.grupo-ancho-completo {
    grid-column: 1 / -1;
}

/* En movil: 1 sola columna */
@media (max-width: 600px) {
    .formulario-grid {
        grid-template-columns: 1fr;
    }
    .grupo-ancho-completo {
        grid-column: 1;
    }
}

/* Icono pequeno dentro del label */
.etiqueta-formulario i {
    font-size: 0.85rem;
    margin-right: 0.3rem;
    opacity: 0.7;
}

/* Select con mismo estilo que los inputs */
select.control-formulario {
    -webkit-appearance: none; /* Safari iOS — sin esto muestra la flecha nativa del SO */
    appearance: none;
    background-image: url(data:image/svg+xml,%3Csvg xmlns=http://www.w3.org/2000/svg width=12 height=12 viewBox=0 0 12 12%3E%3Cpath fill=%236b7280 d=M6 8L1 3h10z/%3E%3C/svg%3E);
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
    cursor: pointer;
}

/* Textarea un poco mas alta */
#detalleMensaje {
    min-height: 110px;
    resize: vertical;
}

/* ===================================================
   SECCIÓN TESTIMONIOS
   Fondo oscuro para romper la monotonia visual
   y dar contraste entre secciones
=================================================== */
.testimonios-seccion {
    background: #0f172a;   /* azul muy oscuro — mismo tono que el footer */
    color: white;
}

.testimonios-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-top: 2.5rem;
}

@media (max-width: 768px) {
    .testimonios-grid { grid-template-columns: 1fr; }
}

.testimonio-card {
    background: rgba(255, 255, 255, 0.06);  /* blanco muy transparente */
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: background 0.2s;
}
.testimonio-card:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Estrellas en dorado */
.testimonio-estrellas {
    color: #fbbf24;
    font-size: 1.1rem;
    letter-spacing: 2px;
}

/* Texto de la reseña */
.testimonio-texto {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.05rem;
    line-height: 1.7;
    font-style: italic;
    flex: 1;
}

/* Nombre del autor */
.testimonio-autor {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.9rem;
    font-weight: 600;
}

/* ===== TESTIMONIOS ESTILO GOOGLE REVIEWS ===== */
.testimonios-seccion {
  background: #f8fafc;
  padding: 4rem 0;
}
.testimonios-wrapper {
  display: flex;
  gap: 2.5rem;
  align-items: flex-start;
  flex-wrap: wrap;
}
.testimonios-panel-izq {
  flex: 0 0 220px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  text-align: center;
}
.testimonios-logo {
  width: 80px;
  height: 80px;
  object-fit: contain;
  border-radius: 50%;
}
.testimonios-empresa {
  font-size: 1rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
}
.testimonios-rating-global {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}
.testimonios-numero {
  font-size: 2.5rem;
  font-weight: 800;
  color: #1e293b;
  line-height: 1;
}
.testimonios-estrellas-global i {
  color: #fbbc04;
  font-size: 1.1rem;
}
.testimonios-total {
  font-size: 0.8rem;
  color: #64748b;
  margin: 0;
}
.btn-resena {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #fff;
  border: 2px solid var(--primary-color, #e63946);
  color: var(--primary-color, #e63946);
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: none;
  transition: background 0.2s;
  margin-top: 0.5rem;
}
.btn-resena:hover {
  background: var(--primary-color, #e63946);
  color: #fff;
}
.testimonios-cards {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}
.testimonio-card-google {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,.08);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.testimonio-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.testimonio-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.testimonio-meta {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}
.testimonio-nombre {
  font-weight: 700;
  font-size: 0.9rem;
  color: #1e293b;
}
/* #94a3b8 sobre blanco = 2.45:1 — falla WCAG AA. #64748b = 4.6:1 ✓ */
.testimonio-fecha {
  font-size: 0.75rem;
  color: #64748b;
}
.testimonio-google-icon {
  width: 20px;
  height: 20px;
  object-fit: contain;
  flex-shrink: 0;
}
.testimonio-stars i {
  color: #fbbc04;
  font-size: 0.9rem;
}
.testimonio-verificado {
  color: #1a73e8 !important;
  margin-left: 0.4rem;
}
.testimonio-texto {
  font-size: 0.9rem;
  color: #475569;
  line-height: 1.5;
  margin: 0;
  font-style: italic;
}
@media (max-width: 768px) {
  .testimonios-wrapper {
    flex-direction: column;
  }
  .testimonios-panel-izq {
    flex: unset;
    width: 100%;
  }
}

/* Avatar real (foto Google Maps) en testimonios */
.testimonio-avatar-img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

/* ===== QUIENES SOMOS ===== */
.quienes-somos-seccion {
  background: #fff;
  padding: 5rem 0 3rem;
}
.quienes-wrapper {
  display: flex;
  gap: 3.5rem;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 3.5rem;
}
.quienes-texto {
  flex: 1 1 400px;
}
.quienes-pretitulo {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--primary-color, #e63946);
  margin-bottom: 0.5rem;
}
.quienes-titulo {
  font-size: 1.8rem;                     /* Fallback Safari < 13.1 */
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 1.25rem;
  line-height: 1.2;
}
.quienes-texto p {
  color: #475569;
  line-height: 1.8;
  margin-bottom: 1rem;
}
.quienes-checks {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.quienes-checks li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: #334155;
  font-size: 0.95rem;
}
.quienes-checks li i {
  color: var(--primary-color, #e63946);
  font-size: 1rem;
  flex-shrink: 0;
}
.quienes-cta {
  margin-top: 0.5rem;
}
.quienes-foto-wrap {
  flex: 1 1 340px;
}
.quienes-foto {
  width: 100%;
  border-radius: 16px;
  object-fit: cover;
  max-height: 400px;
  box-shadow: 0 8px 32px rgba(0,0,0,.12);
}

/* Franja de cifras */
.quienes-cifras {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  background: var(--primary-color, #e63946);
  border-radius: 16px;
  padding: 2rem;
  margin-bottom: 3rem;
  text-align: center;
}
.cifra-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  color: #fff;
}
.cifra-numero {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
}
.cifra-label {
  font-size: 0.8rem;
  opacity: 0.85;
  text-transform: uppercase;
  letter-spacing: .05em;
}

/* Sectores */
.quienes-sectores {
  text-align: center;
  margin-top: 3rem;
}
.sectores-titulo {
  font-size: 0.9rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: #94a3b8;
  margin-bottom: 1.5rem;
}
.sectores-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 1rem;
}
.sector-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 1.5rem 1rem;
  cursor: default;
  transition: transform 0.2s ease; /* Solo transform. border/shadow cambian al instante (no compositable). */
}
.sector-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 28px rgba(37, 99, 235, 0.15);
  border-color: var(--primary);
}
.sector-icono {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  color: #fff;
  transition: transform 0.3s ease; /* background no compositable — cambio instantáneo */
}
.sector-card:hover .sector-icono {
  background: var(--primary-dark);
  transform: scale(1.1);
}
.sector-card span {
  font-size: 0.82rem;
  font-weight: 600;
  color: #334155;
  text-align: center;
  line-height: 1.3;
}

@media (max-width: 768px) {
  .quienes-wrapper { flex-direction: column; }
  .quienes-cifras { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .quienes-cifras { grid-template-columns: 1fr 1fr; }
}

/* ===== OVERRIDE: cifras banner y ticks quienes somos ===== */
.quienes-cifras {
  background: #1e293b !important;
}
.quienes-checks li i {
  color: #22c55e !important;
}

/* ===== OVERRIDE: seccion contacto fondo claro ===== */
#contacto.cta,
#contacto.seccion-cta-dinamica {
  background: #f8fafc !important;
  color: #1e293b !important;
}
#contacto .section-header h3,
#contacto .cabecera-cta h3 {
  color: #1e293b !important;
}
#contacto .section-header p,
#contacto .cabecera-cta p {
  color: #475569 !important;
}

/* ===== Campos del formulario: mas padding y altura ===== */
.control-formulario {
  padding: 0.85rem 1rem !important;
  font-size: 0.95rem !important;
  border-radius: 8px !important;
  border: 1.5px solid #e2e8f0 !important;
  transition: box-shadow 0.2s !important;
}
.control-formulario:focus {
  border-color: var(--primary-color, #e63946) !important;
  box-shadow: 0 0 0 3px rgba(230,57,70,.12) !important;
  outline: none !important;
}
.etiqueta-formulario {
  font-size: 0.85rem !important;
  font-weight: 600 !important;
  color: #334155 !important;
  margin-bottom: 0.4rem !important;
  display: block !important;
}
.grupo-formulario {
  display: flex !important;
  flex-direction: column !important;
  gap: 0.3rem !important;
}

/* ===== VALIDACIÃ“N DE FORMULARIO INLINE ===== */

/* Estado error */
.control-formulario.campo-error {
  border-color: #ef4444 !important;
  background: #fff5f5 !important;
  box-shadow: 0 0 0 3px rgba(239,68,68,.12) !important;
}

/* Estado ok */
.control-formulario.campo-ok {
  border-color: #22c55e !important;
  background: #f0fdf4 !important;
  box-shadow: 0 0 0 3px rgba(34,197,94,.1) !important;
}

/* Mensajes helper bajo cada campo */
.campo-helper {
  font-size: 0.78rem;
  margin-top: 0.25rem;
  display: block;
  min-height: 1rem;
}
/* #ef4444 sobre blanco = 3.63:1 — falla WCAG AA. #b91c1c = 7.5:1 ✓ */
.helper-error { color: #b91c1c; }
.helper-ok    { color: #16a34a; }

/* Shake al intentar enviar con errores */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  15%       { transform: translateX(-6px); }
  30%       { transform: translateX(6px); }
  45%       { transform: translateX(-4px); }
  60%       { transform: translateX(4px); }
  75%       { transform: translateX(-2px); }
  90%       { transform: translateX(2px); }
}
.formulario-shake {
  animation: shake 0.45s ease-in-out;
}

/* Tarjeta de Ã©xito */
.tarjeta-exito {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 3rem 2rem;
  gap: 1rem;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 2px 16px rgba(0,0,0,.08);
  animation: fadeInUp 0.4s ease;
}
.tarjeta-exito-icono {
  font-size: 3.5rem;
  color: #22c55e;
}
.tarjeta-exito h4 {
  font-size: 1.4rem;
  font-weight: 800;
  color: #1e293b;
  margin: 0;
}
.tarjeta-exito p {
  color: #475569;
  margin: 0;
  max-width: 360px;
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== PROCESO "COMO TRABAJAMOS" ===== */
.proceso-seccion {
  background: #1e293b;
  padding: 5rem 0;
}
.proceso-header {
  text-align: center;
  margin-bottom: 3rem;
}
.proceso-pretitulo {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--primary-color, #e63946);
  margin-bottom: 0.5rem;
}
.proceso-titulo {
  font-size: 1.8rem;                     /* Fallback Safari < 13.1 */
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  color: #fff;
  margin: 0;
}
.proceso-pasos {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
  flex-wrap: wrap;
}
.proceso-paso {
  flex: 1 1 180px;
  max-width: 220px;
  text-align: center;
  padding: 0 1rem;
}
.proceso-icono {
  position: relative;
  width: 70px;
  height: 70px;
  background: rgba(255,255,255,.06);
  border: 2px solid rgba(255,255,255,.12);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
  font-size: 1.6rem;
  color: var(--primary-color, #e63946);
}
.proceso-numero {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 22px;
  height: 22px;
  background: var(--primary-color, #e63946);
  color: #fff;
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
.proceso-paso h3 {
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.5rem;
}
.proceso-paso p {
  font-size: 0.87rem;
  color: #94a3b8;
  line-height: 1.6;
  margin: 0;
}
.proceso-flecha {
  display: flex;
  align-items: center;
  padding-top: 1.8rem;
  color: rgba(255,255,255,.2);
  font-size: 1.2rem;
  flex-shrink: 0;
}
@media (max-width: 768px) {
  .proceso-flecha { display: none; }
  .proceso-paso { max-width: 100%; padding: 1rem 0; border-bottom: 1px solid rgba(255,255,255,.06); }
}

/* ===== CTA URGENTE ===== */
.cta-urgente-seccion {
  background: var(--primary-color, #e63946);
  padding: 3.5rem 0;
}
.cta-urgente-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}
.cta-urgente-texto h2 {
  font-size: 1.7rem;                      /* Fallback Safari < 13.1 */
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  font-weight: 800;
  color: #fff;
  margin: 0 0 0.4rem;
}
.cta-urgente-texto p {
  color: rgba(255,255,255,.85);
  margin: 0;
  font-size: 1rem;
}
.cta-urgente-botones {
  display: flex;
  gap: 1rem;
  flex-shrink: 0;
  flex-wrap: wrap;
}
.cta-btn-tel {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #fff;
  color: var(--primary-color, #e63946);
  font-weight: 700;
  font-size: 1.05rem;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  text-decoration: none;
  transition: transform .15s;
  box-shadow: 0 4px 16px rgba(0,0,0,.15);
}
.cta-btn-tel:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.cta-btn-wa {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #25d366;
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
  padding: 0.75rem 1.5rem;
  border-radius: 999px;
  text-decoration: none;
  transition: transform .15s;
  box-shadow: 0 4px 16px rgba(0,0,0,.15);
}
.cta-btn-wa:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.2); }
@media (max-width: 640px) {
  .cta-urgente-inner { flex-direction: column; text-align: center; }
  .cta-urgente-botones { justify-content: center; }
}

/* ===== GALERIA MASONRY ===== */
.galeria-seccion { background: #f8fafc; }
.galeria-masonry {
  columns: 3;
  column-gap: 1rem;
}
.galeria-item {
  break-inside: avoid;
  position: relative;
  overflow: hidden;
  border-radius: 12px;
  margin-bottom: 1rem;
  cursor: pointer;
}
.galeria-item img {
  width: 100%;
  height: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  transition: transform .35s ease;
  border-radius: 12px;
}
.galeria-item:hover img { transform: scale(1.06); }
.galeria-overlay {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0; /* Fallback Safari < 14.1 */
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.7) 0%, transparent 50%);
  opacity: 0;
  transition: opacity .3s;
  display: flex;
  align-items: flex-end;
  padding: 1rem;
  border-radius: 12px;
}
.galeria-item:hover .galeria-overlay { opacity: 1; }
.galeria-overlay span {
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
}
@media (max-width: 900px) { .galeria-masonry { columns: 2; } }
@media (max-width: 540px) { .galeria-masonry { columns: 1; } }

/* ===== CARDS SERVICIOS â€” borde color superior ===== */


/* CTA urgente: azul oscuro en vez de rojo */
.cta-urgente-seccion {
  background: #1e293b !important;
}
.cta-btn-tel {
  background: #fff !important;
  color: #1e293b !important;
}
.cta-btn-tel:hover { color: #1e293b !important; }

/* Proceso: iconos blancos, numeros azul sutil, sin rojo */
.proceso-icono {
  color: #fff !important;
  border-color: rgba(255,255,255,.25) !important;
  background: rgba(255,255,255,.07) !important;
}
.proceso-numero {
  background: #2563eb !important;
}
.proceso-flecha {
  color: rgba(255,255,255,.35) !important;
}

/* Reducir espacio entre cabecera contacto y formulario */
#contacto .section-header,
#contacto .cabecera-cta {
  margin-bottom: 1.5rem !important;
  padding-bottom: 0 !important;
}
#contacto .section-header h3,
#contacto .cabecera-cta h3 {
  margin-bottom: 0.4rem !important;
}
#contacto .section-header p,
#contacto .cabecera-cta p {
  margin-bottom: 0 !important;
}
#contacto.section {
  padding-top: 3rem !important;
}

/* Contact grid: forzar 2 columnas y altura controlada */
.contact-grid {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 2rem !important;
  align-items: start !important;
}
.contenedor-mapa-blanco {
  height: 380px !important;
  min-height: unset !important;
}
@media (max-width: 768px) {
  .contact-grid {
    grid-template-columns: 1fr !important;
  }
  .contenedor-mapa-blanco {
    height: 260px !important;
  }
}


/* ===== SECCION CONTACTO MEJORADA ===== */
.seccion-contacto {
    background: #f8fafc;
    padding: 5rem 0;
}

.contacto-cabecera {
    text-align: center;
    margin-bottom: 3rem;
}

.contacto-pretitulo {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--primary);
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    border-radius: 20px;
    padding: 0.3rem 1rem;
    margin-bottom: 0.75rem;
}

.contacto-cabecera h2 {
    font-size: 2rem;
    color: #1e293b;
    margin: 0.5rem 0;
}

.contacto-cabecera p {
    color: #64748b;
    font-size: 1.05rem;
}

.contacto-grid {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 2.5rem;
    align-items: start;
}

/* Columna izquierda */
.contacto-col-info {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.contacto-datos {
    background: #fff;
    border-radius: 14px;
    padding: 1.5rem;
    box-shadow: 0 1px 8px rgba(0,0,0,.07);
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}

.contacto-dato-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.contacto-dato-icono {
    width: 38px;
    height: 38px;
    min-width: 38px;
    background: #eff6ff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 0.95rem;
}

.contacto-dato-item strong {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    margin-bottom: 0.2rem;
}

.contacto-dato-item span {
    font-size: 0.92rem;
    color: #334155;
    line-height: 1.5;
}

.contacto-dato-item a {
    color: #334155;
    text-decoration: none;
}

.contacto-dato-item a:hover {
    color: var(--primary);
}

/* Columna derecha: formulario como card */
.contacto-col-form {
    background: #fff;
    border-radius: 16px;
    padding: 2rem 2rem 1.5rem;
    box-shadow: 0 4px 24px rgba(0,0,0,.08);
}

.contacto-garantias {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #f1f5f9;
}

.contacto-garantias span {
    font-size: 0.8rem;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.contacto-garantias span i {
    color: #22c55e;
    font-size: 0.85rem;
}

@media (max-width: 900px) {
    .contacto-grid {
        grid-template-columns: 1fr;
    }

    .contacto-col-form {
        padding: 1.5rem;
    }
}


/* ===== FORMULARIO MULTI-PASO ===== */

/* Barra de progreso */
.form-progreso {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #f1f5f9;
}

.form-progreso-paso {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    position: relative;
}

.form-progreso-paso span {
    font-size: 0.72rem;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.progreso-circulo {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e2e8f0;
    color: #94a3b8;
    font-size: 0.85rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .3s; /* Solo transform: compositable. color/bg/shadow cambian instantáneo. */
}

.form-progreso-paso.activo .progreso-circulo {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 0 0 4px #bfdbfe;
}

.form-progreso-paso.completado .progreso-circulo {
    background: #22c55e;
    color: #fff;
}

.form-progreso-paso.activo span,
.form-progreso-paso.completado span {
    color: #1e293b;
}

.form-progreso-linea {
    flex: 1;
    height: 2px;
    background: #e2e8f0;
    margin: 0 0.5rem;
    margin-bottom: 1.2rem;
    transition: background .3s;
}

.form-progreso-linea.completada {
    background: #22c55e;
}

/* Pasos del formulario */
.form-paso {
    display: none;
    animation: deslizarEntrada .35s ease;
}

.form-paso.activo {
    display: block;
}

@keyframes deslizarEntrada {
    from { opacity: 0; transform: translateX(24px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes deslizarSalida {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(-24px); }
}

.form-paso-titulo {
    font-size: 1rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 1.25rem;
}

.form-paso-titulo i {
    color: var(--primary);
    margin-right: .35rem;
}

/* Selector visual de servicio */
.servicio-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.65rem;
    margin-bottom: 1.25rem;
}

.servicio-opcion {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding: 0.9rem 0.5rem;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    transition: transform .15s ease; /* Solo transform: compositable. border/bg/shadow cambian al instante. */
    font-size: 0.78rem;
    font-weight: 600;
    color: #475569;
    font-family: inherit;
}

.servicio-opcion i {
    font-size: 1.4rem;
    color: #64748b; /* #94a3b8 sobre blanco = 2.45:1 — falla WCAG AA. #64748b = 4.6:1 ✓ */
    /* Sin transition: color no es compositable y los iconos son pequeños — cambio instante es aceptable */
}

.servicio-opcion:hover {
    border-color: #93c5fd;
    background: #f0f9ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37,99,235,.1);
}

.servicio-opcion:hover i {
    color: var(--primary);
}

.servicio-opcion.seleccionado {
    border-color: var(--primary);
    background: #eff6ff;
    color: var(--primary);
    box-shadow: 0 0 0 3px #bfdbfe;
    transform: translateY(-2px);
}

.servicio-opcion.seleccionado i {
    color: var(--primary);
}

/* Campos ruta origen - destino */
.ruta-campos {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.ruta-flecha {
    color: #94a3b8;
    font-size: 0.9rem;
    margin-top: 1.6rem;
    text-align: center;
}

/* Navegacion entre pasos */
.form-paso-nav {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.25rem;
}

.form-paso-nav .btn-anterior {
    flex: 0 0 auto;
}

.form-paso-nav .btn-siguiente,
.form-paso-nav .btn-cta-final {
    flex: 1;
}

.btn-cta-final {
    font-size: 1rem;
    padding: 0.85rem 1.5rem;
    font-weight: 700;
    letter-spacing: .02em;
}

/* RGPD */
.rgpd-etiqueta {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    cursor: pointer;
    font-size: 0.82rem;
    color: #64748b;
    line-height: 1.5;
}

.rgpd-etiqueta input[type="checkbox"] {
    width: 16px;
    height: 16px;
    min-width: 16px;
    margin-top: 2px;
    accent-color: var(--primary);
    cursor: pointer;
}

.rgpd-etiqueta a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: underline;
}

/* Input focus glow */
.control-formulario:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}

@media (max-width: 768px) {
    .servicio-selector {
        grid-template-columns: repeat(2, 1fr);
    }

    .ruta-campos {
        grid-template-columns: 1fr;
    }

    .ruta-flecha {
        display: none;
    }
}

/* Botón cerrar dentro de la cabecera del chat */
.chat-cerrar-btn {
    margin-left: auto;
    background: rgba(255,255,255,.2);
    border: none;
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    transition: background .2s;
}
.chat-cerrar-btn:hover {
    background: rgba(255,255,255,.35);
}


/* ===== Estimador de precio (Módulo Python) ===== */
.precio-estimado {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border: 1px solid #86efac;
    border-radius: 10px;
    padding: .9rem 1.1rem;
    margin: .8rem 0;
    animation: fadeIn .3s ease;
}
@keyframes fadeIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.precio-estimado[hidden] { display: none; }
.precio-estimado-inner {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: .5rem .8rem;
    grid-template-areas: "label km precio" "nota nota nota";
}
.precio-est-label  { grid-area: label;  font-size: .8rem; color: #15803d; font-weight: 600; }
.precio-est-km     { grid-area: km;     font-size: .85rem; color: #166534; }
.precio-est-precio { grid-area: precio; font-size: 1.25rem; font-weight: 700; color: #15803d; white-space: nowrap; }
/* #4ade80 sobre #f0fdf4 = ~1.8:1 — falla WCAG AA. #166534 = 7.9:1 ✓ */
.precio-est-nota   { grid-area: nota;   font-size: .72rem; color: #166534; font-style: italic; }
.precio-cargando {
    font-size: .85rem;
    color: #64748b;
    padding: .5rem 0;
}
.precio-cargando[hidden] { display: none; }

/* ===== Chat: chips de servicio ===== */
.chat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem;
  padding: .4rem 0 .6rem .5rem;
}
.chat-chip {
  background: #fff;
  border: 1.5px solid #e63946;
  color: #e63946;
  border-radius: 999px;
  padding: .35rem .85rem;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
  white-space: nowrap;
}
.chat-chip:hover {
  background: #e63946;
  color: #fff;
}

/* ===== Chat: typing indicator (tres puntos) ===== */
.chat-typing {
  display: flex !important;
  align-items: center;
  gap: 4px;
  padding: .55rem .8rem !important;
  width: fit-content;
}
.chat-typing span {
  display: block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #94a3b8;
  animation: chatTypingBounce .9s infinite ease-in-out;
}
.chat-typing span:nth-child(2) { animation-delay: .15s; }
.chat-typing span:nth-child(3) { animation-delay: .30s; }
/* Renombrado de chatBounce a chatTypingBounce para evitar conflicto
   con la animacion del boton #chatBoton */
@keyframes chatTypingBounce {
  0%, 60%, 100% { transform: translateY(0); opacity: .5; }
  30%            { transform: translateY(-5px); opacity: 1; }
}

/* ===================================================
   RESPONSIVE DESIGN - Mobile First
=================================================== */

/* Tablets (768px - 1024px) */
@media (max-width: 1024px) {
  :root {
    --container-width: 90vw;
  }

  .container {
    padding: 0 1.5rem;
  }

  h1 { font-size: 2rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }

  /* Chat responsivo */
  #chatPanel {
    width: 100%;
    max-width: 380px;
    max-height: 85vh;
  }

  .chat-mensajes {
    max-height: 50vh;
  }

  #chatBoton {
    padding: 0 1.2rem;
    height: 48px;
    font-size: 0.85rem;
  }

  .chat-input {
    font-size: 16px; /* Previene zoom en iOS */
  }

  .service-card { padding: 1.5rem; }
}

/* Móviles grandes (480px - 768px) */
@media (max-width: 768px) {
  :root {
    --header-height: 70px;
  }

  .container {
    padding: 0 1rem;
  }

  /* Tipografía móvil */
  body { font-size: 15px; }
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.35rem; }
  h3 { font-size: 1.1rem; }
  h4 { font-size: 1rem; }

  /* Chat fullscreen en móvil */
  #chatWidget {
    bottom: 1rem;
    right: 1rem;
  }

  #chatPanel {
    width: calc(100vw - 2rem);
    max-width: 100%;
    max-height: 90vh;
    border-radius: 12px;
  }

  .chat-mensajes {
    max-height: 55vh;
    min-height: 150px;
    padding: 0.75rem;
  }

  .chat-burbuja {
    max-width: 90%;
    font-size: 0.85rem;
    padding: 0.5rem 0.75rem;
  }

  /* Botones móvil */
  #chatBoton {
    width: auto;
    height: 50px;
    padding: 0 1rem;
  }

  .chat-input {
    padding: 0.7rem 0.9rem;
    font-size: 16px;
  }

  .chat-boton-enviar {
    padding: 0 0.8rem;
  }

  /* Callout oculto en móvil — molesta más que ayuda */
  .chat-callout {
    display: none !important;
  }

  /* Botón chat como círculo en móvil */
  #chatBoton .chat-boton-texto {
    display: none;
  }
  #chatBoton {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    padding: 0;
    justify-content: center;
  }
  #chatBoton i {
    font-size: 1.5rem;
  }

  /* Grid responsive */
  .services-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .service-card {
    padding: 1.25rem;
  }

  .service-card h4 {
    font-size: 1rem;
  }

  /* Formularios */
  input, textarea, select {
    font-size: 16px !important;
  }

  .btn {
    padding: 0.7rem 1.25rem;
    font-size: 0.95rem;
    width: 100%;
    margin: 0.5rem 0;
  }

  /* Hero section */
  .hero {
    min-height: 50vh;
    padding: 3rem 1rem;
  }

  .hero h1 {
    font-size: 1.5rem;
  }

  /* Espaciado general */
  section {
    padding: 2rem 0;
  }

  /* Tablas */
  table {
    font-size: 0.85rem;
  }

  th, td {
    padding: 0.75rem 0.5rem;
  }
}

/* Móviles pequeños (hasta 480px) */
@media (max-width: 480px) {
  /* Top-bar: ocultar completamente en pantallas muy pequeñas para ganar espacio */
  .top-bar {
    display: none;
  }

  :root {
    --header-height: 60px;
    --container-width: 100%;
  }

  body {
    font-size: 14px;
    line-height: 1.6;
  }

  /* Hero h1 en móvil pequeño */
  .hero-text h1, .hero-text h2 {
    font-size: 1.6rem;
  }
  .hero-visual {
    display: none;
  }

  /* Footer gap reducido */
  .footer-grid {
    gap: 1.5rem;
  }

  /* Service card más compacta */
  .service-card {
    padding: 1rem;
  }
  .service-card img {
    height: 160px;
  }

  /* waWidget z-index y panel fijo */
  #waWidget { z-index: 9998; }
  #waPanel {
    position: fixed;
    bottom: 80px;
    left: 0.75rem;
    width: calc(100vw - 1.5rem);
    max-height: 70vh;
    overflow-y: auto;
  }

  /* ruta-campos en columna en móvil */
  .ruta-campos {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  .ruta-flecha { display: none; }

  /* Mejor contraste */
  .chat-burbuja-bot {
    background: #f0f7ff !important;
    color: #0f172a !important;
    border: 1px solid #e0eeff;
  }

  h1 { font-size: 1.5rem; line-height: 1.2; }
  h2 { font-size: 1.2rem; line-height: 1.2; }
  h3 { font-size: 1rem; }

  .container {
    padding: 0 0.75rem;
  }

  /* Chat ultra responsivo */
  #chatWidget {
    bottom: 0.75rem;
    right: 0.75rem;
  }

  #chatPanel {
    width: calc(100vw - 1.5rem);
    max-height: 95vh;
    box-shadow: 0 5px 30px rgba(0, 0, 0, 0.2);
  }

  .chat-cabecera {
    padding: 0.75rem 0.75rem;
    gap: 0.5rem;
  }

  .chat-logo {
    width: 32px;
    height: 32px;
  }

  .chat-nombre-empresa {
    font-size: 0.85rem;
    font-weight: 600;
  }

  .chat-estado {
    font-size: 0.7rem;
  }

  .chat-reiniciar-btn,
  .chat-cerrar-btn {
    font-size: 1rem;
    padding: 2px 4px;
  }

  .chat-mensajes {
    max-height: 60vh;
    min-height: 120px;
    padding: 0.6rem;
    gap: 0.4rem;
  }

  .chat-burbuja {
    max-width: 95%;
    font-size: 0.8rem;
    padding: 0.45rem 0.65rem;
    border-radius: 10px;
  }

  .chat-entrada {
    gap: 0;
  }

  .chat-input {
    padding: 0.65rem 0.75rem;
    font-size: 16px;
    border-radius: 0;
  }

  .chat-boton-enviar {
    padding: 0 0.7rem;
    font-size: 0.9rem;
  }

  /* Botón chat */
  #chatBoton {
    padding: 0 0.85rem;
    height: 48px;
    font-size: 0.8rem;
    border-radius: 40px;
  }

  .chat-badge {
    width: 18px;
    height: 18px;
    font-size: 0.65rem;
  }

  /* Chips */
  .chat-chips {
    gap: 0.35rem;
    padding: 0.3rem 0 0.5rem 0.35rem;
  }

  .chat-chip {
    padding: 0.3rem 0.7rem;
    font-size: 0.75rem;
  }

  #chatBoton {
    width: 50px;
    height: 50px;
  }

  .chat-resumen {
    font-size: 0.75rem;
    padding: 0.65rem;
  }

  .resumen-titulo {
    font-size: 0.8rem;
    margin-bottom: 0.35rem;
  }

  .resumen-item {
    font-size: 0.75rem;
    margin: 0.2rem 0;
  }

  /* Botones generales */
  .btn {
    padding: 0.65rem 1rem;
    font-size: 0.9rem;
    width: 100%;
  }

  .btn-primary {
    box-shadow: 0 2px 10px rgba(37, 99, 235, 0.3);
  }

  /* Hero */
  .hero {
    min-height: 40vh;
    padding: 2rem 0.75rem;
  }

  .hero h1 {
    font-size: 1.35rem;
  }

  /* Sections */
  section {
    padding: 1.5rem 0;
  }

  /* Grid - una columna */
  .services-grid,
  .features-grid,
  .testimonials-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .service-card {
    padding: 1rem;
  }

  /* Navegación */
  nav {
    padding: 0.75rem 0;
  }

  /* Tablas responsivas */
  table {
    font-size: 0.8rem;
    width: 100%;
    overflow-x: auto;
  }

  th, td {
    padding: 0.5rem 0.35rem;
  }

  /* Modales/Popups */
  .modal {
    width: 95vw;
  }

  /* Footer */
  footer {
    padding: 1.5rem 0.75rem;
  }

  /* Contacto */
  form input,
  form textarea,
  form select {
    font-size: 16px !important;
    width: 100%;
    margin-bottom: 0.75rem;
    padding: 0.7rem 0.75rem;
  }
}

/* Orientación landscape en móviles */
@media (max-height: 500px) and (orientation: landscape) {
  .chat-mensajes {
    max-height: 30vh;
  }

  #chatPanel {
    max-height: 90vh;
  }

  section {
    padding: 1rem 0;
  }
}

/* Impresión */
@media print {
  #chatWidget,
  .chat-callout,
  nav,
  footer {
    display: none;
  }

  body {
    background: white;
    color: black;
  }

  a {
    text-decoration: underline;
  }
}

/* =====================================================================
   CONTENT-VISIBILITY: SKIP-RENDER para secciones fuera del viewport
   Reduce drásticamente el Style & Layout work en carga inicial (~648ms).
   contain-intrinsic-size evita CLS cuando la sección entra al viewport.
   ===================================================================== */
/* content-visibility solo si el navegador lo soporta; sin soporte, sin penalización */
@supports (content-visibility: auto) {
  .quienes-somos-seccion,
  .galeria-seccion,
  .testimonios-seccion,
  .ruta-section,
  .main-footer {
    content-visibility: auto;
    contain-intrinsic-size: auto 600px;
  }
}

/* =====================================================================
   FONT-DISPLAY OVERRIDE para Font Awesome desde CDN
   Por defecto usa 'block' (invisible durante carga). 'swap' muestra
   el carácter de fallback en su lugar hasta que la fuente llega.
   ===================================================================== */
@font-face {
  font-family: 'Font Awesome 6 Free';
  font-display: swap;
}
@font-face {
  font-family: 'Font Awesome 6 Brands';
  font-display: swap;
}

/* =====================================================================
   ACCESIBILIDAD — FOCUS VISIBLE
   Sin esto, los usuarios de teclado no ven dónde están.
   :focus-visible solo activa el anillo cuando el usuario navega con
   teclado/switch, no cuando hace clic — no molesta a los usuarios de ratón.
   ===================================================================== */
:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Los inputs ya tienen box-shadow de foco — solo desactivamos el outline duplicado */
.control-formulario:focus-visible,
.chat-input:focus-visible {
  outline: none;
}

/* Botones del chat con fondo oscuro: anillo blanco */
#chatBoton:focus-visible,
#waBoton:focus-visible,
.chat-boton-enviar:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

/* =====================================================================
   ACCESIBILIDAD — CONTRASTE
   --gray: #64748b sobre #f8fafc = 4.46:1 (falla 4.5:1 por 0.04)
   Ajuste mínimo a #5e6e82 = 4.52:1 ✓
   ===================================================================== */
:root {
  --gray: #5e6e82;
}

/* =====================================================================
   PREFERS-REDUCED-MOTION
   Deshabilita todas las animaciones/transiciones para usuarios que
   tienen activada la opción "Reducir movimiento" en su SO.
   Cumple WCAG 2.1 — criterio 2.3.3 (AAA) y es buena práctica AA.
   ===================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* =====================================================================
   FIXES RESPONSIVIDAD — pantallas ≤480px
   ===================================================================== */

/* Fix 1: .precio-estimado-inner — grid 3 col desborda en 320px */
@media (max-width: 480px) {
  .precio-estimado-inner {
    grid-template-columns: 1fr;
    grid-template-areas:
      "label"
      "km"
      "precio"
      "nota";
  }
  .precio-est-precio {
    font-size: 1.1rem;
  }
}

/* Fix 2: .contacto-cabecera h2 — 2rem sin override móvil */
@media (max-width: 480px) {
  .contacto-cabecera h2 {
    font-size: 1.35rem;
  }
}

/* Fix 3: .servicio-selector — 2 col demasiado estrecho en 360px */
@media (max-width: 400px) {
  .servicio-selector {
    grid-template-columns: 1fr;
  }
}

/* ============================================================
   AUDITORÍA RESPONSIVIDAD — Samsung Galaxy S (360×740 DPR4)
   17/05/2026
   ============================================================ */

/* Fix A: H1 line-height — ratio 1.10 demasiado ajustado, mínimo 1.3 */
@media (max-width: 768px) {
  .hero-text h1,
  .hero-text h2 {
    line-height: 1.3;
  }
}

/* Fix B: Footer links — área táctil mínima 44px (WCAG 2.5.5) */
@media (max-width: 768px) {
  .footer-col ul li a,
  .footer-col a[href^="tel"] {
    min-height: 44px;
    display: flex;
    align-items: center;
    padding: 6px 0;
  }
  .footer-col ul li {
    margin-bottom: 0;
  }
}

/* Fix C: Galería — 2 columnas en móvil en vez de 1 (reduce altura a la mitad) */
@media (max-width: 540px) {
  .galeria-masonry {
    columns: 2;
    column-gap: 0.5rem;
  }
  .galeria-item {
    margin-bottom: 0.5rem;
  }
}

/* Fix D: Botones de navegación formulario — mínimo 48px táctil */
@media (max-width: 768px) {
  .form-paso-nav .btn-siguiente,
  .form-paso-nav .btn-cta-final,
  .form-paso-nav .btn-anterior {
    min-height: 48px;
    padding-top: 0.75rem;
    padding-bottom: 0.75rem;
  }
}

/* Fix E: Servicio-opcion font-size — de 0.78rem (12.5px) a 14px mínimo */
@media (max-width: 768px) {
  .servicio-opcion {
    font-size: 0.875rem;
  }
}

/* Fix F: Textos por debajo de 14px — elevar al mínimo de legibilidad */
@media (max-width: 768px) {
  .testimonios-total {
    font-size: 0.875rem;
  }
  .quienes-pretitulo {
    font-size: 0.875rem;
  }
  .sector-nombre,
  .sector-card span {
    font-size: 0.875rem;
  }
}

/* Fix G: Quiénes Somos — gap excesivo en móvil (3.5rem → 1.5rem) */
@media (max-width: 768px) {
  .quienes-wrapper {
    gap: 1.5rem;
    margin-bottom: 2rem;
  }
}

/* Fix H: Mapa Leaflet — altura mínima más cómoda en móvil */
@media (max-width: 768px) {
  #mapa,
  .leaflet-container {
    height: 300px !important;
    min-height: 300px;
  }
}

/* Fix I: Overlay semiopaco detrás del menú hamburguesa */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 998;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.nav-overlay.activo {
  display: block;
}

/* Fix J: Testimonios total — también en pantallas muy pequeñas */
@media (max-width: 360px) {
  .testimonio-nombre {
    font-size: 0.82rem;
  }
  .testimonio-fecha {
    font-size: 0.72rem;
  }
}

/* ============================================================
   AUDITORÍA VISUAL MÓVIL — 2ª ronda · Mayo 2026
   Fixes K–S basados en snippet de imágenes + computedStyle
   ============================================================ */

/* Fix K: Services grid — 1 columna + padding card corregido + foto landscape */
@media (max-width: 768px) {
  .services-grid {
    grid-template-columns: 1fr !important;
    gap: 1.25rem;
  }
  .service-card-contenido {
    padding: 1.25rem 1rem 1.5rem;
  }
  .service-foto {
    width: 100%;
    height: 190px;
    object-fit: cover;
    object-position: center;
  }
  /* El H3 del card deja de estar en columna de 43px */
  .service-card-contenido h4 {
    font-size: 1.05rem;
  }
  .service-cta {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
  }
}

/* Fix L: Testimonios cards — forzar 1fr (minmax(240px,1fr) desborda en ~300px contenedor) */
@media (max-width: 768px) {
  .testimonios-cards {
    grid-template-columns: 1fr !important;
    width: 100%;
    min-width: 0;
  }
  .testimonio-card-google {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  .testimonios-panel-izq {
    flex: unset;
    width: 100%;
    box-sizing: border-box;
  }
  /* Número de rating: 2.5rem demasiado grande en panel comprimido */
  .testimonios-numero {
    font-size: 2rem;
  }
}

/* Fix M: Quiénes somos — foto no debe crecer a 400px de alto en móvil */
@media (max-width: 768px) {
  .quienes-foto-wrap {
    flex: 0 0 auto;
    width: 100%;
  }
  .quienes-foto {
    max-height: 220px;
    width: 100%;
    object-fit: cover;
    object-position: center 35%;
  }
  /* Cifras: 4 columnas → 2×2 para que los números sean legibles */
  .quienes-cifras {
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    padding: 1.25rem 1rem;
    margin-bottom: 2rem;
  }
  .cifra-numero {
    font-size: 1.5rem;
  }
  .cifra-label {
    font-size: 0.75rem;
  }
}

/* Fix N: Proceso pasos — columna explícita (flex-wrap no basta en todos los navegadores) */
@media (max-width: 768px) {
  .proceso-pasos {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  .proceso-paso {
    flex: none;
    max-width: 100%;
    padding: 1.25rem 0.5rem;
  }
}

/* Fix O: Footer — 1 columna con mayor especificidad; links con área táctil 44px */
@media (max-width: 768px) {
  .footer-grid {
    grid-template-columns: 1fr !important;
    gap: 1.5rem;
    margin-bottom: 2rem;
  }
  footer a,
  .footer-col a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 4px 0;
  }
}

/* Fix P: Hero — degradé opaco compensa hero-bg.webp pixelado en servidor;
          line-height y gap ajustados para lectura en móvil               */
@media (max-width: 768px) {
  .hero {
    /* Gradiente completamente opaco — la imagen no es fiable en servidor */
    background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
  }
  .hero-bg-img {
    /* Desvanece imagen borrosa: el gradiente oscuro cubre el 80% */
    opacity: 0.18;
  }
  .hero-content {
    gap: 1.5rem;
    padding: 1rem 0;
  }
  .hero h1,
  .hero-text h1,
  .hero-text h2 {
    line-height: 1.35;
    font-size: clamp(1.35rem, 5.5vw, 1.75rem);
  }
}

/* Fix Q: CTA urgente — botones en columna con altura consistente */
@media (max-width: 640px) {
  .cta-urgente-botones {
    flex-direction: column;
    width: 100%;
    gap: 0.75rem;
  }
  .cta-btn-tel,
  .cta-btn-wa {
    width: 100%;
    justify-content: center;
    min-height: 52px;
    padding: 0.85rem 1.5rem;
    box-sizing: border-box;
  }
}

/* Fix R: Galería — 2 columnas en móvil (override del columns:1 anterior) */
@media (max-width: 540px) {
  .galeria-masonry {
    columns: 2 !important;
    column-gap: 0.4rem;
  }
  .galeria-item {
    margin-bottom: 0.4rem;
  }
}

/* Fix S: Contacto — stacking con mayor especificidad que la regla de 900px */
@media (max-width: 768px) {
  .contacto-grid {
    grid-template-columns: 1fr !important;
    gap: 1.25rem;
  }
  .contacto-col-info,
  .contacto-col-form {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  .contacto-col-form {
    padding: 1.25rem 1rem;
  }
  /* Botones de selección de servicio: aumentar tap target */
  .servicio-opcion {
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
  }
  /* Datos de contacto: no se truncan */
  .contacto-dato-item {
    flex-wrap: wrap;
  }
  .contacto-dato-item span,
  .contacto-dato-item a {
    word-break: break-word;
  }
}

/* ============================================================
   AUDITORÍA VISUAL MÓVIL — 3ª ronda · Mayo 2026
   Fixes T–Y: problemas residuales que grid/flex override no resolvía
   Estrategia: display:block en contenedores críticos para cortar
   la cadena de sizing heredada de flex:1 y minmax().
   ============================================================ */

/* Fix T: Testimonios — display:block corta la herencia flex:1 del wrapper */
@media (max-width: 768px) {
  .testimonios-wrapper {
    display: block !important;
  }
  .testimonios-panel-izq {
    width: 100% !important;
    box-sizing: border-box;
    flex: none;
    margin-bottom: 1.5rem;
  }
  .testimonios-cards {
    display: block !important;
    width: 100% !important;
    box-sizing: border-box;
  }
  .testimonio-card-google {
    width: 100% !important;
    box-sizing: border-box;
    margin-bottom: 1rem;
    display: flex;        /* mantener layout interno de la card */
    flex-direction: column;
  }
}

/* Fix U: Contacto — display:block garantiza stacking sin depender de grid */
@media (max-width: 768px) {
  .contacto-grid {
    display: block !important;
  }
  .contacto-col-info,
  .contacto-col-form {
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }
  .contacto-col-info { margin-bottom: 1.5rem; }
  .contacto-col-form { padding: 1.25rem 1rem !important; }

  /* Formulario y descendientes: ninguno puede desbordarse */
  #formularioContacto,
  .form-progreso,
  .form-paso,
  .servicio-selector,
  .ruta-campos,
  .grupo-formulario,
  .form-paso-nav {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }
}

/* Fix V: service-card-contenido — !important sobre la regla base de desktop */
@media (max-width: 768px) {
  .service-card-contenido {
    padding: 1.25rem 1rem 1.5rem !important;
  }
  .service-cta {
    width: 100%;
    box-sizing: border-box;
  }
}

/* Fix W: quienes-foto — height fijo landscape en vez de max-height portrait */
@media (max-width: 768px) {
  .quienes-foto {
    height: 200px !important;
    max-height: 200px !important;
    width: 100%;
    object-fit: cover;
    object-position: center 40%;
  }
  /* Cifras: igualar columnas explícitamente */
  .quienes-cifras {
    grid-template-columns: 1fr 1fr !important;
  }
  .cifra-label {
    font-size: 0.875rem !important;   /* ≥14px */
  }
}

/* Fix X: Tap targets y fuentes por debajo del mínimo */
@media (max-width: 768px) {
  /* Botón Siguiente: aún 38px → mínimo 48px */
  .btn-siguiente {
    min-height: 48px !important;
    padding-top: 0.75rem !important;
    padding-bottom: 0.75rem !important;
  }
  /* Botón Reseña: 43px → mínimo 44px */
  .btn-resena {
    min-height: 44px !important;
    display: inline-flex !important;
    align-items: center;
    padding: 0.5rem 1.1rem;
  }
  /* Proceso — texto descriptivo por debajo de 14px */
  .proceso-paso p {
    font-size: 0.875rem;
  }
  /* Subtítulo hero: desproporcionado respecto al H1 */
  .hero-text p,
  .hero p {
    font-size: 1rem;
  }
}

/* Fix Y: CTA urgente — altura igual en ambos botones */
@media (max-width: 640px) {
  .cta-btn-tel,
  .cta-btn-wa {
    min-height: 52px !important;
    height: auto;
    padding: 0.875rem 1.5rem;
    box-sizing: border-box;
  }
}

/* ============================================================
   AUDITORÍA VISUAL MÓVIL — 4ª ronda · Mayo 2026
   Fix Z1: Hero deja de ser 100svh en móvil (el usuario veía
            solo botones sin heading porque el hero ocupaba
            740px y el contenido quedaba centrado a mitad).
   Fix Z2: Leaflet popup — desborda 74px en viewports estrechos.
   ============================================================ */

/* Fix Z1: Hero — altura automática en móvil para mostrar contenido + siguiente sección */
@media (max-width: 768px) {
  .hero {
    height: auto !important;      /* cancela height:100svh del base */
    min-height: 85svh;            /* al menos 85% de pantalla */
    min-height: 85vh;             /* fallback para Safari < 15.4 */
    /* padding-top cubre el header fijo (--header-height: 70px en móvil) */
    padding-top: max(5rem, calc(var(--header-height, 70px) + 1.5rem)) !important;
    padding-bottom: 2.5rem;
    display: flex;
    align-items: flex-start;      /* contenido desde arriba (bajo el header) en vez de centrado */
    justify-content: center;
  }
  .hero-content {
    padding-top: 0;
    align-self: center;
  }
}

/* Fix Z2: Leaflet popup — max-width relativo al viewport en cualquier pantalla */
@media (max-width: 768px) {
  .leaflet-popup {
    max-width: calc(100vw - 2.5rem) !important;
  }
  .leaflet-popup-content-wrapper {
    max-width: 100% !important;
    box-sizing: border-box;
  }
  .leaflet-popup-content {
    max-width: 100% !important;
    margin: 0.75rem 1rem !important;
    word-break: break-word;
  }
}
