/**
 * Floating Zalo contact: labelled desktop button and compact mobile control.
 * @package NNF_Commerce
 */
:root {
	--nnf-zalo-blue: #0068FF;
	--nnf-zalo-blue-hover: #0056D6;
}

.nnf-floating-zalo {
	position: fixed;
	bottom: max(var(--nnf-zalo-offset-y, 28px), env(safe-area-inset-bottom, 0px), var(--nnf-floating-bottom-floor, 0px));
	z-index: 9990;
	display: inline-flex;
	user-select: none;
}

.nnf-floating-zalo.nnf-zalo-pos-right {
	right: max(var(--nnf-zalo-offset-x, 24px), env(safe-area-inset-right, 0px));
}

.nnf-floating-zalo.nnf-zalo-pos-left {
	left: max(var(--nnf-zalo-offset-x, 24px), env(safe-area-inset-left, 0px));
}

.nnf-zalo-btn {
	display: inline-flex;
	align-items: center;
	gap: 0;
	min-height: 54px;
	width: 54px;
	padding: 6px;
	box-sizing: border-box;
	border: 1px solid #DDE7F2;
	border-radius: 18px;
	background: #FFFFFF;
	color: #162D49;
	box-shadow: 0 4px 20px rgba(19, 44, 76, 0.12);
	text-decoration: none;
	transition: transform 0.2s ease;
	-webkit-tap-highlight-color: transparent;
}

.nnf-zalo-btn:hover {
	color: #162D49;
	border-color: #AACBF5;
}

.nnf-zalo-icon-wrap {
	display: grid;
	place-items: center;
	flex: 0 0 40px;
	width: 40px;
	height: 40px;
	border-radius: 12px;
	background: var(--nnf-zalo-blue);
}

.nnf-zalo-svg {
	display: block;
	width: 34px;
	height: 34px;
}

.nnf-zalo-copy {
	display: none;
	flex-direction: column;
	gap: 3px;
	max-width: 220px;
	text-align: left;
	line-height: 1.3;
}

.nnf-zalo-brand {
	font-size: 9px;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: #5B6D80;
}

.nnf-zalo-label {
	font-size: 12px;
	font-weight: 800;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.nnf-zalo-arrow {
	display: none;
	flex: 0 0 16px;
	margin-right: 6px;
	color: var(--nnf-zalo-blue-hover);
}

.nnf-zalo-effect-lift .nnf-zalo-btn:hover {
	transform: translateY(-2px);
}

.nnf-zalo-effect-scale .nnf-zalo-btn:hover {
	transform: scale(1.03);
}

.nnf-zalo-effect-glow .nnf-zalo-btn:hover {
	box-shadow: 0 0 0 4px rgba(0, 104, 255, 0.1), 0 4px 20px rgba(19, 44, 76, 0.12);
}

.nnf-zalo-btn:focus-visible {
	outline: 3px solid var(--nnf-zalo-blue);
	outline-offset: 4px;
}

.nnf-zalo-btn:active {
	transform: scale(0.98);
}

.nnf-floating-zalo.nnf-zalo-device-mobile_only {
	display: none;
}

@media (max-width: 768px) {
	.nnf-floating-zalo.nnf-zalo-device-desktop_only {
		display: none;
	}
	.nnf-floating-zalo.nnf-zalo-device-mobile_only {
		display: inline-flex;
	}
	.nnf-zalo-btn {
		min-height: 52px;
		width: 52px;
		padding: 5px;
		gap: 0;
		border-radius: 17px;
	}
	.nnf-zalo-copy,
	.nnf-zalo-arrow {
		display: none;
	}
	.nnf-floating-zalo.nnf-zalo-pos-left {
		left: max(min(var(--nnf-zalo-offset-x, 16px), 20px), env(safe-area-inset-left, 0px));
	}
	.nnf-floating-zalo.nnf-zalo-pos-right {
		right: max(min(var(--nnf-zalo-offset-x, 16px), 20px), env(safe-area-inset-right, 0px));
	}
}

@media (prefers-reduced-motion: reduce) {
	.nnf-zalo-btn {
		transition: none;
	}
	.nnf-floating-zalo .nnf-zalo-btn:hover,
	.nnf-floating-zalo .nnf-zalo-btn:active {
		transform: none;
	}
}

/* The measured clearance follows Zalo's actual position and sticky-cart state. */
#nnf-back-to-top {
	bottom: var(--nnf-back-to-top-bottom, max(28px, env(safe-area-inset-bottom, 0px), var(--nnf-zalo-clearance, 0px)));
	right: var(--nnf-back-to-top-right, var(--nnf-zalo-center-right, max(28px, env(safe-area-inset-right, 0px))));
	transition-property: background-color, color, box-shadow, opacity, visibility, transform;
}

/* Also ensure admin banner inspector trigger sits comfortably above Zalo and Back-To-Top */
body.nnf-zalo-is-right .nnf-banner-floating-trigger {
	bottom: calc(var(--nnf-zalo-offset-y, 28px) + 124px);
}

/* Expanded only for the first3seconds, visible contact cards or keyboard focus. */
.nnf-floating-zalo.is-expanded .nnf-zalo-btn{width:auto;max-width:calc(100vw - 48px);gap:12px;padding:6px}
.nnf-floating-zalo.is-expanded .nnf-zalo-copy{display:flex;min-width:0}
.nnf-floating-zalo.is-expanded .nnf-zalo-arrow{display:block}
