/* Compatara Pro — shopper chat. Style settings arrive as --cpta-c-*. Logical properties only. */
.cpta-chat {
	display: flex;
	flex-direction: column;
	block-size: min(560px, 75vh);
	border: 1px solid #e5e7eb;
	border-radius: var(--cpta-c-radius, 16px);
	background: var(--cpta-c-surface, #fff);
	color: var(--cpta-c-text, #111827);
	font-size: var(--cpta-c-font-size, 15px);
	line-height: 1.5;
	overflow: hidden;
}
.cpta-chat[hidden] { display: none !important; }

.cpta-chat__head {
	display: flex;
	align-items: center;
	gap: 8px;
	padding-block: 12px;
	padding-inline: 16px;
	border-block-end: 1px solid #eef0f3;
}
.cpta-chat__title { flex: 1 1 auto; margin: 0; font-size: 1.05em; }
.cpta-chat__reset,
.cpta-chat__x {
	margin: 0;
	padding-block: 4px;
	padding-inline: 8px;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: #4b5563;
	font: inherit;
	font-size: .85em;
	cursor: pointer;
}
.cpta-chat__x { font-size: 1.4em; line-height: 1; }
.cpta-chat__reset:hover,
.cpta-chat__x:hover { background: #f3f4f6; color: #111827; }

.cpta-chat__car {
	margin: 0;
	padding-block: 6px;
	padding-inline: 16px;
	background: var(--cpta-c-accent-soft, #ecfdf5);
	color: #065f46;
	font-size: .85em;
	font-weight: 600;
}
.cpta-chat__car[hidden] { display: none; }

.cpta-chat__log {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 14px;
	overflow-y: auto;
	overscroll-behavior: contain;
}
.cpta-chat__msg { display: flex; flex-direction: column; gap: 8px; max-inline-size: 88%; }
.cpta-chat__msg--you { align-self: flex-end; }
.cpta-chat__msg--shop { align-self: flex-start; }
.cpta-chat__text {
	margin: 0;
	padding-block: 9px;
	padding-inline: 13px;
	border-radius: 14px;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}
.cpta-chat__msg--shop .cpta-chat__text { background: #f3f4f6; border-start-start-radius: 4px; }
.cpta-chat__msg--you .cpta-chat__text { background: var(--cpta-c-accent, #111827); color: #fff; border-start-end-radius: 4px; }

.cpta-chat__products { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.cpta-chat__product { margin: 0; }
.cpta-chat__plink {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px;
	border: 1px solid #e5e7eb;
	border-radius: 12px;
	background: #fff;
	color: inherit;
	text-decoration: none;
}
.cpta-chat__plink:hover,
.cpta-chat__plink:focus-visible { border-color: var(--cpta-c-accent, #111827); }
.cpta-chat__pimg { flex: 0 0 auto; inline-size: 56px; block-size: 56px; border-radius: 8px; object-fit: cover; background: #f3f4f6; }
.cpta-chat__pinfo { display: flex; flex-direction: column; gap: 2px; min-inline-size: 0; }
.cpta-chat__pname { font-weight: 600; font-size: .92em; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cpta-chat__pmeta { display: flex; flex-wrap: wrap; gap: 8px; font-size: .85em; }
.cpta-chat__price { font-weight: 700; }
.cpta-chat__fits { color: #047857; font-weight: 600; }
.cpta-chat__all { align-self: flex-start; font-size: .88em; font-weight: 600; }

.cpta-chat__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cpta-chat__chip {
	margin: 0;
	padding-block: 6px;
	padding-inline: 12px;
	border: 1px solid #d1d5db;
	border-radius: 999px;
	background: #fff;
	color: #111827;
	font: inherit;
	font-size: .88em;
	cursor: pointer;
}
.cpta-chat__chip:hover,
.cpta-chat__chip:focus-visible { border-color: var(--cpta-c-accent, #111827); }
.cpta-chat__typing { margin: 0; color: #6b7280; font-size: .88em; }

.cpta-chat__form {
	display: flex;
	gap: 8px;
	margin: 0;
	padding: 10px;
	border-block-start: 1px solid #eef0f3;
}
.cpta-chat input[type="text"].cpta-chat__q {
	flex: 1 1 auto;
	inline-size: auto;
	min-inline-size: 0;
	margin: 0;
	min-block-size: 44px;
	padding-inline: 12px;
	border: 1px solid #d1d9e6;
	border-radius: 12px;
	background: #fff;
	color: #111827;
	font: inherit;
}
.cpta-chat .cpta-chat__send {
	margin: 0;
	min-block-size: 44px;
	padding-inline: 16px;
	border: 0;
	border-radius: 12px;
	background: var(--cpta-c-accent, #111827);
	color: #fff;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}
.cpta-chat .cpta-chat__send:disabled { opacity: .6; cursor: progress; }

/* Floating button and its panel */
.cpta-chatfab { position: fixed; inset-block-end: 20px; inset-inline-end: 20px; z-index: 99990; display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
/* The garage button sits in the same corner: stand above it. */
body:has(#cpta-fab) .cpta-chatfab { inset-block-end: 92px; }
.cpta-chatfab__btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	min-block-size: 48px;
	padding-inline: 18px;
	border: 0;
	border-radius: 999px;
	background: #111827;
	color: #fff;
	font: inherit;
	font-weight: 600;
	box-shadow: 0 8px 24px rgba(17, 24, 39, .25);
	cursor: pointer;
}
.cpta-chatfab__icon { inline-size: 18px; block-size: 18px; border: 2px solid currentColor; border-radius: 50% 50% 50% 4px; }
.cpta-chatfab .cpta-chat--floating {
	order: -1;
	inline-size: min(380px, calc(100vw - 32px));
	block-size: min(560px, calc(100vh - 120px));
	box-shadow: 0 16px 48px rgba(17, 24, 39, .22);
}
@media (max-width: 480px) {
	.cpta-chatfab { inset-block-end: 12px; inset-inline-end: 12px; }
	body:has(#cpta-fab) .cpta-chatfab { inset-block-end: 84px; }
	.cpta-chatfab.is-open .cpta-chatfab__btn { display: none; }
	.cpta-chatfab .cpta-chat--floating { inline-size: calc(100vw - 24px); block-size: calc(100vh - 24px); }
}
@media (prefers-reduced-motion: no-preference) {
	.cpta-chat__msg { animation: cpta-chat-in .18s ease-out; }
	@keyframes cpta-chat-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
}
