/* CBS mobile action dock — owner request 2026-08-29. Reference: ELLA .ella-mobile-toolbar. */

:root {
  /* Consumed by back-to-top and the footer clearance. 0 by default, so desktop and every other
     theme resolve to today's values byte-for-byte. */
  --cbs-dock-h: 0px;
}

.cbs-dock {
  position: fixed;
  left: 50%;
  bottom: max(0.8rem, env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 1080; /* above back-to-top (1075); below pwa-install (1088), cookie (10000), holiday. */
  display: none;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  width: min(calc(100% - 1rem), 30rem);
  /* Owner ruling 2026-08-29: squared, not pills. Padding equals the container radius so the
     item rectangles sit flush inside it — nested-radius geometry, one corner language. */
  padding: 4px;
  border: 1px solid color-mix(in srgb, var(--cbs-lavender, #c6a3d9) 22%, transparent);
  border-radius: 4px;
  background: color-mix(in srgb, var(--cbs-ink-soft, #201728) 92%, transparent);
  box-shadow: 0 10px 30px color-mix(in srgb, var(--cbs-ink, #15101b) 55%, transparent);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.cbs-dock__item {
  display: grid;
  place-items: center;
  gap: 0.2rem;
  min-width: 0;
  min-height: 3.25rem; /* 52px — WCAG 2.5.5 target with the icon-above-label stack. */
  padding: 0.3rem 0.15rem;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: color-mix(in srgb, var(--cbs-lavender, #c6a3d9) 82%, transparent);
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.1;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

/* Hover ONLY where a real pointer exists. Without this guard a tap latches :hover on touch and
   the highlight stays stuck on whatever was last pressed — the defect the owner spotted. */
@media (hover: hover) and (pointer: fine) {
  .cbs-dock__item:hover {
    color: #fff;
    background: color-mix(in srgb, var(--cbs-purple, #6f3a91) 30%, transparent);
    text-decoration: none;
  }
}

/* Touch feedback is the press itself, not a state that outlives it. */
.cbs-dock__item:active {
  background: color-mix(in srgb, var(--cbs-purple, #6f3a91) 38%, transparent);
}

.cbs-dock__item:focus-visible {
  color: #fff;
  text-decoration: none;
  outline: 2px solid var(--cbs-lavender, #c6a3d9);
  outline-offset: -2px;
}

/* Current page: a squared plate plus a hard top rule — reads as a selected tab, and stays
   legible over the hero imagery the dock floats on. */
.cbs-dock__item[aria-current="page"] {
  color: #fff;
  background: color-mix(in srgb, var(--cbs-purple, #6f3a91) 30%, transparent);
  box-shadow: inset 0 2px 0 0 var(--cbs-lavender, #c6a3d9);
}

/* No permanent accent on any slot. This is navigation, not a CTA row: a standing brand fill on
   "Book" competed with the current-page fill and read as "always selected" (owner, 2026-08-29).
   Exactly one item is ever highlighted — the one you are on. */

.cbs-dock__icon {
  display: block;
  width: 22px;
  height: 22px;
}

.cbs-dock__icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.cbs-dock__label {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Tablet downwards (owner ruling 2026-08-29). One breakpoint for both the dock and the launcher
   suppression, so there is no band where the launchers are hidden but the dock is not yet up. */
@media (max-width: 991.98px) {
  /* Clearance only when the dock actually rendered (widget-gated 2026-08-29). */
  body:has(.cbs-dock) {
    --cbs-dock-h: calc(3.85rem + max(0.8rem, env(safe-area-inset-bottom, 0px)));
  }

  .cbs-dock {
    display: grid;
  }

  /* Hidden only where the dock carries that slot — an off proxy keeps its launcher (2026-08-29). */
  body:has([data-cbs-dock-proxy="#mirage-chatbot-launcher"]) .mirage-chatbot__launcher,
  body:has([data-cbs-dock-proxy=".ciw-trigger"]) .ciw-root .ciw-trigger {
    display: none !important;
  }
}

/* The dock is static by design: no scroll-hide, no entrance. Nothing to gate for reduced
   motion, which is the point — the owner runs reduced motion and a dock that moves is a dock
   that is missing when it is wanted. */
