/**
 * Product Chatbot — widget styles.
 *
 * Scoped under #ats-pcb-root so nothing here can reach the Woodmart parent
 * theme's own components.
 */

#ats-pcb-root {
	--ats-pcb-accent: #0b6bcb;
	--ats-pcb-surface: #ffffff;
	--ats-pcb-text: #1b1f24;
	--ats-pcb-muted: #5a6470;
	--ats-pcb-border: #dfe3e8;
	--ats-pcb-bot: #f2f5f8;
}

.ats-pcb-bubble {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 9998;
	display: flex;
	align-items: center;
	gap: 8px;
	/* 44px minimum touch target. */
	min-height: 44px;
	padding: 10px 18px 10px 14px;
	border: 0;
	border-radius: 999px;
	background: var(--ats-pcb-accent);
	color: #fff;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}

.ats-pcb-bubble svg {
	width: 22px;
	height: 22px;
	fill: currentColor;
}

.ats-pcb-bubble[disabled] {
	opacity: 0.6;
	cursor: progress;
}

.ats-pcb-panel {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 9999;
	display: flex;
	flex-direction: column;
	width: 380px;
	max-width: calc(100vw - 32px);
	height: 560px;
	max-height: calc(100vh - 40px);
	overflow: hidden;
	border: 1px solid var(--ats-pcb-border);
	border-radius: 14px;
	background: var(--ats-pcb-surface);
	color: var(--ats-pcb-text);
	box-shadow: 0 16px 48px rgba(0, 0, 0, 0.24);
}

.ats-pcb-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 16px;
	border-bottom: 1px solid var(--ats-pcb-border);
}

.ats-pcb-title {
	margin: 0;
	font-size: 16px;
	font-weight: 600;
}

.ats-pcb-close {
	min-width: 44px;
	min-height: 44px;
	border: 0;
	background: none;
	color: var(--ats-pcb-muted);
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
}

.ats-pcb-log {
	flex: 1;
	overflow-y: auto;
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.ats-pcb-msg {
	max-width: 85%;
	padding: 10px 13px;
	border-radius: 12px;
	font-size: 14px;
	line-height: 1.5;
	/* Model output is plain text; preserve its paragraph breaks. */
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}

.ats-pcb-msg--bot {
	align-self: flex-start;
	background: var(--ats-pcb-bot);
}

.ats-pcb-msg--user {
	align-self: flex-end;
	background: var(--ats-pcb-accent);
	color: #fff;
}

/* A human agent. Visually distinct from the bot so the visitor can tell at a
   glance who is answering — the whole reason the handover happens in place. */
.ats-pcb-msg--agent {
	align-self: flex-start;
	background: var(--ats-pcb-surface, #fff);
	border: 1px solid var(--ats-pcb-accent);
}

/* A system note, not a party in the conversation: centred, quiet, no bubble. */
.ats-pcb-msg--note {
	align-self: center;
	max-width: 100%;
	padding: 4px 10px;
	background: none;
	color: var(--ats-pcb-muted);
	font-size: 12.5px;
	text-align: center;
}

.ats-pcb-action {
	align-self: flex-start;
}

.ats-pcb-action-btn {
	min-height: 44px;
	padding: 10px 16px;
	border: 1px solid var(--ats-pcb-accent);
	border-radius: 999px;
	background: transparent;
	color: var(--ats-pcb-accent);
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
}

.ats-pcb-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	padding: 0 16px 10px;
}

.ats-pcb-chip {
	min-height: 34px;
	padding: 7px 12px;
	border: 1px solid var(--ats-pcb-border);
	border-radius: 999px;
	background: #fff;
	color: var(--ats-pcb-text);
	font-size: 13px;
	text-align: left;
	cursor: pointer;
}

.ats-pcb-form {
	display: flex;
	gap: 8px;
	padding: 12px 16px;
	border-top: 1px solid var(--ats-pcb-border);
}

.ats-pcb-input {
	flex: 1;
	min-height: 44px;
	padding: 10px 12px;
	border: 1px solid var(--ats-pcb-border);
	border-radius: 8px;
	font-size: 14px;
	color: var(--ats-pcb-text);
	background: #fff;
}

.ats-pcb-send {
	min-height: 44px;
	padding: 10px 18px;
	border: 0;
	border-radius: 8px;
	background: var(--ats-pcb-accent);
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
}

.ats-pcb-disclaimer {
	margin: 0;
	padding: 0 16px 12px;
	color: var(--ats-pcb-muted);
	font-size: 11px;
	line-height: 1.4;
}

#ats-pcb-root :focus-visible {
	outline: 2px solid var(--ats-pcb-accent);
	outline-offset: 2px;
}

@media (max-width: 480px) {
	.ats-pcb-panel {
		right: 0;
		bottom: 0;
		width: 100vw;
		max-width: 100vw;
		height: 100dvh;
		max-height: 100dvh;
		border: 0;
		border-radius: 0;
	}
}

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