/*
 * Columbia Basin App — WordPress theme styling.
 *
 * This is a faithful port of the Next.js PWA's design system
 * (src/app/globals.css). Tokens, type scale, radii, and component
 * styling are kept 1:1 with the app so the two stay visually identical.
 *
 *   Primary  = "Glacier Deep" — a confident, slightly cool ocean blue
 *   Accent   = "Ice Pale"     — a very light, frosted glacial blue
 *   Font     = Inter (loaded in header.php), Geist Mono fallback for code
 *   Radius   = 0.625rem base, with the same xl/2xl/3xl scale the app uses
 *
 * Dark mode follows the OS preference (the app does the same by default).
 */

/* ---- Design tokens — copied verbatim from the app (oklch). ---- */
:root {
	--background: oklch(0.99 0.005 235);
	--foreground: oklch(0.2 0.04 245);
	--card: oklch(1 0 0);
	--card-foreground: oklch(0.2 0.04 245);
	--primary: oklch(0.43 0.16 245);
	--primary-foreground: oklch(0.99 0.005 235);
	--secondary: oklch(0.95 0.025 225);
	--secondary-foreground: oklch(0.28 0.08 245);
	--muted: oklch(0.96 0.015 230);
	--muted-foreground: oklch(0.5 0.04 240);
	--accent: oklch(0.93 0.035 225);
	--accent-foreground: oklch(0.28 0.08 245);
	--destructive: oklch(0.577 0.245 27.325);
	--border: oklch(0.9 0.02 230);
	--input: oklch(0.9 0.02 230);
	--ring: oklch(0.5 0.14 245);

	/* Radius scale — mirrors @theme inline in globals.css. */
	--radius: 0.625rem;
	--radius-sm: calc(var(--radius) * 0.6);
	--radius-md: calc(var(--radius) * 0.8);
	--radius-lg: var(--radius);
	--radius-xl: calc(var(--radius) * 1.4);
	--radius-2xl: calc(var(--radius) * 1.8);
	--radius-3xl: calc(var(--radius) * 2.2);

	--font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--font-mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

	/* Derived surfaces — color-mix keeps these locked to the tokens above. */
	--ring-soft: color-mix(in oklab, var(--ring) 50%, transparent);
	--card-ring: color-mix(in oklab, var(--foreground) 10%, transparent);
	--shadow-sm: 0 1px 2px color-mix(in oklab, var(--foreground) 4%, transparent),
		0 1px 3px color-mix(in oklab, var(--foreground) 3%, transparent);
	--shadow-lg: 0 12px 28px -8px color-mix(in oklab, var(--primary) 18%, transparent),
		0 4px 10px -6px color-mix(in oklab, var(--foreground) 6%, transparent);
}

/*
 * Dark palette. Two entry points, IDENTICAL values — keep them in sync:
 *   1. OS prefers dark AND the user hasn't explicitly chosen light
 *      (no-JS, and the moment before the theme script runs).
 *   2. The toggle set .cba-dark on <html>.
 * .cba-light always wins (forces light even when the OS prefers dark).
 */
@media (prefers-color-scheme: dark) {
	:root:not(.cba-light) {
		--background: oklch(0.18 0.04 245);
		--foreground: oklch(0.96 0.015 230);
		--card: oklch(0.22 0.05 245);
		--card-foreground: oklch(0.96 0.015 230);
		--primary: oklch(0.7 0.15 230);
		--primary-foreground: oklch(0.18 0.04 245);
		--secondary: oklch(0.28 0.06 240);
		--secondary-foreground: oklch(0.95 0.02 230);
		--muted: oklch(0.25 0.05 240);
		--muted-foreground: oklch(0.7 0.04 230);
		--accent: oklch(0.32 0.08 240);
		--accent-foreground: oklch(0.95 0.02 230);
		--destructive: oklch(0.704 0.191 22.216);
		--border: oklch(1 0 0 / 12%);
		--input: oklch(1 0 0 / 16%);
		--ring: oklch(0.6 0.15 230);
		--card-ring: color-mix(in oklab, var(--foreground) 14%, transparent);
	}
}
:root.cba-dark {
	--background: oklch(0.18 0.04 245);
	--foreground: oklch(0.96 0.015 230);
	--card: oklch(0.22 0.05 245);
	--card-foreground: oklch(0.96 0.015 230);
	--primary: oklch(0.7 0.15 230);
	--primary-foreground: oklch(0.18 0.04 245);
	--secondary: oklch(0.28 0.06 240);
	--secondary-foreground: oklch(0.95 0.02 230);
	--muted: oklch(0.25 0.05 240);
	--muted-foreground: oklch(0.7 0.04 230);
	--accent: oklch(0.32 0.08 240);
	--accent-foreground: oklch(0.95 0.02 230);
	--destructive: oklch(0.704 0.191 22.216);
	--border: oklch(1 0 0 / 12%);
	--input: oklch(1 0 0 / 16%);
	--ring: oklch(0.6 0.15 230);
	--card-ring: color-mix(in oklab, var(--foreground) 14%, transparent);
}

