/* Smart Visitor Chat — Widget público */
#smartchat-widget-root {
	--sc-primary: #2563eb;
	--sc-radius: 18px;
	position: fixed;
	z-index: 999999;
	bottom: 20px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
#smartchat-widget-root.sc-pos-right { right: 20px; }
#smartchat-widget-root.sc-pos-left  { left: 20px; }

.sc-launcher {
	width: 60px;
	height: 60px;
	border-radius: 50%;
	background: var(--sc-primary);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	box-shadow: 0 8px 24px rgba(0,0,0,.2);
	transition: transform .2s ease;
	position: relative;
	border: none;
}
.sc-launcher:hover { transform: scale(1.06); }
.sc-launcher svg, .sc-launcher span.sc-icon { color: #fff; font-size: 26px; }
.sc-launcher .sc-badge {
	position: absolute;
	top: -4px; right: -4px;
	background: #ef4444;
	color: #fff;
	border-radius: 50%;
	min-width: 20px; height: 20px;
	font-size: 12px;
	display: flex; align-items: center; justify-content: center;
	padding: 0 4px;
	font-weight: 600;
}

.sc-bubble-preview {
	position: absolute;
	bottom: 72px;
	right: 0;
	background: #fff;
	border-radius: 14px;
	padding: 12px 16px;
	box-shadow: 0 8px 24px rgba(0,0,0,.15);
	max-width: 240px;
	font-size: 14px;
	color: #1f2937;
	animation: sc-pop .25s ease;
}
#smartchat-widget-root.sc-pos-left .sc-bubble-preview { right: auto; left: 0; }
.sc-bubble-preview .sc-close-preview {
	position: absolute; top: -8px; right: -8px;
	background: #e5e7eb; border-radius: 50%;
	width: 20px; height: 20px; font-size: 12px;
	display: flex; align-items: center; justify-content: center;
	cursor: pointer; color: #374151;
}

.sc-window {
	position: absolute;
	bottom: 76px;
	right: 0;
	width: 360px;
	max-width: 92vw;
	height: 540px;
	max-height: 75vh;
	background: #fff;
	border-radius: var(--sc-radius);
	box-shadow: 0 16px 48px rgba(0,0,0,.25);
	display: none;
	flex-direction: column;
	overflow: hidden;
	animation: sc-pop .2s ease;
}
#smartchat-widget-root.sc-pos-left .sc-window { right: auto; left: 0; }
.sc-window.sc-open { display: flex; }

.sc-header {
	background: var(--sc-primary);
	color: #fff;
	padding: 16px;
	display: flex;
	align-items: center;
	gap: 10px;
}
.sc-header img { width: 36px; height: 36px; border-radius: 50%; background:#fff; object-fit:cover; }
.sc-header .sc-title { font-weight: 600; font-size: 15px; }
.sc-header .sc-subtitle { font-size: 12px; opacity: .85; display:flex; align-items:center; gap:4px;}
.sc-header .sc-subtitle .dot { width:7px; height:7px; border-radius:50%; background:#22c55e; display:inline-block;}
.sc-header .sc-close { margin-left: auto; cursor: pointer; font-size: 20px; opacity: .85; }

.sc-body {
	flex: 1;
	overflow-y: auto;
	padding: 14px;
	background: #f5f7fb;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.sc-msg {
	max-width: 80%;
	padding: 9px 13px;
	border-radius: 14px;
	font-size: 14px;
	line-height: 1.4;
	word-break: break-word;
}
.sc-msg.sc-from-system,
.sc-msg.sc-from-agent {
	background: #fff;
	color: #1f2937;
	align-self: flex-start;
	border-bottom-left-radius: 4px;
	box-shadow: 0 1px 2px rgba(0,0,0,.06);
}
.sc-msg.sc-from-visitor {
	background: var(--sc-primary);
	color: #fff;
	align-self: flex-end;
	border-bottom-right-radius: 4px;
}

.sc-options {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-top: 4px;
}
.sc-option-btn {
	border: none;
	background: #fff;
	border-radius: 12px;
	padding: 10px 12px;
	display: flex;
	align-items: center;
	gap: 10px;
	cursor: pointer;
	font-size: 14px;
	box-shadow: 0 1px 2px rgba(0,0,0,.08);
	text-align: left;
	transition: transform .15s ease;
}
.sc-option-btn:hover { transform: translateX(2px); }
.sc-option-btn .sc-opt-icon {
	width: 30px; height: 30px;
	border-radius: 50%;
	display: flex; align-items: center; justify-content: center;
	font-size: 15px;
	flex-shrink: 0;
	color:#fff;
}

.sc-lead-form { display: flex; flex-direction: column; gap: 8px; background:#fff; padding:12px; border-radius:12px; box-shadow: 0 1px 2px rgba(0,0,0,.06);}
.sc-lead-form input {
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	padding: 9px 11px;
	font-size: 14px;
	outline: none;
}
.sc-lead-form input:focus { border-color: var(--sc-primary); }
.sc-lead-form button {
	background: var(--sc-primary);
	color: #fff; border: none; border-radius: 8px;
	padding: 9px; font-size: 14px; cursor: pointer; font-weight: 600;
}

.sc-footer {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px;
	border-top: 1px solid #eee;
	background:#fff;
}
.sc-footer input {
	flex: 1;
	border: 1px solid #e5e7eb;
	border-radius: 20px;
	padding: 10px 14px;
	font-size: 14px;
	outline: none;
}
.sc-footer input:focus { border-color: var(--sc-primary); }
.sc-footer button {
	background: var(--sc-primary);
	border: none; color: #fff;
	width: 38px; height: 38px;
	border-radius: 50%;
	cursor: pointer;
	font-size: 16px;
	flex-shrink: 0;
}

.sc-trigger-back {
	background: none; border: none; color: var(--sc-primary);
	font-size: 13px; cursor: pointer; padding: 4px 0; text-align:left;
}

button.smartchat-trigger-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	border: 2px solid;
	border-radius: 30px;
	padding: 10px 20px;
	background: #fff;
	cursor: pointer;
	font-size: 14px;
	font-weight: 600;
	color: #fff;
}

@keyframes sc-pop {
	from { opacity: 0; transform: translateY(8px) scale(.97); }
	to   { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 480px) {
	.sc-window {
		width: 94vw;
		height: 78vh;
		bottom: 78px;
	}
}
