/**
 * Web Bảo Lộc - Thước Lỗ Ban
 * Stylesheet - responsive, nhẹ, không phụ thuộc theme.
 */

.wblc-loban {
	max-width: 100%;
	margin: 0 auto;
	font-size: 14px;
	line-height: 1.5;
	color: #333;
	background: #fff;
	border: 1px solid #e2e2e2;
	border-radius: 8px;
	overflow: hidden;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
	box-sizing: border-box;
}

.wblc-loban *,
.wblc-loban *::before,
.wblc-loban *::after {
	box-sizing: border-box;
}

/* ---------- Thanh thương hiệu ---------- */

.wblc-brand {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
	padding: 12px 16px;
	background: #d43535;
	color: #fff;
}

.wblc-brand a {
	color: #fff;
	text-decoration: none;
}

.wblc-brand__logo {
	display: flex;
	flex-direction: column;
	gap: 1px;
}

.wblc-brand__name {
	font-size: 19px;
	font-weight: 800;
	letter-spacing: 0.4px;
	line-height: 1.2;
}

.wblc-brand__tagline {
	font-size: 12px;
	opacity: 0.9;
}

.wblc-brand__hotline {
	font-size: 13px;
	font-weight: 700;
	background: rgba(255, 255, 255, 0.16);
	padding: 7px 14px;
	border-radius: 20px;
	white-space: nowrap;
}

.wblc-brand__hotline:hover {
	background: rgba(255, 255, 255, 0.28);
}

/* ---------- Thanh điều khiển (số đo = ô nhập trực tiếp) ---------- */

.wblc-control {
	position: relative;
	z-index: 12;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 8px 16px;
	background: #fff;
	border-bottom: 1px solid #e2e2e2;
}

.wblc-loban .wblc-control__input {
	width: 200px;
	max-width: 100%;
	height: 40px;
	padding: 0 12px;
	text-align: center;
	font-size: 20px;
	font-weight: 800;
	font-variant-numeric: tabular-nums;
	color: #b92a2a;
	background: #fff;
	border: 2px solid #d43535;
	border-radius: 7px;
	box-shadow: 0 1px 5px rgba(212, 53, 53, 0.15);
	appearance: none;
	-moz-appearance: textfield;
}

.wblc-loban .wblc-control__input::-webkit-outer-spin-button,
.wblc-loban .wblc-control__input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.wblc-loban .wblc-control__input:focus {
	outline: none;
	border-color: #b92a2a;
	box-shadow: 0 0 0 3px rgba(212, 53, 53, 0.2);
}

.wblc-control__unit {
	font-size: 12px;
	font-weight: 700;
	color: #888;
	white-space: nowrap;
}

.wblc-warn {
	display: none;
	padding: 8px 16px;
	font-size: 13px;
	font-weight: 700;
	text-align: center;
	color: #fff;
	background: #c0392b;
}

.wblc-warn.is-visible {
	display: block;
}

/* ---------- Kích thước phổ biến ---------- */

.wblc-presets {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 4px;
	padding: 8px 16px;
	background: #fafafa;
	border-top: 1px solid #e2e2e2;
	font-size: 12px;
	color: #666;
}

.wblc-presets__label {
	font-weight: 600;
}

.wblc-presets__row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
}

.wblc-presets__group {
	font-weight: 700;
	color: #444;
}

.wblc-presets__chip {
	appearance: none;
	border: 1px solid #d9d9d9;
	border-radius: 14px;
	background: #fff;
	color: #555;
	font-size: 12px;
	font-weight: 600;
	padding: 3px 10px;
	cursor: pointer;
	line-height: 1.4;
	white-space: nowrap;
}

.wblc-presets__chip:hover {
	border-color: #d43535;
	color: #b92a2a;
}

/* ---------- Vùng thước ---------- */

.wblc-ruler {
	position: relative;
	background: #f3f3f3;
	cursor: grab;
	touch-action: pan-y;
	-webkit-user-select: none;
	user-select: none;
	-webkit-touch-callout: none;
	-webkit-tap-highlight-color: transparent;
}

.wblc-ruler.is-dragging {
	cursor: grabbing;
}

/* Thanh tên loại thước - nằm phía trên thước, không đè lên ảnh */
.wblc-rule__label {
	display: block;
	padding: 5px 10px;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.4;
	color: #fff;
	background: #3d3d3d;
	border-bottom: 1px solid #2a2a2a;
	pointer-events: none;
}

.wblc-rule__track {
	position: relative;
	height: 120px;
	background: #f3f3f3;
}

.wblc-rule__track:not(:last-child) {
	border-bottom: 1px solid #e2e2e2;
}

