/**
 * Sticky call bar (Task 12).
 *
 * Ships its own minimal CSS so the bar renders correctly even on a page
 * where the theme is not active. Ported from the live bar
 * (design/reference/hvac-mold-treatment-50-per-vent.html, #bx-bar) with two
 * fixes a prior review found (DEPLOY-RUNBOOK.md, "PATCH A" and the 360px
 * wrap note):
 *
 *   1. body's padding-bottom now accounts for env(safe-area-inset-bottom),
 *      so the bar never overlaps page content on an iPhone with a home
 *      indicator.
 *   2. The Call label is shortened ("Call 843-282-7777", set in PHP) and
 *      the button font-size dropped from 13px to 12px, so it never wraps
 *      onto two lines at a 360px viewport.
 *
 * REVIEW ROUND 1: the padding-bottom above used to be a bare `body{}` rule
 * gated only by the max-width media query, which left a permanent blank gap
 * once a visitor dismissed the bar (the media query alone can never know
 * about a dismissal). It is now scoped to `body.bx-bar-visible`, a class
 * callbar.js owns: added the moment the bar is shown, removed the moment it
 * is hidden or dismissed, and never added at all when a prior dismissal is
 * still remembered in localStorage. The invariant is: bar visible implies
 * padding, bar dismissed or hidden implies no padding. BX_Callbar::html()
 * also renders a tiny #bx-bar-pad <style> fallback carrying the same rule
 * unconditionally (a class cannot be added to <body> from wp_footer, which
 * runs after the tag is already sent), for the case JavaScript never runs at
 * all; callbar.js deletes that element the instant it does run, so the two
 * mechanisms never fight each other.
 *
 * No em dashes anywhere (house style).
 */

#bx-bar {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 99998;
	display: none;
	align-items: stretch;
	gap: 10px;
	box-sizing: border-box;
	padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
	background: #ffffff;
	box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.12);
}

@media (max-width: 980px) {
	#bx-bar {
		display: flex;
	}

	/* Only while the bar is actually on screen (see the review-round-1 note
	   in the file header). Toggled by callbar.js; see #bx-bar-pad for the
	   no-JS fallback that carries the same rule unconditionally. */
	body.bx-bar-visible {
		padding-bottom: calc(78px + env(safe-area-inset-bottom, 0px));
	}
}

.bx-bar-btn {
	flex: 1 1 0;
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	min-height: 44px;
	padding: 14px 10px;
	border: 1px solid #bb2b1e;
	border-radius: 100px;
	font-family: 'Libre Franklin', 'Open Sans', sans-serif;
	font-size: 12px;
	line-height: 18px;
	font-weight: 600;
	letter-spacing: 1px;
	text-align: center;
	text-transform: uppercase;
	text-decoration: none;
	white-space: nowrap;
}

/* !important on both: .bx-bar-btn is an <a>, and a theme's own a{color:...}
   rule (or Divi's, on the live site) outranks a plain class on specificity
   grounds in some cascades; these two must always win regardless of theme. */
.bx-bar-primary {
	background: #bb2b1e;
	color: #ffffff !important;
}

.bx-bar-secondary {
	background: #ffffff;
	color: #bb2b1e !important;
}

/* REVIEW ROUND 1: was 22x22px, under WCAG 2.5.8's 24px pointer-target
   minimum, with no exception that applied (its old top:-11px placed it about
   1px from the Book button below, nowhere near the 24px clear space the
   "spacing" exception would have required). Now 26x26 (a 2px margin over the
   24px floor) and moved further up so its own box no longer overlaps the
   button's box at all. It stays outside the two-button flex row on purpose,
   so it can never eat into the width the 360px no-wrap fix depends on. */
.bx-bar-dismiss {
	position: absolute;
	top: -20px;
	right: 6px;
	width: 26px;
	height: 26px;
	box-sizing: border-box;
	padding: 0;
	border: 1px solid #bb2b1e;
	border-radius: 50%;
	background: #ffffff;
	color: #bb2b1e;
	font-size: 16px;
	line-height: 24px;
	text-align: center;
	cursor: pointer;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}
