.kch-bar {
	--kch-accent: #1a73e8;
	--kch-accent-bg: #e8f0fe;
	--kch-pill-bg: #f1f2f4;
	--kch-border: #e3e5e8;
	font-size: 14px;
	margin-bottom: 20px;
}

/* ---------- Lưới logo thương hiệu ---------- */

.kch-brands {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
	gap: 8px;
	margin-bottom: 22px;
}

.kch-brand {
	position: relative;
	display: block;
	margin: 0;
	cursor: pointer;
}

.kch-brand .kch-input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.kch-brand-box {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 54px;
	padding: 8px 10px;
	background: #fff;
	border: 1px solid var(--kch-border);
	border-radius: 10px;
	transition: border-color .15s, box-shadow .15s, background .15s;
}

.kch-brand:hover .kch-brand-box {
	border-color: #c4c8cd;
}

.kch-brand .kch-input:checked + .kch-brand-box {
	border-color: var(--kch-accent);
	background: var(--kch-accent-bg);
	box-shadow: 0 0 0 1px var(--kch-accent) inset;
}

.kch-brand .kch-input:focus-visible + .kch-brand-box {
	outline: 2px solid var(--kch-accent);
	outline-offset: 2px;
}

.kch-brand-box img {
	display: block;
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	margin: 0;
	object-fit: contain;
}

.kch-brand-text {
	font-size: 13px;
	font-weight: 600;
	text-align: center;
	line-height: 1.2;
}

/* ---------- Tiêu đề từng khu ---------- */

.kch-section {
	margin-bottom: 18px;
}

.kch-heading {
	margin: 0 0 10px;
	font-size: 17px;
	font-weight: 700;
	line-height: 1.3;
}

.kch-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
}

/* ---------- Nút dạng viên thuốc ---------- */

.kch-pill {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0;
	padding: 9px 14px;
	min-height: 0;
	background: var(--kch-pill-bg);
	border: 1px solid var(--kch-border);
	border-radius: 10px;
	box-shadow: none;
	color: inherit;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.2;
	letter-spacing: 0;
	text-transform: none;
	cursor: pointer;
	transition: background .15s, border-color .15s, color .15s;
}

.kch-pill:hover {
	border-color: #c4c8cd;
}

.kch-pill.is-active {
	background: var(--kch-accent-bg);
	border-color: var(--kch-accent);
	color: var(--kch-accent);
}

.kch-pill:focus-visible {
	outline: 2px solid var(--kch-accent);
	outline-offset: 2px;
}

.kch-pill svg {
	flex: 0 0 auto;
}

.kch-count:empty {
	display: none;
}

.kch-caret {
	width: 0;
	height: 0;
	margin-left: 2px;
	border-left: 4px solid transparent;
	border-right: 4px solid transparent;
	border-top: 5px solid currentColor;
}

.kch-reset {
	background: none;
	border-style: dashed;
}

.kch-reset[hidden] {
	display: none;
}

/* ---------- Dropdown ---------- */

.kch-dd {
	position: relative;
}

.kch-panel {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	z-index: 60;
	min-width: 220px;
	max-width: calc(100vw - 32px);
	max-height: 320px;
	overflow-y: auto;
	padding: 6px;
	background: #fff;
	border: 1px solid var(--kch-border);
	border-radius: 12px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
}

.kch-panel.is-right {
	left: auto;
	right: 0;
}

.kch-panel[hidden] {
	display: none;
}

.kch-panel ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.kch-panel li {
	margin: 0;
	padding: 0;
}

.kch-panel label {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	padding: 8px 10px;
	border-radius: 8px;
	font-weight: 400;
	cursor: pointer;
}

.kch-panel label:hover {
	background: #f6f7f8;
}

.kch-panel .kch-input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.kch-box {
	position: relative;
	flex: 0 0 18px;
	width: 18px;
	height: 18px;
	border: 1px solid #9aa0a6;
	border-radius: 4px;
	background: #fff;
	transition: background .15s, border-color .15s;
}

.kch-panel .kch-input:checked + .kch-box {
	background: var(--kch-accent);
	border-color: var(--kch-accent);
}

.kch-panel .kch-input:checked + .kch-box::after {
	content: "";
	position: absolute;
	left: 5px;
	top: 1px;
	width: 5px;
	height: 10px;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

.kch-panel .kch-input:focus-visible + .kch-box {
	outline: 2px solid var(--kch-accent);
	outline-offset: 2px;
}

/* ---------- Trạng thái tải ---------- */

.kch-loading {
	opacity: .4;
	pointer-events: none;
	transition: opacity .2s;
}

@media (max-width: 549px) {
	.kch-brands {
		grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
	}

	.kch-brand-box {
		height: 48px;
	}

	.kch-heading {
		font-size: 16px;
	}

	.kch-pill {
		padding: 8px 12px;
	}
}
