/* ==========================================================================
   PVKB Smart Floating Contact Widget & Safe-Area Mobile Action Dock
   Zero external assets — pure crisp inline SVG + GPU-accelerated transitions
   ========================================================================== */

.pvkb-contact-root {
	position: relative;
	z-index: 2147483000 !important;
	font-family: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	line-height: 1.45;
	color: #0F172A;
}

.pvkb-contact-root *,
.pvkb-contact-root *::before,
.pvkb-contact-root *::after {
	box-sizing: border-box;
}

/* Backdrop (primarily for mobile/tablet bottom sheet) */
.pvkb-sheet-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(9, 23, 56, 0.48);
	z-index: 2147483000 !important;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition: opacity 0.2s ease, visibility 0.2s ease;
}

.pvkb-contact-root[data-open="true"] .pvkb-sheet-backdrop {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}

@media (min-width: 769px) {
	.pvkb-sheet-backdrop {
		display: none;
	}
}

/* --------------------------------------------------------------------------
   Expandable Contact Panel (Desktop Popover + Mobile Bottom Sheet)
   -------------------------------------------------------------------------- */
.pvkb-contact-panel {
	position: fixed;
	right: 24px;
	bottom: 92px;
	width: 356px;
	max-width: calc(100vw - 32px);
	background: #FFFFFF;
	border: 1px solid rgba(15, 37, 87, 0.12);
	border-radius: 18px;
	box-shadow: 0 20px 50px -12px rgba(9, 23, 56, 0.28), 0 4px 16px rgba(9, 23, 56, 0.08);
	overflow: hidden;
	z-index: 2147483003 !important;
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transform: translateY(14px) scale(0.96);
	transform-origin: bottom right;
	transition: opacity 0.22s ease, transform 0.24s cubic-bezier(0.22, 1, 0.36, 1), visibility 0.22s ease;
}

.pvkb-contact-root[data-open="true"] .pvkb-contact-panel {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
	transform: translateY(0) scale(1);
}

