/* ==========================================================================
   SYNAPSE ADS - SISTEMA DE DISEÑO Y ESTILOS GLOBALES
   Agencia de Publicidad con Inteligencia Artificial
   ========================================================================== */

/* --- Variables y Tokens de Diseño --- */
:root {
  /* Paleta Corporativa Principal */
  --bg-primary: #080C17;
  --bg-secondary: #0F172A;
  --bg-tertiary: #172036;
  --bg-surface: #1E293B;
  --bg-surface-hover: #27354F;
  --bg-glass: rgba(15, 23, 42, 0.82);
  --bg-glass-card: rgba(23, 32, 54, 0.7);

  /* Acentos de Marca */
  --brand-indigo: #6366F1;
  --brand-indigo-light: #818CF8;
  --brand-indigo-glow: rgba(99, 102, 241, 0.25);
  
  --brand-cyan: #06B6D4;
  --brand-cyan-light: #22D3EE;
  --brand-cyan-glow: rgba(6, 182, 212, 0.2);

  --brand-emerald: #10B981;
  --brand-emerald-light: #34D399;
  --brand-emerald-glow: rgba(16, 185, 129, 0.2);

  --brand-amber: #F59E0B;
  --brand-rose: #F43F5E;

  /* Gradientes */
  --grad-primary: linear-gradient(135deg, #6366F1 0%, #06B6D4 100%);
  --grad-accent: linear-gradient(135deg, #4F46E5 0%, #0EA5E9 100%);
  --grad-surface: linear-gradient(180deg, rgba(23, 32, 54, 0.8) 0%, rgba(15, 23, 42, 0.95) 100%);
  --grad-hero-glow: radial-gradient(circle at 50% 20%, rgba(99, 102, 241, 0.18) 0%, rgba(6, 182, 212, 0.08) 35%, transparent 70%);
  --grad-card-glow: radial-gradient(circle at top left, rgba(99, 102, 241, 0.12), transparent 60%);

  /* Tipografía y Textos */
  --font-heading: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  --text-primary: #F8FAFC;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --text-inverse: #0A0F1D;

  /* Bordes y Sombras */
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-medium: rgba(255, 255, 255, 0.15);
  --border-accent: rgba(99, 102, 241, 0.4);
  --border-cyan: rgba(6, 182, 212, 0.4);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 24px -4px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 16px 40px -8px rgba(0, 0, 0, 0.6);
  --shadow-glow-indigo: 0 0 35px rgba(99, 102, 241, 0.35);
  --shadow-glow-cyan: 0 0 35px rgba(6, 182, 212, 0.3);
  --shadow-glow-emerald: 0 0 30px rgba(16, 185, 129, 0.3);

  /* Dimensiones y Espaciados */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --container-max: 1240px;
  --container-narrow: 960px;
  --header-height: 80px;
  --transition-fast: 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Reseteo y Base --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  color-scheme: dark;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
}

/* Background Atmosphere */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-image: var(--grad-hero-glow);
  pointer-events: none;
  z-index: -1;
}

/* Tipografía */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.025em;
}

h1 {
  font-size: clamp(2.4rem, 5vw + 1rem, 3.8rem);
  font-weight: 800;
  letter-spacing: -0.035em;
}

h2 {
  font-size: clamp(1.8rem, 3.5vw + 0.5rem, 2.6rem);
  letter-spacing: -0.03em;
}

h3 {
  font-size: clamp(1.25rem, 2vw + 0.5rem, 1.6rem);
}

h4 {
  font-size: 1.15rem;
}

p {
  color: var(--text-secondary);
  font-size: 1.05rem;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

img, svg, video {
  display: block;
  max-width: 100%;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  border: none;
  outline: none;
  background: none;
}

/* Enfoque Accesible */
:focus-visible {
  outline: 2px solid var(--brand-cyan);
  outline-offset: 3px;
}

/* Layout Utilities */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

.container-narrow {
  max-width: var(--container-narrow);
}

.section {
  padding: 5.5rem 0;
  position: relative;
}

.section-sm {
  padding: 3.5rem 0;
}

.section-title-wrap {
  text-align: center;
  max-width: 760px;
  margin: 0 auto 3.5rem auto;
}

.section-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.9rem;
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-full);
  color: var(--brand-cyan-light);
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}

.section-title {
  margin-bottom: 1rem;
}

.section-subtitle {
  font-size: 1.15rem;
  color: var(--text-secondary);
}

