/* ═══════════════════════════════════════════════════════════════════════
   Lazzo Bienestar · Cliente — Bottom nav (C8)
   ───────────────────────────────────────────────────────────────────────
   Chasis visual clon del SPA Lazzo (.bottom-nav del app.css) pero:
   - Sin tab-bump central (no hay acción dominante en este módulo)
   - Acento activo violeta (--bcl-c1) en lugar del gradiente coral
   - Indicador activo = línea fina debajo del label (en lugar del dot)
   - Badge "Pronto" para tabs en placeholder (Mensajes hasta C10)
   Variables heredadas de cliente.css.
   ═══════════════════════════════════════════════════════════════════════ */

#screen-bienestar .bcl-tab-pane {
  flex: 1;
  min-height: 0;          /* permite overflow:auto del hijo en flex */
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  background: var(--bcl-bg);
}
#screen-bienestar .bcl-tab-pane[hidden] { display: none !important; }

/* El root de cada feature interna ocupa todo el alto del pane y deja
   espacio inferior para la nav (sino el último botón queda tapado). */
#bcl-welcome-root,
#bcl-sesiones-root {
  width: 100%;
  min-height: 100%;
  padding-bottom: calc(var(--bcl-nav-h, 76px) + var(--safe-bottom, 0px) + 24px);
  box-sizing: border-box;
}

/* ── Bottom nav contenedor ────────────────────────────────────────────── */
#screen-bienestar {
  --bcl-nav-h: 64px;
  --bcl-nav-side-pad: 14px;
}
.bcl-bottom-nav {
  position: relative;          /* dentro del flex column */
  flex: 0 0 auto;
  width: 100%;
  padding: 0 var(--bcl-nav-side-pad)
           calc(var(--safe-bottom, 0px) + 14px);
  background: transparent;
  z-index: 5;
  pointer-events: none;        /* solo el inner recibe taps */
}
.bcl-bottom-nav-inner {
  pointer-events: auto;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  height: var(--bcl-nav-h);
  background: #ffffff;
  border-radius: 24px;
  box-shadow:
    0 8px 32px -8px rgba(123, 95, 176, 0.22),
    0 2px 8px -2px rgba(0, 0, 0, 0.06);
  display: flex;
  align-items: stretch;
  padding: 0 4px;
  position: relative;
}

/* Línea decorativa superior tenue (sutil, refuerza separación) */
.bcl-bottom-nav-inner::before {
  content: '';
  position: absolute;
  top: 0; left: 24px; right: 24px;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(155, 127, 212, 0.08) 50%,
    transparent 100%
  );
}

/* ── Tab ──────────────────────────────────────────────────────────────── */
.bcl-nav-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 4px 8px;
  background: none;
  border: 0;
  font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--bcl-muted, #8a857d);
  cursor: pointer;
  position: relative;
  border-radius: 16px;
  -webkit-tap-highlight-color: transparent;
  outline: none;
  transition: color 0.18s ease;
}
.bcl-nav-tab i[data-lucide] {
  width: 22px;
  height: 22px;
  stroke-width: 1.7;
  display: block;
  transition: transform 0.18s ease, stroke-width 0.18s ease;
}
.bcl-nav-tab span:not(.bcl-nav-badge) {
  text-transform: capitalize;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* Estado activo: color violeta + icono más grueso + indicador fino */
.bcl-nav-tab.is-active {
  color: var(--bcl-c1, #9b7fd4);
}
.bcl-nav-tab.is-active i[data-lucide] {
  stroke-width: 2.3;
  transform: translateY(-1px);
}
.bcl-nav-tab.is-active::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  width: 18px;
  height: 3px;
  border-radius: 2px;
  background: var(--bcl-grad, linear-gradient(135deg, #9b7fd4, #f4956a));
}

/* Tap feedback */
.bcl-nav-tab:active i[data-lucide] {
  transform: scale(0.86);
}

/* ── Badge "Pronto" (Mensajes placeholder) ────────────────────────────── */
.bcl-nav-badge {
  position: absolute;
  top: 4px;
  right: calc(50% - 26px);
  background: linear-gradient(135deg, var(--bcl-c1, #9b7fd4), var(--bcl-c2, #f4956a));
  color: #fff;
  font-size: 0.52rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 2px 7px;
  border-radius: 9px;
  border: 1.5px solid #fff;
  pointer-events: none;
  text-transform: uppercase;
  line-height: 1.1;
  box-shadow: 0 2px 6px -2px rgba(155, 127, 212, 0.45);
}

/* ── Mostrar/ocultar nav según contexto ────────────────────────────────
   Ocultar cuando hay overlay activo encima (calendario, resumen, cuestionario,
   pago) — cada uno los gestiona via .bcl-nav-hidden setter en JS. */
.bcl-bottom-nav[hidden] { display: none; }
#screen-bienestar.bcl-nav-hidden .bcl-bottom-nav { display: none; }

/* Ajuste safe-area iOS para que el inner no quede tapado por la home bar */
@supports (padding: env(safe-area-inset-bottom)) {
  #screen-bienestar {
    --safe-bottom: env(safe-area-inset-bottom);
  }
}

/* ── Responsive: pantallas pequeñas ───────────────────────────────────── */
@media (max-width: 360px) {
  #screen-bienestar { --bcl-nav-side-pad: 10px; }
  .bcl-nav-tab { font-size: 0.58rem; }
  .bcl-nav-tab i[data-lucide] { width: 20px; height: 20px; }
  .bcl-nav-badge { right: calc(50% - 22px); font-size: 0.48rem; padding: 2px 5px; }
}

/* ─── C5.4: gating tabs Sesiones + Mensajes (2026-05-12) ──────────────────── */
/* Sin reserva ≥ pendiente_validacion, esos tabs están "atenuados" + candado. */
.bcl-nav-tab.bcl-nav-bloqueado {
  opacity: 0.42;
  cursor: not-allowed;
  position: relative;
}
.bcl-nav-tab.bcl-nav-bloqueado::before {
  content: '';
  position: absolute;
  top: 6px;
  right: calc(50% - 22px);
  width: 14px;
  height: 14px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect width='18' height='11' x='3' y='11' rx='2' ry='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E");
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  color: var(--bcl-muted, #807c7c);
  opacity: 0.9;
}
.bcl-nav-tab.bcl-nav-bloqueado:active {
  /* Aún si pulsan, no parece "activo" — solo dispara toast */
  background: transparent !important;
}
