/*
 * ============================================================
 *  SERVCONTEC — main.css
 *  Sitio web principal · servcontec.com
 *
 *  Estructura:
 *    1. Reset & Variables
 *    2. Tipografía base
 *    3. Utilidades globales
 *    4. Componentes (label, botones)
 *    5. Nav
 *    6. Hero
 *    7. Marquee
 *    8. Servicios
 *    9. Proceso
 *   10. Tech Stack
 *   11. Por qué elegirnos
 *   12. CTA
 *   13. Footer
 *   14. Responsive
 *   15. Chat Widget
 * ============================================================
 */


/* ============================================================
   1. RESET & VARIABLES
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* ── Paleta de marca (extraída del logo isométrico) ── */
  --navy:       #1B2E50;   /* cara top-izq del cubo  */
  --navy-dark:  #0f1d33;   /* fondos oscuros          */
  --navy-mid:   #243a60;   /* hover estados navy      */
  --green:      #2D5230;   /* cara top-der del cubo   */
  --slate:      #607D8B;   /* cara izquierda del cubo */
  --sky:        #55C5E5;   /* cara frontal — acento   */
  --sky-dark:   #3aafd4;   /* sky hover / darker      */
  --sky-light:  rgba(85, 197, 229, 0.12);

  /* ── Tema claro (secciones interiores) ── */
  --white:      #ffffff;
  --gray-50:    #f7f9fc;
  --gray-100:   #eef1f6;
  --gray-200:   #dde3ed;
  --gray-400:   #8fa3b8;
  --gray-600:   #4a6278;
  --text-dark:  #0f1d33;
  --text-body:  #3d5166;
  --text-muted: #7a94a8;

  /* ── Espaciado & efectos ── */
  --radius:     10px;
  --radius-lg:  18px;
  --shadow-sm:  0 1px 3px rgba(15, 29, 51, .07), 0 1px 2px rgba(15, 29, 51, .05);
  --shadow-md:  0 4px 16px rgba(15, 29, 51, .1),  0 2px 6px rgba(15, 29, 51, .06);
  --shadow-lg:  0 12px 40px rgba(15, 29, 51, .14);

  /* ── Tipografía ── */
  /* SF Pro en Apple → Inter como fallback web en el resto */
  --font-sans:    -apple-system, BlinkMacSystemFont, 'SF Pro Text',
                  'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, 'SF Pro Display',
                  'Inter', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono:    'Space Mono', 'SF Mono', 'Fira Code', monospace;
}


/* ============================================================
   2. TIPOGRAFÍA BASE
   ============================================================ */

html { scroll-behavior: smooth; }

body {
  background: var(--white);
  color: var(--text-dark);
  font-family: var(--font-sans);
  line-height: 1.6;
  overflow-x: hidden;
  /* Suavizado de fuente estilo Apple */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  color: var(--text-dark);
  letter-spacing: -.018em;
}

h1 { font-size: clamp(2.6rem, 5.5vw, 5rem);  font-weight: 800; letter-spacing: -.03em; }
h2 { font-size: clamp(1.9rem, 3.5vw, 2.9rem); letter-spacing: -.025em; }
h3 { font-size: 1.1rem;  letter-spacing: -.01em; }

p { color: var(--text-body); line-height: 1.75; }
a { text-decoration: none; color: inherit; }


/* ============================================================
   3. UTILIDADES GLOBALES
   ============================================================ */

.container   { max-width: 1160px; margin: 0 auto; padding: 0 28px; }
.section     { padding: 96px 0; }
.section-alt { background: var(--gray-50); }

.section-header          { margin-bottom: 56px; }
.section-header.centered {
  text-align: center;
  max-width: 580px;
  margin-left: auto;
  margin-right: auto;
}
.section-header h2 { margin-bottom: 14px; letter-spacing: -.02em; }
.section-header p  { font-size: 1.05rem; }


/* ============================================================
   4. COMPONENTES — Label pill y Botones
   ============================================================ */

