/* Product Assistant widget. All selectors are prefixed with .product-bot- */
.product-bot-root {
	--pb-color: #0b5cab;
	--pb-on-color: #fff;
	--pb-bg: #fff;
	--pb-text: #1d2327;
	--pb-muted: #5c6670;
	--pb-border: #dcdfe3;
	--pb-bot: #f1f3f5;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 15px;
	line-height: 1.45;
	color: var(--pb-text);
}

.product-bot-root *,
.product-bot-root *::before,
.product-bot-root *::after {
	box-sizing: border-box;
}

.product-bot-root:not(.product-bot-inline) {
	position: fixed;
	bottom: 20px;
	z-index: 99999;
}

.product-bot-root.product-bot-pos-right:not(.product-bot-inline) { right: 20px; }
.product-bot-root.product-bot-pos-left:not(.product-bot-inline) { left: 20px; }

.product-bot-bubble-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 56px;
	height: 56px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--pb-color);
	color: var(--pb-on-color);
	font-size: 26px;
	cursor: pointer;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.product-bot-bubble-btn:focus-visible,
.product-bot-close:focus-visible,
.product-bot-send:focus-visible,
.product-bot-input:focus-visible,
.product-bot-log:focus-visible,
.product-bot-card-link:focus-visible,
.product-bot-contact:focus-visible {
	outline: 3px solid #1e90ff;
	outline-offset: 2px;
}

.product-bot-root.product-bot-open .product-bot-bubble-btn { display: none; }

.product-bot-panel {
	display: flex;
	flex-direction: column;
	width: 380px;
	max-width: calc(100vw - 24px);
	height: 560px;
	max-height: calc(100vh - 40px);
	background: var(--pb-bg);
	border: 1px solid var(--pb-border);
	border-radius: 14px;
	overflow: hidden;
	box-shadow: 0 10px 34px rgba(0, 0, 0, 0.28);
}

.product-bot-panel[hidden] { display: none; }

.product-bot-inline .product-bot-panel {
	width: 100%;
	max-width: 640px;
	height: 520px;
	margin: 0 auto;
	box-shadow: none;
}

.product-bot-header {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 12px 14px;
	background: var(--pb-color);
	color: var(--pb-on-color);
}

.product-bot-avatar {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	object-fit: cover;
}

.product-bot-title {
	flex: 1;
	font-weight: 600;
	font-size: 16px;
}

.product-bot-close {
	width: 32px;
	height: 32px;
	padding: 0;
	border: 0;
	border-radius: 6px;
	background: transparent;
	color: inherit;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
}

.product-bot-close:hover { background: rgba(255, 255, 255, 0.18); }

.product-bot-log {
	flex: 1;
	overflow-y: auto;
	padding: 14px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	background: var(--pb-bg);
}

.product-bot-msg { display: flex; flex-direction: column; gap: 6px; max-width: 92%; }
.product-bot-msg-user { align-self: flex-end; align-items: flex-end; }
.product-bot-msg-bot,
.product-bot-msg-error { align-self: flex-start; align-items: flex-start; }

.product-bot-bubble {
	padding: 9px 12px;
	border-radius: 14px;
	overflow-wrap: anywhere;
	word-break: break-word;
}

.product-bot-msg-user .product-bot-bubble {
	background: var(--pb-color);
	color: var(--pb-on-color);
	border-bottom-right-radius: 4px;
	white-space: pre-wrap;
}

.product-bot-msg-bot .product-bot-bubble {
	background: var(--pb-bot);
	border-bottom-left-radius: 4px;
}

.product-bot-msg-error .product-bot-bubble {
	background: #fcf0f1;
	color: #8a2424;
	border: 1px solid #f0c3c3;
}

.product-bot-p { margin: 0 0 6px; }
.product-bot-p:last-child { margin-bottom: 0; }
.product-bot-list { margin: 4px 0 6px 18px; padding: 0; }
.product-bot-list li { margin: 2px 0; }