/* --- Botones y CTAs --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 0.85rem 1.65rem;
  font-family: var(--font-heading);
  font-size: 0.975rem;
  font-weight: 600;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-smooth);
  text-align: center;
  position: relative;
  white-space: nowrap;
}

.btn-primary {
  background: var(--grad-primary);
  color: #FFFFFF;
  box-shadow: var(--shadow-sm), var(--shadow-glow-indigo);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md), 0 0 30px rgba(99, 102, 241, 0.6);
  filter: brightness(1.08);
}

.btn-secondary {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border-medium);
  box-shadow: var(--shadow-sm);
}

.btn-secondary:hover {
  background: var(--bg-surface-hover);
  border-color: var(--brand-indigo-light);
  transform: translateY(-2px);
  color: #FFFFFF;
}

.btn-emerald {
  background: var(--brand-emerald);
  color: #06231A;
  font-weight: 700;
  box-shadow: var(--shadow-sm), var(--shadow-glow-emerald);
}

.btn-emerald:hover {
  background: var(--brand-emerald-light);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md), 0 0 25px rgba(16, 185, 129, 0.5);
}

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

.btn-outline:hover {
  border-color: var(--brand-cyan);
  color: var(--brand-cyan-light);
  background: rgba(6, 182, 212, 0.06);
}

.btn-sm {
  padding: 0.55rem 1.1rem;
  font-size: 0.875rem;
}

.btn-lg {
  padding: 1.05rem 2.2rem;
  font-size: 1.1rem;
}

.btn-full {
  width: 100%;
}

/* Iconos de botón */
.btn-icon {
  width: 1.2rem;
  height: 1.2rem;
  flex-shrink: 0;
  transition: transform var(--transition-fast);
}

.btn:hover .btn-icon-right {
  transform: translateX(4px);
}

/* --- Header y Barra de Navegación --- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  z-index: 1000;
  transition: background-color var(--transition-smooth), border-color var(--transition-smooth), backdrop-filter var(--transition-smooth);
  background: rgba(8, 12, 23, 0.7);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
}

.site-header.scrolled {
  background: rgba(8, 12, 23, 0.95);
  border-bottom-color: var(--border-medium);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.brand-logo-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--grad-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
}

.brand-logo-icon svg {
  width: 22px;
  height: 22px;
  color: #FFF;
}

.brand-logo span {
  background: linear-gradient(90deg, #FFFFFF 0%, #22D3EE 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-tag-badge {
  font-size: 0.65rem;
  padding: 0.15rem 0.45rem;
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid var(--border-cyan);
  border-radius: var(--radius-full);
  color: var(--brand-cyan-light);
  font-weight: 700;
  letter-spacing: 0.05em;
  margin-left: 0.25rem;
  -webkit-text-fill-color: var(--brand-cyan-light);
}

.nav-menu {
  display: flex;
  align-items: center;
  list-style: none;
  gap: 1.75rem;
}

.nav-link {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 0.5rem 0.25rem;
  position: relative;
  transition: color var(--transition-fast);
}

.nav-link:hover, .nav-link.active {
  color: #FFFFFF;
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--brand-cyan);
  border-radius: var(--radius-full);
  box-shadow: 0 0 8px var(--brand-cyan);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all var(--transition-fast);
}

.nav-toggle.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle.active span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Drawer Móvil */
.mobile-nav-drawer {
  position: fixed;
  top: var(--header-height);
  left: 0;
  width: 100%;
  height: calc(100vh - var(--header-height));
  background: var(--bg-primary);
  border-top: 1px solid var(--border-subtle);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transform: translateX(100%);
  transition: transform var(--transition-smooth);
  z-index: 999;
  overflow-y: auto;
}

.mobile-nav-drawer.open {
  transform: translateX(0);
}

.mobile-nav-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.mobile-nav-links a {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.mobile-nav-links a.active, .mobile-nav-links a:hover {
  color: #FFFFFF;
}

/* --- Hero Section --- */
.hero-section {
  padding-top: calc(var(--header-height) + 3.5rem);
  padding-bottom: 5rem;
  position: relative;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 3.5rem;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.4rem 1rem;
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: var(--radius-full);
  color: var(--brand-emerald-light);
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
}

.hero-badge-dot {
  width: 8px;
  height: 8px;
  background: var(--brand-emerald);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--brand-emerald);
  animation: pulse-glow 2s infinite;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(1.3); }
}

