/* ================================================================
   GUÍA PEDAGÓGICA — Estilos específicos
   ================================================================ */

/* ── Hero ────────────────────────────────────────────────── */

.guia-hero {
  background: linear-gradient(135deg, #1e293b, #0f172a);
  color: #fff;
  padding: 2rem 0 1.75rem;
}

.guia-hero .back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: #94a3b8;
  text-decoration: none;
  font-size: 0.8rem;
  margin-bottom: 1rem;
  transition: color .15s;
}

.guia-hero .back-link:hover { color: #e2e8f0; }

.guia-hero h1 {
  font-size: clamp(1.4rem, 3vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.025em;
}

.guia-hero .hero-sub {
  color: #94a3b8;
  font-size: 0.9rem;
  margin-top: 0.35rem;
  max-width: 560px;
}

/* ── Main content ────────────────────────────────────────── */

.guia-main { padding: 2rem 0 4rem; }

.guia-section { margin-bottom: 2.5rem; }

.guia-section-title {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* ── Acordeón (details/summary) ──────────────────────────── */

.accordion { display: flex; flex-direction: column; gap: 0.5rem; }

.accordion-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.accordion-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.125rem;
  cursor: pointer;
  font-weight: 700;
  font-size: 0.9rem;
  list-style: none;
  gap: 0.75rem;
  user-select: none;
  transition: background .12s;
}

.accordion-item summary::-webkit-details-marker { display: none; }

.accordion-item summary:hover { background: #f8fafc; }

.accordion-item[open] summary {
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
}

.summary-left {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.summary-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.summary-chevron {
  font-size: 0.75rem;
  color: var(--text-muted);
  transition: transform .2s ease;
  flex-shrink: 0;
}

.accordion-item[open] .summary-chevron { transform: rotate(180deg); }

.accordion-body {
  padding: 1.125rem;
  font-size: 0.875rem;
  line-height: 1.7;
  color: #334155;
}

.accordion-body p { margin-bottom: 0.75rem; }
.accordion-body p:last-child { margin-bottom: 0; }

.accordion-body strong { color: var(--text); }

.accordion-body ul, .accordion-body ol {
  padding-left: 1.25rem;
  margin: 0.5rem 0 0.75rem;
}

.accordion-body li { margin-bottom: 0.3rem; }

.accordion-body .callout {
  background: #eff6ff;
  border-left: 3px solid #3b82f6;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 0.75rem 1rem;
  margin: 0.75rem 0;
  font-size: 0.83rem;
  color: #1e40af;
}

.accordion-body .callout.green {
  background: var(--valle-bg);
  border-color: var(--valle);
  color: #065f46;
}

.accordion-body .callout.amber {
  background: var(--llano-bg);
  border-color: var(--llano);
  color: #78350f;
}

/* ── Tabla comparativa ───────────────────────────────────── */

/* Wrapper de scroll horizontal — nada más que lo necesario */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-top: 1.25rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}

/* Dentro del cuerpo de un acordeón el margen lo pone el wrapper inline */
.accordion-body .table-scroll { margin-top: 0; }

.compare-table {
  width: auto;        /* NO width:100% — deja que la tabla crezca si lo necesita */
  min-width: 100%;    /* pero al menos rellena el contenedor cuando hay espacio */
  border-collapse: collapse;
  font-size: 0.82rem;
  background: var(--surface);
}

.compare-table th {
  background: #1e293b;
  color: #e2e8f0;
  padding: 0.6rem 0.875rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.compare-table td {
  padding: 0.625rem 0.875rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.compare-table tr:last-child td { border-bottom: none; }
.compare-table tr:nth-child(even) td { background: #f8fafc; }

@media (max-width: 639px) {
  /* Padding más ajustado */
  .compare-table th,
  .compare-table td { padding: 0.5rem 0.625rem; font-size: 0.78rem; }

  /* Oculta la columna "Requiere seguimiento" (col 3) en la tabla principal
     de 4 columnas — la información es deducible del tipo de tarifa */
  .guia-section > .table-scroll .compare-table th:nth-child(3),
  .guia-section > .table-scroll .compare-table td:nth-child(3) {
    display: none;
  }
}

.compare-table .tag {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 700;
}

.tag.green  { background: var(--valle-bg);  color: var(--valle); }
.tag.amber  { background: var(--llano-bg);  color: var(--llano); }
.tag.red    { background: var(--punta-bg);  color: var(--punta); }

/* ── Mini-curso: pasos de la factura ─────────────────────── */

.steps { display: flex; flex-direction: column; gap: 1rem; }

.step {
  display: flex;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1.125rem;
  align-items: flex-start;
}

.step-number {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #1e293b;
  color: #fff;
  font-weight: 800;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.step-content h3 {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
  color: var(--text);
}

.step-content p {
  font-size: 0.83rem;
  color: #334155;
  line-height: 1.65;
  margin-bottom: 0.4rem;
}

.step-content p:last-child { margin-bottom: 0; }

.step-formula {
  display: inline-block;
  background: #f1f5f9;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  font-family: 'Courier New', monospace;
  color: var(--text);
  margin-top: 0.3rem;
}

/* ── Guía de decisión ────────────────────────────────────── */

.decision-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.875rem;
}

@media (min-width: 640px) {
  .decision-grid { grid-template-columns: repeat(3, 1fr); }
}

.decision-card {
  border-radius: var(--radius-sm);
  padding: 1.125rem;
  border: 1px solid transparent;
}

.decision-card.pvpc   { background: var(--valle-bg);  border-color: var(--valle-border); }
.decision-card.libre  { background: var(--llano-bg);  border-color: var(--llano-border); }
.decision-card.fijo   { background: var(--punta-bg);  border-color: var(--punta-border); }

.decision-card h3 {
  font-size: 0.9rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}

.decision-card.pvpc  h3 { color: var(--valle); }
.decision-card.libre h3 { color: var(--llano); }
.decision-card.fijo  h3 { color: var(--punta); }

.decision-card p {
  font-size: 0.8rem;
  line-height: 1.6;
  color: #334155;
  margin-bottom: 0.4rem;
}

.decision-card .ideal-for {
  font-size: 0.75rem;
  font-weight: 700;
  margin-top: 0.5rem;
  color: #475569;
}

/* ── Footer guía ─────────────────────────────────────────── */

.guia-footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 0;
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-muted);
}

.guia-footer a { color: #3b82f6; text-decoration: none; }
.guia-footer a:hover { text-decoration: underline; }
