/* Business Printing 4 U — AI Shopping Assistant widget styles */
:root {
	--bp4u-accent: #1f6feb;
	--bp4u-accent-dark: #14213d;
	--bp4u-bg: #ffffff;
	--bp4u-user-bubble: #1f6feb;
	--bp4u-bot-bubble: #f1f5f9;
	--bp4u-text: #1f2933;
	--bp4u-muted: #6b7280;
	--bp4u-shadow: 0 12px 38px rgba(20, 33, 61, 0.24);
}

#bp4u-bot-root, #bp4u-bot-root * {
	box-sizing: border-box;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Launcher button */
#bp4u-bot-launcher {
	position: fixed;
	bottom: 22px;
	right: 22px;
	width: 62px;
	height: 62px;
	border-radius: 50%;
	background: var(--bp4u-accent);
	color: #fff;
	border: none;
	cursor: pointer;
	box-shadow: var(--bp4u-shadow);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 999998;
	overflow: visible;
	transition: transform .18s ease, background .18s ease;
}
#bp4u-bot-launcher:hover { transform: scale(1.06); background: var(--bp4u-accent-dark); }
#bp4u-bot-launcher svg {
	width: 32px !important; height: 32px !important; position: relative; z-index: 2;
	display: block !important; color: #fff; stroke: #fff; overflow: visible;
}
#bp4u-bot-launcher .bp4u-pulse {
	position: absolute; inset: 0; border-radius: 50%; z-index: 1; pointer-events: none;
	box-shadow: 0 0 0 0 rgba(31,111,235,.5);
	animation: bp4u-pulse 2.2s infinite;
}
@keyframes bp4u-pulse {
	0% { box-shadow: 0 0 0 0 rgba(31,111,235,.5); }
	70% { box-shadow: 0 0 0 16px rgba(31,111,235,0); }
	100% { box-shadow: 0 0 0 0 rgba(31,111,235,0); }
}

/* Panel */
#bp4u-bot-panel {
	position: fixed;
	bottom: 96px;
	right: 22px;
	width: 384px;
	max-width: calc(100vw - 32px);
	height: 580px;
	max-height: calc(100vh - 130px);
	background: var(--bp4u-bg);
	border-radius: 16px;
	box-shadow: var(--bp4u-shadow);
	display: none;
	flex-direction: column;
	overflow: hidden;
	z-index: 999999;
	opacity: 0;
	transform: translateY(14px);
	transition: opacity .2s ease, transform .2s ease;
}
#bp4u-bot-panel.bp4u-open { display: flex; opacity: 1; transform: translateY(0); }

/* Header */
#bp4u-bot-header {
	background: linear-gradient(135deg, var(--bp4u-accent) 0%, var(--bp4u-accent-dark) 100%);
	color: #fff;
	padding: 16px 18px;
	display: flex;
	align-items: center;
	gap: 12px;
}
#bp4u-bot-header .bp4u-avatar {
	width: 40px; height: 40px; border-radius: 50%;
	background: rgba(255,255,255,.18);
	display: flex; align-items: center; justify-content: center; flex: 0 0 auto;
}
#bp4u-bot-header .bp4u-avatar svg { width: 22px; height: 22px; }
#bp4u-bot-header .bp4u-titles { line-height: 1.25; flex: 1; min-width: 0; }
#bp4u-bot-header .bp4u-title { font-weight: 700; font-size: 15px; }
#bp4u-bot-header .bp4u-subtitle { font-size: 12px; opacity: .85; }
#bp4u-bot-header .bp4u-status { font-size: 11px; opacity: .9; display: flex; align-items: center; gap: 5px; margin-top: 2px; }
#bp4u-bot-header .bp4u-dot { width: 8px; height: 8px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 3px rgba(52,211,153,.25); }
#bp4u-bot-close { background: none; border: none; color: #fff; cursor: pointer; font-size: 22px; line-height: 1; opacity: .85; padding: 4px; }
#bp4u-bot-close:hover { opacity: 1; }

