/* ==========================================================================
   BossBli - Estilos para Ecosistema y Soluciones WebTV (ecosistema.html)
   Reglas AGENTS.md: 100% externo, sin colores azules, paleta cálida y consistente.
   ========================================================================== */

/* Cabecera / Hero de Ecosistema con destello warm a la derecha */
.ecosystem-hero {
  padding: 85px 0 52px;
  text-align: center;
  background: radial-gradient(circle at 82% 14%, rgba(var(--primary-rgb), 0.16), transparent 34%);
  border-bottom: var(--border-width, 1px) solid var(--line);
  position: relative;
}

.ecosystem-head {
  text-align: center;
}

.ecosystem-head h1 {
  font-size: clamp(2.1rem, 4.2vw, 3rem);
  font-weight: 850;
  line-height: 1.15;
  margin: 14px 0 16px;
  color: var(--text);
  letter-spacing: -0.015em;
}

.ecosystem-head p {
  color: var(--muted);
  font-size: 1.06rem;
  max-width: 680px;
  margin: 0 auto 24px;
  line-height: 1.6;
}

/* Badges de soporte y protocolos */
.ecosystem-badges {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.ecosystem-hero-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.ecosystem-hero-actions .btn {
  padding: 11px 22px;
  font-size: 0.92rem;
}

.eco-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: var(--surface);
  border: var(--border-width, 1px) solid var(--line);
  color: var(--text);
}

.eco-badge-highlight {
  background: rgba(var(--primary-rgb), 0.12);
  border-color: rgba(var(--primary-rgb), 0.35);
  color: var(--primary);
}

.eco-badge-green {
  background: rgba(var(--success-rgb), 0.1);
  border-color: rgba(var(--success-rgb), 0.3);
  color: var(--green);
}

/* Secciones del Ecosistema */
.eco-flow-section {
  padding: 44px 0 20px;
}

.eco-modules-section {
  padding: 50px 0 30px;
}

.eco-section-header {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 36px;
}

.eco-section-header .kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gold);
  margin-bottom: 8px;
}

.eco-section-header h2 {
  font-size: clamp(1.8rem, 3.4vw, 2.35rem);
  font-weight: 800;
  color: var(--text);
  margin: 8px 0 12px;
  line-height: 1.2;
}

.eco-section-header p {
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.55;
  margin: 0;
}

/* Grid de Módulos del Ecosistema */
.modules-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
  margin-bottom: 20px;
}

.module-card {
  background: var(--surface);
  border: var(--border-width, 1px) solid var(--line);
  border-radius: var(--radius);
  padding: 30px 24px;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  position: relative;
}

.module-card:hover {
  transform: translateY(-4px);
  border-color: rgba(var(--primary-rgb), 0.4);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.4);
}

.module-card-featured {
  border-color: rgba(var(--primary-rgb), 0.45);
  background: linear-gradient(180deg, rgba(var(--primary-rgb), 0.04) 0%, var(--surface) 100%);
}

.module-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.module-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(var(--primary-rgb), 0.12);
  color: var(--primary);
  display: grid;
  place-items: center;
}

.module-icon-wrap svg {
  width: 24px;
  height: 24px;
}

.module-pill {
  font-size: 0.72rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: var(--border-width, 1px) solid var(--line);
  color: var(--muted);
}

.module-pill-primary {
  background: rgba(var(--primary-rgb), 0.15);
  border-color: rgba(var(--primary-rgb), 0.35);
  color: var(--primary);
}

.module-card h3 {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}

.module-card p {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.55;
  margin-bottom: 20px;
}

.module-features {
  list-style: none;
  padding: 0;
  margin: 0 0 26px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-grow: 1;
}

.module-features li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--text);
  line-height: 1.4;
}

.module-features li svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--green);
  margin-top: 2px;
}

.module-actions {
  display: flex;
  gap: 10px;
  margin-top: auto;
}

.module-actions .btn {
  flex: 1;
  text-align: center;
  justify-content: center;
  font-size: 0.88rem;
  padding: 10px 14px;
}

.eco-arch-section {
  padding: 30px 0 40px;
}