/* ── Label pill ── */
.label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--sky-dark);
  background: var(--sky-light);
  border: 1px solid rgba(85, 197, 229, 0.3);
  padding: 5px 13px;
  border-radius: 100px;
  margin-bottom: 18px;
}

.label::before {
  content: '';
  width: 5px;
  height: 5px;
  background: var(--sky);
  border-radius: 50%;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: .4; transform: scale(.7); }
}

/* ── Botones base ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 8px;
  font-size: .92rem;
  font-weight: 600;
  font-family: var(--font-sans);
  cursor: pointer;
  transition: all .2s ease;
  border: none;
}

/* Variantes */
.btn-primary {
  background: var(--sky);
  color: #fff;
}
.btn-primary:hover {
  background: var(--sky-dark);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(85, 197, 229, .4);
}

.btn-white {
  background: white;
  color: var(--navy);
}
.btn-white:hover {
  background: var(--gray-50);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
}

.btn-outline-white {
  background: transparent;
  color: white;
  border: 1.5px solid rgba(255, 255, 255, .35);
}
.btn-outline-white:hover {
  border-color: white;
  background: rgba(255, 255, 255, .1);
  transform: translateY(-2px);
}

.btn-outline {
  background: transparent;
  color: var(--navy);
  border: 1.5px solid var(--gray-200);
}
.btn-outline:hover {
  border-color: var(--sky);
  color: var(--sky-dark);
  transform: translateY(-2px);
}


/* ============================================================
   5. NAV — transparente sobre hero, blanca al hacer scroll
   ============================================================ */

/* Selector explícito al navbar — evita conflictos con nav del footer */
nav#navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 22px 0;
  transition: all .35s ease;
}

nav#navbar.scrolled {
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(16px);
  padding: 14px 0;
  box-shadow: 0 1px 0 rgba(0, 0, 0, .08);
}

/* Cambios de color al hacer scroll (sobre fondo blanco) */
nav#navbar.scrolled .nav-links a        { color: var(--text-muted); }
nav#navbar.scrolled .nav-links a:hover  { color: var(--navy); }
nav#navbar.scrolled .logo-text          { color: var(--navy); }
nav#navbar.scrolled .logo-text span     { color: var(--sky-dark); }
nav#navbar.scrolled .btn-outline-nav    { color: var(--navy); border-color: var(--gray-200); }
nav#navbar.scrolled .btn-outline-nav:hover { border-color: var(--sky); color: var(--sky-dark); }

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Logo */
.logo       { display: flex; align-items: center; gap: 10px; }
.logo-icon  {
  width: 38px; height: 38px; flex-shrink: 0;
}
.logo-text  {
  font-size: 1.05rem; font-weight: 800;
  letter-spacing: .04em; color: white;
  transition: color .35s;
}
.logo-text span { color: var(--sky); transition: color .35s; }

/* Links */
.nav-links { display: flex; align-items: center; gap: 28px; list-style: none; }
.nav-links a {
  font-size: .875rem;
  color: rgba(255, 255, 255, .72);
  font-weight: 500;
  transition: color .2s;
}
.nav-links a:hover { color: white; }

/* Botones nav */
.nav-cta { display: flex; align-items: center; gap: 10px; }
.btn-outline-nav {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 20px; border-radius: 7px;
  font-size: .875rem; font-weight: 600;
  color: white; border: 1.5px solid rgba(255, 255, 255, .3);
  background: transparent; cursor: pointer;
  transition: all .2s; font-family: var(--font-sans);
}
.btn-outline-nav:hover { border-color: white; background: rgba(255, 255, 255, .1); }


/* ============================================================
   6. HERO — dark navy
   ============================================================ */

.hero {
  min-height: 100vh;
  background: var(--navy-dark);
  display: flex; align-items: center;
  position: relative; overflow: hidden;
  padding-top: 90px;
}

/* Gradientes de fondo */
.hero-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 75% 60% at 55% 40%, rgba(27,  46, 80, .9) 0%, transparent 65%),
    radial-gradient(ellipse 50% 45% at 90% 90%, rgba(45,  82, 48, .2) 0%, transparent 55%),
    radial-gradient(ellipse 40% 35% at  0% 60%, rgba(85, 197,229, .05) 0%, transparent 50%);
}

