/* AmberJack chat assistant. Uses the theme's tokens when present, with fallbacks. */
.hbc-chat {
	--c-deep: var(--hb-deep, #0a2a43);
	--c-gold: var(--hb-gold, #c9a24f);
	--c-gold-l: var(--hb-gold-light, #e2c47f);
	--c-tint: var(--hb-shallow-2, #eef6f9);
	--c-line: var(--hb-line, #d5dfe6);
	--c-ink: var(--hb-ink, #10243a);
	--c-muted: var(--hb-muted, #55687c);
	position: fixed; inset-inline-end: 20px; bottom: 20px; z-index: 1500;
	font-family: var(--hb-font, system-ui, sans-serif); color: var(--c-ink);
	display: flex; flex-direction: column; align-items: flex-end; gap: 12px;
	transition: bottom .2s;
}
.hbc-chat.is-lifted { bottom: 88px; }

.hbc-chat__launcher {
	display: inline-flex; align-items: center; gap: 10px; border: 0; cursor: pointer;
	background: var(--c-deep); color: #fff; font: inherit; font-weight: 600; font-size: .95rem;
	padding: 12px 18px 12px 14px; border-radius: 999px;
	box-shadow: 0 10px 28px -8px rgba(var(--hb-deep-rgb, 10, 42, 67), .55), 0 0 0 2px var(--c-gold) inset;
}
[dir="rtl"] .hbc-chat__launcher { padding: 12px 14px 12px 18px; }
.hbc-chat__launcher svg { color: var(--c-gold); flex: none; }
.hbc-chat__launcher:hover { background: var(--hb-deep-2, #12395a); }
.hbc-chat__launcher:focus-visible { outline: 3px solid var(--c-gold); outline-offset: 3px; }
.hbc-chat.is-open .hbc-chat__launcher span { display: none; }
.hbc-chat.is-open .hbc-chat__launcher { padding: 12px; }

.hbc-chat__panel {
	width: min(390px, calc(100vw - 24px)); height: min(600px, calc(100vh - 120px));
	display: flex; flex-direction: column; overflow: hidden;
	background: var(--hb-surface, #fff); border-radius: 12px; border: 1px solid var(--c-line);
	box-shadow: 0 24px 60px -18px rgba(var(--hb-deep-rgb, 10, 42, 67), .45);
}
.hbc-chat__panel[hidden] { display: none; }
.hbc-chat__panel:not([hidden]) { animation: hbc-in .18s ease-out; }
@keyframes hbc-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.hbc-chat__head { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 14px; background: var(--c-deep); color: #fff; }
.hbc-chat__head img { border-radius: 50%; flex: none; box-shadow: 0 0 0 2px var(--c-gold); }
.hbc-chat__head div { flex: 1; min-width: 0; display: grid; }
.hbc-chat__head strong { font-size: 1rem; line-height: 1.3; }
.hbc-chat__head span { font-size: .78rem; color: var(--hb-on-deep-muted, #b9cfe2); line-height: 1.4; }
.hbc-chat__icon { background: none; border: 0; color: #fff; cursor: pointer; padding: 6px; border-radius: 8px; display: grid; place-items: center; }
.hbc-chat__icon:hover { background: rgba(255, 255, 255, .1); }
.hbc-chat__icon:focus-visible { outline: 2px solid var(--c-gold); }

.hbc-chat__log { flex: 1; overflow-y: auto; padding: 16px 14px 8px; display: flex; flex-direction: column; gap: 10px; background: var(--hb-surface, #fff); overscroll-behavior: contain; }
.hbc-msg { display: flex; flex-direction: column; gap: 8px; max-width: 88%; }
.hbc-msg--user { align-self: flex-end; align-items: flex-end; }
.hbc-msg--bot { align-self: flex-start; }
.hbc-msg.is-new { animation: hbc-msg .2s ease-out; }
@keyframes hbc-msg { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.hbc-msg__bubble { padding: 10px 13px; border-radius: 14px; font-size: .93rem; line-height: 1.65; overflow-wrap: anywhere; }
.hbc-msg__bubble p { margin: 0 0 6px; }
.hbc-msg__bubble p:last-child { margin-bottom: 0; }
.hbc-msg__bubble ul { margin: 4px 0 6px; padding-inline-start: 18px; }
.hbc-msg__bubble li { margin: 2px 0; }
.hbc-msg--bot .hbc-msg__bubble { background: var(--c-tint); border-end-start-radius: 4px; }
.hbc-msg--user .hbc-msg__bubble { background: var(--c-deep); color: #fff; border-end-end-radius: 4px; }
.hbc-msg__bubble a { color: inherit; font-weight: 600; text-decoration: underline; text-decoration-color: var(--c-gold); text-underline-offset: 3px; }

.hbc-typing .hbc-msg__bubble { display: inline-flex; gap: 4px; padding: 14px 16px; }
.hbc-typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--c-muted); opacity: .4; animation: hbc-dot 1s infinite; }
.hbc-typing i:nth-child(3) { animation-delay: .15s; }
.hbc-typing i:nth-child(4) { animation-delay: .3s; }
@keyframes hbc-dot { 0%, 100% { opacity: .3; transform: none; } 50% { opacity: 1; transform: translateY(-3px); } }

.hbc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
.hbc-chips button {
	border: 1px solid var(--c-gold); background: var(--hb-surface, #fff); color: var(--c-deep); font: inherit; font-size: .84rem; font-weight: 500;
	padding: 6px 12px; border-radius: 999px; cursor: pointer;
}
.hbc-chips button:hover { background: var(--c-gold); }

.hbc-cards { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; max-width: 100%; scroll-snap-type: x mandatory; }
.hbc-card { flex: 0 0 220px; display: flex; gap: 10px; padding: 8px; border: 1px solid var(--c-line); border-radius: 10px; background: var(--hb-surface, #fff); scroll-snap-align: start; }
.hbc-card img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; background: var(--c-tint); flex: none; }
.hbc-card__body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.hbc-card__name { font-size: .84rem; font-weight: 600; color: var(--c-ink); text-decoration: none; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hbc-card__name:hover { color: var(--c-deep); text-decoration: underline; }
.hbc-card__price { font-size: .82rem; font-weight: 700; color: var(--c-deep); font-family: var(--hb-figures, inherit); direction: ltr; unicode-bidi: isolate; text-align: start; }
.hbc-card__actions { display: flex; gap: 8px; margin-top: auto; font-size: .78rem; }
.hbc-card__actions a { color: var(--c-deep); font-weight: 600; }
.hbc-card__actions button { border: 0; background: var(--c-deep); color: #fff; font: inherit; font-size: .76rem; font-weight: 600; padding: 3px 8px; border-radius: 6px; cursor: pointer; }
.hbc-card__actions button:disabled { background: var(--hb-ok, #067647); cursor: default; }

.hbc-contact { display: flex; flex-wrap: wrap; gap: 6px; }
.hbc-contact a { font-size: .84rem; font-weight: 600; color: var(--c-deep); background: var(--hb-surface, #fff); border: 1px solid var(--c-line); padding: 5px 12px; border-radius: 999px; text-decoration: none; }
.hbc-contact a:hover { border-color: var(--c-gold); }

.hbc-chat__form { display: flex; align-items: flex-end; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--c-line); background: var(--hb-surface, #fff); }
.hbc-chat__form textarea {
	flex: 1; resize: none; border: 1px solid var(--hb-input-line, #b9c7d3); border-radius: 10px; padding: 9px 12px; font: inherit; font-size: .93rem;
	line-height: 1.5; max-height: 120px; color: var(--c-ink); background: var(--hb-surface, #fff);
}
.hbc-chat__form textarea:focus { outline: none; border-color: var(--c-gold); box-shadow: 0 0 0 3px rgba(var(--hb-gold-rgb, 201, 162, 79), .3); }
.hbc-chat__send { flex: none; width: 42px; height: 42px; border: 0; border-radius: 10px; background: var(--c-gold); color: var(--c-deep); cursor: pointer; display: grid; place-items: center; }
[dir="rtl"] .hbc-chat__send svg { transform: scaleX(-1); }
.hbc-chat__send:hover { background: var(--c-gold-l); }
.hbc-chat__send:disabled { opacity: .5; cursor: wait; }
.hbc-chat__note { margin: 0; padding: 0 14px 10px; font-size: .72rem; color: var(--c-muted); background: var(--hb-surface, #fff); line-height: 1.5; }

@media (max-width: 560px) {
	.hbc-chat { inset-inline-end: 12px; bottom: 12px; }
	.hbc-chat.is-lifted { bottom: 80px; }
	.hbc-chat__launcher span { display: none; }
	.hbc-chat__launcher, [dir="rtl"] .hbc-chat__launcher { padding: 14px; }
	.hbc-chat.is-open { inset: 0; gap: 0; }
	.hbc-chat.is-open .hbc-chat__panel { width: 100%; height: 100%; border-radius: 0; border: 0; }
	.hbc-chat.is-open .hbc-chat__launcher { display: none; }
}
@media (prefers-reduced-motion: reduce) {
	.hbc-chat__panel, .hbc-msg.is-new, .hbc-typing i { animation: none !important; }
}
