/* Sticky showroom booking CTA — variant 3 (MCKELVTRSD-208).
   Plain CSS (not part of the gulp build), ported from the reviewed prototype
   (fruition.github.io/mckinley-prototype/?variant=3). Tokens are lifted
   verbatim from the theme's sass/site/_variables.sass:
     $primary #bd302c  $secondary #3556a4  $gray #e6e6e6
   Yellow #eed202 comes from _base.sass:200 (Request Service button).
   Fonts (Open Sans, Adriane Text) are already loaded by the theme.
   Breakpoints match the Foundation overrides: 767 / 1024 / 1200. */

/* --------------------------------------------------------------------------
   1. Tokens, scoped to the component
   -------------------------------------------------------------------------- */

.sticky-cta {
	--mck-cta-red: #bd302c;
	--mck-cta-blue: #3556a4;
	--mck-cta-blue-hover: #4468bd;
	--mck-cta-yellow: #eed202;
	--mck-cta-ink: #000;
	--mck-cta-paper: #fff;
	--mck-cta-ink-60: rgba(0, 0, 0, 0.6);
	--mck-cta-shell: 62.5rem;
	--mck-cta-gutter: 0.9375rem;
	--mck-cta-ease: cubic-bezier(0.22, 0.61, 0.36, 1);

	box-sizing: border-box;
	font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
	line-height: 1.6;
}

.sticky-cta * {
	box-sizing: border-box;
}

/* [hidden] is applied to this by JS and by the template. The UA rule loses
   to the theme's display rules, so it is repeated here. */
.sticky-cta[hidden] {
	display: none !important;
}

.sticky-cta .shell {
	width: 100%;
	max-width: var(--mck-cta-shell);
	margin-inline: auto;
	padding-inline: var(--mck-cta-gutter);
}

.sticky-cta .visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* One focus treatment for the new component. Deliberately high contrast:
   the production theme relies on the browser default, which a dark hero and
   a blue button both swallow. Scoped so the rest of the page is untouched. */
.sticky-cta :focus-visible {
	outline: 3px solid var(--mck-cta-yellow);
	outline-offset: 2px;
	border-radius: 2px;
}

/* --------------------------------------------------------------------------
   2. The CTA button. Visual spec matches the theme's blue button style, but
   namespaced .sticky-cta__link so it never collides with the theme's .button.
   -------------------------------------------------------------------------- */

.sticky-cta .sticky-cta__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	padding: 0.875rem 1.5rem;
	border: 0;
	border-radius: 0;
	font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	line-height: 1.2;
	text-transform: uppercase;
	text-decoration: none;
	text-align: center;
	cursor: pointer;
	background: var(--mck-cta-blue);
	color: var(--mck-cta-paper);
	transition: background-color 0.2s var(--mck-cta-ease), color 0.2s var(--mck-cta-ease);
	white-space: nowrap;
}

.sticky-cta .sticky-cta__link:hover {
	background: var(--mck-cta-blue-hover);
	color: var(--mck-cta-paper);
}

/* --------------------------------------------------------------------------
   3. The bar itself.
   Hidden on load; sticky-cta.js reveals it once the page has scrolled.
   -------------------------------------------------------------------------- */

.sticky-cta {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 60;
	background: var(--mck-cta-paper);
	box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.18);
	/* Pre-reveal resting state; JS adds .is-visible to bring it up. This also
	   keeps the bar off screen if JS never runs. */
	transform: translateY(100%);
	transition: transform 0.4s var(--mck-cta-ease), opacity 0.25s var(--mck-cta-ease);
	will-change: transform;
}

.sticky-cta.is-visible {
	transform: translateY(0);
}

/* Dismiss-out state (JS removes the element after the transition). */
.sticky-cta.is-dismissed {
	opacity: 0;
	transform: translateY(100%);
}

.sticky-cta .sticky-cta__inner {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 1.5rem;
	padding-block: 0.875rem;
	/* The close button is absolutely positioned and cannot push content, so
	   its lane is held open with padding. */
	padding-right: calc(var(--mck-cta-gutter) + 2.375rem);
}

.sticky-cta .sticky-cta__text {
	margin: 0;
	min-width: 0;
	color: var(--mck-cta-ink);
	font-size: 1rem;
	font-weight: 600;
}

/* Follow the theme's text-size widget so the bar resizes with the page. */
body.resize.medium .sticky-cta .sticky-cta__text { font-size: 1.15rem; }
body.resize.large  .sticky-cta .sticky-cta__text { font-size: 1.3rem; }

.sticky-cta .sticky-cta__close {
	position: absolute;
	top: 50%;
	right: var(--mck-cta-gutter);
	transform: translateY(-50%);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.875rem;
	height: 1.875rem;
	padding: 0;
	background: none;
	border: 0;
	color: var(--mck-cta-ink-60);
	cursor: pointer;
	touch-action: manipulation;
}

.sticky-cta .sticky-cta__close:hover {
	color: var(--mck-cta-ink);
}

.sticky-cta .sticky-cta__close svg {
	width: 1.125rem;
	height: 1.125rem;
}

/* --------------------------------------------------------------------------
   4. Small screens — stacks to copy-over-button.
   The close button moves out of the vertical centre — on a two-row bar,
   centred meant it landed beside the CTA — and pins to the top-right corner,
   with the top padding opened up so the first line of copy clears it.
   -------------------------------------------------------------------------- */

@media (max-width: 767px) {
	.sticky-cta .sticky-cta__inner {
		flex-direction: column;
		align-items: stretch;
		gap: 0.75rem;
		padding-inline: var(--mck-cta-gutter);
		padding-top: 0.875rem;
		padding-bottom: 1rem;
		text-align: left;
	}

	.sticky-cta .sticky-cta__close {
		top: 0.5rem;
		right: 0.5rem;
		transform: none;
	}

	.sticky-cta .sticky-cta__text {
		/* Only the first line has to dodge the close button, so the gutter is
		   reserved here rather than on the container — that keeps the CTA
		   below free to run the full width. */
		padding-right: 2rem;
		font-size: 0.875rem;
	}

	/* Full-bleed CTA: a centred pill on a 390px bar wastes the row and gives a
	   smaller target than the bar can afford. */
	.sticky-cta .sticky-cta__link {
		display: flex;
		width: 100%;
		min-height: 3rem;
	}
}

/* --------------------------------------------------------------------------
   5. Reduced motion — JS also zeroes its timers; this covers the CSS.
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	.sticky-cta,
	.sticky-cta * {
		transition-duration: 0.001ms !important;
		animation-duration: 0.001ms !important;
		animation-iteration-count: 1 !important;
	}
}

/* --------------------------------------------------------------------------
   6. Print — strip the overlay
   -------------------------------------------------------------------------- */

@media print {
	.sticky-cta {
		display: none !important;
	}
}