/* Grid de puntos decorativo */
.hero-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 52px 52px;
  mask-image: radial-gradient(ellipse 90% 80% at 50% 50%, black 10%, transparent 80%);
}

/* Blob animado (luz ambiental derecha) */
.hero-blob {
  position: absolute;
  width: 600px; height: 600px;
  right: -100px; top: 50%;
  transform: translateY(-50%);
  background: radial-gradient(circle, rgba(85,197,229,.07) 0%, transparent 65%);
  border-radius: 50%;
  animation: blobFloat 8s ease-in-out infinite;
  pointer-events: none;
}
@keyframes blobFloat {
  0%, 100% { transform: translateY(-50%) scale(1); }
  50%       { transform: translateY(-54%) scale(1.06); }
}

.hero-content { position: relative; z-index: 2; max-width: 780px; }
.hero-eyebrow { margin-bottom: 26px; }

/* Override de label para fondo oscuro */
.hero-eyebrow .label {
  color: var(--sky);
  background: rgba(85, 197, 229, .1);
  border-color: rgba(85, 197, 229, .25);
}

.hero h1 { color: white; margin-bottom: 24px; letter-spacing: -.02em; }
.hero h1 .hl {
  background: linear-gradient(120deg, var(--sky) 0%, #a8e6f5 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-desc {
  font-size: 1.12rem; color: rgba(255,255,255,.62);
  max-width: 520px; margin-bottom: 38px; line-height: 1.75;
}
.hero-desc strong { color: rgba(255,255,255,.9); font-weight: 600; }

.hero-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }

.hero-stats {
  display: flex; gap: 40px;
  margin-top: 64px; padding-top: 40px;
  border-top: 1px solid rgba(255,255,255,.1);
  flex-wrap: wrap;
}
.stat-number {
  font-size: 2rem; font-weight: 800;
  font-family: var(--font-mono); color: white;
}
.stat-number span { color: var(--sky); }
.stat-label { font-size: .8rem; color: rgba(255,255,255,.45); margin-top: 3px; }


/* ============================================================
   7. MARQUEE — banda de herramientas
   ============================================================ */

.marquee-section {
  padding: 0;
  border-bottom: 1px solid var(--gray-100);
  overflow: hidden;
  background: white;
}
.marquee-inner   { padding: 28px 0 24px; }
.marquee-label   {
  text-align: center; font-size: .72rem;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 20px;
}
.marquee-track {
  display: flex; gap: 12px;
  animation: marquee 30s linear infinite;
  width: max-content;
}
.marquee-track:hover { animation-play-state: paused; }

@keyframes marquee {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

.tool-badge {
  display: flex; align-items: center; gap: 8px;
  white-space: nowrap; padding: 8px 16px;
  border: 1px solid var(--gray-200); border-radius: 100px;
  font-size: .84rem; font-weight: 500; color: var(--text-body);
  background: white; transition: all .2s; cursor: default;
  box-shadow: var(--shadow-sm);
}
.tool-badge:hover { border-color: var(--sky); color: var(--navy); box-shadow: var(--shadow-md); }
.tool-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }


/* ============================================================
   8. SERVICIOS — white bg
   ============================================================ */

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.service-card {
  background: white;
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-lg);
  padding: 36px 30px;
  transition: all .25s;
  position: relative; overflow: hidden;
  box-shadow: var(--shadow-sm);
}

/* Borde inferior degradado al hover */
.service-card::after {
  content: ''; position: absolute;
  bottom: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--sky), var(--navy));
  opacity: 0; transition: opacity .3s;
}
.service-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: var(--gray-200);
}
.service-card:hover::after { opacity: 1; }

.service-icon {
  width: 50px; height: 50px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 22px; font-size: 1.35rem;
  background: var(--gray-50); border: 1px solid var(--gray-100);
}
.service-card h3 { margin-bottom: 10px; color: var(--navy); }
.service-card p  { font-size: .88rem; line-height: 1.7; }