/* Sección de Arquitectura y Conexión DNS */
.arch-box {
  background: var(--surface);
  border: var(--border-width, 1px) solid var(--line);
  border-radius: var(--radius);
  padding: 40px;
  margin: 0;
}

.arch-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 36px;
}

.arch-header h2 {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 10px;
}

.arch-header p {
  color: var(--muted);
  font-size: 0.98rem;
}

.arch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.arch-item {
  background: var(--surface-2);
  border: var(--border-width, 1px) solid var(--line);
  border-radius: 12px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.arch-item-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: rgba(var(--accent-rgb), 0.12);
  color: var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
}

.arch-item-icon svg {
  width: 22px;
  height: 22px;
}

.arch-item h4 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.arch-item p {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
  margin: 0;
}

.eco-faq-section {
  padding: 30px 0 40px;
}

/* Acordeón FAQ exclusivo de Ecosistema */
.eco-faq-wrap {
  margin: 0 auto;
}

.eco-faq-header {
  text-align: center;
  margin-bottom: 30px;
}

.eco-faq-header h2 {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 10px;
}

.eco-faq-header p {
  color: var(--muted);
  font-size: 0.98rem;
}

.eco-faq-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 800px;
  margin: 0 auto;
}

.eco-faq-card {
  background: var(--surface);
  border: var(--border-width, 1px) solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.eco-faq-card:hover {
  border-color: rgba(var(--primary-rgb), 0.3);
}

.eco-faq-question {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  background: transparent;
  border: 0;
  color: var(--text);
  font-size: 1rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  gap: 14px;
}

.eco-faq-question svg {
  width: 18px;
  height: 18px;
  color: var(--muted);
  transition: transform 0.2s ease, color 0.2s ease;
  flex-shrink: 0;
}

.eco-faq-answer {
  display: none;
  padding: 0 22px 20px;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.eco-faq-card.open .eco-faq-answer {
  display: block;
}

.eco-faq-card.open .eco-faq-question svg {
  transform: rotate(180deg);
  color: var(--primary);
}

.eco-cta-section {
  padding: 20px 0 60px;
}

/* Banner de llamado a la acción (CTA) */
.eco-cta-banner {
  background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.15), rgba(var(--accent-rgb), 0.05));
  border: 1px solid rgba(var(--primary-rgb), 0.3);
  border-radius: var(--radius);
  padding: 40px;
  text-align: center;
  margin-top: 0;
}

.eco-cta-banner h2 {
  font-size: 1.9rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 12px;
}

.eco-cta-banner p {
  color: var(--muted);
  max-width: 600px;
  margin: 0 auto 24px;
  font-size: 1rem;
  line-height: 1.5;
}

.eco-cta-buttons {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .arch-box {
    padding: 24px 18px;
  }
  .eco-cta-banner {
    padding: 30px 18px;
  }
  .module-actions {
    flex-direction: column;
  }
}

/* ==========================================================================
   Gráfico Animado e Interactivo: Arquitectura de Operación 360°
   Los 5 Pilares: Tu Marca, Recursos, Pagos, Dominio y Acceso, Clientes
   Paleta 100% cálida, cero azul, animaciones vectoriales de alto rendimiento
   ========================================================================== */

