/* Floating Contact Button – Frontend */

.fc-buttons {
	--fc-btn-color: #2176ff;
	--fc-btn-size: 56px;
	position: fixed;
	left: 20px;
	bottom: 24px;
	z-index: 99999;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	font-size: 14px;
	line-height: 1.4;
}

.fc-buttons.right-side {
	left: auto;
	right: 20px;
}

.fc-buttons-content {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
}

.fc-buttons.right-side .fc-buttons-content {
	align-items: flex-end;
}

.fc-buttons.right-side .fc-button-list {
	left: auto;
	right: 0;
	transform-origin: bottom right;
}

/* Panel */
.fc-button-list {
	position: absolute;
	bottom: calc(var(--fc-btn-size) + 12px);
	left: 0;
	width: min(300px, calc(100vw - 40px));
	background: #fff;
	border-radius: 8px;
	box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
	overflow: hidden;
	transform-origin: bottom left;
	animation: fc-slide-in 0.22s ease;
}

.fc-button-list[hidden],
.fc-buttons[data-open="0"] .fc-button-list {
	display: none !important;
}

.fc-buttons[data-open="1"] .fc-button-list {
	display: block !important;
}

.fc-buttons[data-open="0"] .fc-trigger-top,
.fc-buttons[data-open="1"] .fc-trigger-bottom {
	z-index: 2;
}

@keyframes fc-slide-in {
	from {
		opacity: 0;
		transform: translateY(10px) scale(0.96);
	}
	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

.fc-list-title-container {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 12px 14px;
	background: var(--fc-btn-color);
	color: #fff;
}

.fc-close-view-btn {
	appearance: none;
	border: 0;
	background: transparent;
	color: #fff;
	padding: 0;
	margin: 0;
	width: 24px;
	height: 24px;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.fc-close-view-btn:focus-visible,
.fc-chat-button-link:focus-visible,
.fc-social-channel:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

.fc-social-channel:focus-visible {
	outline-color: var(--fc-btn-color);
}

.fc-arrow {
	display: block;
	width: 10px;
	height: 10px;
	border-right: 2px solid #fff;
	border-bottom: 2px solid #fff;
	transform: rotate(45deg);
	margin-top: -4px;
}

.fc-list-title {
	font-weight: 600;
	font-size: 13px;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.fc-channel-list-container {
	padding: 12px 14px 14px;
	max-height: min(360px, calc(100vh - 160px));
	overflow-y: auto;
}

.fc-grid-title {
	margin-bottom: 10px;
}

.fc-grid-title p {
	margin: 0;
	color: #222;
	font-size: 14px;
}

.fc-channel-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.fc-social-channel {
	display: flex;
	align-items: center;
	gap: 12px;
	text-decoration: none;
	color: #222;
	padding: 6px 4px;
	border-radius: 6px;
	transition: background 0.15s ease;
}

.fc-social-channel:hover {
	background: #f5f7fb;
	color: #111;
}

.fc-chat-button-icon {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	background: #888;
}

.fc-chat-button-icon svg {
	width: 20px;
	height: 20px;
	fill: #fff;
}

.fc-chat-button-icon.channel-phone {
	background: #25d366;
}

.fc-chat-button-icon.channel-facebook_messenger {
	background: #0084ff;
}

.fc-chat-button-icon.channel-mail {
	background: #f5a623;
}

.fc-chat-button-icon.channel-zalo {
	background: #0068ff;
}

.fc-chat-button-icon.channel-whatsapp {
	background: #25d366;
}

.fc-chat-button-icon.channel-custom {
	background: #607d8b;
}

.fc-list-channel-title {
	font-size: 14px;
	word-break: break-word;
}

/* Trigger */
.fc-trigger {
	position: relative;
}

.fc-trigger-button {
	position: relative;
	width: var(--fc-btn-size);
	height: var(--fc-btn-size);
}

.fc-trigger-top,
.fc-trigger-bottom {
	position: absolute;
	inset: 0;
}

.fc-chat-button-link {
	appearance: none;
	border: 0;
	padding: 0;
	margin: 0;
	width: var(--fc-btn-size);
	height: var(--fc-btn-size);
	border-radius: 50%;
	background: var(--fc-btn-color);
	color: #fff;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.fc-chat-button-link:hover {
	transform: scale(1.05);
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.28);
}

.fc-chat-button-link .fc-chat-button-icon {
	width: 28px;
	height: 28px;
	background: transparent;
	border-radius: 0;
}

.fc-chat-button-link .fc-chat-button-icon svg {
	width: 28px;
	height: 28px;
	fill: #fff;
}

.fc-chat-button-link .fc-chat-button-icon img,
.fc-chat-button-link .fc-trigger-custom-icon {
	width: 28px;
	height: 28px;
	object-fit: contain;
	display: block;
}

.fc-cta-tooltip {
	position: absolute;
	left: calc(var(--fc-btn-size) + 12px);
	top: 50%;
	transform: translateY(-50%);
	background: #fff;
	color: #222;
	padding: 8px 12px;
	border-radius: 4px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
	white-space: nowrap;
	font-size: 13px;
	pointer-events: none;
}

.fc-cta-tooltip::before {
	content: "";
	position: absolute;
	left: -6px;
	top: 50%;
	transform: translateY(-50%);
	border: 6px solid transparent;
	border-right-color: #fff;
	border-left: 0;
}

.fc-buttons.right-side .fc-cta-tooltip {
	left: auto;
	right: calc(var(--fc-btn-size) + 12px);
}

.fc-buttons.right-side .fc-cta-tooltip::before {
	left: auto;
	right: -6px;
	border: 6px solid transparent;
	border-left-color: #fff;
	border-right: 0;
}

/* Open / closed states */
.fc-buttons[data-open="0"] .fc-trigger-bottom {
	visibility: hidden;
	pointer-events: none;
	opacity: 0;
}

.fc-buttons[data-open="0"] .fc-trigger-top {
	visibility: visible;
	opacity: 1;
}

.fc-buttons[data-open="1"] .fc-trigger-top {
	visibility: hidden;
	pointer-events: none;
	opacity: 0;
}

.fc-buttons[data-open="1"] .fc-trigger-bottom {
	visibility: visible;
	opacity: 1;
}

.fc-buttons[data-open="1"] .fc-cta-tooltip {
	display: none;
}

.fc-buttons[data-shake="1"][data-open="0"] .fc-open-btn {
	animation: fc-shake 2.6s ease-in-out infinite;
}

.fc-buttons[data-shake="1"][data-open="0"] .fc-open-btn:hover {
	animation-play-state: paused;
}

@keyframes fc-shake {
	0%,
	72%,
	100% {
		transform: rotate(0deg);
	}
	75% {
		transform: rotate(-14deg);
	}
	78% {
		transform: rotate(12deg);
	}
	81% {
		transform: rotate(-10deg);
	}
	84% {
		transform: rotate(8deg);
	}
	87% {
		transform: rotate(-4deg);
	}
	90% {
		transform: rotate(2deg);
	}
	93% {
		transform: rotate(0deg);
	}
}

@media (prefers-reduced-motion: reduce) {
	.fc-buttons[data-shake="1"][data-open="0"] .fc-open-btn {
		animation: none;
	}
}

@media (max-width: 480px) {
	.fc-buttons.left-side {
		left: 12px;
		right: auto;
		bottom: 16px;
	}

	.fc-buttons.right-side {
		left: auto;
		right: 12px;
		bottom: 16px;
	}

	.fc-button-list {
		width: min(280px, calc(100vw - 24px));
	}
}
