/* ==========================================================================
   MÓDULO DEDICADO: SIMULADOR INTERACTIVO MAYORISTA (10 PASOS)
   Somos Marketing Perú E.I.R.L. · Arquitectura Modular 100% Responsiva
   Dispositivos soportados: Desde móviles 320px hasta pantallas 4K Ultra Wide
   ========================================================================== */

/* 1. SECCIÓN CONTENEDORA Y BLINDAJE CONTRA DESBORDES */
#simulador-demo {
  position: relative;
  width: 100%;
  max-width: 100vw;
  overflow-x: clip;
  box-sizing: border-box;
}

#simulador-demo * {
  box-sizing: border-box;
}

#simulador-demo .container {
  width: 100%;
  max-width: 1220px;
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(12px, 3.5vw, 24px);
  padding-right: clamp(12px, 3.5vw, 24px);
  min-width: 0;
}

/* 2. EMBUDO OMNICANAL SUPERIOR */
#simulador-demo .omnichannel-funnel-strip {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto 24px auto;
  min-width: 0;
  overflow: hidden;
}

/* 3. STEPPER SUPERIOR DE 10 PASOS */
#simulador-demo .hero-master-stepper-outer {
  width: 100%;
  max-width: 1220px;
  margin: 0 auto 24px auto;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

#simulador-demo .hero-master-stepper-wrapper {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

/* 4. DUAL COCKPIT GRID (CARD + TELÉFONO 3D/HD) */
#simulador-demo .hero-dual-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(20px, 3vw, 44px);
  align-items: start;
  width: 100%;
  min-width: 0;
}

#simulador-demo .hero-card-side {
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

#simulador-demo .hero-phone-side {
  width: 100%;
  min-width: 0;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* 5. TARJETA DINÁMICA INTERACTIVA (.hero-dynamic-card) */
#simulador-demo .hero-dynamic-card {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  background: #ffffff;
  border-radius: 18px;
  border: 1.5px solid #cbd5e1;
  padding: clamp(16px, 3vw, 32px);
  min-height: auto;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 30px -10px rgba(15, 23, 42, 0.08);
  position: relative;
  overflow: hidden;
}

/* 5.1 Barra Superior de la Card (Rol Badge + Contador) */
#simulador-demo .hero-card-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  width: 100%;
  min-width: 0;
}

#simulador-demo .role-badge {
  font-size: clamp(0.68rem, 2vw, 0.74rem);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

#simulador-demo .step-counter-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: clamp(0.68rem, 2vw, 0.74rem);
  font-weight: 800;
  color: #334155;
  background: #f1f5f9;
  padding: 4px 10px;
  border-radius: 9999px;
  border: 1px solid #e2e8f0;
  white-space: nowrap;
}

/* 5.2 Título y Subtítulo Fluidos */
#simulador-demo .hero-card-title {
  font-family: var(--font-display, 'Plus Jakarta Sans', sans-serif);
  font-size: clamp(1.08rem, 3.2vw, 1.45rem);
  font-weight: 800;
  color: var(--text-main, #0f172a);
  margin-bottom: 8px;
  line-height: 1.25;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
  width: 100%;
  min-width: 0;
}

#simulador-demo .hero-card-subtitle {
  font-size: clamp(0.82rem, 2.2vw, 0.92rem);
  color: var(--text-muted, #475569);
  line-height: 1.45;
  margin-bottom: 16px;
  overflow-wrap: anywhere;
  word-break: break-word;
  width: 100%;
  min-width: 0;
}

/* 5.3 Contenedor de Campos de Datos */
#simulador-demo .hero-card-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
  background: #f8fafc;
  border-radius: 12px;
  padding: clamp(12px, 2.5vw, 18px);
  border: 1px solid #e2e8f0;
  width: 100%;
  min-width: 0;
}

#simulador-demo .card-field-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px dashed #e2e8f0;
  width: 100%;
  min-width: 0;
}

#simulador-demo .card-field-row:last-child {
  border-bottom: none;
}

#simulador-demo .field-label {
  font-size: clamp(0.74rem, 2vw, 0.82rem);
  font-weight: 700;
  color: #64748b;
  flex-shrink: 0;
  max-width: 45%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

