/* Listing dock: the phone bar every Crush listing page carries. Call <first name> / Text / Email, fixed to the bottom
   edge on phones, on an opaque base that runs down through the safe area; the page pads its own bottom by exactly the
   bar's height so the footer's last line and the agent card are never under it. Hidden from 900px up, where the
   page's header carries the phone number and the Book button. CSS only, no JS.
   Measured from our listing pages (34 of them: peter-martin-3409-hwy3, boehm-team, aiken-doyle, t-williams, cliff-meredith,
   wilma-mixon-hall...): max-width 899px, 48px buttons in a 68px bar (10px 12px padding, 8px gaps), Call wider at
   1.35-1.5fr (1.4 most often), 18px stroked icons, a 2px press.

   Knobs: set them on :root (the page's body padding reads the same numbers). Every colour is the property's own.
     --ldock-bg          bar base (the page's darkest ground)          --ldock-line   hairline on top of the bar
     --ldock-btn-bg      Text / Email fill (solid, never see-through) --ldock-btn-ink their text + icon colour
     --ldock-btn-border  their 1px edge                                --ldock-main-bg / -ink / -border  the Call button
     --ldock-btn-h       button height (48px)                          --ldock-pad-y / --ldock-pad-x  bar padding (10px / 12px)
     --ldock-gap         between buttons (8px)                         --ldock-main-grow  Call's share vs 1 for the others (1.4)
     --ldock-radius      button corners (4px)                          --ldock-font   label font (600 15px/1 system sans)
     --ldock-press       press distance (2px)                          --ldock-z      stacking (60)
     --ldock-focus       keyboard focus ring colour
   Breakpoint: the two @media (max-width: 899px) lines below (CSS can't take a variable there). */

.ldock { display: none; }

@media (max-width: 899px) {
  /* the page makes room: its last line and any anchor or focused field land above the bar, never under it */
  body:has(.ldock), .ldock-pad {
    padding-bottom: calc(var(--ldock-btn-h, 48px) + 2 * var(--ldock-pad-y, 10px) + env(safe-area-inset-bottom, 0px));
  }
  html:has(.ldock) {
    scroll-padding-bottom: calc(var(--ldock-btn-h, 48px) + 2 * var(--ldock-pad-y, 10px) + env(safe-area-inset-bottom, 0px) + 12px);
  }

  .ldock {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--ldock-z, 60);
    display: flex; gap: var(--ldock-gap, 8px); box-sizing: border-box;
    /* the base runs to the screen's bottom edge, through the home-indicator strip: nothing of the page shows below it */
    padding: var(--ldock-pad-y, 10px) var(--ldock-pad-x, 12px) calc(var(--ldock-pad-y, 10px) + env(safe-area-inset-bottom, 0px));
    background: var(--ldock-bg, #22302a);
    box-shadow: 0 -1px 0 var(--ldock-line, rgb(0 0 0 / .2));
    transition: transform .25s cubic-bezier(.22, .8, .2, 1), visibility 0s linear 0s;
  }
  .ldock__b {
    flex: 1 1 0; min-width: 0; box-sizing: border-box; height: var(--ldock-btn-h, 48px);
    display: flex; align-items: center; justify-content: center; gap: 8px; padding: 0 10px;
    border: 1px solid var(--ldock-btn-border, rgb(255 255 255 / .14)); border-radius: var(--ldock-radius, 4px);
    background: var(--ldock-btn-bg, #34463d); color: var(--ldock-btn-ink, #f3eee4);
    font: var(--ldock-font, 600 15px/1 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif);
    text-decoration: none; -webkit-tap-highlight-color: transparent; touch-action: manipulation;
  }
  .ldock__b--main {
    flex-grow: var(--ldock-main-grow, 1.4);
    background: var(--ldock-main-bg, #b8473a); color: var(--ldock-main-ink, #fff8f0);
    border-color: var(--ldock-main-border, rgb(255 255 255 / .22));
  }
  .ldock__b > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ldock__b svg {
    flex: none; width: 18px; height: 18px;
    fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round;
  }
  .ldock__b:active { transform: translateY(var(--ldock-press, 2px)); }
  .ldock__b:focus-visible { outline: 2px solid var(--ldock-focus, #fff); outline-offset: 2px; }

  /* flush look (boehm-team): one edge-to-edge strip of cells split by hairlines, 60px tall, no rounded buttons */
  .ldock--flush { gap: 0; padding: 0 0 env(safe-area-inset-bottom, 0px); }
  .ldock--flush .ldock__b { height: var(--ldock-btn-h, 60px); border: 0; border-radius: 0; }
  .ldock--flush .ldock__b + .ldock__b { border-left: 1px solid var(--ldock-btn-border, rgb(255 255 255 / .14)); }
  body:has(.ldock--flush) { padding-bottom: calc(var(--ldock-btn-h, 60px) + env(safe-area-inset-bottom, 0px)); }

  /* a menu, a true modal or the photo viewer (product-lightbox) owns the screen: the bar steps down out of its way
     and comes back when it closes */
  html.is-menu-open .ldock, html.is-modal-open .ldock, html.plb-open .ldock {
    transform: translateY(100%); visibility: hidden;
    transition: transform .25s cubic-bezier(.22, .8, .2, 1), visibility 0s linear .25s;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ldock, html.is-menu-open .ldock, html.is-modal-open .ldock, html.plb-open .ldock { transition: none; }
  .ldock__b:active { transform: none; }
}
@media print { .ldock { display: none !important; } }
