/* Face Plan™ — mobile bottom tab bar (app shell) */
:root {
  --fp-bottom-nav-h: 0px;
  --fp-quota-banner-h: 0px;
  --fp-gold: #c9a96e;
  --fp-nav-bg: rgba(18, 18, 18, 0.94);
  --fp-nav-border: rgba(201, 169, 110, 0.14);
  --fp-nav-muted: #8a8680;
}

body.fp-bottom-nav-on {
  --fp-bottom-nav-h: calc(60px + env(safe-area-inset-bottom, 0px));
}

body.fp-nav-guard #fpBottomNav,
body.fp-nav-guard #fpMoreSheet,
body.is-slider-dragging #fpBottomNav,
body.is-slider-dragging #fpMoreSheet {
  pointer-events: none !important;
}

#fpBottomNav {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 240;
  height: var(--fp-bottom-nav-h);
  padding: 0 4px env(safe-area-inset-bottom, 0px);
  box-sizing: border-box;
  background: var(--fp-nav-bg);
  border-top: 1px solid var(--fp-nav-border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  align-items: stretch;
  justify-content: space-around;
  font-family: 'DM Sans', system-ui, sans-serif;
  /* Evita o browser interpretar swipe horizontal como navegação ao soltar perto da barra */
  touch-action: manipulation;
}

body.fp-bottom-nav-on #fpBottomNav {
  display: flex;
}

body.fp-bottom-nav-on.tv-presentation #fpBottomNav,
body.fp-bottom-nav-on.presentation-mode #fpBottomNav {
  display: none !important;
}

body.fp-bottom-nav-on.tv-presentation,
body.fp-bottom-nav-on.presentation-mode {
  --fp-bottom-nav-h: 0px;
}

.fp-bn-tab {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 8px 2px 6px;
  border: none;
  background: transparent;
  color: var(--fp-nav-muted);
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  font: inherit;
  min-height: 48px;
}

.fp-bn-tab svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.fp-bn-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1;
  white-space: nowrap;
}

.fp-bn-tab.active {
  color: var(--fp-gold, #c9a96e);
}

.fp-bn-tab.active svg {
  filter: drop-shadow(0 0 6px rgba(201, 169, 110, 0.35));
}

.fp-bn-tab:focus-visible {
  outline: 1px solid var(--fp-gold, #c9a96e);
  outline-offset: -2px;
  border-radius: 8px;
}

/* Push page content above the bar (avoid clobbering page-specific bottom chrome) */
@media (max-width: 1023px) {
  body.fp-bottom-nav-on .app {
    height: calc(100vh - 65px - 48px - var(--fp-bottom-nav-h) - var(--fp-quota-banner-h, 0px)) !important;
    height: calc(100dvh - 65px - 48px - var(--fp-bottom-nav-h) - var(--fp-quota-banner-h, 0px)) !important;
  }

  /* historico / compare style pages */
  body.fp-bottom-nav-on > main,
  body.fp-bottom-nav-on > .wrap {
    padding-bottom: calc(32px + var(--fp-bottom-nav-h));
  }
}

/* Precos savebar sits above bottom nav; keep room for both */
body.fp-bottom-nav-on .savebar {
  bottom: var(--fp-bottom-nav-h);
}

@media (max-width: 1023px) {
  body.fp-bottom-nav-on:has(.savebar) {
    padding-bottom: calc(120px + var(--fp-bottom-nav-h)) !important;
  }
}

body.fp-bottom-nav-on.tv-presentation .tv-exit-hint,
body.fp-bottom-nav-on.presentation-mode .tv-exit-hint {
  bottom: max(16px, env(safe-area-inset-bottom));
}

/* ── Mais sheet ── */
#fpMoreSheet {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 260;
}

#fpMoreSheet.open {
  display: block;
}

.fp-more-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  border: none;
  cursor: pointer;
}

.fp-more-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 10px 16px calc(18px + env(safe-area-inset-bottom, 0px));
  background: #141414;
  border-top: 1px solid var(--fp-nav-border);
  border-radius: 16px 16px 0 0;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.55);
  font-family: 'DM Sans', system-ui, sans-serif;
  transform: translateY(8px);
  opacity: 0;
  transition: transform 0.22s ease, opacity 0.22s ease;
}

#fpMoreSheet.open .fp-more-panel {
  transform: translateY(0);
  opacity: 1;
}

.fp-more-handle {
  width: 36px;
  height: 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.18);
  margin: 0 auto 14px;
}

.fp-more-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fp-gold, #c9a96e);
  margin-bottom: 10px;
}

.fp-more-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px 4px;
  border: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: transparent;
  color: #f0ede8;
  font-size: 15px;
  font-weight: 500;
  font-family: inherit;
  text-decoration: none;
  cursor: pointer;
  text-align: left;
}

.fp-more-link:last-of-type {
  border-bottom: none;
}

.fp-more-link.danger {
  color: #e57373;
}

.fp-more-link[hidden] {
  display: none !important;
}

@media (min-width: 1024px) {
  body.fp-bottom-nav-on {
    --fp-bottom-nav-h: 0px;
    padding-bottom: 0 !important;
  }
  body.fp-bottom-nav-on #fpBottomNav {
    display: none !important;
  }
}
