/*!
 * EFLL Site Design - V2 mobile call bar (v2-callbar.css)
 * Markup: includes/v2-callbar.php (div#efll-cb.efll-cb printed in wp_footer).
 * Everything is scoped to body.efll-sd.efll-v2.efll-callbar-on (the class exists only where the bar
 * renders), so this file is inert anywhere else, including the standalone V2 test pages.
 * Phones only (< 768px). Hidden while a text field is focused (html.efll-cb-typing, set by the inline script).
 */

body.efll-sd.efll-v2.efll-callbar-on {
	--efll-cb-h: 68px;               /* bar height above the safe area */
	--efll-cb-safe: env(safe-area-inset-bottom, 0px);
}

/* Desktop / tablet: never shown. */
body.efll-sd.efll-v2 .efll-cb {
	display: none;
}

@media (max-width: 767.98px) {

	/* Room for the bar so it never covers the end of the page (footer legal line, last CTA). */
	body.efll-sd.efll-v2.efll-callbar-on {
		padding-bottom: calc(var(--efll-cb-h) + var(--efll-cb-safe));
	}

	body.efll-sd.efll-v2.efll-callbar-on .efll-cb {
		display: block;
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 9990; /* under the header's full-screen menu (100000) and GTranslate (999999) */
		box-sizing: border-box;
		margin: 0;
		padding: 0 0 var(--efll-cb-safe);
		background: rgba(5, 11, 20, .97);
		box-shadow: inset 0 1px 0 rgba(212, 167, 44, .55), 0 -6px 18px rgba(3, 7, 13, .16);
		-webkit-backdrop-filter: saturate(140%) blur(8px);
		backdrop-filter: saturate(140%) blur(8px);
		transform: translateY(0);
		visibility: visible;
		transition: transform .22s cubic-bezier(.2, .7, .2, 1), visibility 0s linear 0s;
		font-family: "Barlow", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
		-webkit-font-smoothing: antialiased;
		-webkit-tap-highlight-color: transparent;
	}

	/* On-screen keyboard: slide away while a field has focus (padding stays: no layout jump). */
	html.efll-cb-typing body.efll-sd.efll-v2.efll-callbar-on .efll-cb {
		transform: translateY(calc(100% + 2px));
		visibility: hidden;
		transition: transform .18s ease-in, visibility 0s linear .18s;
	}

	/* The header's full-screen menu is open: keep out of the way. */
	html.sdh-menu-open body.efll-sd.efll-v2.efll-callbar-on .efll-cb {
		visibility: hidden;
	}

	body.efll-sd.efll-v2.efll-callbar-on .efll-cb *,
	body.efll-sd.efll-v2.efll-callbar-on .efll-cb *::before,
	body.efll-sd.efll-v2.efll-callbar-on .efll-cb *::after {
		box-sizing: border-box;
	}

	body.efll-sd.efll-v2.efll-callbar-on .efll-cb__in {
		display: grid;
		grid-template-columns: minmax(0, 1.06fr) minmax(0, 1fr);
		gap: 8px;
		height: var(--efll-cb-h);
		max-width: 560px;
		margin: 0 auto;
		padding: 8px max(12px, env(safe-area-inset-right, 0px)) 8px max(12px, env(safe-area-inset-left, 0px));
		align-items: stretch;
	}

	/* Both actions (beats Astra / kit `a` rules: 0-5-1+). */
	body.efll-sd.efll-v2.efll-callbar-on .efll-cb a.efll-cb__btn {
		display: flex;
		align-items: center;
		justify-content: center;
		gap: 10px;
		min-width: 0;
		min-height: 52px;
		margin: 0;
		padding: 0 12px;
		border: 1px solid transparent;
		border-radius: 2px;
		text-decoration: none;
		line-height: 1.1;
		white-space: nowrap;
		box-shadow: none;
		transition: background-color .15s, border-color .15s, color .15s;
	}

	body.efll-sd.efll-v2.efll-callbar-on .efll-cb a.efll-cb__btn:focus { outline: none; }
	body.efll-sd.efll-v2.efll-callbar-on .efll-cb a.efll-cb__btn:focus-visible {
		outline: 2px solid #fff;
		outline-offset: 2px;
	}

	/* Call: navy with a gold hairline, gold icon disc, two-line label. */
	body.efll-sd.efll-v2.efll-callbar-on .efll-cb a.efll-cb__btn--call {
		justify-content: flex-start;
		gap: 9px;
		padding: 0 8px 0 7px;
		background: #0e1a2b;
		border-color: rgba(212, 167, 44, .5);
		color: #fff;
	}
	body.efll-sd.efll-v2.efll-callbar-on .efll-cb a.efll-cb__btn--call:hover,
	body.efll-sd.efll-v2.efll-callbar-on .efll-cb a.efll-cb__btn--call:active {
		background: #1b304b;
		border-color: #d4a72c;
		color: #fff;
	}

	body.efll-sd.efll-v2.efll-callbar-on .efll-cb__disc {
		flex: 0 0 auto;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 32px;
		height: 32px;
		border-radius: 50%;
		background: #d4a72c;
		color: #08111d;
	}
	body.efll-sd.efll-v2.efll-callbar-on .efll-cb__ico {
		display: block;
		flex: 0 0 auto;
		width: 17px;
		height: 17px;
	}

	body.efll-sd.efll-v2.efll-callbar-on .efll-cb__txt {
		display: flex;
		flex-direction: column;
		align-items: flex-start;
		min-width: 0;
		gap: 3px;
	}
	body.efll-sd.efll-v2.efll-callbar-on .efll-cb__k {
		font: 600 11px/1 "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
		letter-spacing: .22em;
		text-transform: uppercase;
		color: #e6c25a;
	}
	body.efll-sd.efll-v2.efll-callbar-on .efll-cb__v {
		font: 600 clamp(15px, 4.1vw, 17px)/1 "Barlow", system-ui, sans-serif;
		letter-spacing: .01em;
		font-variant-numeric: tabular-nums;
		color: #fff;
	}

	/* Free case review: solid gold, dark text. */
	body.efll-sd.efll-v2.efll-callbar-on .efll-cb a.efll-cb__btn--review {
		background: #d4a72c;
		border-color: #d4a72c;
		color: #08111d;
		gap: 8px;
		padding: 0 10px;
		font: 600 clamp(14px, 3.85vw, 16px)/1 "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
		letter-spacing: .07em;
		text-transform: uppercase;
	}
	body.efll-sd.efll-v2.efll-callbar-on .efll-cb a.efll-cb__btn--review:hover,
	body.efll-sd.efll-v2.efll-callbar-on .efll-cb a.efll-cb__btn--review:active {
		background: #e6c25a;
		border-color: #e6c25a;
		color: #08111d;
	}
	body.efll-sd.efll-v2.efll-callbar-on .efll-cb a.efll-cb__btn--review .efll-cb__ico {
		width: 16px;
		height: 16px;
		margin-right: -2px;
		transition: transform .2s;
	}
	/* The page has its own form: the arrow points down to it. */
	body.efll-sd.efll-v2.efll-callbar-on .efll-cb a.efll-cb__btn--review.is-onpage .efll-cb__ico {
		transform: rotate(90deg);
	}
	body.efll-sd.efll-v2.efll-callbar-on .efll-cb__lbl {
		min-width: 0;
		overflow: hidden;
		text-overflow: ellipsis;
	}

	/* Very narrow phones (320px): tighten. */
	@media (max-width: 359.98px) {
		body.efll-sd.efll-v2.efll-callbar-on .efll-cb__in { gap: 6px; padding-left: 8px; padding-right: 8px; }
		body.efll-sd.efll-v2.efll-callbar-on .efll-cb a.efll-cb__btn { gap: 7px; padding: 0 8px; }
		body.efll-sd.efll-v2.efll-callbar-on .efll-cb a.efll-cb__btn--call { padding-left: 6px; }
		body.efll-sd.efll-v2.efll-callbar-on .efll-cb__disc { width: 30px; height: 30px; }
		body.efll-sd.efll-v2.efll-callbar-on .efll-cb__ico { width: 16px; height: 16px; }
		body.efll-sd.efll-v2.efll-callbar-on .efll-cb a.efll-cb__btn--review { letter-spacing: .06em; }
		body.efll-sd.efll-v2.efll-callbar-on .efll-cb a.efll-cb__btn--review .efll-cb__ico { display: none; }
	}

	/* Scroll target (the page's own form panel) clears the top edge; programmatic focus has no ring. */
	body.efll-sd.efll-v2.efll-callbar-on [data-efll-cb-target] { scroll-margin-top: 16px; }
	body.efll-sd.efll-v2.efll-callbar-on [data-efll-cb-target]:focus:not(:focus-visible) { outline: none; }

	/* Old floating orange call image (Elementor fixed image widget, Floating-Call-Icon*.png): the bar replaces it.
	 * !important: Elementor's fixed-position / motion classes set display and visibility. */
	body.efll-sd.efll-v2.efll-callbar-on .elementor-element:has(> .elementor-widget-container img[src*="Floating-Call-Icon"]),
	body.efll-sd.efll-v2.efll-callbar-on .elementor-element.elementor-fixed:has(img[src*="Floating-Call-Icon"]),
	body.efll-sd.efll-v2.efll-callbar-on a[href^="tel:"] > img[src*="Floating-Call-Icon"] {
		display: none !important;
	}

	/* Keep clear of other floating corners. !important: these carry inline `bottom:` styles.
	 * - reCAPTCHA v3 / invisible badge (the WPForms v2 checkbox is inline and needs nothing)
	 * - GTranslate floating selector (only when it is positioned at the bottom)
	 * - the editor-only "Current / New preview" switcher printed by v2.php */
	body.efll-sd.efll-v2.efll-callbar-on .grecaptcha-badge,
	body.efll-sd.efll-v2.efll-callbar-on :is(.gt_switcher_wrapper, .gt_float_wrapper, #gt_float_wrapper, .gtranslate_wrapper)[style*="bottom"],
	body.efll-sd.efll-v2.efll-callbar-on .efll-v2bar {
		bottom: calc(var(--efll-cb-h) + var(--efll-cb-safe) + 12px) !important;
	}
	html.efll-cb-typing body.efll-sd.efll-v2.efll-callbar-on .efll-v2bar { bottom: 16px !important; }
}

@media (max-width: 767.98px) and (prefers-reduced-motion: reduce) {
	body.efll-sd.efll-v2.efll-callbar-on .efll-cb,
	html.efll-cb-typing body.efll-sd.efll-v2.efll-callbar-on .efll-cb,
	body.efll-sd.efll-v2.efll-callbar-on .efll-cb a.efll-cb__btn,
	body.efll-sd.efll-v2.efll-callbar-on .efll-cb .efll-cb__ico {
		transition: none;
	}
}

@media print {
	body.efll-sd.efll-v2 .efll-cb { display: none !important; }
	body.efll-sd.efll-v2.efll-callbar-on { padding-bottom: 0 !important; }
}