* { box-sizing: border-box; }

html {
	-webkit-text-size-adjust: 100%;
	font-family: var(--font-sans);
}

body.cba-body {
	margin: 0;
	font-family: var(--font-sans);
	color: var(--foreground);
	background: var(--background);
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
	/* Respect notches when installed standalone. */
	padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.cba-shell {
	display: flex;
	flex-direction: column;
	min-height: 100dvh;
	max-width: 768px; /* matches the app's max-w-3xl */
	margin: 0 auto;
	width: 100%;
}

/* Theme toggle — fixed top-right, like the app's <ThemeToggle>. */
.cba-theme-toggle {
	position: fixed;
	top: 16px;
	right: 16px;
	z-index: 50;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	border: 1px solid var(--card-ring);
	background: color-mix(in oklab, var(--background) 70%, transparent);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
	box-shadow: var(--shadow-sm);
	color: var(--foreground);
	cursor: pointer;
	transition: background .15s, color .15s;
}
.cba-theme-toggle:hover { background: var(--accent); }
.cba-theme-toggle:focus-visible {
	outline: none;
	box-shadow: 0 0 0 3px var(--ring-soft);
}
.cba-theme-toggle span { display: inline-flex; }
.cba-theme-toggle svg { width: 20px; height: 20px; }
/* Sun in light mode, moon in dark — matches the app. */
.cba-theme-toggle .cba-moon { display: none; }
:root.cba-dark .cba-theme-toggle .cba-sun { display: none; }
:root.cba-dark .cba-theme-toggle .cba-moon { display: inline-flex; }
@media (prefers-color-scheme: dark) {
	:root:not(.cba-light) .cba-theme-toggle .cba-sun { display: none; }
	:root:not(.cba-light) .cba-theme-toggle .cba-moon { display: inline-flex; }
}
@media (min-width: 640px) {
	.cba-theme-toggle { top: 20px; right: 20px; }
}

/* Offline banner — full-width, warning amber, light/dark aware. Shown by app.js
   (the [hidden] attribute is toggled) when the device loses connectivity. */
.cba-offline:not([hidden]) {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 10px 16px;
	font-size: 0.9rem;
	font-weight: 600;
	line-height: 1.3;
	text-align: center;
	background: #fef3c7;
	color: #92400e;
	border-bottom: 1px solid #fcd34d;
}
.cba-offline-dot {
	flex: none;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: currentColor;
	opacity: 0.7;
}
:root.cba-dark .cba-offline:not([hidden]) {
	background: #3a2c0a;
	color: #fde68a;
	border-bottom-color: #5c4716;
}
@media (prefers-color-scheme: dark) {
	:root:not(.cba-light) .cba-offline:not([hidden]) {
		background: #3a2c0a;
		color: #fde68a;
		border-bottom-color: #5c4716;
	}
}

.cba-main {
	flex: 1;
	width: 100%;
	min-width: 0; /* let children shrink instead of widening the shell */
	padding: 56px 20px 40px;
}

@media (min-width: 640px) {
	.cba-main { padding: 96px 20px 56px; }
}

/* ---- Card — bg-card + hairline ring + soft shadow, rounded-xl. ---- */
.cba-card {
	background: var(--card);
	color: var(--card-foreground);
	border: 1px solid var(--card-ring);
	border-radius: var(--radius-xl);
	box-shadow: var(--shadow-sm);
	padding: 28px 24px;
}

.cba-card h1 {
	margin: 4px 0 0;
	font-size: 1.875rem;
	font-weight: 600;
	letter-spacing: -0.02em;
	line-height: 1.2;
}

.cba-sub {
	margin: 8px 0 22px;
	color: var(--muted-foreground);
	font-size: 1.0625rem;
}

/* ---- Back link ---- */
.cba-back {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	margin-bottom: 10px;
	color: var(--muted-foreground);
	text-decoration: none;
	font-size: 0.95rem;
	font-weight: 500;
	transition: color .15s;
}
.cba-back:hover { color: var(--primary); }
.cba-back svg { width: 18px; height: 18px; }

/* =====================================================================
   Landing — mirrors the app: logo tile → welcome → CTA cards.
   ===================================================================== */
.cba-landing {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	margin-bottom: 56px;
	animation: cba-rise .5s ease both;
}

/*
 * Brand logo with a feathered white halo. The CBI logo is artwork on an
 * opaque white background, so we sit it on a radial gradient whose white core
 * is large enough to cover the image fully (its white edges merge with the
 * core, no hard rectangle) and then fades to transparent in the empty ring
 * around it. In light mode the fade is over near-white (invisible); in dark
 * mode it reads as a soft white glow blending into the background. The blend
 * is the goal — same mechanism either way.
 */
.cba-brand {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 280px;
	height: 280px;
	margin-bottom: 0;
	/* A circular glow (closest-side → fades fully before the box edges, so no
	   square cutoff) with a long, multi-stop taper. Solid white reaches past the
	   logo so its white edges stay seamless; everything outside feathers out. */
	background: radial-gradient(circle closest-side,
		#fff 0%,
		#fff 45%,
		rgba(255, 255, 255, 0.68) 59%,
		rgba(255, 255, 255, 0.34) 75%,
		rgba(255, 255, 255, 0.10) 89%,
		rgba(255, 255, 255, 0) 100%);
}
.cba-brand img {
	width: auto;
	height: 90px;
	display: block;
}

.cba-welcome {
	margin: 0;
	font-size: 2.25rem;
	font-weight: 600;
	letter-spacing: -0.025em;
	line-height: 1.1;
}

.cba-lede {
	margin: 16px 0 0;
	max-width: 28rem;
	color: var(--muted-foreground);
	font-size: 1.25rem;
	line-height: 1.5;
}

@media (min-width: 640px) {
	.cba-landing { margin-bottom: 80px; }
	.cba-brand { width: 360px; height: 360px; }
	.cba-brand img { height: 112px; }
	.cba-welcome { font-size: 3rem; }
	.cba-lede { font-size: 1.5rem; }
}

/* CTA grid — single column on phones, two up on tablet+. */
.cba-choices {
	display: grid;
	gap: 20px;
	animation: cba-rise .7s ease both;
}
@media (min-width: 768px) {
	.cba-choices { grid-template-columns: 1fr 1fr; }
}

.cba-choice {
	display: flex;
	flex-direction: column;
	height: 100%;
	padding: 28px 24px;
	background: var(--card);
	border: 1px solid var(--card-ring);
	border-radius: var(--radius-xl);
	box-shadow: var(--shadow-sm);
	text-decoration: none;
	color: var(--card-foreground);
	transition: transform .2s, box-shadow .2s, border-color .2s;
}
.cba-choice:hover {
	transform: translateY(-2px);
	box-shadow: var(--shadow-lg);
	border-color: color-mix(in oklab, var(--primary) 20%, transparent);
}
.cba-choice:active { transform: translateY(0); }
.cba-choice:focus-visible {
	outline: none;
	box-shadow: 0 0 0 2px var(--background), 0 0 0 4px var(--ring);
}

/* Primary icon tile, like the app's rounded-2xl square. */
.cba-choice-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 64px;
	height: 64px;
	margin-bottom: 16px;
	border-radius: var(--radius-2xl);
	background: var(--primary);
	color: var(--primary-foreground);
	box-shadow: 0 4px 10px -2px color-mix(in oklab, var(--primary) 30%, transparent);
	transition: transform .2s;
}
.cba-choice-icon svg { width: 32px; height: 32px; }
.cba-choice:hover .cba-choice-icon { transform: scale(1.05); }

