/*
 * CQI Bot public widget styles. Self-contained, no CDN font or icon
 * dependency. Accent colour is set per-site via a CSS custom property
 * so branding never requires editing this file.
 */

.cqisa-launcher {
	position: fixed;
	bottom: 20px;
	right: 20px;
	z-index: 999999;
	width: 56px;
	height: 56px;
	box-sizing: border-box;
	border-radius: 50%;
	border: 3px solid var(--cqisa-accent, #0FC5B8);
	background: #FFFFFF;
	color: var(--cqisa-accent, #0FC5B8);
	font-size: 24px;
	font-weight: 400;
	cursor: pointer;
	padding: 9px;
	overflow: hidden;
	transition: box-shadow 0.2s ease;
	/* Plain rgba fallback first: browsers without color-mix() support keep
	   this valid declaration since their parser rejects the one below
	   outright, rather than losing the shadow entirely. */
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18), 0 0 0 5px rgba(15, 197, 184, 0.18);
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18), 0 0 0 5px color-mix(in srgb, var(--cqisa-accent, #0FC5B8) 18%, transparent);
}

.cqisa-launcher:hover,
.cqisa-launcher:focus-visible {
	box-shadow: 0 4px 18px rgba(0, 0, 0, 0.22), 0 0 0 7px rgba(15, 197, 184, 0.24);
	box-shadow: 0 4px 18px rgba(0, 0, 0, 0.22), 0 0 0 7px color-mix(in srgb, var(--cqisa-accent, #0FC5B8) 24%, transparent);
}

.cqisa-launcher img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	border-radius: 50%;
}

.cqisa-launcher.cqisa-position-bottom-left {
	right: auto;
	left: 20px;
}

.cqisa-cta {
	position: fixed;
	bottom: 32px;
	right: 86px;
	z-index: 999998;
	display: flex;
	align-items: center;
	background: #FFFFFF;
	border: none;
	border-radius: 999px;
	padding: 10px 18px;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.16);
	font-size: 15px;
	font-weight: 700;
	white-space: nowrap;
	cursor: pointer;
	animation: cqisa-cta-in 0.3s ease 0.4s both;
}

.cqisa-cta.cqisa-position-bottom-left {
	right: auto;
	left: 86px;
}

.cqisa-cta__my,
.cqisa-cta__assistant {
	color: #2E3B52;
}

.cqisa-cta__chat {
	color: var(--cqisa-accent, #0FC5B8);
}

@keyframes cqisa-cta-in {
	from {
		opacity: 0;
		transform: translateY(6px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.cqisa-panel {
	position: fixed;
	bottom: 88px;
	right: 20px;
	z-index: 999999;
	width: 340px;
	max-width: calc(100vw - 40px);
	height: 460px;
	max-height: calc(100vh - 120px);
	display: none;
	flex-direction: column;
	background: #FFFFFF;
	border-radius: 12px;
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
	overflow: hidden;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.cqisa-panel.is-open {
	display: flex;
}

.cqisa-panel__header {
	background: var(--cqisa-accent, #0FC5B8);
	color: #FFFFFF;
	padding: 14px 16px;
	font-size: 15px;
	font-weight: 600;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.cqisa-panel__header-actions {
	display: flex;
	align-items: center;
	gap: 10px;
}

.cqisa-panel__handoff-link {
	background: none;
	border: none;
	color: #FFFFFF;
	font-size: 12px;
	font-weight: 600;
	text-decoration: underline;
	cursor: pointer;
	padding: 0;
}

.cqisa-panel__voice-toggle {
	background: none;
	border: none;
	color: #FFFFFF;
	cursor: pointer;
	padding: 0;
	line-height: 1;
	display: flex;
	align-items: center;
	opacity: 0.9;
}

.cqisa-panel__voice-toggle:hover,
.cqisa-panel__voice-toggle:focus-visible {
	opacity: 1;
}

.cqisa-panel__voice-toggle.is-muted {
	opacity: 0.55;
}

.cqisa-message__play {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 18px;
	height: 18px;
	margin-left: 6px;
	vertical-align: middle;
	border: none;
	border-radius: 50%;
	background: #E2E4E8;
	color: #6B7280;
	cursor: pointer;
	padding: 0;
}

.cqisa-message__play:hover,
.cqisa-message__play:focus-visible {
	background: var(--cqisa-accent, #0FC5B8);
	color: #FFFFFF;
}

.cqisa-panel__close {
	background: none;
	border: none;
	color: #FFFFFF;
	font-size: 18px;
	font-weight: 400;
	cursor: pointer;
	line-height: 1;
}

.cqisa-panel__handoff-offer {
	padding: 10px 14px;
	border-top: 1px solid #E2E4E8;
	background: #F9FAFA;
}

.cqisa-handoff__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin: 0 0 8px;
}

.cqisa-handoff__intro {
	margin: 0;
	font-size: 12px;
	font-weight: 600;
	color: #1D2327;
}

.cqisa-handoff__close {
	background: none;
	border: none;
	color: #5B6472;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	padding: 0 0 0 8px;
}

.cqisa-handoff__button {
	display: inline-block;
	width: 100%;
	box-sizing: border-box;
	text-align: center;
	background: var(--cqisa-accent, #0FC5B8);
	color: #FFFFFF;
	text-decoration: none;
	font-size: 13px;
	font-weight: 600;
	padding: 8px 10px;
	border: none;
	border-radius: 8px;
	margin-bottom: 8px;
	cursor: pointer;
}

.cqisa-handoff__email-form {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.cqisa-handoff__email-form input {
	border: 1px solid #E2E4E8;
	border-radius: 8px;
	padding: 7px 9px;
	font-size: 13px;
	font-weight: 400;
}

.cqisa-handoff__note {
	margin: 6px 0 0;
	font-size: 12px;
	font-weight: 400;
	color: #1D2327;
}

.cqisa-panel__messages {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 12px 14px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.cqisa-message {
	max-width: 85%;
	padding: 8px 12px;
	border-radius: 12px;
	font-size: 13px;
	font-weight: 400;
	line-height: 1.4;
}

.cqisa-message.is-user {
	align-self: flex-end;
	background: var(--cqisa-accent, #0FC5B8);
	color: #FFFFFF;
}

.cqisa-message.is-assistant {
	align-self: flex-start;
	background: #F1F2F4;
	color: #1D2327;
}

.cqisa-sources {
	align-self: flex-start;
	max-width: 85%;
	font-size: 10px;
	font-weight: 400;
	color: #8A919C;
	padding: 0 2px;
}

.cqisa-sources a {
	color: #8A919C;
	text-decoration: underline;
}

.cqisa-sources a:hover,
.cqisa-sources a:focus {
	color: var(--cqisa-accent, #0FC5B8);
}

.cqisa-visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.cqisa-panel__form {
	display: flex;
	border-top: 1px solid #E2E4E8;
	padding: 8px;
	gap: 8px;
}

.cqisa-panel__footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 6px 10px 8px;
	border-top: 1px solid #F1F2F4;
}

.cqisa-panel__notice {
	font-size: 10px;
	font-weight: 400;
	color: #8A919C;
}

.cqisa-panel__clear-link {
	background: none;
	border: none;
	font-size: 10px;
	font-weight: 600;
	color: #8A919C;
	text-decoration: underline;
	cursor: pointer;
	padding: 0;
	flex-shrink: 0;
}

.cqisa-panel__input {
	flex: 1 1 auto;
	border: 1px solid #E2E4E8;
	border-radius: 8px;
	padding: 8px 10px;
	font-size: 13px;
	font-weight: 400;
}

.cqisa-panel__mic {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	border: 1px solid #E2E4E8;
	border-radius: 8px;
	background: #FFFFFF;
	color: #6B7280;
	cursor: pointer;
	padding: 0;
	transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.cqisa-panel__mic:hover,
.cqisa-panel__mic:focus-visible {
	color: var(--cqisa-accent, #0FC5B8);
	border-color: var(--cqisa-accent, #0FC5B8);
}

.cqisa-panel__mic.is-listening {
	background: var(--cqisa-accent, #0FC5B8);
	border-color: var(--cqisa-accent, #0FC5B8);
	color: #FFFFFF;
	animation: cqisa-mic-pulse 1.4s ease-in-out infinite;
}

@keyframes cqisa-mic-pulse {
	0%, 100% {
		box-shadow: 0 0 0 0 color-mix(in srgb, var(--cqisa-accent, #0FC5B8) 45%, transparent);
	}
	50% {
		box-shadow: 0 0 0 6px color-mix(in srgb, var(--cqisa-accent, #0FC5B8) 0%, transparent);
	}
}

.cqisa-panel__send {
	border: none;
	border-radius: 8px;
	background: var(--cqisa-accent, #0FC5B8);
	color: #FFFFFF;
	font-size: 13px;
	font-weight: 600;
	padding: 8px 14px;
	cursor: pointer;
}

.cqisa-panel__send:focus-visible,
.cqisa-launcher:focus-visible,
.cqisa-panel__close:focus-visible,
.cqisa-panel__mic:focus-visible,
.cqisa-panel__voice-toggle:focus-visible,
.cqisa-message__play:focus-visible,
.cqisa-panel__input:focus-visible {
	outline: 2px solid var(--cqisa-accent, #0FC5B8);
	outline-offset: 2px;
}

/* ---------- Product results (CQI Shop Assistant quick look) ---------- */

.cqisa-results {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
	align-self: stretch;
}

.cqisa-result__link {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 6px;
	border: 1px solid #E2E4E8;
	border-radius: 10px;
	background: #FFFFFF;
	color: #1D2327;
	text-decoration: none;
}

.cqisa-result__link:hover,
.cqisa-result__link:focus-visible {
	border-color: var(--cqisa-accent, #0FC5B8);
	outline: none;
}

.cqisa-result__image {
	flex: 0 0 48px;
	width: 48px;
	height: 48px;
	border-radius: 6px;
	object-fit: cover;
	background: #F1F2F4;
}

.cqisa-result__image--empty {
	display: block;
}

.cqisa-result__body {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.cqisa-result__title {
	font-size: 13px;
	font-weight: 600;
	line-height: 1.3;
	overflow: hidden;
	text-overflow: ellipsis;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.cqisa-result__meta {
	display: flex;
	gap: 8px;
	font-size: 12px;
	font-weight: 400;
}

.cqisa-result__price {
	font-weight: 600;
	color: #2E3B52;
}

.cqisa-result__stock {
	color: #A94442;
}

.cqisa-results__notes p,
.cqisa-results__more {
	margin: 0;
	font-size: 11px;
	font-weight: 400;
	color: #5B6472;
}
