/* ==========================================================================
   THE MOBILE "GET A QUOTE" BAR. ONE FILE, THE BUSINESS-FACING PAGES.
   ==========================================================================

   A fixed bar at the bottom of the screen carrying the one call to action a
   business owner is here to make. It is PHONE ONLY (the desktop header already
   carries the button in view the whole time) and it appears only AFTER the hero
   has scrolled out of view, so it never covers the hero's own buttons.

   The bar is a deep green strip spanning the full width, and the tap target
   inside it is a cream pill reading "Get a quote". The whole strip is one
   anchor, so a tap anywhere on it opens the business form.

   It ships on the business-facing pages that have a hero to watch (index.html
   and coverage.html) and is deliberately absent from the application forms
   (apply-business, apply-creator) and the portal pages: a person filling in the
   form does not need a second button telling them to start it.

   Load it AFTER tokens.css: --deep-green and --ts-green come from there, and the
   pages that carry the bar define --accent (the cream). The behaviour is
   /quoteBar.js; without it the bar stays off-screen, which is its resting state,
   so no script failure can leave it stuck over the content.
   ========================================================================== */

/* Off on desktop entirely: the header button is always in view there. */
.mobile-quote-bar { display: none; }

@media (max-width: 768px) {
  .mobile-quote-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 900;
    display: block;
    text-decoration: none;
    /* Deep green strip, full width. The safe-area inset keeps the bar clear of
       the iOS home indicator and the Safari bottom toolbar. */
    background: var(--ts-green, #1F433D);
    padding: 0.7rem 16px calc(0.7rem + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -4px 20px rgba(23, 46, 42, 0.25);
    /* Starts slid out of view; the script slides it up once the hero is gone. */
    transform: translateY(120%);
    transition: transform 0.28s ease;
  }
  .mobile-quote-bar.is-visible { transform: translateY(0); }

  /* The cream pill: full width inside the bar, a comfortable tap target. */
  .mobile-quote-bar .mqb-pill {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 44px;
    padding: 0.55rem 1.25rem;
    border-radius: 9999px;
    background: var(--accent, #E8E0D0);
    color: var(--deep-green, #1F433D);
    font-family: var(--font-body, 'Libre Franklin', sans-serif);
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.04em;
  }

  /* The bar only appears once the hero has scrolled out of view, which is when
     the footer comes into view, so reserve room at the foot of the page and the
     last footer row is never hidden behind it. `body footer` outranks each
     page's own `footer` rule regardless of load order. */
  body footer { padding-bottom: calc(5.5rem + env(safe-area-inset-bottom, 0px)); }
}

/* A reader who asked not to be moved gets no slide: the bar is simply there or
   not, switched by the same class without the transition. */
@media (prefers-reduced-motion: reduce) {
  .mobile-quote-bar { transition: none; }
}
