/* ===========================================================================
   IMP-020 — BOTTOM NAV  (navbar inferior global)
   5 itens · centro elevado (Postar, laranja) · safe-area iOS · alvos >=44px
   Marcação no parcial views/site/shared/bottom-nav.php (incluído UMA vez
   no fim do body de layout.php).
   =========================================================================== */

.fb-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: var(--fb-z-nav);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: stretch;

  height: calc(var(--fb-nav-h) + var(--fb-safe-bottom));
  padding-bottom: var(--fb-safe-bottom);

  background: color-mix(in srgb, var(--fb-surface) 86%, transparent);
  -webkit-backdrop-filter: saturate(140%) blur(14px);
  backdrop-filter: saturate(140%) blur(14px);
  border-top: 1px solid var(--fb-line);
  /* sombra para cima — separa a nav do conteúdo sem linha dura */
  box-shadow: 0 -6px 20px rgba(16, 40, 42, 0.08);
  font-family: var(--fb-font-body);
}

/* fallback p/ navegadores sem color-mix (WebView antigo) */
@supports not (background: color-mix(in srgb, #fff 86%, transparent)) {
  .fb-nav { background: var(--fb-surface); }
}

/* o conteúdo da página deve reservar espaço para a nav */
.fb-has-bottom-nav {
  padding-bottom: calc(var(--fb-nav-h) + var(--fb-safe-bottom) + var(--fb-space-3));
}

.fb-nav__item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 44px;           /* alvo acessível */
  text-decoration: none;
  color: var(--fb-faint);
  transition: color var(--fb-dur-2) var(--fb-ease);
  -webkit-tap-highlight-color: transparent;
}

.fb-nav__icon {
  font-size: 20px;
  line-height: 1;
  transition: transform var(--fb-dur-2) var(--fb-ease-spring);
}

.fb-nav__label {
  font-size: var(--fb-fs-xs);
  font-weight: var(--fb-fw-med);
  letter-spacing: 0.02em;
}

/* Estado ativo: cor teal-funda + indicador (pílula no topo do item) */
.fb-nav__item.is-active {
  color: var(--fb-teal-deep);
}
.fb-nav__item.is-active .fb-nav__icon {
  transform: translateY(-1px) scale(1.06);
}
.fb-nav__item.is-active::before {
  content: "";
  position: absolute;
  top: 0;
  width: 22px; height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--fb-teal-deep);
}

/* Item central — a fisgada. Botão flutuante laranja elevado. */
.fb-nav__item--center {
  justify-content: flex-end;
  color: var(--fb-orange-deep);
}
.fb-nav__item--center .fb-nav__fab {
  position: absolute;
  top: -22px;
  display: grid;
  place-items: center;
  width: 56px; height: 56px;
  border-radius: var(--fb-radius-pill);
  background: linear-gradient(150deg, var(--fb-orange) 0%, var(--fb-orange-deep) 100%);
  color: #fff;
  font-size: 22px;
  box-shadow: var(--fb-shadow-orange);
  border: 3px solid var(--fb-surface); /* anel que "recorta" da nav */
  transition: transform var(--fb-dur-2) var(--fb-ease-spring),
              box-shadow var(--fb-dur-2) var(--fb-ease);
}
.fb-nav__item--center .fb-nav__label {
  margin-top: 2px;
  color: var(--fb-orange-deep);
}
.fb-nav__item--center:active .fb-nav__fab {
  transform: scale(0.92);
  box-shadow: var(--fb-shadow-orange-lg);
}
.fb-nav__item--center.is-active .fb-nav__fab {
  transform: scale(1.04);
}
/* sem indicador-pílula no item central (o FAB já comunica) */
.fb-nav__item--center.is-active::before { display: none; }

/* Foco visível (teclado) */
.fb-nav__item:focus-visible {
  outline: 2px solid var(--fb-teal-deep);
  outline-offset: -4px;
  border-radius: var(--fb-radius-sm);
}

/* Tap feedback genérico */
.fb-nav__item:active .fb-nav__icon { transform: scale(0.9); }

/* Desktop largo: a nav inferior some; o menu/topbar atual assume.
   Breakpoint alinhado ao Bootstrap 4 (md = 768px). */
@media (min-width: 768px) {
  .fb-nav { display: none; }
  .fb-has-bottom-nav { padding-bottom: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .fb-nav__icon,
  .fb-nav__item--center .fb-nav__fab { transition: none; }
}