/* Messages */
#bp4u-bot-messages {
	flex: 1;
	overflow-y: auto;
	padding: 16px;
	background: #fafbfc;
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.bp4u-msg { max-width: 84%; padding: 10px 13px; border-radius: 14px; font-size: 14px; line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; }
.bp4u-msg.bot { align-self: flex-start; background: var(--bp4u-bot-bubble); color: var(--bp4u-text); border-bottom-left-radius: 4px; }
.bp4u-msg.user { align-self: flex-end; background: var(--bp4u-user-bubble); color: #fff; border-bottom-right-radius: 4px; }
.bp4u-msg a { color: inherit; text-decoration: underline; }
.bp4u-msg.user a { color: #fff; }

/* Product cards */
.bp4u-products { align-self: stretch; display: flex; flex-direction: column; gap: 8px; }
.bp4u-card {
	display: flex; gap: 10px; align-items: center;
	background: #fff; border: 1px solid #e6ebf0; border-radius: 12px;
	padding: 8px; text-decoration: none; color: var(--bp4u-text);
	transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.bp4u-card:hover { border-color: var(--bp4u-accent); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(20,33,61,.10); }
.bp4u-card-img { width: 56px; height: 56px; flex: 0 0 auto; border-radius: 8px; overflow: hidden; background: #f1f5f9; }
.bp4u-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bp4u-card-body { flex: 1; min-width: 0; }
.bp4u-card-name { font-size: 13px; font-weight: 600; line-height: 1.3; margin-bottom: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bp4u-card-meta { display: flex; align-items: center; gap: 8px; }
.bp4u-card-price { font-size: 13px; font-weight: 700; color: var(--bp4u-accent); }
.bp4u-oos { font-size: 10.5px; color: #b91c1c; background: #fee2e2; border-radius: 6px; padding: 1px 6px; }

/* Quick replies */
#bp4u-bot-quick { display: flex; flex-wrap: wrap; gap: 7px; padding: 0 16px 6px; background: #fafbfc; }
.bp4u-quick-btn {
	background: #fff; border: 1px solid #d4dde6; color: var(--bp4u-accent);
	border-radius: 18px; padding: 7px 12px; font-size: 12.5px; cursor: pointer; transition: all .15s ease;
}
.bp4u-quick-btn:hover { background: var(--bp4u-accent); color: #fff; border-color: var(--bp4u-accent); }

/* Typing indicator */
.bp4u-typing { display: inline-flex; gap: 4px; align-items: center; padding: 12px 14px; }
.bp4u-typing span { width: 7px; height: 7px; border-radius: 50%; background: #9aa6b2; animation: bp4u-bounce 1.3s infinite; }
.bp4u-typing span:nth-child(2) { animation-delay: .2s; }
.bp4u-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes bp4u-bounce { 0%,60%,100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-5px); opacity: 1; } }

/* Input */
#bp4u-bot-input-row { display: flex; gap: 8px; padding: 12px; border-top: 1px solid #e6ebf0; background: #fff; }
#bp4u-bot-input {
	flex: 1; resize: none; border: 1px solid #d4dde6; border-radius: 10px;
	padding: 10px 12px; font-size: 14px; max-height: 90px; line-height: 1.4; outline: none; color: var(--bp4u-text);
}
#bp4u-bot-input:focus { border-color: var(--bp4u-accent); }
#bp4u-bot-send {
	background: var(--bp4u-accent); border: none; color: #fff; border-radius: 10px;
	width: 44px; flex: 0 0 auto; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .15s ease;
}
#bp4u-bot-send:hover { background: var(--bp4u-accent-dark); }
#bp4u-bot-send:disabled { opacity: .5; cursor: default; }
#bp4u-bot-send svg { width: 20px !important; height: 20px !important; display: block !important; stroke: #fff; }

#bp4u-bot-footer { text-align: center; font-size: 10.5px; color: var(--bp4u-muted); padding: 0 0 8px; background: #fff; }

/* ---- Mobile: full-screen sheet ---------------------------------------- */
@media (max-width: 600px) {
	#bp4u-bot-launcher {
		width: 56px; height: 56px;
		bottom: calc(16px + env(safe-area-inset-bottom, 0px));
		right: calc(16px + env(safe-area-inset-right, 0px));
	}
	#bp4u-bot-launcher svg { width: 28px !important; height: 28px !important; }

	#bp4u-bot-panel {
		top: 0; left: 0; right: 0; bottom: 0;
		width: 100%;
		height: 100%;
		height: 100vh;
		height: 100dvh;
		max-width: 100%;
		max-height: none;
		border-radius: 0;
		transform: translateY(100%);
	}
	#bp4u-bot-panel.bp4u-open { transform: translateY(0); }

	#bp4u-bot-header {
		padding: 14px 16px;
		padding-top: calc(14px + env(safe-area-inset-top, 0px));
	}
	#bp4u-bot-close { font-size: 28px; padding: 8px; }

	#bp4u-bot-messages { padding: 14px; }
	.bp4u-msg { max-width: 88%; font-size: 15px; }

	#bp4u-bot-input-row {
		padding: 10px 12px;
		padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
	}
	#bp4u-bot-input { font-size: 16px; }
	#bp4u-bot-send { width: 48px; }

	#bp4u-bot-quick { padding: 0 14px 8px; }
	.bp4u-quick-btn { font-size: 13px; padding: 8px 13px; }

	.bp4u-card-img { width: 60px; height: 60px; }
}

@media (max-width: 360px) {
	#bp4u-bot-launcher { width: 52px; height: 52px; }
}
