/*
 * DOVE SEI NEL FUNNEL (shared/_funnel_nav): la barra dei cinque passi dei nuovi clienti,
 * sopra ogni pagina del CRM. Il passo corrente e' pieno, gli altri sono cliccabili; il
 * pallino col numero dice a che punto del processo si e'. Una property per riga.
 */

.funnel-nav {
  margin: 0 0 1.1rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.funnel-nav::-webkit-scrollbar {
  display: none;
}

.funnel-nav-passi {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  width: max-content;
  min-width: 100%;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-1);
}

.funnel-nav-passo {
  flex: 0 0 auto;
}

.funnel-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 38px;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  color: var(--gray-text);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.funnel-nav-link:hover {
  background: var(--azure-soft);
  color: var(--navy);
}

.funnel-nav-n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex: none;
  border-radius: 50%;
  background: var(--border-soft);
  color: var(--gray-text);
  font-size: 0.72rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.funnel-nav-passo.is-attivo .funnel-nav-link {
  background: var(--gradient-brand);
  color: #ffffff;
}

.funnel-nav-passo.is-attivo .funnel-nav-n {
  background: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

/* Il lavoro che aspetta su quel passo: e' il motivo per cui ci si clicca sopra. */
.funnel-nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 0.35rem;
  border-radius: 999px;
  background: var(--corallo);
  color: #ffffff;
  font-size: 0.7rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.funnel-nav-passo.is-attivo .funnel-nav-badge {
  background: #ffffff;
  color: var(--corallo-dark);
}

@media (max-width: 48rem) {
  .funnel-nav-nome {
    display: none;
  }

  .funnel-nav-passo.is-attivo .funnel-nav-nome {
    display: inline;
  }

  .funnel-nav-link {
    padding: 0.35rem 0.5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .funnel-nav-link {
    transition: none;
  }
}

/* ---------- Non tagliare mai un passo ---------- */
/* Prima la striscia scorreva in orizzontale e l'ultimo passo restava mozzato contro il bordo:
   sembrava un errore, non una barra da scorrere. Ora va a capo e il contenitore cresce. Lo
   scorrimento resta solo sotto i 48rem, dove le etichette sono gia' nascoste e i pallini
   stanno in fila comodi. */

.funnel-nav {
  overflow: visible;
}

.funnel-nav-passi {
  flex-wrap: wrap;
  width: auto;
  min-width: 0;
  border-radius: var(--radius);
  row-gap: 0.2rem;
}

@media (max-width: 48rem) {
  .funnel-nav {
    overflow-x: auto;
  }

  .funnel-nav-passi {
    flex-wrap: nowrap;
    width: max-content;
    min-width: 100%;
    border-radius: 999px;
  }
}
