#rcfo-chat-root {
	position: fixed;
	bottom: 90px; /* clears the site's .scrollToTop button, which sits at bottom: 20px */
	right: 20px;
	z-index: 999999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--rcfo-accent-soft: color-mix(in srgb, var(--rcfo-accent, #0b3d91) 85%, #4a7fe0 15%);
}

/* Defensive reset: many themes (Woodmart included) apply global styles to
   button/input/textarea that otherwise leak into the widget and override
   its own look. Everything below is scoped under #rcfo-chat-root. */
#rcfo-chat-root,
#rcfo-chat-root * {
	box-sizing: border-box;
}
#rcfo-chat-root button,
#rcfo-chat-root textarea,
#rcfo-chat-root input {
	all: revert;
	box-sizing: border-box;
	font-family: inherit;
	margin: 0;
}
#rcfo-chat-root button {
	appearance: none;
	-webkit-appearance: none;
	cursor: pointer;
}
#rcfo-chat-root ul,
#rcfo-chat-root ol {
	margin: 4px 0 4px 0;
	padding-left: 20px;
}
#rcfo-chat-root li { margin-bottom: 3px; }
#rcfo-chat-root strong { font-weight: 700; color: inherit; }

@keyframes rcfoFadeInUp {
	from { opacity: 0; transform: translateY(6px); }
	to { opacity: 1; transform: translateY(0); }
}
@keyframes rcfoPulseRing {
	0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--rcfo-accent, #0b3d91) 45%, transparent); }
	100% { box-shadow: 0 0 0 14px color-mix(in srgb, var(--rcfo-accent, #0b3d91) 0%, transparent); }
}
@keyframes rcfoDotBounce {
	0%, 60%, 100% { transform: translateY(0); opacity: 0.5; }
	30% { transform: translateY(-4px); opacity: 1; }
}

/* --- bubble --- */
#rcfo-chat-root .rcfo-chat-bubble {
	position: relative;
	width: 60px;
	height: 60px;
	border-radius: 50% !important;
	background: linear-gradient(145deg, var(--rcfo-accent-soft), var(--rcfo-accent, #0b3d91)) !important;
	color: #fff !important;
	border: none !important;
	box-shadow: 0 6px 20px color-mix(in srgb, var(--rcfo-accent, #0b3d91) 45%, transparent);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 26px;
	transition: transform 0.18s cubic-bezier(.34,1.56,.64,1);
	padding: 0;
}
#rcfo-chat-root .rcfo-chat-bubble::before {
	content: '';
	position: absolute;
	inset: 0;
	border-radius: 50%;
	animation: rcfoPulseRing 2.4s ease-out infinite;
	pointer-events: none;
}
#rcfo-chat-root .rcfo-chat-bubble:hover { transform: scale(1.08) rotate(-4deg); }
#rcfo-chat-root .rcfo-chat-bubble:active { transform: scale(0.96); }

/* --- window: smooth open/close instead of an instant flip --- */
#rcfo-chat-root .rcfo-chat-window {
	position: fixed;
	bottom: 162px;
	right: 20px;
	width: 380px;
	max-width: calc(100vw - 32px);
	height: 540px;
	max-height: calc(100vh - 210px);
	background: #fff !important;
	border-radius: 18px;
	box-shadow: 0 20px 60px rgba(15,20,50,0.22), 0 2px 8px rgba(15,20,50,0.08);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	opacity: 0;
	transform: scale(0.94) translateY(10px);
	pointer-events: none;
	visibility: hidden;
	transition: opacity 0.2s ease, transform 0.2s cubic-bezier(.2,.9,.3,1.2), visibility 0.2s;
	transform-origin: bottom right;
}
#rcfo-chat-root .rcfo-chat-window.rcfo-open {
	opacity: 1;
	transform: scale(1) translateY(0);
	pointer-events: auto;
	visibility: visible;
}

#rcfo-chat-root .rcfo-chat-header {
	background: linear-gradient(120deg, var(--rcfo-accent, #0b3d91), var(--rcfo-accent-soft)) !important;
	color: #fff !important;
	padding: 18px 18px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-shrink: 0;
	position: relative;
}
#rcfo-chat-root .rcfo-chat-header-info { display: flex; align-items: center; gap: 10px; }
#rcfo-chat-root .rcfo-chat-avatar {
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: rgba(255,255,255,0.18);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 17px;
	flex-shrink: 0;
}
#rcfo-chat-root .rcfo-chat-header strong { font-size: 15.5px; color: #fff !important; font-weight: 700; display: flex; align-items: center; gap: 6px; }
#rcfo-chat-root .rcfo-chat-status-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #4ade80;
	box-shadow: 0 0 0 2px rgba(255,255,255,0.3);
	display: inline-block;
}
#rcfo-chat-root .rcfo-chat-header small { display: block; opacity: 0.85; font-size: 11.5px; color: #fff !important; margin-top: 1px; }
#rcfo-chat-root .rcfo-chat-close {
	background: rgba(255,255,255,0.15) !important;
	border: none !important;
	color: #fff !important;
	font-size: 17px;
	line-height: 1;
	padding: 6px 10px;
	border-radius: 9px;
	transition: background 0.15s ease, transform 0.15s ease;
}
#rcfo-chat-root .rcfo-chat-close:hover { background: rgba(255,255,255,0.28) !important; transform: rotate(90deg); }

#rcfo-chat-root .rcfo-chat-messages {
	flex: 1;
	overflow-y: auto;
	padding: 18px 16px;
	background:
		radial-gradient(circle at top right, color-mix(in srgb, var(--rcfo-accent, #0b3d91) 4%, transparent), transparent 55%),
		#f6f7fb;
}
#rcfo-chat-root .rcfo-chat-messages::-webkit-scrollbar { width: 5px; }
#rcfo-chat-root .rcfo-chat-messages::-webkit-scrollbar-thumb { background: #d5d8e3; border-radius: 4px; }

/* --- message text --- */
#rcfo-chat-root .rcfo-chat-msg {
	max-width: 88%;
	margin-bottom: 12px;
	padding: 11px 14px;
	border-radius: 16px;
	font-size: 14px;
	line-height: 1.55;
	animation: rcfoFadeInUp 0.22s ease both;
}
#rcfo-chat-root .rcfo-chat-msg > div:not(:last-child) { margin-bottom: 2px; }
#rcfo-chat-root .rcfo-chat-para-break { height: 8px; }

#rcfo-chat-root .rcfo-chat-msg.user {
	background: linear-gradient(135deg, var(--rcfo-accent-soft), var(--rcfo-accent, #0b3d91)) !important;
	color: #fff !important;
	margin-left: auto;
	border-bottom-right-radius: 5px;
	box-shadow: 0 3px 10px color-mix(in srgb, var(--rcfo-accent, #0b3d91) 30%, transparent);
}
#rcfo-chat-root .rcfo-chat-msg.assistant {
	background: #fff !important;
	color: #24262b !important;
	border: 1px solid #e9eaf2;
	box-shadow: 0 2px 6px rgba(20,20,40,0.05);
	margin-right: auto;
	border-bottom-left-radius: 5px;
}
#rcfo-chat-root .rcfo-chat-msg.typing {
	background: #fff !important;
	border: 1px solid #e9eaf2;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 13px 16px;
}
#rcfo-chat-root .rcfo-chat-typing-dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: color-mix(in srgb, var(--rcfo-accent, #0b3d91) 55%, #999);
	animation: rcfoDotBounce 1.2s ease-in-out infinite;
}
#rcfo-chat-root .rcfo-chat-typing-dot:nth-child(2) { animation-delay: 0.15s; }
#rcfo-chat-root .rcfo-chat-typing-dot:nth-child(3) { animation-delay: 0.3s; }

/* --- highlighted links --- */
#rcfo-chat-root .rcfo-chat-msg a {
	font-weight: 600;
	text-decoration: none;
	border-bottom: 1.5px solid currentColor;
	padding-bottom: 1px;
	transition: opacity 0.12s ease;
}
#rcfo-chat-root .rcfo-chat-msg a:hover { opacity: 0.75; }
#rcfo-chat-root .rcfo-chat-msg.user a { color: #fff !important; border-bottom-color: rgba(255,255,255,0.6); }
#rcfo-chat-root .rcfo-chat-msg.assistant a {
	color: var(--rcfo-accent, #0b3d91) !important;
	background: color-mix(in srgb, var(--rcfo-accent, #0b3d91) 8%, transparent);
	border-bottom-color: var(--rcfo-accent, #0b3d91);
	border-radius: 5px;
	padding: 1px 5px;
	margin: 0 -2px;
}

/* --- shared card system: used identically for products, aircraft, and instructors --- */
#rcfo-chat-root .rcfo-chat-card-row {
	display: flex;
	gap: 10px;
	overflow-x: auto;
	padding: 2px 2px 14px;
	margin-top: -6px;
	scroll-snap-type: x proximity;
	animation: rcfoFadeInUp 0.25s ease both;
}
#rcfo-chat-root .rcfo-chat-card-row::-webkit-scrollbar { height: 5px; }
#rcfo-chat-root .rcfo-chat-card-row::-webkit-scrollbar-thumb { background: #d5d8e3; border-radius: 4px; }

#rcfo-chat-root .rcfo-chat-card {
	flex: 0 0 148px;
	scroll-snap-align: start;
	background: #fff !important;
	border: 1px solid #e9eaf2;
	border-radius: 14px;
	padding: 10px;
	display: flex;
	flex-direction: column;
	box-shadow: 0 2px 6px rgba(20,20,40,0.06);
	transition: transform 0.16s cubic-bezier(.2,.9,.3,1.2), box-shadow 0.16s ease;
}
#rcfo-chat-root .rcfo-chat-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 10px 22px rgba(20,20,40,0.14);
}

#rcfo-chat-root .rcfo-chat-card img {
	width: 100%;
	height: 98px;
	object-fit: cover;
	border-radius: 9px;
	background: #f0f1f5;
	margin-bottom: 8px;
	max-width: none;
}

