/* ============================================================
   Infografía animada: Agentes IA para pymes
   ============================================================ */

/* 1. Custom Properties (usando paleta BigLobster) */
:root {
  --bg-base: #F7F8FA;
  --bg-surface: #FFFFFF;
  --bg-subtle: #EEF0F4;
  --text-primary: #111318;
  --text-secondary: #4A5063;
  --text-muted: #8A91A4;
  --accent: #B8391C;
  --accent-hover: #9C2F16;
  --accent-teal: #D4622A;
  --accent-light: #FAECEA;
  --border: #DDE1E9;

  --font-display: 'DM Serif Display', Georgia, serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 4px rgba(0,0,0,.06);
  --shadow-md: 0 8px 32px rgba(0,0,0,.08);
  --shadow-lg: 0 12px 48px rgba(0,0,0,.12);

  --ease: cubic-bezier(.4,0,.2,1);
  --ease-bounce: cubic-bezier(.68,-0.55,.265,1.55);
}

[data-theme="dark"] {
  --bg-base: #0E1117;
  --bg-surface: #161B26;
  --bg-subtle: #1D2333;
  --text-primary: #EDF0F7;
  --text-secondary: #9BA3B8;
  --text-muted: #5A6278;
  --accent: #D94F2E;
  --accent-hover: #B8391C;
  --accent-teal: #E07A50;
  --accent-light: #2A1410;
  --border: #252D3F;
  --shadow-sm: 0 1px 4px rgba(0,0,0,.2);
  --shadow-md: 0 8px 32px rgba(0,0,0,.28);
  --shadow-lg: 0 12px 48px rgba(0,0,0,.36);
}

/* 2. Reset y base */
* { box-sizing: border-box; margin: 0; padding: 0; }
body { 
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  color: var(--text-secondary);
  background: var(--bg-base);
  padding: 1rem;
  transition: background .3s var(--ease), color .3s var(--ease);
}
.hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* 3. Estilos para el contenedor embebido (ya definidos inline en HTML) */
.infografia-container {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  margin: 2rem auto;
  max-width: 1200px;
  border: 1px solid var(--border);
  transition: border-color .3s var(--ease), background .3s var(--ease);
}

@media (max-width: 640px) {
  .infografia-container {
    padding: 1.5rem;
    margin: 1rem auto;
  }
}

/* 4. Navegación */
.infografia-nav {
  display: flex;
  overflow-x: auto;
  gap: 0.5rem;
  padding: 1rem 0;
  margin-bottom: 2rem;
  scrollbar-width: none;
}
.infografia-nav::-webkit-scrollbar { display: none; }
.nav-btn {
  padding: 0.6rem 1.2rem;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all .2s var(--ease);
  flex-shrink: 0;
}
.nav-btn:hover {
  background: color-mix(in srgb, var(--accent) 15%, transparent);
  color: var(--accent);
}
.nav-btn.active {
  background: var(--accent);
  color: #fff;
}

/* 5. Secciones */
.infografia-main {
  position: relative;
  min-height: 500px;
}
.infografia-section {
  display: none;
  animation: viewIn 0.4s var(--ease) forwards;
}
.infografia-section.active {
  display: block;
}
@keyframes viewIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

/* 6. Cartas base */
.card {
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.8rem;
  transition: all .3s var(--ease);
}
.card:hover {
  border-color: var(--accent-teal);
  box-shadow: var(--shadow-sm);
}
.card-title {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--text-primary);
  margin-bottom: 1.2rem;
}
.card-list {
  list-style: none;
  margin: 1.2rem 0;
}
.card-list li {
  padding-left: 1.5rem;
  position: relative;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}
.card-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.7rem;
  width: 0.5rem;
  height: 0.5rem;
  background: var(--accent-teal);
  border-radius: 50%;
}
.card-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 1rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--border);
}

/* 7. Sección 1: Problema vs Solución */
.problem-solution-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 2rem;
  align-items: center;
  margin: 2rem 0;
}
@media (max-width: 768px) {
  .problem-solution-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
}
.problem-card .card-icon {
  color: #ef4444;
  font-size: 2.5rem;
  margin-bottom: 1rem;
}
.solution-card .card-icon {
  color: #10b981;
  font-size: 2.5rem;
  margin-bottom: 1rem;
}
.solution-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.solution-arrow {
  font-size: 3rem;
  color: var(--accent-teal);
  margin-bottom: 0.5rem;
  animation: arrowBounce 1.5s var(--ease-bounce) infinite;
}
@keyframes arrowBounce {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(8px); }
}
.solution-label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent-teal);
  background: color-mix(in srgb, var(--accent-teal) 12%, transparent);
  padding: 0.4rem 1rem;
  border-radius: var(--radius-sm);
}

/* 8. Sección 2: Agente IA explicado */
.agent-explanation {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3rem;
  margin: 2rem 0;
}
.agent-visual {
  position: relative;
  text-align: center;
}
.agent-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}
.agent-glow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 120px;
  height: 120px;
  background: radial-gradient(circle, color-mix(in srgb, var(--accent) 20%, transparent) 0%, transparent 70%);
  border-radius: 50%;
  animation: breathe 3s var(--ease) infinite;
  z-index: -1;
}
@keyframes breathe {
  0%, 100% { opacity: 0.6; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 0.9; transform: translate(-50%, -50%) scale(1.1); }
}
.agent-label {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--accent);
  margin-top: 0.5rem;
}
.agent-process {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  width: 100%;
  max-width: 800px;
}
.process-step {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}
.step-number {
  background: var(--accent);
  color: #fff;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 1.1rem;
  flex-shrink: 0;
}
.step-content h5 {
  font-size: 1rem;
  color: var(--text-primary);
  margin-bottom: 0.3rem;
}
.step-content p {
  font-size: 0.9rem;
  color: var(--text-secondary);
}
.agent-keyfact {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--accent-light);
  padding: 1.2rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--accent);
  max-width: 600px;
  margin-top: 1rem;
}
.keyfact-icon {
  font-size: 1.8rem;
}
.keyfact-text {
  font-size: 1.1rem;
  line-height: 1.5;
}