.cba-choice-title {
	display: block;
	font-size: 1.5rem;
	font-weight: 600;
	letter-spacing: -0.01em;
	line-height: 1.25;
}
.cba-choice-desc {
	display: block;
	margin-top: 8px;
	color: var(--muted-foreground);
	font-size: 1.125rem;
	line-height: 1.45;
}
.cba-choice-cta {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-top: 20px;
	color: var(--primary);
	font-size: 1.125rem;
	font-weight: 600;
}
.cba-choice-cta svg { width: 22px; height: 22px; transition: transform .2s; }
.cba-choice:hover .cba-choice-cta svg { transform: translateX(4px); }

/* Each column stacks its primary card + a secondary CTA underneath. The card
   grows so the secondary buttons line up across columns. */
.cba-choice-col {
	display: flex;
	flex-direction: column;
	gap: 12px;
	height: 100%;
}
.cba-choice-col .cba-choice { flex: 1; }

.cba-choice-secondary {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	min-height: 3.25rem;
	padding: 0 18px;
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	background: var(--card);
	color: var(--foreground);
	font: inherit;
	font-size: 1.0625rem;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	transition: background .15s, border-color .15s, color .15s;
}
.cba-choice-secondary:hover {
	background: var(--accent);
	border-color: color-mix(in oklab, var(--primary) 40%, transparent);
	color: var(--primary);
}
.cba-choice-secondary:active { transform: translateY(1px); }
.cba-choice-secondary:focus-visible {
	outline: none;
	box-shadow: 0 0 0 3px var(--ring-soft);
}
.cba-choice-secondary svg { width: 20px; height: 20px; }

