/* ==========================================
   Component: dms-contact-float (Nút liên hệ nổi)
   Dùng ở: mọi trang giao diện khách, khi module contact-float bật và có số điện thoại hoặc link Zalo. Chỉ CSS, không JS.
   Biến: --dms-color-call, --dms-color-zalo, --dms-color-action, --dms-color-action-hover, --dms-color-on-action,
         --dms-color-bg, --dms-color-border, --dms-color-text, --dms-fe-radius, --dms-fe-shadow
   Phụ thuộc: global/tokens.css
   Phiên bản: 0.2.0 | Cập nhật: 2026-11-27 (rc4: viền tiêu điểm hai màu)
   ========================================== */

/*
 * Từ 1025px: cụm nút vuông 56px ở góc dưới phải. Dưới 1025px: thanh đáy 60px, body chừa chỗ qua lớp dms-has-contact-bar.
 * Mốc 1024/1025px viết cứng; site cần mốc khác thì ghi đè ở site.css (T-04).
 * Site muốn ẩn tạm (vd. khi mở form): thêm lớp dms-contact-float-hidden vào body (T-03).
 */

/* Trình duyệt chưa hiểu color-mix(): màu rê chuột lấy bằng màu thường, để nút không mất nền. */
@supports not (color: color-mix(in srgb, #000, #fff)) {
	:root {
		--dms-color-action-hover: var(--dms-color-action);
	}
}

.dms-contact-float {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 200;
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.dms-contact-float__item {
	width: 56px;
	height: 56px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 2px;
	border-radius: var(--dms-fe-radius);
	color: var(--dms-color-on-action);
	font-size: 11px;
	font-weight: 700;
	line-height: 1.1;
	text-decoration: none;
	box-shadow: var(--dms-fe-shadow);
}

.dms-contact-float__item svg {
	width: 22px;
	height: 22px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.dms-contact-float__item--call {
	background: var(--dms-color-call);
}

.dms-contact-float__item--zalo {
	background: var(--dms-color-zalo);
}

.dms-contact-float__item--quote {
	background: var(--dms-color-action);
}

@media (min-width: 1025px) {
	.dms-contact-float__item--call:hover {
		background: color-mix(in srgb, var(--dms-color-call) 85%, #000);
	}

	.dms-contact-float__item--zalo:hover {
		background: color-mix(in srgb, var(--dms-color-zalo) 85%, #000);
	}

	.dms-contact-float__item--quote:hover {
		background: var(--dms-color-action-hover);
	}
}

.dms-contact-float[hidden] {
	display: none;
}

/* Tiêu điểm bàn phím: viền hai màu (màu chữ cạnh màu nền) để đủ tương phản trên mọi màu nút. */
.dms-contact-float .dms-contact-float__item:focus-visible {
	outline: 3px solid var(--dms-color-text);
	outline-offset: 2px;
	box-shadow: 0 0 0 7px var(--dms-color-bg);
}

@media (max-width: 1024px) {
	body.dms-has-contact-bar {
		padding-bottom: 60px;
		padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px));
	}

	.dms-contact-float {
		left: 0;
		right: 0;
		bottom: 0;
		flex-direction: row;
		gap: 0;
		padding-bottom: env(safe-area-inset-bottom, 0px);
		background: var(--dms-color-bg);
		border-top: 1px solid var(--dms-color-border);
		box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.08);
	}

	.dms-contact-float__item {
		flex: 1 1 0;
		width: auto;
		height: 60px;
		border-radius: 0;
		box-shadow: none;
		background: var(--dms-color-bg);
		color: var(--dms-color-call);
		font-size: 13px;
	}

	.dms-contact-float__item + .dms-contact-float__item {
		border-left: 1px solid var(--dms-color-border);
	}

	.dms-contact-float__item--zalo {
		color: var(--dms-color-zalo);
	}

	.dms-contact-float__item--quote {
		flex-grow: 1.5;
		background: var(--dms-color-action);
		color: var(--dms-color-on-action);
		font-size: 15px;
		border-left: 0;
	}

	.dms-contact-float__item:hover {
		box-shadow: inset 0 -3px 0 currentColor;
	}

	.dms-contact-float__item--call:hover {
		color: var(--dms-color-call);
	}

	.dms-contact-float__item--zalo:hover {
		color: var(--dms-color-zalo);
	}

	.dms-contact-float__item--quote:hover {
		background: var(--dms-color-action-hover);
		box-shadow: none;
	}

	/* Thanh đáy: viền nằm trong nút để không bị cắt. */
	.dms-contact-float .dms-contact-float__item:focus-visible {
		outline-offset: -3px;
		box-shadow: inset 0 0 0 6px var(--dms-color-bg);
	}

	body.dms-contact-float-hidden.dms-has-contact-bar {
		padding-bottom: 0;
	}
}

.dms-cf-long {
	display: none;
}

@media (max-width: 1024px) {
	.dms-cf-short {
		display: none;
	}

	.dms-cf-long {
		display: inline;
	}
}

body.dms-contact-float-hidden .dms-contact-float {
	display: none;
}

@media print {
	.dms-contact-float {
		display: none;
	}
}
