/**
 * MB Sticky Contact Frontend Styles (v1.1.0)
 * Responsive for Mobile & Desktop
 */

:root {
	--mb-contact-zalo: #0068ff;
	--mb-contact-hotline: #28a745;
	--mb-contact-text: #1e293b;
	--mb-desk-bottom: 30px;
	--mb-desk-right: 30px;
	--mb-desk-size: 54px;
	--mb-desk-icon-size: 34px; /* Increased from 26px to 34px for much clearer visibility */
}

/* ==========================================================================
   1. MOBILE BOTTOM BAR (< 768px)
   FIXED: Edge-to-edge 100% full width, zero white margin or gap
   ========================================================================== */
.mb-contact-mobile-bar {
	display: none;
	position: fixed !important;
	bottom: 0 !important;
	left: 0 !important;
	right: 0 !important;
	width: 100% !important;
	min-width: 100% !important;
	max-width: 100% !important;
	height: 52px !important;
	z-index: 999999 !important;
	box-shadow: 0 -3px 12px rgba(0, 0, 0, 0.12);
	background: linear-gradient(to right, var(--mb-contact-zalo, #0068ff) 50%, var(--mb-contact-hotline, #28a745) 50%) !important;
	padding: 0 !important;
	margin: 0 !important;
	border: none !important;
	box-sizing: border-box !important;
	padding-bottom: env(safe-area-inset-bottom, 0px) !important;
}

@media (max-width: 767px) {
	.mb-contact-mobile-bar {
		display: grid !important;
		grid-template-columns: 1fr 1fr !important;
		grid-auto-flow: column !important;
		grid-gap: 0 !important;
		gap: 0 !important;
		width: 100% !important;
		max-width: 100% !important;
		left: 0 !important;
		right: 0 !important;
	}

	.mb-contact-mobile-bar.has-1-btn {
		grid-template-columns: 1fr !important;
		background: var(--mb-contact-zalo, #0068ff) !important;
	}

	body.mb-has-mobile-contact-bar {
		padding-bottom: calc(52px + env(safe-area-inset-bottom, 0px)) !important;
	}

	/* Tự động ẩn thanh contact khi mở modal bộ lọc sản phẩm trên mobile */
	body.mb-filters-lock .mb-contact-mobile-bar,
	body.mb-filters-lock #mbMobileContactBar {
		display: none !important;
	}
}

.mb-contact-mobile-bar * {
	box-sizing: border-box !important;
}

.mb-mobile-btn {
	width: 100% !important;
	height: 52px !important;
	max-width: 100% !important;
	min-width: 0 !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	gap: 8px !important;
	text-decoration: none !important;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif !important;
	font-weight: 700 !important;
	font-size: 13.5px !important;
	color: #ffffff !important;
	cursor: pointer;
	border: none !important;
	border-radius: 0 !important;
	outline: none !important;
	box-shadow: none !important;
	padding: 0 8px !important;
	margin: 0 !important;
	box-sizing: border-box !important;
	transition: opacity 0.15s ease, filter 0.15s ease;
	-webkit-tap-highlight-color: transparent;
	user-select: none;
	appearance: none !important;
	-webkit-appearance: none !important;
	float: none !important;
	clear: none !important;
}

.mb-mobile-btn:active {
	opacity: 0.9;
	filter: brightness(0.95);
}

.mb-mobile-btn--zalo {
	background: var(--mb-contact-zalo, #0068ff) !important;
	border-right: 1px solid rgba(255, 255, 255, 0.25) !important;
}

.mb-mobile-btn--hotline {
	background: var(--mb-contact-hotline, #28a745) !important;
	border: none !important;
}

/* Larger, crisper icons on mobile */
.mb-mobile-btn svg {
	width: 24px !important;
	height: 24px !important;
	fill: currentColor !important;
	flex-shrink: 0 !important;
}

.mb-mobile-btn img.mb-mobile-custom-icon {
	width: 26px !important;
	height: 26px !important;
	object-fit: contain !important;
	border-radius: 4px !important;
	flex-shrink: 0 !important;
	display: block !important;
}

.mb-mobile-btn__text {
	white-space: nowrap !important;
	letter-spacing: 0.3px !important;
	text-transform: uppercase !important;
	font-size: 13px !important;
}

@media (min-width: 380px) {
	.mb-mobile-btn__text {
		font-size: 13.5px !important;
	}
	.mb-mobile-btn svg {
		width: 26px !important;
		height: 26px !important;
	}
	.mb-mobile-btn img.mb-mobile-custom-icon {
		width: 28px !important;
		height: 28px !important;
	}
}

/* ==========================================================================
   2. MOBILE HOTLINE POPUP / BOTTOM SHEET
   ========================================================================== */
.mb-hotline-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	width: 100%;
	height: 100%;
	background: rgba(15, 23, 42, 0.65);
	backdrop-filter: blur(3px);
	-webkit-backdrop-filter: blur(3px);
	z-index: 1000000;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.25s ease, visibility 0.25s ease;
}

.mb-hotline-overlay.is-active {
	opacity: 1;
	visibility: visible;
}

.mb-hotline-sheet {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	width: 100%;
	max-width: 480px;
	margin: 0 auto;
	background: #ffffff;
	border-radius: 20px 20px 0 0;
	padding: 16px 16px calc(20px + env(safe-area-inset-bottom, 0px));
	box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.25);
	transform: translateY(100%);
	transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
	z-index: 1000001;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
	box-sizing: border-box;
}

.mb-hotline-overlay.is-active .mb-hotline-sheet {
	transform: translateY(0);
}

.mb-hotline-sheet__handle {
	width: 40px;
	height: 4px;
	background: #cbd5e1;
	border-radius: 2px;
	margin: 0 auto 14px;
}

.mb-hotline-sheet__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 16px;
	padding-bottom: 12px;
	border-bottom: 1px solid #f1f5f9;
}

.mb-hotline-sheet__title {
	font-size: 16px;
	font-weight: 700;
	color: #0f172a;
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0;
}

button.mb-hotline-sheet__close,
.mb-hotline-sheet__close {
	background: #f1f5f9 !important;
	border: none !important;
	width: 32px !important;
	height: 32px !important;
	min-width: 32px !important;
	max-width: 32px !important;
	min-height: 32px !important;
	max-height: 32px !important;
	border-radius: 50% !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	font-size: 16px !important;
	line-height: 1 !important;
	color: #64748b !important;
	cursor: pointer !important;
	margin: 0 !important;
	padding: 0 !important;
	outline: none !important;
	box-shadow: none !important;
	box-sizing: border-box !important;
	flex-shrink: 0 !important;
	appearance: none !important;
	-webkit-appearance: none !important;
	transition: background 0.15s ease !important;
}

button.mb-hotline-sheet__close:hover,
.mb-hotline-sheet__close:hover {
	background: #e2e8f0 !important;
	color: #0f172a !important;
}

.mb-hotline-list {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.mb-hotline-card {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 14px;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	text-decoration: none !important;
	color: inherit !important;
	transition: all 0.15s ease;
	-webkit-tap-highlight-color: transparent;
}

.mb-hotline-card:hover,
.mb-hotline-card:active {
	background: #f1f7fe;
	border-color: #0b6cb3;
}

.mb-hotline-card__left {
	display: flex;
	align-items: center;
	gap: 12px;
	min-width: 0;
}

.mb-hotline-card__icon {
	width: 42px;
	height: 42px;
	border-radius: 50%;
	background: #dcfce7;
	color: #16a34a;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.mb-hotline-card__icon svg {
	width: 20px;
	height: 20px;
	fill: currentColor;
}

.mb-hotline-card__info {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.mb-hotline-card__name {
	font-size: 14px;
	font-weight: 700;
	color: #0f172a;
	line-height: 1.3;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.mb-hotline-card__note {
	font-size: 12px;
	color: #64748b;
	margin-top: 1px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.mb-hotline-card__phone {
	font-size: 15px;
	font-weight: 800;
	color: #0b6cb3;
	margin-top: 2px;
	letter-spacing: 0.3px;
}

.mb-hotline-card__btn {
	background: var(--mb-contact-hotline);
	color: #ffffff;
	font-size: 13px;
	font-weight: 700;
	padding: 8px 14px;
	border-radius: 20px;
	white-space: nowrap;
	display: flex;
	align-items: center;
	gap: 4px;
	flex-shrink: 0;
}

.mb-hotline-card__btn svg {
	width: 14px;
	height: 14px;
	fill: currentColor;
}

/* ==========================================================================
   3. DESKTOP FLOATING BUTTONS (>= 768px)
   FIXED: Perfectly Centered Vertical Axis + Hover Bridge
   ========================================================================== */
.mb-contact-desktop {
	display: none;
	position: fixed;
	bottom: var(--mb-desk-bottom, 30px);
	right: var(--mb-desk-right, 30px);
	z-index: 999999;
	flex-direction: column;
	gap: 16px;
	align-items: center !important; /* FIXED: Perfectly vertical center alignment */
	width: var(--mb-desk-size, 54px) !important; /* FIXED: Fixed width ensures 0px horizontal drift */
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

.mb-contact-desktop.pos-left {
	right: auto;
	left: var(--mb-desk-right, 30px);
}

@media (min-width: 768px) {
	.mb-contact-desktop {
		display: flex !important;
	}
}

.mb-desk-btn-wrap {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: var(--mb-desk-size, 54px) !important;
	height: var(--mb-desk-size, 54px) !important;
	min-width: var(--mb-desk-size, 54px) !important;
	max-width: var(--mb-desk-size, 54px) !important;
	min-height: var(--mb-desk-size, 54px) !important;
	max-height: var(--mb-desk-size, 54px) !important;
	flex-shrink: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	box-sizing: border-box !important;
}

button.mb-desk-btn,
a.mb-desk-btn,
.mb-desk-btn {
	width: var(--mb-desk-size, 54px) !important;
	height: var(--mb-desk-size, 54px) !important;
	min-width: var(--mb-desk-size, 54px) !important;
	max-width: var(--mb-desk-size, 54px) !important;
	min-height: var(--mb-desk-size, 54px) !important;
	max-height: var(--mb-desk-size, 54px) !important;
	aspect-ratio: 1 / 1 !important;
	border-radius: 50% !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	text-decoration: none !important;
	color: #ffffff !important;
	cursor: pointer !important;
	border: none !important;
	outline: none !important;
	position: relative !important;
	z-index: 2 !important;
	transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease !important;
	user-select: none !important;
	box-sizing: border-box !important;
	overflow: hidden !important;
	margin: 0 !important;
	padding: 0 !important;
	line-height: 1 !important;
	flex-shrink: 0 !important;
	appearance: none !important;
	-webkit-appearance: none !important;
	vertical-align: middle !important;
}

.mb-desk-btn:hover {
	transform: scale(1.1) !important;
}

/* Icon scaling: Bigger and cleaner */
.mb-desk-btn svg {
	width: var(--mb-desk-icon-size, 34px);
	height: var(--mb-desk-icon-size, 34px);
	fill: currentColor;
	flex-shrink: 0;
}

.mb-desk-btn img.mb-desk-custom-icon {
	width: 70%;
	height: 70%;
	object-fit: contain;
	display: block;
	flex-shrink: 0;
}

.mb-desk-btn--zalo {
	background: var(--mb-contact-zalo);
	box-shadow: 0 4px 16px rgba(0, 104, 255, 0.4);
}

.mb-desk-btn--zalo:hover {
	box-shadow: 0 6px 20px rgba(0, 104, 255, 0.55);
}

.mb-desk-btn--hotline {
	background: var(--mb-contact-hotline);
	box-shadow: 0 4px 16px rgba(40, 167, 69, 0.4);
}

.mb-desk-btn--hotline:hover {
	box-shadow: 0 6px 20px rgba(40, 167, 69, 0.55);
}

/* Tooltip on Zalo Desktop */
.mb-desk-tooltip {
	position: absolute;
	right: calc(100% + 14px);
	background: #1e293b;
	color: #ffffff;
	font-size: 13px;
	font-weight: 600;
	padding: 6px 12px;
	border-radius: 6px;
	white-space: nowrap;
	opacity: 0;
	visibility: hidden;
	transform: translateX(6px);
	transition: all 0.2s ease;
	pointer-events: none;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
	z-index: 5;
}

.mb-contact-desktop.pos-left .mb-desk-tooltip {
	right: auto;
	left: calc(100% + 14px);
	transform: translateX(-6px);
}

.mb-desk-btn-wrap:hover .mb-desk-tooltip {
	opacity: 1;
	visibility: visible;
	transform: translateX(0);
}

/* Pulse Wave Animation for Hotline */
.mb-desk-pulse-ring {
	position: absolute;
	top: -6px;
	left: -6px;
	right: -6px;
	bottom: -6px;
	border-radius: 50% !important;
	border: 2px solid var(--mb-contact-hotline);
	opacity: 0;
	animation: mbPulseRing 2s cubic-bezier(0.215, 0.61, 0.355, 1) infinite;
	z-index: 1;
	pointer-events: none;
	box-sizing: border-box !important;
}

.mb-desk-pulse-ring:nth-child(2) {
	animation-delay: 0.6s;
}

@keyframes mbPulseRing {
	0% {
		transform: scale(0.95);
		opacity: 0.8;
	}
	70% {
		transform: scale(1.4);
		opacity: 0;
	}
	100% {
		transform: scale(1.4);
		opacity: 0;
	}
}

/* ==========================================================================
   4. DESKTOP HOTLINE CARD (FIXED HOVER GAP WITH INVISIBLE BRIDGE)
   ========================================================================== */
.mb-desk-hotline-card {
	position: absolute;
	bottom: calc(100% + 14px);
	right: 0;
	width: 320px;
	background: #ffffff;
	border-radius: 16px;
	box-shadow: 0 12px 35px rgba(0, 0, 0, 0.18), 0 2px 6px rgba(0, 0, 0, 0.06);
	border: 1px solid #e2e8f0;
	opacity: 0;
	visibility: hidden;
	transform: translateY(10px) scale(0.96);
	transform-origin: bottom right;
	transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
	pointer-events: none;
	z-index: 100;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
	box-sizing: border-box;
}

/* INVISIBLE HOVER BRIDGE: Prevents popup from closing when moving mouse from button into card! */
.mb-desk-hotline-card::after {
	content: "";
	position: absolute;
	top: 100%;
	left: -20px;
	right: -20px;
	height: 24px;
	background: transparent;
	pointer-events: auto;
}

.mb-contact-desktop.pos-left .mb-desk-hotline-card {
	right: auto;
	left: 0;
	transform-origin: bottom left;
}

/* Active states (hover or click) */
.mb-desk-btn-wrap.is-open .mb-desk-hotline-card,
.mb-desk-btn-wrap.is-hovered .mb-desk-hotline-card {
	opacity: 1 !important;
	visibility: visible !important;
	transform: translateY(0) scale(1) !important;
	pointer-events: auto !important;
}

.mb-desk-hotline-card__header {
	background: #f8fafc;
	padding: 12px 16px;
	border-bottom: 1px solid #f1f5f9;
	font-size: 14px;
	font-weight: 700;
	color: #0f172a;
	display: flex;
	align-items: center;
	gap: 8px;
	border-radius: 16px 16px 0 0;
}

.mb-desk-hotline-card__body {
	padding: 12px 14px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.mb-desk-hotline-item {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 9px 12px;
	border-radius: 10px;
	background: #f8fafc;
	border: 1px solid #f1f5f9;
	text-decoration: none !important;
	color: inherit !important;
	transition: all 0.15s ease;
}

.mb-desk-hotline-item:hover {
	background: #eff6ff;
	border-color: #0b6cb3;
}

.mb-desk-hotline-item__name {
	font-size: 13px;
	font-weight: 700;
	color: #0f172a;
	line-height: 1.25;
}

.mb-desk-hotline-item__note {
	font-size: 11px;
	color: #64748b;
	margin-top: 1px;
}

.mb-desk-hotline-item__phone {
	font-size: 14px;
	font-weight: 800;
	color: #0b6cb3;
	margin-top: 2px;
}

.mb-desk-hotline-item__badge {
	background: #dcfce7;
	color: #16a34a;
	font-size: 11px;
	font-weight: 700;
	padding: 5px 10px;
	border-radius: 12px;
	display: flex;
	align-items: center;
	gap: 3px;
	flex-shrink: 0;
}
.mb-desk-hotline-card__body {
	max-height: min(60vh, 420px);
	overflow-y: auto;
}

.mb-hotline-list {
	max-height: 62vh;
	overflow-y: auto;
}