/* Footer of the landing — install button + ordering-guide link, stacked. */
.cba-landing-foot {
	margin-top: 32px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 14px;
}
.cba-install-row { margin: 0; }
.cba-install {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 3rem;
	padding: 0 20px;
	border: 1px solid var(--card-ring);
	border-radius: var(--radius-lg);
	background: var(--card);
	color: var(--foreground);
	font: inherit;
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	transition: background .15s, border-color .15s, color .15s;
}
.cba-install:hover {
	background: var(--accent);
	border-color: color-mix(in oklab, var(--primary) 40%, transparent);
	color: var(--primary);
}
.cba-install:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring-soft); }
.cba-install svg { width: 18px; height: 18px; }

/* Centered "Download our Ordering Guide" link under the choices. */
.cba-guide { margin: 0; text-align: center; }
.cba-guide-link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: var(--primary);
	font-size: 1rem;
	font-weight: 600;
	text-decoration: none;
}
.cba-guide-link:hover { text-decoration: underline; }
.cba-guide-link svg { width: 18px; height: 18px; }

/* =====================================================================
   Stepper — numbered circles that become checks, with connector fill.
   Mirrors the app's <Stepper>. JS flips data-status per li.
   ===================================================================== */
.cba-stepper {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	width: 100%;
	margin: 8px 0 32px;
	padding: 0;
	list-style: none;
}

.cba-stitem {
	display: flex;
	flex: 1 1 0;
	align-items: flex-start;
	gap: 12px;
	min-width: 0;
}

.cba-sind {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	flex-shrink: 0;
	border-radius: 50%;
	border: 2px solid var(--border);
	color: var(--muted-foreground);
	font-size: 1.125rem;
	font-weight: 600;
	transition: all .3s;
}
.cba-sind svg { width: 22px; height: 22px; display: none; }

.cba-stitem[data-status="current"] .cba-sind {
	border-color: var(--primary);
	color: var(--primary);
	box-shadow: 0 0 0 4px color-mix(in oklab, var(--primary) 15%, transparent);
	transform: scale(1.1);
}
.cba-stitem[data-status="complete"] .cba-sind {
	background: var(--primary);
	border-color: var(--primary);
	color: var(--primary-foreground);
	box-shadow: 0 2px 8px -2px color-mix(in oklab, var(--primary) 30%, transparent);
}
.cba-stitem[data-status="complete"] .cba-sind-num { display: none; }
.cba-stitem[data-status="complete"] .cba-sind svg { display: block; }

.cba-stext {
	display: flex;
	flex-direction: column;
	padding-top: 4px;
	min-width: 0;
}
.cba-skicker {
	font-size: 0.7rem;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--muted-foreground);
	transition: color .3s;
}
.cba-slabel {
	font-size: 0.85rem;
	font-weight: 600;
	line-height: 1.25;
	color: var(--muted-foreground);
	transition: color .3s;
}
.cba-stitem:not([data-status="upcoming"]) .cba-skicker,
.cba-stitem:not([data-status="upcoming"]) .cba-slabel { color: var(--foreground); }

/* Connector line — hidden on phones (like the app), fills as steps complete. */
.cba-sline { display: none; }
.cba-sline-fill {
	display: block;
	height: 100%;
	width: 100%;
	background: var(--primary);
	transform: translateX(-100%);
	transition: transform .5s ease-out;
}
.cba-stitem[data-status="complete"] .cba-sline-fill { transform: translateX(0); }

/* Phones: stack the label beneath the number (centered) so multi-word labels
   get the full column width instead of being squished beside the circle. */
@media (max-width: 639px) {
	.cba-stepper { gap: 8px; }
	.cba-stitem {
		flex-direction: column;
		align-items: center;
		gap: 6px;
		text-align: center;
	}
	.cba-sind { width: 36px; height: 36px; font-size: 0.95rem; }
	.cba-sind svg { width: 18px; height: 18px; }
	.cba-stext { align-items: center; padding-top: 0; }
	.cba-skicker { font-size: 0.65rem; }
	.cba-slabel { font-size: 0.8rem; overflow-wrap: break-word; }
}