/* 9. Sección 3: 3 Casos concretos */
.use-cases-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}
.use-case-card {
  text-align: center;
  position: relative;
}
.use-case-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}
.use-case-flow {
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  padding: 0.8rem;
  margin: 1rem 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.4;
}
.flow-step {
  margin-bottom: 0.3rem;
}
.card-price {
  font-weight: 600;
  color: var(--accent);
  font-size: 1.2rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}
.pack-info {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 2.5rem;
  padding: 1.2rem;
  background: linear-gradient(135deg, var(--accent-light), color-mix(in srgb, var(--accent-teal) 8%, transparent));
  border-radius: var(--radius-md);
  border: 1px solid var(--accent);
}
.pack-badge {
  font-weight: 600;
  color: var(--accent);
  font-size: 1.1rem;
}
.pack-price {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--text-primary);
  font-weight: 700;
}

/* 10. Sección 4: Implementación en 4 pasos */
.timeline {
  position: relative;
  margin: 3rem 0;
  padding-left: 2rem;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 1.6rem;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--accent-teal);
  border-radius: 1px;
}
.timeline-step {
  position: relative;
  margin-bottom: 2.5rem;
  padding-left: 2rem;
}
.timeline-step:last-child {
  margin-bottom: 0;
}
.timeline-number {
  position: absolute;
  left: -1.6rem;
  top: 0;
  width: 3.2rem;
  height: 3.2rem;
  background: var(--bg-surface);
  border: 2px solid var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: var(--accent);
  font-size: 1.1rem;
}
.timeline-content h5 {
  font-size: 1.1rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}
.timeline-content p {
  font-size: 0.95rem;
  color: var(--text-secondary);
}
.timeline-duration {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 0.5rem;
  background: var(--bg-subtle);
  padding: 0.3rem 0.8rem;
  border-radius: var(--radius-sm);
  display: inline-block;
}
.implementation-note {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-subtle);
  padding: 1.2rem;
  border-radius: var(--radius-md);
  margin-top: 2rem;
}
.note-icon {
  font-size: 1.5rem;
}
.note-text {
  font-size: 0.95rem;
  line-height: 1.5;
}

/* 11. Sección 5: ROI y números */
.roi-comparison {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 2rem;
  margin: 2rem 0;
}
@media (max-width: 768px) {
  .roi-comparison {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
}
.comparison-column {
  background: var(--bg-base);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.8rem;
}
.comparison-header {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  text-align: center;
}
.comparison-price {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--accent);
  text-align: center;
  margin-bottom: 1.5rem;
}
.comparison-list {
  list-style: none;
  margin: 1.5rem 0;
}
.comparison-list li {
  padding-left: 1.8rem;
  position: relative;
  margin-bottom: 0.8rem;
  font-size: 0.95rem;
}
.comparison-list li:nth-child(1)::before,
.comparison-list li:nth-child(2)::before,
.comparison-list li:nth-child(3)::before,
.comparison-list li:nth-child(4)::before,
.comparison-list li:nth-child(5)::before {
  content: none;
}
.comparison-list li::before {
  content: '✔';
  position: absolute;
  left: 0;
  color: #10b981;
  font-weight: 700;
}
.comparison-column:last-child .comparison-list li::before {
  content: '✘';
  color: #ef4444;
}
.comparison-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 1rem;
}
.comparison-vs {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--text-muted);
}
.roi-timeline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
  margin-top: 3rem;
}
.roi-step {
  text-align: center;
  padding: 1.5rem;
  background: var(--bg-subtle);
  border-radius: var(--radius-md);
}
.roi-month {
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 0.5rem;
}
.roi-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}
.roi-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* 12. Sección 6: CTA */
.cta-content {
  text-align: center;
  padding: 2rem 0;
}
.cta-visual {
  margin-bottom: 1.5rem;
}
.cta-emoji {
  font-size: 4rem;
  animation: ctaPulse 2.5s var(--ease) infinite;
}
@keyframes ctaPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}
.cta-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  color: var(--text-primary);
  margin-bottom: 1rem;
}
.cta-description {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 2rem;
  line-height: 1.6;
}
.cta-features {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
  margin: 2rem 0;
}
.cta-feature {
  background: var(--bg-subtle);
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
}
.cta-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 2rem;
}
.cta-btn {
  padding: 1rem 2rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  text-decoration: none;
  transition: all .2s var(--ease);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}
.cta-btn.primary {
  background: var(--accent);
  color: #fff;
}
.cta-btn.primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px color-mix(in srgb, var(--accent) 35%, transparent);
}
.cta-btn.secondary {
  background: var(--bg-subtle);
  color: var(--text-primary);
  border: 1px solid var(--border);
}
.cta-btn.secondary:hover {
  background: var(--accent-light);
  border-color: var(--accent);
}

/* 13. Indicador de progreso */
.infografia-progress {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.progress-bar {
  height: 6px;
  background: var(--bg-subtle);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}
.progress-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
  transition: width 0.4s var(--ease);
}
.progress-label {
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
}

/* 14. Animaciones de entrada */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: none; }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

/* 15. Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .agent-glow, .solution-arrow, .cta-emoji { animation: none; }
}