/**
 * CognitiveCart AI Chat Widget
 *
 * @package CognitiveCart
 */

.cognitive-cart-chat-wrap {
	position: fixed;
	bottom: 24px;
	right: 24px;
	z-index: 999998;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, sans-serif;
	font-size: 14px;
}

.cognitive-cart-chat-button {
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: #1d2327;
	color: #fff;
	border: none;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.2s, box-shadow 0.2s;
}

.cognitive-cart-chat-button:hover {
	transform: scale(1.05);
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.cognitive-cart-chat-button svg {
	width: 28px;
	height: 28px;
	fill: currentColor;
}

.cognitive-cart-chat-panel {
	display: none;
	position: absolute;
	bottom: 68px;
	right: 0;
	width: 380px;
	max-width: calc(100vw - 48px);
	height: 480px;
	max-height: 70vh;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
	flex-direction: column;
	overflow: hidden;
}

.cognitive-cart-chat-panel.is-open {
	display: flex;
}

.cognitive-cart-chat-header {
	padding: 14px 16px;
	background: #1d2327;
	color: #fff;
	font-weight: 600;
	flex-shrink: 0;
}

.cognitive-cart-chat-messages {
	flex: 1;
	overflow-y: auto;
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.cognitive-cart-chat-msg {
	max-width: 85%;
	padding: 10px 14px;
	border-radius: 12px;
	line-height: 1.45;
	word-wrap: break-word;
	white-space: pre-wrap;
}

.cognitive-cart-chat-msg.user {
	align-self: flex-end;
	background: #1d2327;
	color: #fff;
}

.cognitive-cart-chat-msg.assistant {
	align-self: flex-start;
	background: #f0f0f1;
	color: #1d2327;
	line-height: 1.55;
}

.cognitive-cart-chat-msg.nudge {
	align-self: flex-start;
	background: #e8f5e9;
	border: 1px solid #c8e6c9;
}

.cognitive-cart-chat-quick-actions {
	padding: 8px 16px;
	border-top: 1px solid #e0e0e0;
	flex-shrink: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	align-items: center;
}

.cognitive-cart-chat-quick-action {
	padding: 6px 12px;
	background: #f0f0f1;
	color: #1d2327;
	border: 1px solid #c3c4c7;
	border-radius: 9999px;
	cursor: pointer;
	font-size: 13px;
	transition: background 0.15s, border-color 0.15s;
}

.cognitive-cart-chat-quick-action:hover {
	background: #e0e0e0;
	border-color: #8c8f94;
}

.cognitive-cart-chat-quick-action:active {
	background: #c3c4c7;
}

/* Checkout button: highlight and right-align */
.cognitive-cart-chat-quick-action--checkout {
	background: #1d2327;
	color: #fff;
	border-color: #1d2327;
	margin-left: auto;
}

.cognitive-cart-chat-quick-action--checkout:hover {
	background: #2c3338;
	border-color: #2c3338;
}

.cognitive-cart-chat-quick-action--checkout:active {
	background: #32373c;
}

.cognitive-cart-chat-actions {
	padding: 12px 16px;
	border-top: 1px solid #e0e0e0;
	flex-shrink: 0;
	display: flex;
	gap: 8px;
	align-items: center;
}

.cognitive-cart-chat-actions .cognitive-cart-chat-input {
	flex: 1;
	padding: 10px 14px;
	border: 1px solid #c3c4c7;
	border-radius: 8px;
	font-size: 14px;
}

.cognitive-cart-chat-actions .cognitive-cart-chat-send {
	padding: 10px 16px;
	background: #1d2327;
	color: #fff;
	border: none;
	border-radius: 8px;
	cursor: pointer;
	font-size: 14px;
}

.cognitive-cart-chat-actions .cognitive-cart-chat-send:hover {
	background: #2c3338;
}

.cognitive-cart-chat-loading {
	padding: 8px 14px;
	align-self: flex-start;
	background: #f0f0f1;
	border-radius: 12px;
	color: #646970;
	font-size: 13px;
}