@media (min-width: 640px) {
	.cba-stepper { gap: 16px; }
	.cba-skicker { font-size: 0.8rem; }
	.cba-slabel { font-size: 1.2rem; }
	.cba-sline {
		display: block;
		flex: 1;
		height: 2px;
		margin-top: 23px;
		background: var(--border);
		border-radius: 2px;
		overflow: hidden;
	}
}

/* =====================================================================
   Wizard steps + navigation
   ===================================================================== */
.cba-step { display: grid; gap: 20px; }

/* Only collapse to one step at a time when JS is driving the wizard;
   without JS every step shows and the single Submit posts the lot. */
.cba-js .cba-step { display: none; }
.cba-js .cba-step.is-active {
	display: grid;
	animation: cba-step-in .3s ease both;
}

.cba-nav {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-top: 8px;
	padding-top: 20px;
	border-top: 1px solid var(--card-ring);
}
.cba-nav-spacer { flex: 1; }
.cba-nav .cba-btn,
.cba-nav .cba-btn-ghost { width: auto; }
.cba-nav .cba-submit { margin-top: 0; }
/* The button's own display rule would otherwise beat the UA [hidden] rule,
   so the markup's hidden Next/Back (no-JS) and JS toggling both need this. */
.cba-btn[hidden],
.cba-btn-ghost[hidden] { display: none; }
.cba-next svg, .cba-prev svg { width: 22px; height: 22px; }

/* Ghost button — the app's variant="ghost" (Back). */
.cba-btn-ghost {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 3.5rem;
	padding: 0 18px;
	border: 1px solid transparent;
	border-radius: var(--radius-lg);
	background: transparent;
	color: var(--foreground);
	font: inherit;
	font-size: 1.25rem;
	font-weight: 600;
	cursor: pointer;
	transition: background .15s, color .15s;
}
.cba-btn-ghost:hover { background: var(--muted); }
.cba-btn-ghost:focus-visible {
	outline: none;
	box-shadow: 0 0 0 3px var(--ring-soft);
}

@keyframes cba-step-in {
	from { opacity: 0; transform: translateX(10px); }
	to   { opacity: 1; transform: translateX(0); }
}

/* =====================================================================
   Form
   ===================================================================== */
.cba-form { display: grid; gap: 20px; margin-top: 8px; }

/* "Clear saved info" — injected by app.js when cached profile data exists. */
.cba-clear-row { margin: 0; text-align: right; }
.cba-clear-profile {
	padding: 0;
	border: 0;
	background: none;
	color: var(--muted-foreground);
	font: inherit;
	font-size: 0.85rem;
	font-weight: 500;
	text-decoration: underline;
	text-underline-offset: 2px;
	cursor: pointer;
}
.cba-clear-profile:hover { color: var(--primary); }

.cba-field { display: grid; gap: 8px; }

.cba-field label {
	font-weight: 500;
	font-size: 0.95rem;
}

.cba-req { color: var(--primary); }

/* Inputs — h-14, rounded-lg, border-input, 3px focus ring at 50%. */
.cba-field input,
.cba-field select,
.cba-field textarea {
	width: 100%;
	min-height: 3.5rem;
	font: inherit;
	font-size: 1.0625rem;
	color: var(--foreground);
	background: var(--card);
	padding: 0 16px;
	border: 1px solid var(--input);
	border-radius: var(--radius-lg);
	appearance: none;
	transition: border-color .15s, box-shadow .15s;
}
.cba-field textarea {
	padding: 12px 16px;
	resize: vertical;
	min-height: 110px;
	line-height: 1.5;
}
.cba-field input::placeholder,
.cba-field textarea::placeholder { color: var(--muted-foreground); }

.cba-field input:focus,
.cba-field select:focus,
.cba-field textarea:focus {
	outline: none;
	border-color: var(--ring);
	box-shadow: 0 0 0 3px var(--ring-soft);
}

.cba-field.has-error input,
.cba-field.has-error select,
.cba-field.has-error textarea {
	border-color: var(--destructive);
}
.cba-field.has-error input:focus,
.cba-field.has-error select:focus,
.cba-field.has-error textarea:focus {
	box-shadow: 0 0 0 3px color-mix(in oklab, var(--destructive) 20%, transparent);
}
.cba-err {
	margin: 0;
	color: var(--destructive);
	font-size: 0.875rem;
}

/* Field-level CTA (e.g. "Become a customer") — revealed only when the field errors. */
.cba-field-cta {
	display: none;
	margin: 6px 0 0;
	font-size: 0.875rem;
	color: var(--muted-foreground);
}
.cba-field.has-error .cba-field-cta { display: block; }
.cba-field-cta a { color: var(--primary); font-weight: 600; text-decoration: none; }
.cba-field-cta a:hover { text-decoration: underline; }

