/* Bayu Plugin - Responsive Frontend Styles (Desktop, Tablet, Mobile) */
.kfb-container {
	--kfb-color: #a80606;
	--kfb-calc-color: #7d0404;
	--kfb-bottom-desktop: 24px;
	--kfb-bottom-tablet: 20px;
	--kfb-bottom-mobile: 18px;
	--kfb-side: 22px;
	--kfb-size-desktop: 54px;
	--kfb-size-tablet: 50px;
	--kfb-size-mobile: 46px;
	--kfb-active-size: var(--kfb-size-desktop);
	--kfb-active-bottom: var(--kfb-bottom-desktop);
	--kfb-active-gap: 12px;
	position: fixed;
	bottom: calc(var(--kfb-active-bottom) + env(safe-area-inset-bottom, 0px));
	z-index: 99999;
	display: flex;
	flex-direction: column;
	gap: var(--kfb-active-gap);
	pointer-events: none;
	transition: opacity 0.28s cubic-bezier(0.16, 1, 0.3, 1), transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
	font-family: 'Poppins', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.kfb-container.kfb-deferred {
	opacity: 0;
	visibility: hidden;
	transform: translateY(12px);
	pointer-events: none;
}

.kfb-container.kfb-deferred .kfb-fab {
	pointer-events: none;
}

.kfb-container.kfb-ready {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.kfb-pos-right {
	right: var(--kfb-side);
	align-items: flex-end;
}

.kfb-pos-left {
	left: var(--kfb-side);
	align-items: flex-start;
}

@media (max-width: 1023px) and (min-width: 768px) {
	.kfb-container {
		--kfb-active-size: var(--kfb-size-tablet);
		--kfb-active-bottom: var(--kfb-bottom-tablet);
		--kfb-active-gap: 10px;
	}
}

@media (max-width: 767px) {
	.kfb-container {
		--kfb-active-size: var(--kfb-size-mobile);
		--kfb-active-bottom: var(--kfb-bottom-mobile);
		--kfb-active-gap: 10px;
	}
	.kfb-pos-right {
		right: min(var(--kfb-side), 16px);
	}
	.kfb-pos-left {
		left: min(var(--kfb-side), 16px);
	}
}

.kfb-buttons-stack {
	display: flex;
	flex-direction: column;
	gap: var(--kfb-active-gap);
	pointer-events: none;
}

.kfb-pos-right .kfb-buttons-stack {
	align-items: flex-end;
}

.kfb-pos-left .kfb-buttons-stack {
	align-items: flex-start;
}

.kfb-container .kfb-fab {
	position: relative;
	pointer-events: auto;
	appearance: none;
	-webkit-appearance: none;
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var(--kfb-active-size);
	height: var(--kfb-active-size);
	min-width: 0;
	min-height: 0;
	max-width: none;
	margin: 0;
	padding: 0;
	border: 2px solid rgba(255, 255, 255, 0.92);
	border-radius: 9999px;
	background-color: var(--kfb-color);
	background-image: none;
	color: #ffffff;
	font-family: inherit;
	line-height: 1;
	text-decoration: none;
	text-transform: none;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
	box-shadow: 0 8px 22px rgba(15, 23, 42, 0.26);
	transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1), filter 0.18s ease, box-shadow 0.18s ease;
}

.kfb-container .kfb-fab.kfb-fab-calc {
	background-color: var(--kfb-calc-color, #7d0404);
}

.kfb-container .kfb-fab:hover,
.kfb-container .kfb-fab:focus-visible {
	background-color: var(--kfb-color);
	color: #ffffff;
	transform: translateY(-2px);
	filter: brightness(1.08);
	box-shadow: 0 12px 26px rgba(15, 23, 42, 0.32);
	outline: none;
}

.kfb-container .kfb-fab.kfb-fab-calc:hover,
.kfb-container .kfb-fab.kfb-fab-calc:focus-visible {
	background-color: var(--kfb-calc-color, #7d0404);
}

.kfb-container .kfb-fab:focus-visible {
	box-shadow: 0 0 0 3px #ffffff, 0 0 0 5px var(--kfb-color);
}

.kfb-fab-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.kfb-fab-icon svg {
	width: calc(var(--kfb-active-size) * 0.46);
	height: calc(var(--kfb-active-size) * 0.46);
	display: block;
}

.kfb-fab-label {
	position: absolute;
	top: 50%;
	transform: translateY(-50%) translateX(6px);
	background-color: #0f172a;
	color: #ffffff;
	font-size: 12px;
	font-weight: 600;
	line-height: 1;
	white-space: nowrap;
	padding: 7px 12px;
	border-radius: 6px;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.16s ease, transform 0.16s ease;
	box-shadow: 0 4px 12px rgba(15, 23, 42, 0.18);
}

.kfb-pos-right .kfb-fab-label {
	right: calc(var(--kfb-active-size) + 12px);
}

.kfb-pos-left .kfb-fab-label {
	left: calc(var(--kfb-active-size) + 12px);
	transform: translateY(-50%) translateX(-6px);
}

@media (hover: hover) {
	.kfb-fab:hover .kfb-fab-label,
	.kfb-fab:focus-visible .kfb-fab-label {
		opacity: 1;
		transform: translateY(-50%) translateX(0);
	}
}

@media (hover: none) {
	.kfb-container:not(.kfb-show-labels) .kfb-fab-label {
		display: none;
	}
}

.kfb-show-labels .kfb-fab {
	width: auto;
	height: calc(var(--kfb-active-size) * 0.88);
	padding: 0 16px 0 12px;
	gap: 8px;
}

.kfb-show-labels .kfb-fab-label {
	position: static;
	transform: none;
	opacity: 1;
	background: transparent;
	box-shadow: none;
	padding: 0;
	font-size: 13px;
}

@media (max-width: 767px) {
	.kfb-show-labels .kfb-fab-label {
		font-size: 12px;
	}
}

.kfb-show-labels .kfb-fab:hover .kfb-fab-label,
.kfb-show-labels .kfb-fab:focus-visible .kfb-fab-label {
	transform: none;
}

.kfb-dialog {
	width: 330px;
	max-width: calc(100vw - 28px);
	background-color: #ffffff;
	border-radius: 14px;
	overflow: hidden;
	box-shadow: 0 18px 44px rgba(15, 23, 42, 0.22);
	border: 1px solid rgba(15, 23, 42, 0.08);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transform: translateY(12px) scale(0.97);
	transform-origin: bottom right;
	transition: opacity 0.2s cubic-bezier(0.16, 1, 0.3, 1), transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.2s;
}

@media (max-width: 1023px) and (min-width: 768px) {
	.kfb-dialog {
		width: 310px;
	}
}

@media (max-width: 767px) {
	.kfb-dialog {
		width: min(300px, calc(100vw - 24px));
	}
}

.kfb-pos-left .kfb-dialog {
	transform-origin: bottom left;
}

.kfb-dialog.kfb-open {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: translateY(0) scale(1);
}

.kfb-dialog-header {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 13px 15px;
	background-color: var(--kfb-color);
	color: #ffffff;
}

.kfb-dialog-avatar {
	width: 36px;
	height: 36px;
	border-radius: 9999px;
	background-color: rgba(255, 255, 255, 0.16);
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.kfb-dialog-meta {
	flex: 1;
	min-width: 0;
}

.kfb-dialog-title {
	font-size: 14px;
	font-weight: 700;
	line-height: 1.25;
	color: #ffffff;
}

.kfb-dialog-subtitle {
	font-size: 12px;
	line-height: 1.3;
	color: rgba(255, 255, 255, 0.85);
	margin-top: 2px;
}

.kfb-container .kfb-dialog .kfb-dialog-close {
	appearance: none;
	-webkit-appearance: none;
	box-sizing: border-box;
	background-color: rgba(255, 255, 255, 0.18);
	background-image: none;
	border: 1px solid rgba(255, 255, 255, 0.25);
	box-shadow: none;
	color: #ffffff;
	width: 30px;
	height: 30px;
	min-width: 0;
	min-height: 0;
	max-width: none;
	border-radius: 9999px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	cursor: pointer;
	margin: 0;
	padding: 0;
	line-height: 1;
	-webkit-tap-highlight-color: transparent;
	transition: background-color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.kfb-container .kfb-dialog .kfb-dialog-close svg {
	width: 15px;
	height: 15px;
	display: block;
	stroke: #ffffff;
	flex-shrink: 0;
}

.kfb-container .kfb-dialog .kfb-dialog-close:hover,
.kfb-container .kfb-dialog .kfb-dialog-close:focus-visible {
	background-color: rgba(255, 255, 255, 0.32);
	border-color: rgba(255, 255, 255, 0.48);
	color: #ffffff;
	outline: none;
}

.kfb-dialog-body {
	padding: 16px 14px;
	background-color: #f1f5f9;
}

.kfb-chat-bubble {
	background-color: #ffffff;
	color: #0f172a;
	padding: 12px 14px;
	border-radius: 12px;
	border-top-left-radius: 4px;
	font-size: 13.5px;
	line-height: 1.55;
	box-shadow: 0 2px 6px rgba(15, 23, 42, 0.06);
	min-height: 58px;
}

.kfb-typing-caret {
	display: inline-block;
	margin-left: 2px;
	font-weight: 600;
	color: var(--kfb-color);
	animation: kfb-caret-blink 0.85s infinite;
}

.kfb-typing-caret.kfb-done {
	display: none;
}

@keyframes kfb-caret-blink {
	0%, 49% { opacity: 1; }
	50%, 100% { opacity: 0; }
}

.kfb-dialog-footer {
	padding: 12px 14px;
	background-color: #ffffff;
	border-top: 1px solid #e2e8f0;
}

.kfb-chat-cta {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	padding: 10px 16px;
	border-radius: 8px;
	background-color: var(--kfb-color);
	color: #ffffff;
	font-size: 13.5px;
	font-weight: 600;
	text-decoration: none;
	box-sizing: border-box;
	transition: filter 0.16s ease, transform 0.16s ease;
}

.kfb-chat-cta:hover,
.kfb-chat-cta:focus-visible {
	color: #ffffff;
	filter: brightness(1.08);
	outline: none;
}

@media (prefers-reduced-motion: reduce) {
	.kfb-fab,
	.kfb-dialog,
	.kfb-typing-caret {
		transition: none;
		animation: none;
	}
}