.pvkb-panel-header {
	background: linear-gradient(135deg, var(--pvkb-primary, #0F2557) 0%, #163373 100%);
	color: #FFFFFF;
	padding: 15px 16px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.pvkb-panel-brand {
	display: flex;
	align-items: center;
	gap: 10px;
}

.pvkb-online-dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: #22C55E;
	box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.28);
	flex-shrink: 0;
}

.pvkb-panel-title {
	font-size: 14.5px;
	font-weight: 700;
	color: #FFFFFF;
	line-height: 1.25;
}

.pvkb-panel-subtitle {
	font-size: 11.5px;
	color: rgba(255, 255, 255, 0.82);
	margin-top: 2px;
}

.pvkb-contact-root button.pvkb-panel-close {
	width: 30px !important;
	height: 30px !important;
	min-height: 30px !important;
	min-width: 30px !important;
	border-radius: 999px !important;
	border: none !important;
	background: rgba(255, 255, 255, 0.16) !important;
	color: #FFFFFF !important;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	padding: 0 !important;
	margin: 0 !important;
	box-shadow: none !important;
	text-transform: none !important;
	flex-shrink: 0;
	transition: background-color 0.18s ease;
}

.pvkb-contact-root button.pvkb-panel-close:hover {
	background: rgba(255, 255, 255, 0.28) !important;
}

.pvkb-panel-body {
	padding: 10px;
	display: flex;
	flex-direction: column;
	gap: 6px;
	max-height: 60vh;
	overflow-y: auto;
}

.pvkb-channel-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 12px;
	border-radius: 12px;
	text-decoration: none !important;
	color: #0F172A !important;
	background: #F8FAFC;
	border: 1px solid #E2E8F0;
	transition: background-color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.pvkb-channel-item:hover {
	background: #EEF2FF;
	border-color: rgba(15, 37, 87, 0.24);
	transform: translateX(2px);
}

.pvkb-channel-icon {
	width: 38px;
	height: 38px;
	border-radius: 11px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: #FFFFFF;
	flex-shrink: 0;
}

.pvkb-icon-zalo {
	background: #0068FF;
}

.pvkb-icon-zalo-oa {
	background: #0284C7;
}

.pvkb-icon-phone-sale {
	background: var(--pvkb-accent, #DC2626);
}

.pvkb-icon-phone-tech {
	background: #16A34A;
}

.pvkb-icon-messenger {
	background: linear-gradient(135deg, #00B2FF 0%, #006AFF 55%, #A033FF 100%);
}

.pvkb-channel-info {
	display: flex;
	flex-direction: column;
	flex: 1;
	min-width: 0;
}

.pvkb-channel-info strong {
	font-size: 13.5px;
	font-weight: 700;
	color: #0F172A;
	line-height: 1.3;
}

.pvkb-channel-info span {
	font-size: 11.5px;
	color: #475569;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.pvkb-channel-arrow {
	font-size: 18px;
	font-weight: 600;
	color: #94A3B8;
	line-height: 1;
}

.pvkb-panel-footer {
	padding: 9px 14px;
	background: #F8FAFC;
	border-top: 1px solid #E2E8F0;
	font-size: 11.5px;
	color: #64748B;
	text-align: center;
}

/* --------------------------------------------------------------------------
   Desktop Bottom-Right Floating Trigger + Back-To-Top
   -------------------------------------------------------------------------- */
.pvkb-desktop-fab-group {
	position: fixed;
	right: 16px;
	bottom: 16px;
	z-index: 2147483001 !important;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 8px;
}

.pvkb-contact-root button.pvkb-btt-btn {
	width: 42px !important;
	height: 42px !important;
	min-width: 42px !important;
	min-height: 42px !important;
	border-radius: 8px !important;
	border: 1px solid #CBD5E1 !important;
	background: rgba(255, 255, 255, 0.96) !important;
	color: var(--pvkb-primary, #0F2557) !important;
	box-shadow: 0 6px 16px rgba(15, 37, 87, 0.14) !important;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	padding: 0 !important;
	margin: 0 !important;
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease, background-color 0.18s ease, color 0.18s ease;
}

.pvkb-contact-root button.pvkb-btt-btn.is-visible {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.pvkb-contact-root button.pvkb-btt-btn:hover {
	background: var(--pvkb-primary, #0F2557) !important;
	color: #FFFFFF !important;
	border-color: var(--pvkb-primary, #0F2557) !important;
}

.pvkb-contact-root button.pvkb-fab-trigger {
	position: relative !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	gap: 8px !important;
	height: 44px !important;
	min-height: 44px !important;
	line-height: 1 !important;
	padding: 0 16px 0 14px !important;
	border-radius: 10px !important;
	border: none !important;
	background: linear-gradient(135deg, var(--pvkb-primary, #0F2557) 0%, #163373 100%) !important;
	color: #FFFFFF !important;
	font-family: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, sans-serif !important;
	font-size: 13.5px !important;
	font-weight: 700 !important;
	text-transform: none !important;
	letter-spacing: 0.01em !important;
	box-shadow: 0 10px 28px rgba(15, 37, 87, 0.34) !important;
	cursor: pointer;
	margin: 0 !important;
	transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.pvkb-contact-root button.pvkb-fab-trigger:hover {
	transform: translateY(-2px);
	box-shadow: 0 14px 32px rgba(15, 37, 87, 0.42) !important;
}

.pvkb-contact-root[data-open="true"] button.pvkb-fab-trigger {
	background: var(--pvkb-accent, #DC2626) !important;
	box-shadow: 0 10px 26px rgba(220, 38, 38, 0.36) !important;
}

/* Disable continuous infinite pulse keyframes to eliminate idle GPU compositor wakeups */
.pvkb-fab-pulse {
	display: none !important;
	animation: none !important;
}

.pvkb-contact-root[data-open="true"] .pvkb-fab-pulse {
	display: none;
}

@keyframes pvkbPulseRing {
	0% {
		transform: scale(1);
		opacity: 0.7;
	}
	70% {
		transform: scale(1.16, 1.32);
		opacity: 0;
	}
	100% {
		transform: scale(1.16, 1.32);
		opacity: 0;
	}
}

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

.pvkb-fab-icon-close {
	display: none;
}

.pvkb-contact-root[data-open="true"] .pvkb-fab-icon-chat {
	display: none;
}

.pvkb-contact-root[data-open="true"] .pvkb-fab-icon-close {
	display: inline-flex;
}

/* --------------------------------------------------------------------------
   Mobile & Tablet Safe-Area Bottom Action Dock (<= 768px)
   -------------------------------------------------------------------------- */
.pvkb-mobile-dock {
	display: none;
}

@media (max-width: 768px) {
	.pvkb-desktop-fab-group {
		display: none !important;
	}

	.pvkb-contact-panel {
		right: 12px;
		left: 12px;
		bottom: calc(72px + env(safe-area-inset-bottom, 0px));
		width: auto;
		max-width: none;
		transform-origin: bottom center;
	}

	.pvkb-mobile-dock {
		position: fixed !important;
		left: 0 !important;
		right: 0 !important;
		bottom: 0 !important;
		width: 100% !important;
		max-width: 100vw !important;
		z-index: 2147483002 !important;
		display: grid !important;
		grid-template-columns: minmax(0, 1.14fr) minmax(0, 0.93fr) minmax(0, 0.93fr) !important;
		gap: 6px !important;
		padding: 8px 8px calc(8px + env(safe-area-inset-bottom, 0px)) !important;
		background: #FFFFFF !important;
		border-top: 1px solid #E2E8F0 !important;
		box-shadow: 0 -4px 16px rgba(15, 37, 87, 0.08) !important;
	}

	.pvkb-contact-root .pvkb-mobile-dock .pvkb-dock-btn {
		display: inline-flex !important;
		align-items: center !important;
		justify-content: center !important;
		gap: 5px !important;
		width: 100% !important;
		min-width: 0 !important;
		height: 44px !important;
		min-height: 44px !important;
		line-height: 1 !important;
		padding: 0 6px !important;
		border-radius: 8px !important;
		border: none !important;
		font-family: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, sans-serif !important;
		font-size: 12.5px !important;
		font-weight: 700 !important;
		text-transform: none !important;
		letter-spacing: 0 !important;
		text-decoration: none !important;
		white-space: nowrap !important;
		overflow: hidden !important;
		cursor: pointer;
		margin: 0 !important;
		transition: transform 0.15s ease, opacity 0.15s ease;
	}

	.pvkb-contact-root .pvkb-mobile-dock .pvkb-dock-btn svg {
		flex-shrink: 0;
		width: 15px;
		height: 15px;
	}

	.pvkb-contact-root .pvkb-mobile-dock .pvkb-dock-btn:active {
		transform: scale(0.97);
	}

	.pvkb-contact-root .pvkb-mobile-dock a.pvkb-dock-call {
		background: var(--pvkb-accent, #DC2626) !important;
		color: #FFFFFF !important;
		box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25) !important;
	}

	.pvkb-contact-root .pvkb-mobile-dock a.pvkb-dock-zalo {
		background: #0068FF !important;
		color: #FFFFFF !important;
		box-shadow: 0 4px 12px rgba(0, 104, 255, 0.22) !important;
	}

	.pvkb-contact-root .pvkb-mobile-dock button.pvkb-dock-more {
		background: var(--pvkb-primary, #0F2557) !important;
		color: #FFFFFF !important;
		box-shadow: 0 4px 12px rgba(15, 37, 87, 0.22) !important;
	}
}

@media (max-width: 400px) {
	.pvkb-contact-root .pvkb-mobile-dock .pvkb-dock-btn {
		font-size: 11.5px !important;
		padding: 0 4px !important;
		gap: 4px !important;
	}
}

/* Prevent cross-origin footer map iframe GPU layer from painting over open contact popover */
body.pvkb-panel-open footer#footer iframe {
	visibility: hidden !important;
	pointer-events: none !important;
}

@media (prefers-reduced-motion: reduce) {
	.pvkb-fab-pulse {
		animation: none;
	}

	.pvkb-contact-panel,
	.pvkb-btt-btn,
	.pvkb-fab-trigger {
		transition: none;
	}
}