#simulador-demo .field-value {
  font-size: clamp(0.80rem, 2.2vw, 0.88rem);
  font-weight: 700;
  color: #0f172a;
  text-align: right;
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* 5.4 Caja de Alerta / Insight */
#simulador-demo .hero-card-alert {
  padding: clamp(10px, 2.5vw, 14px);
  border-radius: 10px;
  font-size: clamp(0.78rem, 2.1vw, 0.84rem);
  font-weight: 600;
  line-height: 1.45;
  margin-bottom: 16px;
  width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* 5.5 Paneles de Interacción Especiales (Pasos 1, 2, 3, etc.) */
#simulador-demo .step-interactive-panel {
  margin-top: 10px;
  background: #ffffff;
  border: 1.5px solid #cbd5e1;
  border-radius: 12px;
  padding: 12px 14px;
  box-shadow: 0 4px 12px -2px rgba(15, 23, 42, 0.05);
  width: 100%;
  min-width: 0;
}

#simulador-demo .step-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
  width: 100%;
  min-width: 0;
}

#simulador-demo .step-panel-title {
  font-size: clamp(0.74rem, 2vw, 0.78rem);
  font-weight: 800;
  color: #334155;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  overflow-wrap: anywhere;
}

/* 5.6 Botones de Navegación de la Card (.hero-card-actions) */
#simulador-demo .hero-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  width: 100%;
  min-width: 0;
}

#simulador-demo .hero-card-actions button {
  min-width: 0;
}

#simulador-demo .btn-autoplay {
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  color: #334155;
  font-size: clamp(0.74rem, 2vw, 0.82rem);
  font-weight: 700;
  border-radius: 10px;
  padding: 8px 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

/* 5.7 Barra de Progreso Auto-Demo */
#simulador-demo .autoplay-progress-bar {
  width: 100%;
  height: 4px;
  background: #f1f5f9;
  border-radius: 9999px;
  overflow: hidden;
  margin-bottom: 12px;
  display: none;
}

#simulador-demo .autoplay-progress-bar.active {
  display: block;
}

#simulador-demo .autoplay-progress-fill {
  height: 100%;
  width: 0%;
  background: #2563eb;
  transition: width 0.1s linear;
}

/* 5.8 Nota al Pie de Confianza */
#simulador-demo .hero-card-footer-trust {
  font-size: clamp(0.68rem, 1.9vw, 0.76rem);
  color: #94a3b8;
  font-weight: 600;
  text-align: center;
  border-top: 1px solid #f1f5f9;
  padding-top: 12px;
  width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
}

/* ==========================================================================
   ADAPTACIONES RESPONSIVAS ESPECÍFICAS
   ========================================================================== */

/* TABLETS Y MÓVILES (<= 992px) */
@media (max-width: 992px) {
  #simulador-demo .hero-dual-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }
}

/* MÓVILES NORMALES Y PEQUEÑOS (<= 640px) */
@media (max-width: 640px) {
  #simulador-demo .hero-card-side,
  #simulador-demo .hero-dynamic-card {
    padding: 16px 14px;
    border-radius: 16px;
  }

  /* Las filas de datos se apilan verticalmente para máxima legibilidad */
  #simulador-demo .card-field-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
    padding: 7px 0;
  }

  #simulador-demo .field-label {
    max-width: 100%;
    font-size: 0.72rem;
    color: #64748b;
  }

  #simulador-demo .field-value {
    text-align: left;
    font-size: 0.84rem;
    width: 100%;
  }

  /* Distribución de botones: Siguiente arriba (100%), Anterior y Auto-Demo abajo (50/50) */
  #simulador-demo .hero-card-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  #simulador-demo #btnHeroNextStep {
    grid-column: 1 / -1;
    order: 1;
    width: 100%;
    justify-content: center;
    padding: 10px 14px;
    font-size: 0.82rem;
    white-space: normal;
    text-align: center;
    line-height: 1.25;
  }

  #simulador-demo #btnHeroPrevStep {
    order: 2;
    width: 100%;
    justify-content: center;
    padding: 8px 10px;
    font-size: 0.76rem;
  }

  #simulador-demo #btnHeroAutoPlay {
    order: 3;
    width: 100%;
    justify-content: center;
    padding: 8px 10px;
    font-size: 0.76rem;
  }
}

/* MÓVILES ULTRA PEQUEÑOS (<= 380px) */
@media (max-width: 380px) {
  #simulador-demo .hero-dynamic-card {
    padding: 14px 10px;
  }

  #simulador-demo .hero-card-top-bar {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  #simulador-demo .hero-card-title {
    font-size: 1.02rem;
  }

  #simulador-demo .hero-card-subtitle {
    font-size: 0.78rem;
  }

  #simulador-demo .field-value {
    font-size: 0.80rem;
  }
}