.hero-title {
  margin-bottom: 1.5rem;
  font-weight: 800;
}

.hero-title .highlight-text {
  background: linear-gradient(135deg, #818CF8 0%, #22D3EE 60%, #34D399 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-description {
  font-size: 1.2rem;
  line-height: 1.6;
  margin-bottom: 2.25rem;
  color: #CBD5E1;
}

.hero-cta-group {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2.5rem;
}

.hero-trust-points {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.trust-item svg {
  color: var(--brand-cyan);
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* Hero Visual / Demo Preview Card */
.hero-visual-card {
  position: relative;
  background: var(--grad-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl);
  padding: 1.5rem;
  box-shadow: var(--shadow-lg), var(--shadow-glow-indigo);
  overflow: hidden;
}

.hero-visual-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--grad-primary);
}

.hero-demo-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-subtle);
}

.demo-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(99, 102, 241, 0.2);
  border: 1px solid var(--border-accent);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--brand-indigo-light);
  text-transform: uppercase;
}

.hero-demo-player {
  position: relative;
  aspect-ratio: 9/12;
  background: #050811;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.5rem;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.8);
}

.hero-demo-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.75;
  filter: brightness(0.9);
  transition: transform 0.6s ease;
}

.hero-demo-player:hover .hero-demo-bg {
  transform: scale(1.03);
}

.hero-demo-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(5, 8, 17, 0.95) 0%, rgba(5, 8, 17, 0.3) 50%, rgba(5, 8, 17, 0.6) 100%);
  pointer-events: none;
}

.hero-demo-content {
  position: relative;
  z-index: 2;
}

.hero-prompt-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border-cyan);
  padding: 0.35rem 0.8rem;
  border-radius: var(--radius-md);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--brand-cyan-light);
  margin-bottom: 0.75rem;
}

.hero-demo-title {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  color: #FFFFFF;
}

.hero-demo-metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-top: 1rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.metric-box {
  background: rgba(255, 255, 255, 0.04);
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  text-align: center;
}

.metric-val {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--brand-emerald-light);
}

.metric-lbl {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.play-button-floating {
  position: absolute;
  top: 45%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--brand-indigo);
  color: #FFF;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 0 30px rgba(99, 102, 241, 0.7);
  transition: all var(--transition-fast);
  z-index: 3;
}

.play-button-floating:hover {
  transform: translate(-50%, -50%) scale(1.1);
  background: var(--brand-indigo-light);
}

/* --- Proof & Authority Bar (Industry Stats) --- */
.stats-strip {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  padding: 2.5rem 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  text-align: center;
}

.stat-item {
  position: relative;
}

.stat-item:not(:last-child)::after {
  content: '';
  position: absolute;
  right: -1rem;
  top: 20%;
  height: 60%;
  width: 1px;
  background: var(--border-subtle);
}

.stat-number {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 800;
  color: #FFFFFF;
  line-height: 1;
  margin-bottom: 0.5rem;
}

.stat-number span {
  color: var(--brand-cyan);
}

.stat-label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.stat-source {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.stat-source a {
  text-decoration: underline;
  color: var(--text-muted);
}

.stat-source a:hover {
  color: var(--brand-cyan);
}

/* --- Tarjetas de Servicios --- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
}

.service-card {
  background: var(--grad-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 2.25rem;
  position: relative;
  transition: all var(--transition-smooth);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.service-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg), var(--shadow-glow-indigo);
}

.service-icon-wrap {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-cyan);
  margin-bottom: 1.5rem;
}

.service-icon-wrap svg {
  width: 26px;
  height: 26px;
}

.service-tag {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.service-title {
  margin-bottom: 0.75rem;
  font-size: 1.35rem;
}

.service-desc {
  font-size: 0.95rem;
  margin-bottom: 1.5rem;
  color: var(--text-secondary);
}

.service-features-list {
  list-style: none;
  margin-bottom: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.service-features-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.875rem;
  color: #CBD5E1;
}

.service-features-list li svg {
  width: 16px;
  height: 16px;
  color: var(--brand-emerald);
  flex-shrink: 0;
  margin-top: 3px;
}

.service-footer {
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.service-turnaround {
  font-size: 0.8rem;
  color: var(--brand-cyan-light);
  font-weight: 600;
}

/* --- Showreel & Portafolio Galería --- */
.portfolio-filters {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-bottom: 3rem;
}

.filter-btn {
  padding: 0.6rem 1.4rem;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 600;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-btn:hover, .filter-btn.active {
  background: var(--brand-indigo);
  color: #FFFFFF;
  border-color: var(--brand-indigo-light);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.4);
}

.portfolio-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.portfolio-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: all var(--transition-smooth);
  display: flex;
  flex-direction: column;
}