.product-bot-cards { display: flex; flex-direction: column; gap: 8px; width: 100%; }

.product-bot-card {
	display: flex;
	gap: 10px;
	padding: 8px;
	border: 1px solid var(--pb-border);
	border-radius: 10px;
	background: #fff;
}

.product-bot-card-img {
	width: 64px;
	height: 64px;
	flex: 0 0 64px;
	border-radius: 8px;
	object-fit: cover;
	background: var(--pb-bot);
}

.product-bot-card-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.product-bot-card-name { font-weight: 600; font-size: 14px; overflow-wrap: anywhere; }
.product-bot-card-price { font-size: 13px; color: var(--pb-muted); }
.product-bot-card-stock { font-size: 12px; font-weight: 600; }
.product-bot-stock-instock { color: #1a7f37; }
.product-bot-stock-outofstock { color: #b32d2e; }
.product-bot-stock-onbackorder { color: #9a6700; }
.product-bot-card-link { font-size: 13px; color: var(--pb-color); font-weight: 600; text-decoration: underline; }

.product-bot-contact {
	display: inline-block;
	padding: 8px 14px;
	border-radius: 999px;
	background: var(--pb-color);
	color: var(--pb-on-color);
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
}

.product-bot-typing .product-bot-bubble { display: flex; gap: 4px; align-items: center; min-height: 36px; }
.product-bot-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--pb-muted);
	animation: product-bot-blink 1.2s infinite ease-in-out;
}
.product-bot-dot:nth-child(3) { animation-delay: 0.2s; }
.product-bot-dot:nth-child(4) { animation-delay: 0.4s; }

@keyframes product-bot-blink {
	0%, 80%, 100% { opacity: 0.25; }
	40% { opacity: 1; }
}

.product-bot-notice {
	margin: 0;
	padding: 6px 14px;
	border-top: 1px solid var(--pb-border);
	font-size: 12px;
	color: var(--pb-muted);
}

.product-bot-notice a { color: inherit; text-decoration: underline; }

.product-bot-form { padding: 10px 12px 12px; border-top: 1px solid var(--pb-border); background: #fafbfc; }
.product-bot-row { display: flex; gap: 8px; align-items: flex-end; }

.product-bot-input {
	flex: 1;
	min-height: 40px;
	max-height: 110px;
	padding: 9px 11px;
	border: 1px solid #b6bcc2;
	border-radius: 10px;
	font: inherit;
	color: var(--pb-text);
	background: #fff;
	resize: none;
}

.product-bot-send {
	height: 40px;
	padding: 0 16px;
	border: 0;
	border-radius: 10px;
	background: var(--pb-color);
	color: var(--pb-on-color);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.product-bot-send:disabled { opacity: 0.5; cursor: not-allowed; }

.product-bot-counter { margin-top: 4px; text-align: right; font-size: 11px; color: var(--pb-muted); }
.product-bot-counter-warn { color: #b32d2e; font-weight: 600; }

.product-bot-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px !important;
	height: 1px !important;
	overflow: hidden !important;
}

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

@media (max-width: 480px) {
	.product-bot-root:not(.product-bot-inline) { bottom: 12px; }
	.product-bot-root.product-bot-pos-right:not(.product-bot-inline) { right: 12px; }
	.product-bot-root.product-bot-pos-left:not(.product-bot-inline) { left: 12px; }
	.product-bot-root.product-bot-open:not(.product-bot-inline) {
		inset: 0;
		bottom: 0;
		right: 0;
		left: 0;
	}
	.product-bot-open .product-bot-panel {
		width: 100vw;
		max-width: 100vw;
		height: 100%;
		max-height: 100%;
		border-radius: 0;
		border: 0;
	}
	.product-bot-input { font-size: 16px; } /* prevents iOS zoom on focus */
}

@media (prefers-reduced-motion: reduce) {
	.product-bot-dot { animation: none; opacity: 0.6; }
}
