/*
 * Smart Floating Contact - frontend
 * Intentionally framework-free and dependency-free.
 */

.sfc-root,
.sfc-root * {
	box-sizing: border-box;
}

.sfc-root {
	--sfc-z: 999999;
	font-family: inherit;
}

.sfc-root svg {
	display: block;
	width: 52%;
	height: 52%;
	fill: currentColor;
}

.sfc-float {
	position: fixed;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 0;
	padding: 0;
	text-decoration: none;
	cursor: pointer;
	z-index: var(--sfc-z);
	box-shadow: var(--sfc-shadow);
	transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
}

.sfc-float:hover,
.sfc-float:focus-visible {
	transform: translateY(-2px) scale(1.03);
}

.sfc-float:focus-visible,
.sfc-sidebar a:focus-visible,
.sfc-chat-action:focus-visible,
.sfc-chat-close:focus-visible {
	outline: 3px solid rgba(8,120,209,.3);
	outline-offset: 3px;
}

.sfc-wa-float {
	width: var(--sfc-wa-size);
	height: var(--sfc-wa-size);
	bottom: var(--sfc-wa-y);
	background: var(--sfc-whatsapp);
	color: var(--sfc-icon);
	border-radius: var(--sfc-radius);
}

.sfc-wa-float.sfc-pos-left {
	left: var(--sfc-wa-x);
}

.sfc-wa-float.sfc-pos-right {
	right: var(--sfc-wa-x);
}

.sfc-chat-trigger {
	width: var(--sfc-chat-size);
	height: var(--sfc-chat-size);
	bottom: var(--sfc-chat-y);
	background: var(--sfc-primary);
	color: var(--sfc-icon);
	border-radius: var(--sfc-radius);
}

.sfc-chat-trigger.sfc-pos-left {
	left: var(--sfc-chat-x);
}

.sfc-chat-trigger.sfc-pos-right {
	right: var(--sfc-chat-x);
}

.sfc-sidebar {
	position: fixed;
	top: 50%;
	transform: translateY(-50%);
	display: flex;
	flex-direction: column;
	z-index: var(--sfc-z);
	background: var(--sfc-sidebar-bg);
	box-shadow: var(--sfc-shadow);
	overflow: hidden;
}

.sfc-sidebar-right {
	right: 0;
	border-radius: 10px 0 0 10px;
}

.sfc-sidebar-left {
	left: 0;
	border-radius: 0 10px 10px 0;
}

.sfc-sidebar a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--sfc-sidebar-size);
	height: var(--sfc-sidebar-size);
	color: var(--sfc-sidebar-icon);
	text-decoration: none;
	background: var(--sfc-sidebar-bg);
	border-bottom: 1px solid rgba(0,0,0,.06);
	transition: background .15s ease, color .15s ease, transform .15s ease;
}

.sfc-sidebar a:last-child {
	border-bottom: 0;
}

.sfc-sidebar a:hover {
	background: rgba(0,0,0,.04);
	transform: translateX(-1px);
}

.sfc-sidebar a.sfc-sidebar-wa {
	color: var(--sfc-whatsapp);
}

.sfc-sidebar svg {
	width: 45%;
	height: 45%;
}

.sfc-chat-panel {
	position: fixed;
	width: min(340px, calc(100vw - 28px));
	bottom: calc(var(--sfc-chat-y) + var(--sfc-chat-size) + 12px);
	z-index: calc(var(--sfc-z) + 1);
	background: var(--sfc-panel-bg);
	color: var(--sfc-panel-text);
	border-radius: 16px;
	box-shadow: 0 14px 45px rgba(0,0,0,.22);
	overflow: hidden;
	transform-origin: bottom right;
	animation: sfcPanelIn .16s ease-out;
}

.sfc-chat-panel[hidden] {
	display: none !important;
}

.sfc-chat-panel-right {
	right: var(--sfc-chat-x);
	transform-origin: bottom right;
}

.sfc-chat-panel-left {
	left: var(--sfc-chat-x);
	transform-origin: bottom left;
}

.sfc-chat-head {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	justify-content: space-between;
	padding: 18px 18px 14px;
	border-bottom: 1px solid rgba(0,0,0,.07);
}

.sfc-chat-head strong {
	display: block;
	font-size: 17px;
	line-height: 1.3;
	margin: 0 0 5px;
}

.sfc-chat-head p {
	font-size: 14px;
	line-height: 1.55;
	margin: 0;
	opacity: .78;
}

.sfc-chat-close {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(0,0,0,.05);
	color: inherit;
	cursor: pointer;
}

.sfc-chat-close svg {
	width: 18px;
	height: 18px;
}

.sfc-chat-actions {
	display: grid;
	gap: 9px;
	padding: 14px;
}

.sfc-chat-action {
	display: flex;
	align-items: center;
	gap: 11px;
	min-height: 46px;
	padding: 10px 13px;
	border: 1px solid rgba(0,0,0,.09);
	border-radius: 10px;
	background: transparent;
	color: var(--sfc-panel-text);
	text-decoration: none;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.3;
	transition: background .15s ease, border-color .15s ease, transform .15s ease;
}

.sfc-chat-action:hover {
	background: rgba(0,0,0,.035);
	border-color: rgba(0,0,0,.16);
	transform: translateY(-1px);
}

.sfc-action-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	flex: 0 0 28px;
	color: var(--sfc-primary);
}

.sfc-action-icon svg {
	width: 22px;
	height: 22px;
}

.sfc-action-wa .sfc-action-icon {
	color: var(--sfc-whatsapp);
}

.sfc-pulse::after {
	content: "";
	position: absolute;
	inset: -5px;
	border: 2px solid currentColor;
	border-radius: inherit;
	opacity: 0;
	pointer-events: none;
	animation: sfcPulse 2.2s ease-out infinite;
}

@keyframes sfcPulse {
	0% { transform: scale(.9); opacity: .34; }
	70%, 100% { transform: scale(1.28); opacity: 0; }
}

@keyframes sfcPanelIn {
	from { opacity: 0; transform: translateY(8px) scale(.98); }
	to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Responsive visibility */
@media (min-width: 1025px) {
	.sfc-hide-desktop {
		display: none !important;
	}
}

@media (min-width: 768px) and (max-width: 1024px) {
	.sfc-hide-tablet {
		display: none !important;
	}
}

@media (max-width: 767px) {
	.sfc-hide-mobile {
		display: none !important;
	}

	.sfc-sidebar {
		top: 46%;
	}

	.sfc-chat-panel {
		width: min(330px, calc(100vw - 24px));
		max-height: calc(100vh - 120px);
		overflow: auto;
	}
}

@media (prefers-reduced-motion: reduce) {
	.sfc-root *,
	.sfc-root *::before,
	.sfc-root *::after {
		animation: none !important;
		transition: none !important;
	}
}
