/* Hardline Product Advisor — widget styles.
   "Recommended build" design: a dark advisor that lives fixed at the bottom
   center of the page. The composer bar is always visible; it expands UPWARD
   into the answer panel and collapses back to just the bar. A traveling
   red→white light rides the composer border when idle and goes solid red once
   a conversation starts. Mobile swaps the dock for a launcher + bottom sheet.
   Both surfaces always show a tap-to-call "Talk to a person" handoff.

   Colors match hardlineproducts.com's dark treatment: brand red on near-black.
   Everything is scoped under .ha- so it can't collide with the theme. */

@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@400;500;600;700;800;900&family=Archivo+Narrow:wght@600;700&display=swap');

.ha-advisor-bubble,
.ha-advisor-inline {
	--ha-black: #050505;
	--ha-panel: #0c0c0d;
	--ha-panel-2: #141416;
	--ha-line: #26262a;
	--ha-white: #fff;
	--ha-dim: #9a9a9f;
	--ha-red: #e31e24;
	--ha-red-2: #ff3a40;
	--ha-ok: #3ecf8e;
	--ha-head: "Archivo Narrow", "Arial Narrow", sans-serif;
	--ha-body: "Archivo", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.ha-advisor-bubble *,
.ha-advisor-inline * { box-sizing: border-box; }
.ha-advisor-bubble a,
.ha-advisor-inline a { text-decoration: none; color: inherit; }

/* ================= animated border angle ================= */
@property --ha-a { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
@keyframes ha-spin { to { --ha-a: 360deg; } }
@keyframes ha-blink { 0%, 60%, 100% { opacity: .25; } 30% { opacity: 1; } }

/* ================= DOCK (desktop: fixed bottom-center) ================= */
.ha-dock {
	position: fixed;
	left: 50%;
	bottom: 18px;
	transform: translateX(-50%);
	width: min(600px, calc(100vw - 32px));
	z-index: 99999;
	font-family: var(--ha-body);
	color: var(--ha-white);
	/* Cap the whole dock to the viewport and lay it out as a column, so the
	   answer panel absorbs the height (and scrolls) while the composer below
	   stays fully visible — never clipped off the bottom of a short screen. */
	display: flex;
	flex-direction: column;
	max-height: calc(100vh - 36px);
	max-height: calc(100dvh - 36px);
}
.ha-dock.ha-collapsed .ha-answer { display: none; }
.ha-dock.ha-dismissed { display: none !important; }
.ha-dock .ha-answer { margin-bottom: 10px; }

/* ================= ANSWER PANEL ================= */
.ha-answer {
	background: var(--ha-panel);
	border: 1px solid var(--ha-line);
	border-radius: 16px;
	overflow: hidden;
	box-shadow: 0 20px 60px rgba(0, 0, 0, .6);
	/* Shrink to fit the dock's capped height; its body scrolls internally. */
	display: flex;
	flex-direction: column;
	min-height: 0;
	flex: 1 1 auto;
}
.ha-a-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 11px 14px;
	border-bottom: 1px solid var(--ha-line);
}
.ha-who {
	display: flex;
	align-items: center;
	gap: 9px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .03em;
	text-transform: uppercase;
	font-family: var(--ha-head);
}
.ha-badge {
	width: 22px;
	height: 22px;
	border-radius: 6px;
	background: var(--ha-red);
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 800;
	font-size: 12px;
	font-style: italic;
}
.ha-logo-chip {
	display: inline-flex;
	align-items: center;
	background: #fff;
	border-radius: 6px;
	padding: 4px 8px;
	/* styling for the text fallback if the logo image fails to load */
	color: var(--ha-red);
	font-family: var(--ha-head);
	font-weight: 700;
	font-style: italic;
	text-transform: uppercase;
	font-size: 14px;
	line-height: 1;
}
.ha-logo { height: 16px; width: auto; display: block; }
.ha-who-label { color: var(--ha-dim); font-weight: 700; letter-spacing: .06em; }
.ha-a-body {
	padding: 14px 16px;
	max-height: 320px;
	overflow-y: auto;
	overflow-x: hidden;
	/* Grow to fill the panel, but shrink below max-height on short screens so
	   the composer always fits. min-height:0 lets the flex item actually scroll. */
	flex: 1 1 auto;
	min-height: 0;
}

/* ================= CONVERSATION THREAD ================= */
.ha-thread { display: flex; flex-direction: column; gap: 12px; }
.ha-msg {
	max-width: 88%;
	font-size: 13.5px;
	line-height: 1.5;
	padding: 10px 13px;
	border-radius: 13px;
	white-space: pre-wrap;
	word-wrap: break-word;
}
.ha-msg.ha-bot {
	background: #000;
	border: 1px solid var(--ha-line);
	align-self: flex-start;
	border-bottom-left-radius: 4px;
	color: var(--ha-dim);
}
.ha-msg.ha-bot b { color: var(--ha-white); font-weight: 700; }
.ha-msg.ha-user {
	background: var(--ha-red);
	color: #fff;
	align-self: flex-end;
	border-bottom-right-radius: 4px;
}
.ha-msg .ha-link { color: var(--ha-red-2); font-weight: 600; word-break: break-word; }
.ha-msg.ha-user .ha-link { color: #fff; text-decoration: underline; }

.ha-typing {
	display: flex;
	gap: 5px;
	align-self: flex-start;
	background: #000;
	border: 1px solid var(--ha-line);
	padding: 13px 15px;
	border-radius: 13px;
}
.ha-typing span { width: 6px; height: 6px; border-radius: 50%; background: #6a6a70; animation: ha-blink 1.2s infinite; }
.ha-typing span:nth-child(2) { animation-delay: .2s; }
.ha-typing span:nth-child(3) { animation-delay: .4s; }

/* ================= PRODUCT CARDS ================= */
.ha-products { display: flex; flex-direction: column; gap: 10px; align-self: stretch; }
.ha-prod {
	display: flex;
	gap: 12px;
	padding: 12px;
	border: 1px solid var(--ha-line);
	border-radius: 12px;
	background: var(--ha-panel-2);
	transition: border-color .15s ease-out;
}
.ha-prod:hover { border-color: var(--ha-red); }
.ha-thumb {
	width: 52px;
	height: 52px;
	border-radius: 8px;
	flex: none;
	background: #000;
	border: 1px solid var(--ha-line);
	display: flex;
	align-items: center;
	justify-content: center;
	color: #4a4a50;
	font-size: 9px;
	font-weight: 700;
	object-fit: cover;
	overflow: hidden;
}
.ha-info { flex: 1; min-width: 0; }
.ha-info h4 { font-size: 13.5px; font-weight: 600; margin: 0 0 3px; color: var(--ha-white); line-height: 1.25; }
.ha-info .ha-why { font-size: 12px; color: var(--ha-dim); line-height: 1.4; }
.ha-meta {
	text-align: right;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	align-items: flex-end;
	flex: none;
	gap: 6px;
}
.ha-price { font-size: 14px; font-weight: 700; color: var(--ha-white); }
.ha-view { font-size: 12px; font-weight: 700; color: var(--ha-red-2); text-transform: uppercase; white-space: nowrap; }
.ha-fit {
	display: inline-flex;
	gap: 4px;
	font-size: 10px;
	font-weight: 700;
	padding: 3px 8px;
	border-radius: 20px;
	margin-top: 6px;
	text-transform: uppercase;
}
.ha-fit.ha-oos { background: rgba(227, 30, 36, .15); color: var(--ha-red-2); }

/* ================= PHONE HANDOFF (always visible) ================= */
.ha-phonebar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 6px 12px;
	border-top: 1px solid var(--ha-line);
	background: #0a0a0b;
}
.ha-ptxt { font-size: 11px; color: var(--ha-dim); }
.ha-callbtn {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	background: var(--ha-red);
	color: #fff;
	font-weight: 700;
	font-size: 10.5px;
	padding: 4px 10px;
	border-radius: 14px;
	text-transform: uppercase;
	letter-spacing: .02em;
	white-space: nowrap;
	transition: background .2s ease-out;
}
.ha-callbtn:hover { background: var(--ha-red-2); }
.ha-callbtn svg { width: 12px; height: 12px; }

/* ================= PRIVACY NOTICE ================= */
.ha-privacy {
	font-size: 10px;
	line-height: 1.4;
	color: #5a5a60;
	text-align: center;
	padding: 8px 14px;
	border-top: 1px solid var(--ha-line);
	background: #0a0a0b;
}
.ha-privacy-link { color: var(--ha-dim); text-decoration: underline; }

/* ================= COMPOSER ================= */
.ha-composer {
	position: relative;
	display: flex;
	align-items: flex-end;
	gap: 10px;
	background: var(--ha-panel);
	border: 1px solid transparent;
	border-radius: 24px;
	padding: 9px 9px 9px 17px;
	box-shadow: 0 14px 44px rgba(0, 0, 0, .55);
	/* Fixed part of the dock — never shrinks, so the input is always in full view. */
	flex: none;
}
/* crisp traveling light on the border — red into white, masked to the ring */
.ha-composer::before {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: 24px;
	padding: 2px;
	pointer-events: none;
	background: conic-gradient(from var(--ha-a),
		transparent 0deg, transparent 205deg,
		var(--ha-red) 262deg, #ffffff 305deg, transparent 345deg, transparent 360deg);
	-webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
	-webkit-mask-composite: xor;
	mask-composite: exclude;
	animation: ha-spin 5.5s linear infinite;
	opacity: .9;
}
/* soft blurred bloom behind the bar */
.ha-composer::after {
	content: "";
	position: absolute;
	inset: -1px;
	border-radius: 26px;
	pointer-events: none;
	z-index: -1;
	background: conic-gradient(from var(--ha-a),
		transparent 0deg, transparent 215deg,
		var(--ha-red) 262deg, #ffffff 305deg, transparent 345deg, transparent 360deg);
	filter: blur(10px);
	animation: ha-spin 5.5s linear infinite;
	opacity: .55;
}
/* once chatting: stop the moving light, go solid red */
.ha-composer.ha-chatting::before { animation: none; background: var(--ha-red); opacity: 1; }
.ha-composer.ha-chatting::after { animation: none; background: var(--ha-red); filter: blur(8px); opacity: .28; }

.ha-orb { flex: none; display: flex; padding-left: 2px; padding-bottom: 7px; }
.ha-orb svg { width: 20px; height: 20px; }
.ha-field {
	flex: 1;
	background: none;
	border: 0;
	outline: 0;
	color: #fff;
	font-family: var(--ha-body);
	font-size: 15px;
	min-width: 0;
	resize: none;
	line-height: 20px;
	padding: 7px 0;
	max-height: 120px;
	overflow-y: hidden;
	display: block;
}
.ha-field::placeholder { color: #6a6a70; }
.ha-iconbtn {
	flex: none;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	border: 0;
	background: transparent;
	color: var(--ha-dim);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}
.ha-iconbtn:hover { background: #1c1c20; color: #fff; }
.ha-iconbtn svg { width: 18px; height: 18px; }
.ha-send {
	flex: none;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	border: 0;
	background: var(--ha-red);
	color: #fff;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}
.ha-send:hover { background: var(--ha-red-2); }
.ha-send:disabled { opacity: .55; cursor: not-allowed; }
.ha-send svg { width: 18px; height: 18px; }

/* ================= CORNER LAUNCHER ================= */
/* Reopens the advisor after it's dismissed (and is the default entry on
   mobile). JS toggles .ha-hidden; base state is visible. */
.ha-launcher {
	display: inline-flex;
	position: fixed;
	right: 16px;
	bottom: 16px;
	z-index: 99999;
	align-items: center;
	gap: 9px;
	background: var(--ha-red);
	color: #fff;
	border: 0;
	border-radius: 30px;
	padding: 13px 18px 13px 15px;
	font-family: var(--ha-body);
	font-weight: 700;
	font-size: 14px;
	cursor: pointer;
	box-shadow: 0 12px 34px rgba(227, 30, 36, .45);
}
.ha-launcher svg { width: 20px; height: 20px; }
.ha-hidden { display: none !important; }

/* ================= MOBILE: dock becomes a bottom sheet ================= */
@media (max-width: 640px) {
	.ha-dock {
		left: 0;
		right: 0;
		bottom: 0;
		width: 100%;
		transform: translateY(100%);
		transition: transform .28s cubic-bezier(.2, .8, .2, 1);
	}
	.ha-dock.ha-open { transform: translateY(0); }
	/* on mobile the answer always shows when the sheet is open */
	.ha-dock.ha-collapsed .ha-answer { display: block; }
	.ha-answer {
		border-radius: 0;
		border-left: 0;
		border-right: 0;
		border-bottom: 0;
		margin-bottom: 0 !important;
		border-top-left-radius: 20px;
		border-top-right-radius: 20px;
	}
	.ha-a-body { max-height: min(52vh, 420px); }
	.ha-composer {
		border-radius: 0;
		box-shadow: none;
		border-top: 1px solid var(--ha-line);
		background: var(--ha-panel);
	}
	.ha-composer::before, .ha-composer::after { display: none; }
}

/* ================= INLINE (shortcode) ================= */
.ha-advisor-inline {
	display: block;
	max-width: 620px;
	margin: 0 auto;
	font-family: var(--ha-body);
	color: var(--ha-white);
}
.ha-advisor-inline .ha-answer { margin-bottom: 10px; }
.ha-advisor-inline .ha-a-body { max-height: 440px; }