.portfolio-card:hover {
  border-color: var(--border-accent);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg), var(--shadow-glow-indigo);
}

.portfolio-media {
  position: relative;
  aspect-ratio: 16/9;
  background: #030712;
  overflow: hidden;
}

.portfolio-media.ratio-vertical {
  aspect-ratio: 9/12;
}

.portfolio-media.ratio-square {
  aspect-ratio: 1/1;
}

.portfolio-media-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.portfolio-card:hover .portfolio-media-thumb {
  transform: scale(1.05);
}

.portfolio-badge-demo {
  position: absolute;
  top: 1rem;
  left: 1rem;
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(6px);
  border: 1px solid var(--border-cyan);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--brand-cyan-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  z-index: 2;
}

.portfolio-badge-format {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(0, 0, 0, 0.7);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.7rem;
  font-weight: 600;
  color: #FFF;
  z-index: 2;
}

.portfolio-play-trigger {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.portfolio-card:hover .portfolio-play-trigger {
  background: rgba(0, 0, 0, 0.15);
}

.play-icon-circle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--brand-indigo);
  color: #FFF;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.6);
  transition: transform var(--transition-fast);
}

.portfolio-card:hover .play-icon-circle {
  transform: scale(1.15);
  background: var(--brand-cyan);
  box-shadow: 0 0 25px rgba(6, 182, 212, 0.8);
}

.portfolio-info {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.portfolio-meta-category {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--brand-indigo-light);
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}

.portfolio-title {
  font-size: 1.15rem;
  margin-bottom: 0.6rem;
}

.portfolio-goal {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.portfolio-prompt-preview {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: #A5B4FC;
  margin-bottom: 1.25rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* --- Calculadora Interactiva de Ahorro y ROI --- */
.roi-calculator-section {
  background: linear-gradient(180deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.calculator-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl);
  padding: 3rem;
  box-shadow: var(--shadow-lg), var(--shadow-glow-indigo);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3.5rem;
}

.calc-controls {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.calc-group {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.calc-label-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.calc-label {
  font-weight: 600;
  font-size: 1rem;
}

.calc-value-display {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--brand-cyan-light);
}

.calc-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 8px;
  border-radius: var(--radius-full);
  background: var(--bg-surface);
  outline: none;
  border: 1px solid var(--border-subtle);
}

.calc-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--brand-indigo);
  border: 2px solid #FFFFFF;
  cursor: pointer;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.8);
  transition: transform var(--transition-fast);
}

.calc-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  background: var(--brand-cyan);
}

.calc-results-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-lg);
  padding: 2.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.calc-results-card::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 150px;
  height: 150px;
  background: radial-gradient(circle, rgba(16, 185, 129, 0.15), transparent 70%);
  pointer-events: none;
}

.calc-savings-highlight {
  text-align: center;
  margin-bottom: 1.5rem;
}

.savings-label {
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.5rem;
}

.savings-amount {
  font-family: var(--font-heading);
  font-size: 3rem;
  font-weight: 800;
  color: var(--brand-emerald-light);
  line-height: 1;
  text-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
}

.calc-breakdown-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding: 1.25rem;
  background: rgba(0, 0, 0, 0.2);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.breakdown-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.breakdown-title {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.breakdown-val {
  font-size: 1.15rem;
  font-weight: 700;
  color: #FFFFFF;
}

/* --- Metodología / Proceso de 4 Pasos --- */
.process-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.75rem;
  position: relative;
}

.process-step-card {
  background: var(--grad-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 2rem 1.5rem;
  position: relative;
  transition: all var(--transition-smooth);
}

.process-step-card:hover {
  border-color: var(--border-cyan);
  transform: translateY(-4px);
}

.process-step-number {
  font-family: var(--font-mono);
  font-size: 2.2rem;
  font-weight: 800;
  color: rgba(99, 102, 241, 0.25);
  margin-bottom: 0.5rem;
}

.process-step-title {
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
}

.process-step-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.process-step-time {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--brand-cyan-light);
  background: rgba(6, 182, 212, 0.1);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-full);
}

