/**
 * NZD Sticky Action Bar
 *
 * Tokens below are the theme's own compiled values, taken from
 * assets/styles/base/variables.scss and assets/styles/elements/button.scss.
 * The theme has no :root custom properties and no theme.json, so there is
 * nothing to inherit at runtime — these are exposed as custom properties so
 * they can be overridden from anywhere without touching this file.
 */

:root {
	/* Refined by JS after measuring; the default matches the CSS below so the
	   reserved body padding is right from the first paint. */
	--nzd-sb-height: 68px;
}

.nzd-bar {
	--nzd-brand: #3909ec;          /* $color-bright-blue — the theme's .button fill */
	--nzd-brand-hover: #2e07bd;    /* 20% darker; see README for why not the theme inversion */
	--nzd-ink: #061c37;            /* $color-black */
	--nzd-surface: #ffffff;        /* $color-white */
	--nzd-hairline: #e0e0e0;       /* $color-grey-light — matches .nav.stuck */
	--nzd-on-brand: #ffffff;
	--nzd-radius: 50px;            /* .button border-radius */
	--nzd-font: "General Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	--nzd-reveal: 260ms;

	position: fixed;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 9999;
	box-sizing: border-box;
	background-color: var(--nzd-surface);
	border-top: 1px solid var(--nzd-hairline);
	box-shadow: 0 -2px 16px rgba(6, 28, 55, 0.1);

	/* Hidden on load. visibility:hidden also takes it out of the tab order and
	   the accessibility tree; `inert` is set by JS as well. */
	visibility: hidden;
	opacity: 0;
	transform: translateY(110%);
	pointer-events: none;
	transition:
		transform var(--nzd-reveal) ease,
		opacity var(--nzd-reveal) ease,
		visibility 0s linear var(--nzd-reveal);
}

.nzd-bar * {
	box-sizing: border-box;
}

.nzd-bar.is-visible {
	visibility: visible;
	opacity: 1;
	transform: translateY(0);
	pointer-events: auto;
	transition:
		transform var(--nzd-reveal) ease,
		opacity var(--nzd-reveal) ease,
		visibility 0s linear 0s;
}

/* A third-party widget panel (Userback / Warmly) is open — stand down. */
.nzd-bar.is-yielding {
	visibility: hidden;
	opacity: 0;
	transform: translateY(110%);
	pointer-events: none;
}

.nzd-bar__inner {
	display: grid;
	grid-template-columns: 2fr 1fr;
	gap: 8px;
	align-items: stretch;
	width: 100%;
	max-width: 720px;
	margin: 0 auto;
	padding: 8px 10px;
	/* iOS home indicator. */
	padding-bottom: max(8px, env(safe-area-inset-bottom, 0px));
}

/* Call button gated off, or no phone number configured. */
.nzd-bar--single .nzd-bar__inner {
	grid-template-columns: 1fr;
}

.nzd-bar__btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-height: 52px;
	padding: 0.7em 1em;
	border-radius: var(--nzd-radius);
	font-family: var(--nzd-font);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.15;
	letter-spacing: 0.02em;
	text-align: center;
	text-decoration: none;
	overflow-wrap: break-word;
	cursor: pointer;
	appearance: none;
	transition: background-color 150ms ease, color 150ms ease, border-color 150ms ease;
}

.nzd-bar__btn[hidden] {
	display: none;
}

/* Primary — solid brand fill. White on #3909ec is 8.66:1. */
.nzd-bar__btn--primary {
	background-color: var(--nzd-brand);
	border: 1px solid var(--nzd-brand);
	color: var(--nzd-on-brand);
}

.nzd-bar__btn--primary:hover {
	background-color: var(--nzd-brand-hover);
	border-color: var(--nzd-brand-hover);
	color: var(--nzd-on-brand);
}

/* Secondary — the theme's .button--outline. #061c37 on white is 17:1. */
.nzd-bar__btn--secondary {
	background-color: transparent;
	border: 1px solid var(--nzd-ink);
	color: var(--nzd-ink);
}

.nzd-bar__btn--secondary:hover {
	background-color: var(--nzd-brand);
	border-color: var(--nzd-brand);
	color: var(--nzd-on-brand);
}

.nzd-bar__icon {
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
}

.nzd-bar__btn-text {
	display: inline-block;
}

/* Visible focus. 3px #061c37 on the white bar is 17:1 against the surface. */
.nzd-bar__btn:focus-visible {
	outline: 3px solid var(--nzd-ink);
	outline-offset: 2px;
}

.nzd-bar__btn--secondary:focus-visible {
	outline-color: var(--nzd-brand);
}

/* Fallback for engines without :focus-visible. */
.nzd-bar__btn:focus:not(:focus-visible) {
	outline: none;
}

/* Reserve the bar's space from the first paint, so the reveal shifts nothing. */
body.nzd-has-sticky-bar {
	padding-bottom: calc(var(--nzd-sb-height, 68px) + env(safe-area-inset-bottom, 0px));
}

/* Floating widget stacking. Applied by JS only while the bar is showing. */
.nzd-widget-lifted {
	transform: translateY(calc(-1 * var(--nzd-sb-height, 68px))) !important;
	transition: transform var(--nzd-reveal) ease;
}

.nzd-widget-hidden {
	display: none !important;
}

/* Very narrow phones: tighten the gutters so the labels keep their line. */
@media (max-width: 360px) {
	.nzd-bar__inner {
		gap: 6px;
		padding-left: 8px;
		padding-right: 8px;
	}

	.nzd-bar__btn {
		padding-left: 0.6em;
		padding-right: 0.6em;
	}
}

@media (min-width: 768px) {
	.nzd-bar__inner {
		gap: 12px;
		padding: 10px 16px;
		padding-bottom: max(10px, env(safe-area-inset-bottom, 0px));
	}

	.nzd-bar__btn {
		min-height: 54px;
		font-size: 15px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.nzd-bar,
	.nzd-bar.is-visible,
	.nzd-bar__btn,
	.nzd-widget-lifted {
		transition: none !important;
	}

	.nzd-bar {
		transform: none;
	}

	.nzd-bar.is-visible {
		transform: none;
	}

	.nzd-bar.is-yielding {
		transform: none;
	}
}

@media (forced-colors: active) {
	.nzd-bar {
		border-top: 1px solid CanvasText;
	}

	.nzd-bar__btn {
		border: 1px solid ButtonText;
	}
}