.service-link {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .82rem; font-weight: 600; color: var(--sky-dark);
  margin-top: 18px;
  opacity: 0; transform: translateX(-4px); transition: all .2s;
}
.service-card:hover .service-link { opacity: 1; transform: translateX(0); }


/* ============================================================
   9. PROCESO — gray-50 bg
   ============================================================ */

.process-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  position: relative;
}

/* Línea conectora decorativa */
.process-grid::before {
  content: ''; position: absolute;
  top: 28px;
  left: calc(12.5% + 16px); right: calc(12.5% + 16px);
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--sky), var(--navy), transparent);
  opacity: .3;
}

.process-step { text-align: center; padding: 0 20px; }

.step-number {
  width: 56px; height: 56px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 24px;
  font-family: var(--font-mono); font-size: .95rem; font-weight: 700;
  color: white; background: var(--navy);
  position: relative; z-index: 1;
  box-shadow: 0 4px 14px rgba(27, 46, 80, .25);
}
.process-step h3 { margin-bottom: 10px; font-size: .98rem; color: var(--navy); }
.process-step p  { font-size: .85rem; }


/* ============================================================
  10. TECH STACK — white bg
   ============================================================ */

.stack-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.stack-card {
  background: white;
  border: 1px solid var(--gray-100);
  border-radius: var(--radius);
  padding: 28px 20px;
  display: flex; flex-direction: column; align-items: center;
  gap: 10px; text-align: center;
  transition: all .22s; cursor: default;
  box-shadow: var(--shadow-sm);
}
.stack-card:hover {
  border-color: var(--sky);
  transform: translateY(-5px);
  box-shadow: 0 10px 28px rgba(85, 197, 229, .15);
}

.stack-logo {
  width: 50px; height: 50px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  font-size: .88rem; font-weight: 700;
  font-family: var(--font-mono);
}
.stack-card h4 { font-size: .9rem;  font-weight: 700; color: var(--navy); }
.stack-card p  { font-size: .76rem; color: var(--text-muted); }


/* ============================================================
  11. POR QUÉ ELEGIRNOS — gray-50 bg
   ============================================================ */

.why-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 72px; align-items: center;
}

/* Panel de métricas */
.why-visual {
  background: white;
  border: 1px solid var(--gray-100);
  border-radius: var(--radius-lg);
  padding: 36px 32px;
  box-shadow: var(--shadow-md);
}
.why-visual-label {
  font-size: .7rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 22px;
}
.why-visual-inner { display: flex; flex-direction: column; gap: 14px; }

.metric-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 13px 16px;
  background: var(--gray-50); border: 1px solid var(--gray-100); border-radius: 8px;
  transition: all .2s;
}
.metric-row:hover { border-color: var(--sky); background: white; }
.metric-label { font-size: .84rem; color: var(--text-body); }
.metric-value { font-family: var(--font-mono); font-size: .92rem; font-weight: 700; color: var(--navy); }
.metric-bar   { width: 100%; height: 3px; background: var(--gray-100); border-radius: 2px; margin-top: 6px; }
.metric-fill  { height: 100%; border-radius: 2px; background: linear-gradient(90deg, var(--sky), var(--navy)); }

/* Puntos de valor */
.why-points { display: flex; flex-direction: column; gap: 26px; }
.why-point  { display: flex; gap: 16px; }
.why-point-icon {
  width: 44px; height: 44px; flex-shrink: 0;
  background: var(--sky-light); border: 1px solid rgba(85,197,229,.25);
  border-radius: 10px; display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem;
}
.why-point h4 { font-size: .98rem; margin-bottom: 5px; color: var(--navy); }
.why-point p  { font-size: .86rem; }


/* ============================================================
  12. CTA — dark navy (mismo tono que hero)
   ============================================================ */