/* Avatar variant for cards with no photo (e.g. instructors) — a centered
   icon circle standing in for a portrait, keeping the same card shape. */
#rcfo-chat-root .rcfo-chat-card-avatar {
	width: 100%;
	height: 98px;
	border-radius: 9px;
	margin-bottom: 8px;
	background: linear-gradient(145deg, color-mix(in srgb, var(--rcfo-accent, #0b3d91) 12%, #fff), color-mix(in srgb, var(--rcfo-accent, #0b3d91) 22%, #fff));
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 30px;
}

#rcfo-chat-root .rcfo-chat-card-title {
	font-size: 12px;
	font-weight: 700;
	color: #24262b !important;
	line-height: 1.35;
	margin-bottom: 4px;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

#rcfo-chat-root .rcfo-chat-card-meta {
	font-size: 11.5px;
	color: var(--rcfo-accent, #0b3d91) !important;
	font-weight: 700;
	margin-bottom: 8px;
	line-height: 1.3;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

#rcfo-chat-root .rcfo-chat-card-action { margin-top: auto; }

#rcfo-chat-root .rcfo-chat-card-btn-primary,
#rcfo-chat-root .rcfo-chat-card-btn-secondary {
	display: block;
	width: 100%;
	text-align: center;
	border-radius: 8px;
	padding: 8px 4px;
	font-size: 11.5px;
	font-weight: 700;
	text-decoration: none;
	transition: opacity 0.12s ease, transform 0.12s ease;
}
#rcfo-chat-root .rcfo-chat-card-btn-primary {
	background: linear-gradient(135deg, var(--rcfo-accent-soft), var(--rcfo-accent, #0b3d91)) !important;
	color: #fff !important;
	border: none !important;
}
#rcfo-chat-root .rcfo-chat-card-btn-primary:hover,
#rcfo-chat-root .rcfo-chat-card-btn-secondary:hover { opacity: 0.9; transform: translateY(-1px); }
#rcfo-chat-root .rcfo-chat-card-btn-primary:disabled { opacity: 0.55; cursor: default; transform: none; }

#rcfo-chat-root .rcfo-chat-card-btn-secondary {
	background: #fff !important;
	color: var(--rcfo-accent, #0b3d91) !important;
	border: 1.5px solid var(--rcfo-accent, #0b3d91) !important;
}

#rcfo-chat-root .rcfo-chat-added-confirm {
	font-size: 11px;
	font-weight: 600;
	color: #157a3d !important;
	line-height: 1.5;
	text-align: center;
	animation: rcfoFadeInUp 0.18s ease both;
}
#rcfo-chat-root .rcfo-chat-added-confirm a {
	color: var(--rcfo-accent, #0b3d91) !important;
	text-decoration: underline;
	font-weight: 700;
}

#rcfo-chat-root .rcfo-chat-search-suggestions {
	margin: -4px 0 12px;
	max-width: 100%;
	overflow-x: auto;
}
#rcfo-chat-root .rcfo-chat-input-row {
	display: flex;
	align-items: stretch;
	border-top: 1px solid #e9eaf2;
	padding: 10px;
	gap: 8px;
	flex-shrink: 0;
	background: #fff;
	padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
}
#rcfo-chat-root .rcfo-chat-input-row textarea {
	flex: 1;
	resize: none !important;
	border: 1.5px solid #e4e6ee !important;
	border-radius: 12px !important;
	padding: 10px 13px !important;
	font-size: 14px !important;
	line-height: 1.4;
	max-height: 80px;
	background: #fafbfd !important;
	color: #222 !important;
	outline: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
#rcfo-chat-root .rcfo-chat-input-row textarea:focus {
	border-color: var(--rcfo-accent, #0b3d91) !important;
	background: #fff !important;
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--rcfo-accent, #0b3d91) 12%, transparent);
}
#rcfo-chat-root .rcfo-chat-send {
	background: linear-gradient(135deg, var(--rcfo-accent-soft), var(--rcfo-accent, #0b3d91)) !important;
	color: #fff !important;
	border: none !important;
	border-radius: 12px !important;
	padding: 0 16px !important;
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 46px;
	box-shadow: 0 3px 10px color-mix(in srgb, var(--rcfo-accent, #0b3d91) 35%, transparent);
	transition: transform 0.14s cubic-bezier(.34,1.56,.64,1), opacity 0.12s ease;
}
#rcfo-chat-root .rcfo-chat-send svg { width: 17px; height: 17px; }
#rcfo-chat-root .rcfo-chat-send:hover:not(:disabled) { transform: scale(1.06); }
#rcfo-chat-root .rcfo-chat-send:active:not(:disabled) { transform: scale(0.94); }
#rcfo-chat-root .rcfo-chat-send:disabled { opacity: 0.45; cursor: default; box-shadow: none; }

/* --- mobile responsiveness --- */
@media (max-width: 480px) {
	#rcfo-chat-root { right: 12px; bottom: 65px; }
	#rcfo-chat-root .rcfo-chat-window {
		right: 8px;
		bottom: 137px;
		left: 8px;
		width: auto;
		max-width: none;
		height: calc(100vh - 190px);
		max-height: calc(100vh - 190px);
	}
	/* 16px prevents iOS Safari from auto-zooming the page on focus */
	#rcfo-chat-root .rcfo-chat-input-row textarea { font-size: 16px !important; }
	#rcfo-chat-root .rcfo-chat-card { flex: 0 0 132px; }
	#rcfo-chat-root .rcfo-chat-bubble { width: 54px; height: 54px; font-size: 22px; }

	/* When the site's sticky mobile toolbar is showing, its .scrollToTop
	   button moves to bottom: 67px — push the widget up further to clear it. */
	body.sticky-toolbar-on #rcfo-chat-root { bottom: 122px; }
	body.sticky-toolbar-on #rcfo-chat-root .rcfo-chat-window {
		bottom: 194px;
		height: calc(100vh - 247px);
		max-height: calc(100vh - 247px);
	}
}

@media (max-width: 360px) {
	#rcfo-chat-root .rcfo-chat-window { height: calc(100vh - 170px); max-height: calc(100vh - 170px); }
	#rcfo-chat-root .rcfo-chat-msg { max-width: 92%; }
}

@media (prefers-reduced-motion: reduce) {
	#rcfo-chat-root * { animation: none !important; transition: none !important; }
}
