/* ==========================================================================
   Beacon Capital - Floating Dock: desktop header-safe placement (21 Oct 2026)

   Problem: on desktop (>= 1025px) the dock was centred on the full viewport
   (top:50%). On a laptop window (e.g. 1366 wide, ~600px tall inner height) the
   ~540px rail started at ~30px, i.e. underneath the fixed header (#bc-ai-header,
   81-96px tall, z-index 9999), so the WhatsApp item - the first action - was
   covered by the header.

   Fix: the dock is centred inside the SAFE AREA between the bottom edge of the
   visible fixed header and the bottom of the viewport (minus the Complianz
   "Manage consent" button when it sits in the same corner). The safe area is
   measured live by window.__bcDockFit (inline bootstrap in bc-floating-dock.php)
   and written to two custom properties on #bc-dock:
     --bc-dock-top    first usable px below the header (+12px gap)
     --bc-dock-avail  usable height of the safe area
   The same function scales --bc-size down (44px -> min 30px) so the rail fits,
   and only when even 30px items cannot fit does it switch on internal scrolling
   (.bc-dock--fit-scroll).

   Without JS the fallbacks below keep the dock clear of the header.
   z-index is unchanged (9985): still below the header, its mega menu, the
   ElementsKit offcanvas menu and the consent banner.
   Touch layouts (<= 1024px) are untouched.
   ========================================================================== */

@media (min-width: 1025px) {
  #bc-dock {
    top: calc(var(--bc-dock-top, 108px) + (var(--bc-dock-avail, calc(100vh - 120px)) / 2));
    transform: translateY(-50%);
  }

  #bc-dock.bc-dock--fit-scroll .bc-dock__rail {
    max-height: var(--bc-dock-avail, calc(100vh - 120px));
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(209,170,109,.35) transparent;
  }

  /* Hover labels would be clipped by the scrolling rail; the aria-label and
     the title attribute set by the fit script carry the name instead. */
  #bc-dock.bc-dock--fit-scroll .bc-dock__label { display: none; }
}