.wblc-viewport {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	overflow-x: auto;
	overflow-y: hidden;
	scrollbar-width: none;
	overscroll-behavior-x: none;
	/* Chặn native scroll ngang (tránh cuộn đúp / quán tính gây sai số khi kéo trên mobile);
	 * vuốt dọc vẫn cuộn trang bình thường. */
	touch-action: pan-y;
}

.wblc-viewport::-webkit-scrollbar {
	display: none;
	height: 0;
}

.wblc-rule__body {
	position: relative;
	height: 120px;
	touch-action: pan-y;
}

.wblc-seg {
	position: absolute;
	top: 0;
	left: 0;
	display: block;
	width: 10000px;
	height: 120px;
	pointer-events: none;
}

/* ---------- Vạch đỏ chỉ vị trí đo (cố định giữa, không cuộn) ---------- */

.wblc-rule__line {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 50%;
	width: 2px;
	margin-left: -1px;
	background: #e02424;
	box-shadow: 0 0 4px rgba(224, 36, 36, 0.65);
	z-index: 10;
	pointer-events: none;
}

.wblc-rule__arrow {
	position: absolute;
	top: -2px;
	left: 50%;
	width: 0;
	height: 0;
	margin-left: -8px;
	border-left: 8px solid transparent;
	border-right: 8px solid transparent;
	border-top: 12px solid #e02424;
	z-index: 10;
	pointer-events: none;
}

/* ---------- Bảng kết quả ---------- */

.wblc-result {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 12px;
	padding: 14px 16px;
	background: #fafafa;
}

.wblc-card {
	border: 1px solid;
	border-radius: 8px;
	padding: 12px 14px;
	background: #fff;
}

.wblc-card--good {
	border-color: #bfe5c6;
	background: #f2fbf2;
}

.wblc-card--bad {
	border-color: #f0c9c4;
	background: #fdf1f0;
}

.wblc-card__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin-bottom: 6px;
}

.wblc-card__title {
	font-size: 14px;
	font-weight: 800;
	color: #333;
}

.wblc-badge {
	flex: none;
	font-size: 11px;
	font-weight: 800;
	letter-spacing: 1px;
	padding: 2px 10px;
	border-radius: 12px;
	color: #fff;
}

.wblc-card--good .wblc-badge {
	background: #2e9e4f;
}

.wblc-card--bad .wblc-badge {
	background: #d63a2f;
}

.wblc-card__cung,
.wblc-card__khoang {
	margin: 2px 0;
	font-size: 13px;
	color: #555;
}

.wblc-card__cung b {
	color: #222;
}

.wblc-card__desc {
	margin: 8px 0 0;
	font-size: 12.5px;
	line-height: 1.55;
}

.wblc-card--good .wblc-card__desc {
	color: #3c7a4c;
}

.wblc-card--bad .wblc-card__desc {
	color: #9c443a;
}

/* ---------- Chia sẻ kết quả ---------- */

.wblc-share {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	padding: 0 16px 14px;
	background: #fafafa;
}

.wblc-share__btn {
	appearance: none;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 7px 12px;
	border: 1px solid #d9d9d9;
	border-radius: 6px;
	background: #fff;
	color: #555;
	font-size: 12.5px;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	line-height: 1.3;
}

.wblc-share__btn:hover {
	border-color: #d43535;
	color: #b92a2a;
}

.wblc-share__fb {
	background: #f1f4ff;
	border-color: #c5d0f0;
	color: #2f5bd0;
}

.wblc-share__fb:hover {
	border-color: #2f5bd0;
	color: #1f44a8;
}

.wblc-share__zalo {
	background: #ecf7ff;
	border-color: #c2dff2;
	color: #0a68b2;
}

.wblc-share__zalo:hover {
	border-color: #0a68b2;
	color: #074e85;
}

/* ---------- Chân trang ---------- */

.wblc-footer {
	text-align: center;
	padding: 10px 16px;
	background: #f7f7f7;
	border-top: 1px solid #e2e2e2;
	font-size: 12px;
	color: #777;
}

.wblc-footer a {
	color: #d43535;
	text-decoration: none;
}

.wblc-footer a:hover {
	text-decoration: underline;
}

/* ---------- Responsive ---------- */

@media (max-width: 768px) {
	.wblc-result {
		grid-template-columns: 1fr;
	}

	.wblc-brand__name {
		font-size: 17px;
	}

	.wblc-loban .wblc-control__input {
		width: 130px;
		height: 36px;
		font-size: 18px;
	}

	.wblc-control__unit {
		font-size: 11px;
	}
}