.cta-section {
  background: var(--navy-dark);
  position: relative; overflow: hidden;
}
.cta-section::before {
  content: ''; position: absolute; inset: 0;
  background:
    radial-gradient(ellipse 60% 70% at 50% 50%, rgba(85,197,229,.06) 0%, transparent 65%),
    radial-gradient(ellipse 40% 40% at 85% 85%, rgba(45, 82, 48,.15) 0%, transparent 50%);
}
.cta-grid {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1fr auto;
  gap: 48px; align-items: center;
}
.cta-text h2 { color: white; letter-spacing: -.02em; margin-bottom: 12px; }
.cta-text p  { color: rgba(255,255,255,.55); font-size: 1.05rem; }
.cta-actions { display: flex; flex-direction: column; gap: 12px; align-items: flex-end; }


/* ============================================================
  13. FOOTER — navy oscuro
   ============================================================ */

footer {
  background: var(--navy-dark);
  border-top: 1px solid rgba(255,255,255,.07);
  padding: 64px 0 30px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 44px; margin-bottom: 44px;
}
.footer-brand .logo-text { color: white; }
.footer-brand p {
  font-size: .875rem; margin-top: 14px;
  max-width: 260px; color: rgba(255,255,255,.45); line-height: 1.7;
}
.footer-col h5 {
  font-size: .7rem; letter-spacing: .12em; text-transform: uppercase;
  color: rgba(255,255,255,.3); margin-bottom: 18px;
}
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 10px; }
.footer-col ul li a { font-size: .875rem; color: rgba(255,255,255,.5); transition: color .2s; }
.footer-col ul li a:hover { color: var(--sky); }
.footer-bottom {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 28px; border-top: 1px solid rgba(255,255,255,.07);
  font-size: .8rem; color: rgba(255,255,255,.25);
}
.footer-mono { font-family: var(--font-mono); font-size: .72rem; }


/* ============================================================
  14. RESPONSIVE
   ============================================================ */

/* Tablet */
@media (max-width: 960px) {
  .services-grid { grid-template-columns: 1fr 1fr; }
  .stack-grid    { grid-template-columns: repeat(2, 1fr); }
  .why-grid      { grid-template-columns: 1fr; gap: 40px; }
  .why-visual    { display: none; }   /* se oculta en mobile, content es suficiente */
  .footer-grid   { grid-template-columns: 1fr 1fr; }
  .cta-grid      { grid-template-columns: 1fr; }
  .cta-actions   { align-items: flex-start; flex-direction: row; flex-wrap: wrap; }
}

/* Mobile */
@media (max-width: 640px) {
  .nav-links, .btn-outline-nav { display: none; }
  .services-grid { grid-template-columns: 1fr; }
  .process-grid  { grid-template-columns: 1fr 1fr; gap: 32px; }
  .process-grid::before { display: none; }
  .footer-grid   { grid-template-columns: 1fr; gap: 32px; }
  .hero-stats    { gap: 24px; }
  .footer-bottom { flex-direction: column; gap: 8px; text-align: center; }
}


/* ============================================================
   15. CHAT WIDGET
   ============================================================ */

/* ── Contenedor raíz ── */
#sc-chat {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  font-family: var(--font-sans);
}

/* ── Botón flotante ── */
#sc-btn {
  position: relative;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: none;
  background: var(--sky);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(85, 197, 229, .45);
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

#sc-btn:hover {
  transform: scale(1.08);
  box-shadow: 0 6px 28px rgba(85, 197, 229, .6);
}

#sc-btn.sc-active {
  background: var(--navy);
  box-shadow: 0 4px 20px rgba(15, 29, 51, .4);
}

/* Pulse ring — desaparece al abrir */
.sc-pulse {
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 2px solid var(--sky);
  opacity: .6;
  animation: sc-pulse 2.2s ease-out infinite;
  pointer-events: none;
}

#sc-btn.sc-active .sc-pulse { display: none; }

@keyframes sc-pulse {
  0%   { transform: scale(1);    opacity: .6; }
  70%  { transform: scale(1.45); opacity: 0;  }
  100% { transform: scale(1.45); opacity: 0;  }
}