.flow-architecture-box {
  background: linear-gradient(180deg, #181410 0%, #120f0b 100%);
  border: var(--border-width, 1px) solid var(--line);
  border-radius: 24px;
  padding: 44px 36px 40px;
  margin: 50px 0;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  position: relative;
  overflow: hidden;
}

/* Resplandor ambiental de fondo */
.flow-architecture-box::before {
  content: "";
  position: absolute;
  top: -80px;
  left: 50%;
  transform: translateX(-50%);
  width: 540px;
  height: 280px;
  background: radial-gradient(ellipse, rgba(var(--primary-rgb), 0.12) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.flow-section-header {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 30px;
  position: relative;
  z-index: 1;
}

.flow-section-header h2 {
  font-size: clamp(1.8rem, 3.8vw, 2.45rem);
  font-weight: 800;
  line-height: 1.15;
  margin: 12px 0 14px;
  color: var(--text);
  letter-spacing: -0.02em;
}

.flow-section-header p {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.6;
  margin: 0 auto;
}

/* Canvas del Diagrama */
.flow-canvas {
  position: relative;
  width: 100%;
  max-width: 960px;
  height: 480px;
  margin: 10px auto 36px;
  z-index: 1;
}

/* Conectores SVG */
.flow-svg-connections {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.flow-path-base {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 2.5;
  stroke-dasharray: 6 6;
}

.flow-path-active {
  fill: none;
  stroke: url(#flowGradWarm);
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-dasharray: 20 220;
  stroke-dashoffset: 0;
  filter: drop-shadow(0 0 8px rgba(var(--primary-rgb), 0.85));
  animation: dataFlowBeam 2.8s linear infinite;
  transition: opacity 0.3s ease, stroke 0.3s ease;
}

.flow-beam-1 { animation-delay: 0s; }
.flow-beam-2 { animation-delay: -0.7s; }
.flow-beam-3 { animation-delay: -1.4s; stroke: url(#flowGradGold); }
.flow-beam-4 { animation-delay: -2.1s; stroke: url(#flowGradGold); }
.flow-beam-5 { animation-delay: -0.3s; stroke: var(--green); filter: drop-shadow(0 0 8px rgba(var(--success-rgb), 0.8)); }

@keyframes dataFlowBeam {
  0% { stroke-dashoffset: 240; }
  100% { stroke-dashoffset: 0; }
}

/* Capa de Nodos */
.flow-nodes-layer {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 2;
}

.flow-node {
  position: absolute;
  transform: translate(-50%, -50%);
  cursor: pointer;
  user-select: none;
  outline: none;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Posiciones fijas en Desktop */
.flow-node-marca {
  top: 80px;
  left: 50%;
}

.flow-node-recursos {
  top: 235px;
  left: 23%;
}

.flow-node-pagos {
  top: 235px;
  left: 77%;
}

.flow-node-dominio {
  top: 335px;
  left: 50%;
}

.flow-node-clientes {
  top: 430px;
  left: 50%;
}

/* Tarjeta del Nodo */
.node-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  border-radius: 18px;
  background: #191510;
  border: 1.5px solid var(--line);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.45);
  position: relative;
  z-index: 2;
  white-space: nowrap;
  transition: all 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.node-halo {
  position: absolute;
  inset: -8px;
  border-radius: 24px;
  background: radial-gradient(ellipse, rgba(var(--primary-rgb), 0.3) 0%, transparent 70%);
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 1;
  pointer-events: none;
}

.node-pulse-ring {
  position: absolute;
  inset: -4px;
  border-radius: 22px;
  border: 1.5px solid rgba(var(--primary-rgb), 0.4);
  opacity: 0;
  pointer-events: none;
  z-index: 1;
}

.node-icon-box {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
  border: var(--border-width, 1px) solid var(--line);
  color: var(--primary);
  transition: all 0.25s ease;
}

.node-icon-box svg {
  width: 20px;
  height: 20px;
}

.node-text {
  display: flex;
  flex-direction: column;
}

.node-step-tag {
  font-size: 9.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  line-height: 1;
  margin-bottom: 2px;
}

.node-title {
  font-size: 14px;
  font-weight: 800;
  color: #ffffff;
  margin: 0;
  line-height: 1.2;
}

.node-desc {
  font-size: 11px;
  color: var(--muted);
  margin: 1px 0 0;
  line-height: 1.2;
}

.node-badge-tag {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 99px;
  background: rgba(var(--accent-rgb), 0.08);
  border: 1px solid rgba(var(--accent-rgb), 0.25);
  color: var(--gold);
  font-size: 10px;
  font-weight: 750;
  margin-left: 4px;
}

/* Hover y Estados Activos de Nodo */
.flow-node:hover {
  transform: translate(-50%, -50%) scale(1.05);
}

.flow-node:hover .node-card {
  border-color: rgba(var(--primary-rgb), 0.6);
  background: #201913;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.55);
}

.flow-node:hover .node-halo {
  opacity: 0.7;
}

.flow-node.is-active {
  transform: translate(-50%, -50%) scale(1.06);
}

.flow-node.is-active .node-card {
  border-color: var(--primary);
  background: linear-gradient(135deg, #241912 0%, #1a1510 100%);
  box-shadow: 0 0 24px rgba(var(--primary-rgb), 0.35), 0 16px 36px rgba(0, 0, 0, 0.6);
}

.flow-node.is-active .node-halo {
  opacity: 1;
}

.flow-node.is-active .node-icon-box {
  background: rgba(var(--primary-rgb), 0.16);
  border-color: var(--primary);
  color: #ffffff;
}

.flow-node.is-active .node-step-tag {
  color: var(--primary);
}

.flow-node.is-active .node-pulse-ring {
  opacity: 1;
  animation: radarWave 2.8s ease-out infinite;
}

@keyframes radarWave {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(1.16); opacity: 0; }
}

/* Tarjeta Inspectora de Detalles Técnicos */
.flow-inspector {
  background: #17130f;
  border: 1px solid rgba(var(--primary-rgb), 0.28);
  border-radius: 20px;
  padding: 24px 28px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45);
  position: relative;
  z-index: 2;
  transition: border-color 0.3s ease, background 0.3s ease;
}

.flow-inspector-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.flow-inspector-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 99px;
  background: rgba(var(--primary-rgb), 0.12);
  border: 1px solid rgba(var(--primary-rgb), 0.3);
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.flow-inspector-title {
  font-size: 18px;
  font-weight: 800;
  color: #ffffff;
  margin: 0;
  line-height: 1.25;
}

.flow-inspector-live-tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 12px;
  border-radius: 99px;
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.25);
  color: var(--green);
  font-size: 11px;
  font-weight: 750;
}

.flow-inspector-live-tag .live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
}

.flow-inspector-summary {
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.6;
  margin: 0 0 20px;
}

.flow-inspector-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.flow-inspector-col-title {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--gold);
  margin: 0 0 10px;
}

.flow-inspector-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.flow-inspector-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.45;
}

.flow-inspector-list li svg {
  width: 14px;
  height: 14px;
  color: var(--primary);
  flex-shrink: 0;
  margin-top: 2px;
}

.flow-metrics-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.flow-metric-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: var(--border-width, 1px) solid var(--line);
  color: var(--text);
  font-size: 11.5px;
  font-weight: 700;
}

/* ==========================================================================
   Responsive del Diagrama: Adaptación en Tablet y Móvil
   ========================================================================== */

@media (max-width: 860px) {
  .flow-architecture-box {
    padding: 32px 18px;
    margin: 36px 0;
  }

  .flow-canvas {
    height: auto;
    max-width: 440px;
    margin-bottom: 28px;
  }

  /* Ocultar trazos SVG curvos de escritorio */
  .flow-svg-connections {
    display: none;
  }

  /* Nodos dispuestos en flujo vertical conectado */
  .flow-nodes-layer {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 22px;
    position: relative;
  }

  /* Línea conectora vertical en móvil */
  .flow-nodes-layer::before {
    content: "";
    position: absolute;
    top: 30px;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    background: linear-gradient(180deg, var(--primary) 0%, var(--gold) 50%, var(--green) 100%);
    z-index: 0;
    opacity: 0.4;
  }

  .flow-node {
    position: static;
    transform: none !important;
    width: 100%;
    max-width: 380px;
  }

  .node-card {
    width: 100%;
    box-sizing: border-box;
    justify-content: flex-start;
  }

  .flow-inspector-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .flow-inspector {
    padding: 20px 18px;
  }
}

@media (max-width: 480px) {
  .node-badge-tag {
    display: none;
  }
}
.flow-node[data-ecosystem-node] {
  padding: 0;
  border: 0;
  background: transparent;
  font: inherit;
  text-align: left;
}

.flow-node[data-ecosystem-node]:focus-visible .node-card {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.eco-faq-card > summary {
  list-style: none;
}

.eco-faq-card > summary::-webkit-details-marker {
  display: none;
}

.eco-faq-card[open] .eco-faq-answer {
  display: block;
}

.eco-faq-card[open] .eco-faq-question svg {
  transform: rotate(180deg);
  color: var(--primary);
}

.eco-faq-card > summary:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: -3px;
}