/* Native select chevron (appearance is reset above). */
.cba-field select,
.cba-combo-input {
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%235b6b82' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 14px center;
	padding-right: 44px;
}

/* Searchable select (combobox) — app.js enhances <select data-searchable>. */
.cba-combo { position: relative; }
.cba-combo-native {
	position: absolute !important;
	width: 1px;
	height: 1px;
	min-height: 0 !important;
	padding: 0;
	margin: -1px;
	border: 0;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	overflow: hidden;
	opacity: 0;
	pointer-events: none;
}
.cba-combo-input { cursor: text; }
.cba-combo--error .cba-combo-input {
	border-color: var(--destructive);
	box-shadow: 0 0 0 3px color-mix(in oklab, var(--destructive) 20%, transparent);
}
.cba-combo-list {
	position: absolute;
	z-index: 30;
	top: calc(100% + 6px);
	left: 0;
	right: 0;
	margin: 0;
	padding: 4px;
	list-style: none;
	max-height: 260px;
	overflow-y: auto;
	background: var(--card);
	color: var(--card-foreground);
	border: 1px solid var(--card-ring);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-lg);
}
.cba-combo-list[hidden] { display: none; }
.cba-combo-opt {
	padding: 10px 12px;
	border-radius: var(--radius-md);
	font-size: 1.0625rem;
	cursor: pointer;
}
.cba-combo-opt.is-active { background: var(--accent); color: var(--accent-foreground); }

/* ---- Line items ---- */
.cba-items-list { display: grid; gap: 12px; }
.cba-item-row {
	display: grid;
	grid-template-columns: 48px 1fr 88px 44px; /* thumb · size · qty · remove */
	gap: 10px;
	align-items: center;
}
/* Square ice thumbnail, left of each line item — kept fixed so rows stay tidy. */
.cba-item-thumb {
	width: 48px;
	height: 48px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 1px solid var(--input);
	border-radius: var(--radius-md);
	background: var(--muted);
	overflow: hidden;
}
.cba-item-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* Product photo under the cart builder — a compact banner, not a hero. */
.cba-cart-photo {
	margin: 0;
	border: 1px solid var(--card-ring);
	border-radius: var(--radius-lg);
	overflow: hidden;
}
.cba-cart-photo img {
	display: block;
	width: 100%;
	height: 160px;
	object-fit: cover;
}
@media (min-width: 640px) {
	.cba-cart-photo img { height: 190px; }
}
.cba-remove-item {
	height: 100%;
	min-height: 3rem;
	border: 1px solid var(--input);
	background: var(--card);
	border-radius: var(--radius-lg);
	color: var(--muted-foreground);
	font-size: 1.3rem;
	line-height: 1;
	cursor: pointer;
	transition: border-color .15s, color .15s, background .15s;
}
.cba-remove-item:hover {
	border-color: var(--destructive);
	color: var(--destructive);
	background: color-mix(in oklab, var(--destructive) 8%, var(--card));
}
.cba-add-item {
	justify-self: start;
	margin-top: 6px;
	background: none;
	border: none;
	color: var(--primary);
	font-weight: 600;
	font-size: 0.95rem;
	cursor: pointer;
	padding: 6px 0;
}
.cba-add-item:hover { text-decoration: underline; }
.cba-custom-note {
	margin: 8px 0 0;
	padding: 12px 14px;
	background: var(--accent);
	border: 1px solid color-mix(in oklab, var(--primary) 25%, transparent);
	border-radius: var(--radius-lg);
	color: var(--accent-foreground);
	font-size: 0.9rem;
	line-height: 1.45;
}
.cba-custom-note a { color: var(--primary); font-weight: 700; }

/* =====================================================================
   Buttons — bg-primary, lighten on hover, h-12+, rounded-lg.
   ===================================================================== */
.cba-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 3.5rem;
	padding: 0 20px;
	border: 1px solid transparent;
	border-radius: var(--radius-lg);
	background: var(--primary);
	color: var(--primary-foreground);
	font: inherit;
	font-size: 1.25rem;
	font-weight: 600;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	transition: background .15s, transform .05s, box-shadow .15s;
}
.cba-btn:hover { background: color-mix(in oklab, var(--primary) 85%, var(--background)); }
.cba-btn:active { transform: translateY(1px); }
.cba-btn:focus-visible {
	outline: none;
	box-shadow: 0 0 0 3px var(--ring-soft);
}
.cba-submit { margin-top: 8px; }