/* ── Panel de chat ── */
#sc-panel {
  position: absolute;
  bottom: calc(100% + 12px);
  right: 0;
  width: 360px;
  height: 480px;
  background: var(--white);
  border-radius: 16px;
  box-shadow: 0 12px 48px rgba(15, 29, 51, .18), 0 2px 8px rgba(15, 29, 51, .08);
  display: flex;
  flex-direction: column;
  overflow: hidden;

  /* Estado cerrado */
  opacity: 0;
  transform: translateY(12px) scale(.97);
  pointer-events: none;
  transition: opacity .25s ease, transform .25s ease;
}

#sc-panel.sc-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: all;
}

/* ── Header del panel ── */
.sc-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  background: var(--navy-dark);
  flex-shrink: 0;
}

.sc-header-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--navy-mid);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1.5px solid rgba(85, 197, 229, .3);
}

.sc-header-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sc-agent-name {
  font-size: .875rem;
  font-weight: 600;
  color: var(--white);
  letter-spacing: -.01em;
}

.sc-agent-status {
  font-size: .75rem;
  color: rgba(255, 255, 255, .6);
  display: flex;
  align-items: center;
  gap: 5px;
}

.sc-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
  animation: sc-status-blink 2.5s ease-in-out infinite;
}

@keyframes sc-status-blink {
  0%, 100% { opacity: 1;   }
  50%       { opacity: .45; }
}

.sc-close-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: .7;
  transition: opacity .15s;
}

.sc-close-btn:hover { opacity: 1; }

/* ── Área de mensajes ── */
.sc-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scroll-behavior: smooth;
}

.sc-messages::-webkit-scrollbar { width: 4px; }
.sc-messages::-webkit-scrollbar-track { background: transparent; }
.sc-messages::-webkit-scrollbar-thumb { background: var(--gray-200); border-radius: 2px; }

/* ── Burbujas ── */
.sc-msg {
  display: flex;
  max-width: 86%;
}

.sc-msg--bot  { align-self: flex-start; }
.sc-msg--user { align-self: flex-end; }

.sc-bubble {
  padding: 10px 14px;
  border-radius: 14px;
  font-size: .875rem;
  line-height: 1.5;
}

.sc-msg--bot .sc-bubble {
  background: var(--gray-50);
  color: var(--text-dark);
  border-bottom-left-radius: 4px;
  border: 1px solid var(--gray-100);
}

.sc-msg--user .sc-bubble {
  background: var(--navy);
  color: var(--white);
  border-bottom-right-radius: 4px;
}

/* ── Indicador de escritura (3 puntos) ── */
.sc-typing-bubble {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 12px 16px;
}

.sc-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--slate);
  animation: sc-bounce .9s ease-in-out infinite;
}

.sc-dot:nth-child(2) { animation-delay: .15s; }
.sc-dot:nth-child(3) { animation-delay: .3s;  }

@keyframes sc-bounce {
  0%, 60%, 100% { transform: translateY(0);    opacity: .4; }
  30%            { transform: translateY(-5px); opacity: 1;  }
}

/* ── Área de input ── */
.sc-input-area {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  border-top: 1px solid var(--gray-100);
  background: var(--white);
  flex-shrink: 0;
}

#sc-input {
  flex: 1;
  border: 1.5px solid var(--gray-200);
  border-radius: 24px;
  padding: 10px 16px;
  font-family: var(--font-sans);
  font-size: .875rem;
  color: var(--text-dark);
  outline: none;
  background: var(--gray-50);
  transition: border-color .2s, background .2s;
}

#sc-input:focus {
  border-color: var(--sky);
  background: var(--white);
}

#sc-input:disabled { opacity: .6; cursor: not-allowed; }

#sc-input::placeholder { color: var(--text-muted); }

#sc-send {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: var(--sky);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .2s, transform .15s;
}

#sc-send:hover   { background: var(--sky-dark); transform: scale(1.08); }
#sc-send:active  { transform: scale(.95); }
#sc-send:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ── Responsive mobile ── */
@media (max-width: 480px) {
  #sc-chat { bottom: 16px; right: 16px; }

  #sc-panel {
    position: fixed;
    bottom: 84px;
    right: 16px;
    left: 16px;
    width: auto;
    height: 420px;
    border-radius: 16px;
  }
}