/* --- Tablas de Planes y Precios --- */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  align-items: stretch;
}

.pricing-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 2.5rem 2rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  transition: all var(--transition-smooth);
}

.pricing-card.featured {
  background: var(--grad-surface);
  border-color: var(--brand-indigo);
  box-shadow: var(--shadow-lg), var(--shadow-glow-indigo);
  transform: scale(1.04);
}

.pricing-badge-popular {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--grad-primary);
  color: #FFF;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.35rem 1rem;
  border-radius: var(--radius-full);
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.5);
}

.pricing-header {
  margin-bottom: 1.75rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 1.5rem;
}

.pricing-plan-name {
  font-size: 1.4rem;
  margin-bottom: 0.5rem;
}

.pricing-plan-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  min-height: 40px;
}

.pricing-cost-row {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  margin-top: 1.25rem;
}

.pricing-cost-amount {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 800;
  color: #FFFFFF;
}

.pricing-cost-period {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.pricing-features-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 2rem;
  flex: 1;
}

.pricing-features-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.9rem;
  color: #CBD5E1;
}

.pricing-features-list li svg {
  width: 18px;
  height: 18px;
  color: var(--brand-emerald);
  flex-shrink: 0;
  margin-top: 2px;
}

/* --- Preguntas Frecuentes (FAQ Accordion) --- */
.faq-container {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.faq-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color var(--transition-fast);
}

.faq-item.active {
  border-color: var(--border-accent);
}

.faq-trigger {
  width: 100%;
  padding: 1.35rem 1.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-heading);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.faq-trigger:hover {
  color: var(--brand-cyan-light);
}

.faq-icon {
  width: 20px;
  height: 20px;
  transition: transform var(--transition-smooth);
  color: var(--brand-indigo-light);
  flex-shrink: 0;
}

.faq-item.active .faq-icon {
  transform: rotate(180deg);
  color: var(--brand-cyan);
}

.faq-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-smooth), padding var(--transition-smooth);
  padding: 0 1.75rem;
}

.faq-item.active .faq-content {
  max-height: 500px;
  padding: 0 1.75rem 1.5rem 1.75rem;
}

.faq-content p {
  font-size: 0.95rem;
  line-height: 1.7;
}

/* --- Configurador de Briefing y Contacto --- */
.contact-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 3.5rem;
}

.brief-form-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl);
  padding: 2.5rem;
  box-shadow: var(--shadow-lg);
}

.form-step-indicator {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2rem;
  position: relative;
}

.form-step-indicator::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--border-subtle);
  z-index: 1;
}

.step-node {
  position: relative;
  z-index: 2;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-surface);
  border: 2px solid var(--border-medium);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: all var(--transition-fast);
}

.step-node.active {
  background: var(--brand-indigo);
  border-color: var(--brand-cyan);
  color: #FFF;
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.6);
}

.step-node.completed {
  background: var(--brand-emerald);
  border-color: var(--brand-emerald-light);
  color: #06231A;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 0.85rem 1.1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
  border-color: var(--brand-indigo-light);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.form-input::placeholder, .form-textarea::placeholder {
  color: var(--text-muted);
}

.form-radio-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
}