/* ---- Alerts ---- */
.cba-alert {
	margin: 0 0 16px;
	padding: 12px 14px;
	border-radius: var(--radius-lg);
	background: color-mix(in oklab, var(--destructive) 10%, var(--card));
	border: 1px solid color-mix(in oklab, var(--destructive) 35%, transparent);
	color: color-mix(in oklab, var(--destructive) 70%, var(--foreground));
	font-size: 0.95rem;
}

/* Client-side rejection summary, injected at the top of the form by app.js. */
.cba-form-errors { margin: 0; }
.cba-form-errors[hidden] { display: none; }
.cba-form-errors-title { margin: 0 0 6px; font-weight: 700; }
.cba-form-errors ul { margin: 0; padding-left: 20px; }
.cba-form-errors li { margin: 2px 0; }

/* ---- Thanks ---- */
.cba-thanks { text-align: center; }
.cba-check {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 64px;
	height: 64px;
	margin: 4px auto 14px;
	border-radius: 50%;
	background: var(--primary);
	color: var(--primary-foreground);
	font-size: 2rem;
	box-shadow: 0 8px 20px -6px color-mix(in oklab, var(--primary) 35%, transparent);
}
.cba-thanks .cba-btn { max-width: 240px; margin: 18px auto 0; }

/* ---- Honeypot: visually + a11y hidden, still in the DOM for bots. ---- */
.cba-hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* =====================================================================
   Modal — the Custom Order "call us" dialog. Mirrors the app's <Dialog>:
   dimmed, blurred backdrop + centered card that fades/zooms in.
   ===================================================================== */
.cba-modal {
	position: fixed;
	inset: 0;
	z-index: 1000;
	align-items: center;
	justify-content: center;
	padding: 16px;
}
/* Display only when open; a plain `display` rule would beat the UA [hidden]. */
.cba-modal:not([hidden]) { display: flex; }

.cba-modal-overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
	backdrop-filter: blur(4px);
	-webkit-backdrop-filter: blur(4px);
	opacity: 0;
	transition: opacity .2s ease;
}

.cba-modal-panel {
	position: relative;
	z-index: 1;
	display: grid;
	gap: 16px;
	width: 100%;
	max-width: 28rem;
	padding: 24px;
	background: var(--card);
	color: var(--card-foreground);
	border: 1px solid var(--card-ring);
	border-radius: var(--radius-xl);
	box-shadow: 0 24px 50px -12px rgba(0, 0, 0, 0.45);
	/* Never exceed the viewport (minus the modal's 16px padding); scroll inside
	   instead, so tall guides don't clip their top/bottom or the close button. */
	max-height: calc(100vh - 32px);
	max-height: calc(100dvh - 32px);
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	opacity: 0;
	transform: scale(0.95);
	transition: opacity .2s ease, transform .2s ease;
}

.cba-modal.is-open .cba-modal-overlay { opacity: 1; }
.cba-modal.is-open .cba-modal-panel { opacity: 1; transform: scale(1); }

.cba-modal-x {
	position: absolute;
	top: 12px;
	right: 12px;
	display: inline-flex;
	padding: 6px;
	border: none;
	background: none;
	color: var(--muted-foreground);
	border-radius: var(--radius-md);
	cursor: pointer;
	opacity: 0.7;
	transition: opacity .15s, color .15s;
}
.cba-modal-x:hover { opacity: 1; color: var(--foreground); }
.cba-modal-x svg { width: 18px; height: 18px; }

.cba-modal-title {
	margin: 0;
	padding-right: 24px;
	font-size: 1.5rem;
	font-weight: 600;
	line-height: 1.3;
}
.cba-modal-desc {
	margin: 0;
	color: var(--muted-foreground);
	font-size: 1.125rem;
	line-height: 1.6;
}

.cba-modal-actions {
	display: flex;
	flex-direction: column-reverse;
	gap: 10px;
	margin-top: 4px;
}
.cba-modal-actions .cba-btn,
.cba-modal-actions .cba-btn-ghost { width: 100%; }
@media (min-width: 480px) {
	.cba-modal-actions { flex-direction: row; justify-content: flex-end; }
	.cba-modal-actions .cba-btn,
	.cba-modal-actions .cba-btn-ghost { width: auto; }
}

/* Thank-you confirmation modal — centered, with the success check. */
.cba-thanks-panel { text-align: center; }
.cba-thanks-panel .cba-check { margin: 0 auto; }
.cba-thanks-panel .cba-modal-actions { justify-content: center; }
.cba-thanks-panel .cba-modal-actions .cba-btn { width: auto; min-width: 160px; }

