/* ============================================================
 * Sticky Bottom CTA — Phase 10 Sprint 1 (2026-05-09)
 *
 * Barre fixe bas mobile sur landing/pricing/marketplace/blog.
 * Apparaît après scroll au-delà du hero, se cache près du footer.
 * Driver : `app/javascript/controllers/sticky_cta_controller.js`.
 *
 * Pattern : utilisé par Stripe, Linear, Notion landing pages.
 * Toujours masqué sur >= lg (sidebar/topbar prennent le relais).
 *
 * État : `.is-visible` ajouté/retiré par le controller. Sans la
 * classe, le bar est translaté hors écran (transform translateY 100%).
 * ============================================================ */

.sticky-bottom-cta {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 7000; /* below mobile-bnav (8000) so they stack correctly */
  padding: 0.75rem 1rem;
  padding-bottom: max(0.75rem, calc(env(safe-area-inset-bottom, 0) + 0.75rem));
  background: var(--bg-surface, #ffffff);
  border-top: 1px solid var(--border-default, #e2e8f0);
  box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.08);
  /* Hidden by default — controller toggles .is-visible on scroll past threshold */
  transform: translateY(calc(100% + env(safe-area-inset-bottom, 0)));
  opacity: 0;
  pointer-events: none;
  transition: transform 240ms cubic-bezier(0.32, 0.72, 0, 1),
              opacity 200ms ease;
  will-change: transform;
}

.sticky-bottom-cta.is-visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.sticky-bottom-cta__inner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  max-width: 480px;
  margin: 0 auto;
}

.sticky-bottom-cta .btn {
  flex: 1;
  min-height: 48px;
  font-weight: 600;
}

.sticky-bottom-cta__hint {
  font-size: 0.75rem;
  color: var(--text-tertiary);
  text-align: center;
  margin-top: 0.25rem;
  display: block;
}

/* Hide on desktop — sidebar/topbar take over */
@media (min-width: 1024px) {
  .sticky-bottom-cta {
    display: none;
  }
}

/* When the mobile-bnav is also present (signed-in users on landing),
   stack the sticky CTA above the bnav. Sibling selector. */
.mobile-bnav-wrapper ~ .sticky-bottom-cta,
.mobile-bnav-wrapper + .sticky-bottom-cta {
  bottom: calc(64px + env(safe-area-inset-bottom, 0));
  padding-bottom: 0.75rem;
}

@media (prefers-reduced-motion: reduce) {
  .sticky-bottom-cta { transition: none; }
}
