/* Kinetic Painting Services: Call Now buttons and the back-to-top button.
   Phones and tablets (up to 1199px, where the site shows its mobile menu): Call Now sits in the header bar
   (.kps-header-call), so it is always reachable and never covers page content. The floating button is not used.
   Desktop (1200px and wider): the floating Call Now pill (a.sticky-call-btn) is used. It and the back-to-top
   button are hidden by assets/js/kinetic-call-button.js whenever they would cover text, links, buttons,
   form fields or images. Selectors start with "body" so they win over older per-page <style> copies. */

/* ---------- Header Call Now (phones and tablets) ---------- */
.kps-header-call {
  display: none;
}
@media (max-width: 1199px) {
  .main-responsive-menu .kps-header-call {
    position: absolute;
    top: -9px;      /* lines up with the menu button */
    right: 50px;    /* just left of the menu button */
    z-index: 1000;  /* above the menu bar's empty clickable area */
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 44px;   /* full-size touch target */
    padding: 0 16px;
    border-radius: 999px;
    background-color: #218838; /* white text meets WCAG AA (4.5:1) */
    color: #ffffff;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
    -webkit-tap-highlight-color: transparent;
  }
  .main-responsive-menu .kps-header-call:hover,
  .main-responsive-menu .kps-header-call:focus-visible {
    background-color: #1e7e34;
    color: #ffffff;
  }
  .main-responsive-menu .kps-header-call:focus-visible {
    outline: 3px solid #1caae4;
    outline-offset: 2px;
  }
  .main-responsive-menu .kps-header-call svg {
    width: 20px;
    height: 20px;
    flex: none;
  }

  /* The floating button is replaced by the header button on these screens. */
  body a.sticky-call-btn {
    display: none !important;
  }
}

/* ---------- Floating Call Now (desktop) ---------- */
body a.sticky-call-btn {
  position: fixed;
  z-index: 990; /* above page content, below the gallery dialogs (top layer) and the menus */
  right: max(16px, calc(env(safe-area-inset-right) + 10px));
  bottom: max(16px, calc(env(safe-area-inset-bottom) + 10px));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 18px;
  border-radius: 999px;
  background-color: #218838;
  color: #ffffff;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.28);
  transition: transform 0.15s ease, opacity 0.18s ease, background-color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
body a.sticky-call-btn:hover,
body a.sticky-call-btn:focus-visible {
  background-color: #1e7e34;
  color: #ffffff;
}
body a.sticky-call-btn:focus-visible {
  outline: 3px solid #1caae4;
  outline-offset: 3px;
}
body a.sticky-call-btn:active {
  transform: scale(0.94);
}
body a.sticky-call-btn svg {
  width: 20px;
  height: 20px;
  flex: none;
}
body a.sticky-call-btn .btn-text {
  display: inline;
}

/* Back-to-top on desktop: parked above the Call Now pill; fades instead of sliding through it. */
body .go-top,
body .go-top.active {
  bottom: calc(max(16px, calc(env(safe-area-inset-bottom) + 10px)) + 60px);
  right: max(18px, calc(env(safe-area-inset-right) + 12px));
  -webkit-transition: opacity 0.18s ease, visibility 0.18s ease, background-color 0.5s ease, transform 0.5s ease;
  transition: opacity 0.18s ease, visibility 0.18s ease, background-color 0.5s ease, transform 0.5s ease;
}
/* Phones and tablets: back-to-top returns to its corner (no floating Call Now there), clear of the iPhone home bar. */
@media (max-width: 1199px) {
  body .go-top,
  body .go-top.active {
    bottom: max(16px, calc(env(safe-area-inset-bottom) + 10px));
    right: max(16px, calc(env(safe-area-inset-right) + 10px));
  }
}

/* Set by kinetic-call-button.js while the control would cover content.
   The Call Now pill stays in the keyboard order and reappears when it receives keyboard focus. */
body a.sticky-call-btn.kps-float-hidden {
  opacity: 0;
  pointer-events: none;
  transition: none; /* get out of the way at once; fade back in gently */
}
body a.sticky-call-btn.kps-float-hidden:focus-visible {
  opacity: 1;
  pointer-events: auto;
}
body .go-top.kps-float-hidden {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  -webkit-transition: none !important;
  transition: none !important;
}

/* Get out of the way while the visitor is typing or the search box is open. */
body:has(input:focus, textarea:focus, select:focus) a.sticky-call-btn,
body:has(.search-overlay[style*="block"]) a.sticky-call-btn {
  opacity: 0;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  body a.sticky-call-btn,
  body .go-top {
    transition: none;
  }
}

@media print {
  body a.sticky-call-btn,
  .kps-header-call {
    display: none !important;
  }
}