/* ---- Install guides (iOS Safari + Chrome) — shared illustrated steps ---- */
.cba-ios-safari .cba-modal-desc,
.cba-chrome-desktop .cba-modal-desc,
.cba-chrome-android .cba-modal-desc { margin-bottom: 14px; }
.cba-install-steps {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 12px;
	text-align: left;
}
.cba-install-steps li {
	display: flex;
	align-items: center;
	gap: 12px;
	font-size: 1rem;
	line-height: 1.4;
}
.cba-install-step-ico {
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	border-radius: var(--radius-md);
	background: color-mix(in oklab, var(--primary) 12%, var(--card));
	color: var(--primary);
}
.cba-install-step-ico svg { width: 22px; height: 22px; }

/* Optional illustrating screenshot inside an install guide. */
.cba-install-shot { margin: 16px 0 0; }
.cba-install-shot img {
	display: block;
	width: auto;
	max-width: 260px;
	max-height: 44vh;
	margin: 0 auto;
	border-radius: var(--radius-md);
	border: 1px solid var(--border);
	box-shadow: var(--shadow-sm);
}

/* iOS guide: show the step set matching the device (app.js adds --top for iPad). */
.cba-ios-ipad { display: none; }
.cba-ios-modal--top .cba-ios-iphone { display: none; }
.cba-ios-modal--top .cba-ios-ipad { display: grid; }
.cba-install-note {
	margin: 12px 0 0;
	font-size: 0.9rem;
	color: var(--muted-foreground);
	line-height: 1.45;
}

/* Chrome guide: show only the step set matching the device (app.js sets the class). */
.cba-chrome-android { display: none; }
.cba-chrome-modal--android .cba-chrome-desktop { display: none; }
.cba-chrome-modal--android .cba-chrome-android { display: block; }

/* The separate "How to install on Chrome" link in the landing footer. */
.cba-install-help { margin: 0; text-align: center; }
.cba-install-help-link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	border: none;
	background: none;
	padding: 0;
	font: inherit;
	color: var(--muted-foreground);
	font-size: 0.95rem;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
}
.cba-install-help-link:hover { color: var(--primary); text-decoration: underline; }
.cba-install-help-link:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring-soft); border-radius: var(--radius-sm); }
.cba-install-help-link svg { width: 18px; height: 18px; }

/* Default: show the Safari steps; app.js reveals the reopen note for non-Safari. */
.cba-ios-reopen { display: none; }
.cba-ios-modal--reopen .cba-ios-safari { display: none; }
.cba-ios-modal--reopen .cba-ios-reopen { display: block; }
.cba-ios-reopen-hint {
	margin: 10px 0 0;
	font-size: 0.95rem;
	color: var(--muted-foreground);
	line-height: 1.5;
}

/* Bouncing pointer toward Safari's Share button — only while the modal is open. */
.cba-ios-pointer { display: none; }
.cba-ios-modal:not([hidden]) .cba-ios-pointer {
	display: inline-flex;
	position: fixed;
	left: 50%;
	bottom: 6px;
	z-index: 2;
	color: var(--primary);
	pointer-events: none;
	animation: cba-ios-point 1.1s ease-in-out infinite;
}
.cba-ios-pointer svg {
	width: 44px;
	height: 44px;
	filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.45));
}
@keyframes cba-ios-point {
	0%, 100% { transform: translate(-50%, 0); }
	50%      { transform: translate(-50%, 7px); }
}
/* iPad: Share lives top-right — point up there instead. */
.cba-ios-modal--top:not([hidden]) .cba-ios-pointer {
	left: auto;
	right: 18px;
	bottom: auto;
	top: 6px;
	animation: cba-ios-point-up 1.1s ease-in-out infinite;
}
@keyframes cba-ios-point-up {
	0%, 100% { transform: translateY(0) rotate(180deg); }
	50%      { transform: translateY(-7px) rotate(180deg); }
}
/* Non-Safari: no toolbar button to point at. */
.cba-ios-modal--reopen .cba-ios-pointer { display: none !important; }
@media (prefers-reduced-motion: reduce) {
	.cba-ios-modal:not([hidden]) .cba-ios-pointer { animation: none; }
}

/* ---- Footer ---- */
.cba-footer {
	padding: 24px 16px;
	text-align: center;
	color: var(--muted-foreground);
	font-size: 0.875rem;
}

@keyframes cba-rise {
	from { opacity: 0; transform: translateY(8px); }
	to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
	.cba-landing, .cba-choices, .cba-js .cba-step.is-active { animation: none; }
	* { transition: none !important; }
}