/* Floating "Contact us" pill — shared across the site.
   Markup: an <a id="kd-contact-fab"> just before </body>. Behaviour (hiding it
   over the thing it points at) lives in /js/contact-fab.js.

   Plain CSS, not Tailwind utilities: css/tw.css is a committed artefact and
   nothing in the Netlify build command rebuilds it, so a new utility class
   added here would simply not exist in the stylesheet that ships.

   z-index sits below the mobile nav's scrim (z-30) and panel (z-40) on purpose
   — opening the menu dims and disarms the button with no JS. It is also well
   under index.html's lightbox (z-index 200) and get-quote's sticky total bar
   (z-index 90). */

#kd-contact-fab {
  position: fixed;
  z-index: 25;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 11px 18px;
  border-radius: 9999px;
  background: #efa710;
  color: #353535;
  font-family: 'Figtree', 'DM Sans', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.01em;
  text-decoration: none;
  box-shadow: 0 8px 32px -4px rgba(239, 167, 16, 0.45), 0 2px 8px rgba(0, 0, 0, 0.18);
  transition: transform .18s ease, box-shadow .18s ease, opacity .25s ease, visibility .25s ease;
}

#kd-contact-fab:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 38px -4px rgba(239, 167, 16, 0.55), 0 3px 10px rgba(0, 0, 0, 0.22);
}

#kd-contact-fab:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 3px;
}

#kd-contact-fab svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
}

/* Set by /js/contact-fab.js while the footer — or, on a page whose href is an
   in-page anchor, the enquiry form itself — is on screen, so the pill never
   sits on top of the thing it points at. The default state is visible: a
   published snapshot of any page can only ever bake in a working button. */
#kd-contact-fab.kd-fab-hidden {
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  pointer-events: none;
}

/* get-quote / custom-quote put a full-width sticky total bar along the bottom
   edge below 860px. Pages carrying one add .kd-fab-lift so the pill clears it. */
@media (max-width: 859px) {
  #kd-contact-fab.kd-fab-lift {
    bottom: calc(92px + env(safe-area-inset-bottom, 0px));
  }
}

@media (min-width: 768px) {
  #kd-contact-fab {
    right: 24px;
    bottom: calc(24px + env(safe-area-inset-bottom, 0px));
    padding: 13px 22px;
    font-size: 15px;
  }

  #kd-contact-fab svg {
    width: 18px;
    height: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  #kd-contact-fab {
    transition: opacity .25s ease, visibility .25s ease;
  }

  #kd-contact-fab:hover,
  #kd-contact-fab.kd-fab-hidden {
    transform: none;
  }
}

@media print {
  #kd-contact-fab {
    display: none;
  }
}