.radio-card {
  position: relative;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.radio-card input {
  position: absolute;
  opacity: 0;
}

.radio-card:hover {
  border-color: var(--border-medium);
}

.radio-card.selected, .radio-card input:checked + .radio-card-content {
  border-color: var(--brand-cyan);
  background: rgba(6, 182, 212, 0.08);
}

.radio-card-title {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 0.25rem;
}

.radio-card-subtitle {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.contact-info-panel {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.contact-info-card {
  background: var(--grad-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 2.25rem;
}

.contact-direct-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.contact-direct-item:last-child {
  margin-bottom: 0;
}

.contact-direct-icon {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  background: rgba(99, 102, 241, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-cyan-light);
  flex-shrink: 0;
}

.contact-direct-title {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.contact-direct-val {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* --- Footer Corporativo --- */
.site-footer {
  background: #040711;
  border-top: 1px solid var(--border-subtle);
  padding: 4.5rem 0 2rem 0;
  position: relative;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3.5rem;
}

.footer-brand-col p {
  font-size: 0.9rem;
  margin-top: 1rem;
  margin-bottom: 1.5rem;
  max-width: 320px;
}

.footer-heading {
  font-family: var(--font-heading);
  font-size: 1rem;
  font-weight: 700;
  color: #FFFFFF;
  margin-bottom: 1.25rem;
  letter-spacing: 0.02em;
}

.footer-links-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-links-list a {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.footer-links-list a:hover {
  color: var(--brand-cyan-light);
}

.footer-bottom {
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.footer-legal-links {
  display: flex;
  gap: 1.5rem;
}

/* --- CHATBOT WIDGET FLOTANTE (GOOGLE GEMINI) --- */
.chatbot-widget {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 10000;
  font-family: var(--font-body);
}

/* Botón disparador */
.chatbot-launcher {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--grad-primary);
  border: 2px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 30px rgba(99, 102, 241, 0.5), 0 0 20px rgba(6, 182, 212, 0.3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  transition: all var(--transition-smooth);
  position: relative;
}

.chatbot-launcher:hover {
  transform: scale(1.08) rotate(5deg);
  box-shadow: 0 10px 40px rgba(99, 102, 241, 0.7);
}

.chatbot-launcher-icon {
  width: 30px;
  height: 30px;
  transition: transform var(--transition-fast);
}

.chatbot-badge-notification {
  position: absolute;
  top: -2px;
  right: -2px;
  background: var(--brand-emerald);
  color: #042118;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-full);
  border: 2px solid var(--bg-primary);
  box-shadow: 0 0 10px var(--brand-emerald);
  animation: pulse-badge 2s infinite;
}

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

/* Ventana del Chat */
.chatbot-window {
  position: fixed;
  bottom: 100px;
  right: 24px;
  width: 400px;
  max-width: calc(100vw - 32px);
  height: 620px;
  max-height: calc(100vh - 120px);
  background: var(--bg-secondary);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg), 0 0 50px rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.95);
  transition: all var(--transition-smooth);
  z-index: 10001;
}

.chatbot-window.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

/* Cabecera del Chat */
.chat-header {
  background: var(--bg-tertiary);
  border-bottom: 1px solid var(--border-subtle);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-header-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.chat-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--grad-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFF;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
}

.chat-agent-name {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  font-weight: 700;
  color: #FFFFFF;
}

.chat-agent-status {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  color: var(--brand-emerald-light);
}

.status-dot-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-emerald);
  box-shadow: 0 0 6px var(--brand-emerald);
}

.chat-header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chat-action-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.chat-action-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #FFF;
}

/* Cuerpo de Mensajes */
.chat-body {
  flex: 1;
  padding: 1.25rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: #080D1A;
}

.chat-message {
  display: flex;
  flex-direction: column;
  max-width: 84%;
  font-size: 0.9rem;
  line-height: 1.5;
  animation: fade-in-up 0.25s ease-out;
}

@keyframes fade-in-up {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.chat-message.bot {
  align-self: flex-start;
}

.chat-message.user {
  align-self: flex-end;
}

.chat-bubble {
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius-lg);
  word-break: break-word;
}

.chat-message.bot .chat-bubble {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-subtle);
  color: #F1F5F9;
  border-bottom-left-radius: var(--radius-xs);
}

.chat-message.user .chat-bubble {
  background: var(--brand-indigo);
  color: #FFFFFF;
  border-bottom-right-radius: var(--radius-xs);
}

.chat-timestamp {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  padding: 0 0.25rem;
}

.chat-message.user .chat-timestamp {
  align-self: flex-end;
}

/* Chips de Preguntas Rápidas */
.chat-chips-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.chat-chip {
  background: rgba(99, 102, 241, 0.15);
  border: 1px solid rgba(99, 102, 241, 0.3);
  border-radius: var(--radius-full);
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--brand-indigo-light);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.chat-chip:hover {
  background: var(--brand-indigo);
  color: #FFFFFF;
}

/* Tarjeta de Lead Capture dentro del Chat */
.chat-lead-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.chat-lead-card-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--brand-cyan-light);
}

/* Indicador de Escribiendo (Typing) */
.chat-typing-indicator {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 0.6rem 0.9rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius-md);
  width: fit-content;
  align-self: flex-start;
  border: 1px solid var(--border-subtle);
}

.typing-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-cyan);
  animation: typing-bounce 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-bounce {
  0%, 80%, 100% { transform: translateY(0); opacity: 0.4; }
  40% { transform: translateY(-5px); opacity: 1; }
}

