/*
  The pinned "Book a call" on a phone (the Bakersfield pages' "phone_bar": True). Under 768 px the nav shows only the logo and Menu, so a
  reader far down a page has no booking button on screen. phone-bar.js shows this bar (data-visible) once the header's buttons are above the
  screen and until the closing block comes in; the closing block and the footer carry their own buttons. Hidden, it is visibility: hidden,
  so it cannot be focused or tapped. Load after service-page.css (.blog-button, the blue pill, is the same one the rows use). The blog, the
  case studies, /work and /about carry it too (their templates load blog.css, which defines .blog-button).

  Room for a chat bubble: the owner plans to install the CRM's chat widget at the bottom right (2026-11-18). Once it is in, set --chat-slot
  on :root to the bubble's width plus its gap, and the button stops short of it instead of running under it. Default 0, so nothing changes
  until then.
*/
.svc-pin { display: none; }

@media (max-width: 767.98px) {
  .svc-pin {
    display: block; position: fixed; right: 0; bottom: 0; left: 0; z-index: 30;   /* under the nav (z-40) and its open menu */
    padding: 12px calc(16px + var(--chat-slot, 0px)) calc(12px + env(safe-area-inset-bottom, 0px)) 16px;   /* --chat-slot: see the note above */
    pointer-events: none;   /* only the pill takes a tap, so the strip around it never blocks the page */
    opacity: 0; visibility: hidden; transform: translateY(12px);
    transition: opacity 150ms var(--ease-out), transform 150ms var(--ease-out), visibility 0s linear 150ms;
  }
  .svc-pin[data-visible] {
    opacity: 1; visibility: visible; transform: none;
    transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out), visibility 0s;
  }
  .svc-pin .svc-pin__button {
    display: flex; width: 100%; height: auto; min-height: 52px; pointer-events: auto;
    box-shadow: 0 1px 3px rgb(12 14 18 / 0.2), 0 8px 24px rgb(12 14 18 / 0.18);
  }

  /* The bar is the same action as the rows' own "Book a call" (and the line above one), so they step aside on a phone. The header's pair,
     the closing block's pair and each row's "Ask about ..." button stay */
  .has-phone-bar .svc-book, .has-phone-bar .svc-book__line { display: none; }

  /* A link reached by key must not land under the bar (WCAG 2.4.11): the page scrolls it clear of it */
  html:has(.svc-pin) { scroll-padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px)); }
}

/* Reduced motion: it fades, it does not slide */
@media (prefers-reduced-motion: reduce) {
  .svc-pin, .svc-pin[data-visible] { transform: none; }
}

@media print { .svc-pin { display: none; } }