/* Input y Footer del Chat */
.chat-footer {
  background: var(--bg-tertiary);
  border-top: 1px solid var(--border-subtle);
  padding: 0.75rem 1rem;
}

.chat-input-form {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-full);
  padding: 0.25rem 0.5rem 0.25rem 1rem;
  transition: border-color var(--transition-fast);
}

.chat-input-form:focus-within {
  border-color: var(--brand-cyan);
}

.chat-input-field {
  flex: 1;
  font-size: 0.875rem;
  color: var(--text-primary);
  background: transparent;
}

.chat-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--grad-primary);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform var(--transition-fast);
  flex-shrink: 0;
}

.chat-send-btn:hover {
  transform: scale(1.08);
}

.chat-legal-disclaimer {
  font-size: 0.65rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 0.4rem;
}

.chat-legal-disclaimer a {
  text-decoration: underline;
}

/* Modal de Configuración de API Key (Chatbot) */
.api-key-modal {
  position: absolute;
  inset: 0;
  background: rgba(8, 12, 23, 0.95);
  backdrop-filter: blur(10px);
  z-index: 10;
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-smooth);
}

.api-key-modal.open {
  opacity: 1;
  visibility: visible;
}

/* --- BANNER DE COOKIES (RGPD) --- */
.cookie-banner {
  position: fixed;
  bottom: 24px;
  left: 24px;
  max-width: 440px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-lg), 0 0 40px rgba(0, 0, 0, 0.7);
  z-index: 9999;
  transform: translateY(120%);
  transition: transform var(--transition-smooth);
}

.cookie-banner.visible {
  transform: translateY(0);
}

.cookie-title {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.cookie-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

.cookie-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Modal de Preferencias de Cookies */
.cookie-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(6px);
  z-index: 10005;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-fast);
}

.cookie-modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.cookie-modal-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl);
  max-width: 520px;
  width: 100%;
  padding: 2rem;
  box-shadow: var(--shadow-lg);
}

.cookie-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border-subtle);
}

/* Switch Toggle Component */
.switch-toggle {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider-toggle {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-medium);
  transition: .3s;
  border-radius: 24px;
}

.slider-toggle:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: #FFF;
  transition: .3s;
  border-radius: 50%;
}

input:checked + .slider-toggle {
  background-color: var(--brand-indigo);
  border-color: var(--brand-cyan);
}

input:checked + .slider-toggle:before {
  transform: translateX(20px);
}

/* --- MODAL DE REPRODUCTOR DE DEMOS --- */
.demo-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(12px);
  z-index: 10002;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-smooth);
}

.demo-modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.demo-modal-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-medium);
  border-radius: var(--radius-xl);
  max-width: 900px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg), 0 0 60px rgba(99, 102, 241, 0.3);
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.demo-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid var(--border-subtle);
  color: #FFF;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all var(--transition-fast);
}

.demo-modal-close:hover {
  background: var(--brand-rose);
  transform: rotate(90deg);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 10010;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.toast {
  background: var(--bg-secondary);
  border: 1px solid var(--border-accent);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  color: #FFFFFF;
  font-size: 0.9rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  animation: slide-toast 0.3s ease-out;
}

@keyframes slide-toast {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* --- Responsive Media Queries --- */
@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.75rem;
  }

  .stat-item:nth-child(2)::after {
    display: none;
  }

  .services-grid, .portfolio-grid, .pricing-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .process-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .calculator-card {
    grid-template-columns: 1fr;
    padding: 2rem;
  }

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

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .demo-modal-card {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  :root {
    --header-height: 70px;
  }

  .nav-menu, .nav-actions .btn-primary {
    display: none;
  }

  .nav-toggle {
    display: flex;
  }

  .section {
    padding: 4rem 0;
  }

  .services-grid, .portfolio-grid, .pricing-grid, .process-grid {
    grid-template-columns: 1fr;
  }

  .pricing-card.featured {
    transform: none;
  }

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

  .stat-item::after {
    display: none !important;
  }

  .form-radio-grid {
    grid-template-columns: 1fr;
  }

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

  .chatbot-window {
    width: 100vw;
    height: 100vh;
    max-width: 100vw;
    max-height: 100vh;
    bottom: 0;
    right: 0;
    border-radius: 0;
  }

  .cookie-banner {
    left: 12px;
    right: 12px;
    bottom: 12px;
    max-width: 100%;
  }
}
