/* ==========================================================================
   Listing (shop + product_cat) — port từ assets/home-clone/cat-clone.css.
   Chỉ chứa style của phần listing (breadcrumb, bộ lọc, toolbar, lưới, bảng,
   stepper, phân trang). Base/header/footer do assets/shell/shell.css lo.
   Token dùng var(--xl-*, fallback) để chạy được cả khi shell.css chưa load.
   ========================================================================== */

.xl-listing {
	--xl-line-soft: #f1f3f7;
	max-width: 1360px;
	margin: 0 auto;
	padding: 0 20px 48px;
	font-family: "Google Sans Flex", "Google Sans", Roboto, -apple-system, "Segoe UI", Arial, sans-serif;
	font-size: 17.5px;
	line-height: 1.5;
	color: var(--xl-ink, #334155);
}
.xl-listing *,
.xl-listing *::before,
.xl-listing *::after { box-sizing: border-box; }
.xl-listing a { color: inherit; text-decoration: none; }
.xl-listing h1 { margin: 0; font-size: 25px; line-height: 1.3; color: var(--xl-ink-strong, #0f172a); }
.xl-listing button { font-family: inherit; }
.xl-listing img { max-width: 100%; }

/* ---------- Breadcrumb + tiêu đề ---------- */
.xl-listing .xl-crumb {
	display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
	padding: 14px 0 6px; font-size: 16px; color: var(--xl-muted, #64748b);
}
.xl-listing .xl-crumb a:hover { color: var(--xl-blue, #1e73be); }
.xl-listing .xl-crumb .sep { color: #94a3b8; }
.xl-listing .xl-crumb b { color: var(--xl-ink-strong, #0f172a); font-weight: 500; }

.xl-listing .xl-cat-head {
	display: flex; align-items: baseline; gap: 12px;
	padding: 2px 0 14px; margin-bottom: 14px;
	border-bottom: 1px solid var(--xl-line, #e5e9f0);
}
.xl-listing .xl-cat-head h1 { text-transform: uppercase; letter-spacing: .2px; }
.xl-listing .xl-cat-head .xl-count { font-size: 16px; color: var(--xl-muted, #64748b); }

.xl-listing .xl-cat-desc {
	margin: -4px 0 16px; font-size: 16px; line-height: 1.6; color: var(--xl-muted, #64748b);
}
.xl-listing .xl-cat-desc p { margin: 0 0 8px; }

/* ---------- Bộ lọc ---------- */
.xl-listing .xl-filter {
	background: #fff; border: 1px solid var(--xl-line, #e5e9f0);
	border-radius: var(--xl-radius, 8px); padding: 14px 16px;
}
.xl-listing .xl-filter-groups {
	display: flex; align-items: stretch; gap: 0;
	overflow-x: auto; overflow-y: hidden; padding-bottom: 8px;
	scrollbar-width: thin; scroll-snap-type: x proximity; overscroll-behavior-x: contain;
}
.xl-listing .xl-filter-groups::-webkit-scrollbar { height: 6px; }
.xl-listing .xl-filter-groups::-webkit-scrollbar-thumb { background: #94a3b8; border-radius: 3px; }
.xl-listing .xl-filter-groups::-webkit-scrollbar-track { background: #f1f5f9; }

.xl-listing .xl-fgroup {
	flex: 0 0 auto; width: clamp(210px, 16vw, 290px); min-width: 0;
	padding: 0 16px; border-right: 1px dashed var(--xl-line, #e5e9f0);
	scroll-snap-align: start;
}
.xl-listing .xl-fgroup:first-child { padding-left: 0; }
.xl-listing .xl-fgroup:last-child { border-right: 0; padding-right: 0; }

.xl-listing .xl-fgroup h3 { margin: 0 0 8px; }
.xl-listing .xl-fgtoggle {
	display: flex; align-items: center; gap: 6px; width: 100%;
	padding: 0; border: 0; background: none; cursor: pointer; text-align: left;
	font-size: 16px; font-weight: 600; text-transform: uppercase;
	color: var(--xl-ink-strong, #0f172a);
}
.xl-listing .xl-fgtoggle::-webkit-details-marker { display: none; }
.xl-listing .xl-fcount { font-size: 14px; font-weight: 400; text-transform: none; color: var(--xl-muted, #64748b); }

.xl-listing .xl-fsearch { margin-bottom: 8px; }
.xl-listing .xl-fsearch input {
	width: 100%; height: 30px; padding: 0 8px 0 28px;
	border: 1px solid #d6dde7; border-radius: 4px;
	background: #fbfcfe url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-4.5-4.5'/%3E%3C/svg%3E") no-repeat 8px 50%;
	background-size: 14px 14px;
	font-family: inherit; font-size: 15.5px; color: var(--xl-ink, #334155);
}
.xl-listing .xl-fsearch input::placeholder { color: #7b8794; opacity: 1; }
.xl-listing .xl-fsearch input:focus {
	outline: none; border-color: var(--xl-blue, #1e73be);
	box-shadow: 0 0 0 2px rgba(30, 115, 190, .12);
}

.xl-listing .xl-fopts {
	display: block; max-height: 190px; overflow-y: auto; padding-right: 6px;
	scrollbar-width: thin; scrollbar-color: #64748b #eef2f7;
	-webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 12px), transparent 100%);
	mask-image: linear-gradient(to bottom, #000 calc(100% - 12px), transparent 100%);
}
.xl-listing .xl-fopts::-webkit-scrollbar { width: 8px; }
.xl-listing .xl-fopts::-webkit-scrollbar-thumb { background: #64748b; border-radius: 4px; border: 2px solid #fff; }
.xl-listing .xl-fopts::-webkit-scrollbar-track { background: #eef2f7; border-radius: 4px; }

.xl-listing .xl-fopt {
	display: flex; align-items: center; gap: 8px; margin-bottom: 6px;
	font-size: 16px; line-height: 1.35; color: #374151; cursor: pointer;
}
.xl-listing .xl-fopt input { flex: 0 0 auto; width: 14px; height: 14px; margin: 0; accent-color: var(--xl-blue, #1e73be); }
.xl-listing .xl-fopt:hover span { color: var(--xl-blue, #1e73be); }
.xl-listing .xl-fopt em { margin-left: auto; font-style: normal; font-size: 14px; color: #6b7280; }
.xl-listing .xl-fopt.is-zero { opacity: .45; cursor: default; }
.xl-listing .xl-fopt.is-zero em { color: #94a3b8; }
.xl-listing .xl-fopt input:disabled { cursor: default; }
.xl-listing .xl-fopt input:checked + span { color: var(--xl-blue, #1e73be); font-weight: 500; }
.xl-listing .xl-fopt.is-hidden { display: none; }

.xl-listing .xl-filter-bar {
	display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
	margin-top: 12px; padding-top: 12px;
	border-top: 1px solid var(--xl-line, #e5e9f0); font-size: 16px;
}
.xl-listing .xl-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.xl-listing .xl-chip {
	display: inline-flex; align-items: center; gap: 6px;
	padding: 3px 10px; border-radius: 14px; font-size: 15.5px;
	background: var(--xl-blue-soft, #eaf2fb); color: var(--xl-blue, #1e73be);
	cursor: pointer; transition: background .15s, color .15s;
}
.xl-listing .xl-chip:hover { background: var(--xl-blue, #1e73be); color: #fff; }
.xl-listing .xl-chip.is-active { background: var(--xl-blue, #1e73be); color: #fff; }
.xl-listing .xl-chip-x { font-size: 17.5px; line-height: 1; }
.xl-listing .xl-clear {
	margin-left: auto; display: inline-flex; align-items: center;
	height: 30px; padding: 0 14px; border: 1px solid var(--xl-line, #e5e9f0);
	border-radius: 4px; background: #fff; color: var(--xl-ink, #334155);
	font-size: 16px; cursor: pointer;
}
.xl-listing .xl-clear:hover { border-color: var(--xl-red, #e11d48); color: var(--xl-red, #e11d48); }

/* ---------- Toolbar ---------- */
.xl-listing .xl-toolbar {
	display: flex; align-items: center; flex-wrap: wrap; gap: 14px;
	padding: 14px 0; font-size: 16px;
}
.xl-listing .xl-result { color: var(--xl-muted, #64748b); }
.xl-listing .xl-result b { color: var(--xl-ink-strong, #0f172a); }
.xl-listing .xl-instock {
	display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
	font-size: 16px; color: var(--xl-ink, #334155); cursor: pointer;
}
.xl-listing .xl-instock input { width: 14px; height: 14px; margin: 0; accent-color: var(--xl-blue, #1e73be); }
.xl-listing .xl-instock:hover { color: var(--xl-blue, #1e73be); }
.xl-listing .xl-sort { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.xl-listing .xl-sort label { white-space: nowrap; }
.xl-listing .xl-sort select {
	height: 32px; padding: 0 8px; border: 1px solid var(--xl-line, #e5e9f0);
	border-radius: 4px; background: #fff; color: var(--xl-ink, #334155);
	font-family: inherit; font-size: 16px;
}
.xl-listing .xl-view { display: flex; overflow: hidden; border: 1px solid var(--xl-line, #e5e9f0); border-radius: 4px; }
.xl-listing .xl-view-btn {
	display: grid; place-items: center; width: 34px; height: 32px;
	background: #fff; color: #64748b; cursor: pointer;
}
.xl-listing .xl-view-btn + .xl-view-btn { border-left: 1px solid var(--xl-line, #e5e9f0); }
.xl-listing .xl-view-btn:hover { color: var(--xl-blue, #1e73be); }
.xl-listing .xl-view-btn.is-active { background: var(--xl-blue, #1e73be); color: #fff; }
.xl-listing .xl-view-btn svg { width: 16px; height: 16px; }

/* Chuyển kiểu xem: PHP render sẵn cả 2, JS/PHP quyết định hiển thị qua data-view */
.xl-listing[data-view="grid"] .xl-view-table,
.xl-listing[data-view="grid"] .xl-table-hint,
.xl-listing[data-view="table"] .xl-view-grid { display: none; }
.xl-listing[data-view="grid"] .xl-view-grid { display: grid; }
.xl-listing[data-view="table"] .xl-view-table { display: block; }

/* ---------- Lưới ---------- */
.xl-listing .xl-view-grid {
	grid-template-columns: repeat(auto-fill, minmax(clamp(190px, 15vw, 260px), 1fr));
	gap: 12px;
}
.xl-listing .xl-card-p {
	position: relative; display: flex; flex-direction: column; gap: 8px;
	padding: 10px; border: 1px solid var(--xl-line, #e5e9f0);
	border-radius: var(--xl-radius, 8px); background: #fff;
	transition: border-color .15s, box-shadow .15s;
}
.xl-listing .xl-card-p:hover { border-color: var(--xl-blue, #1e73be); box-shadow: 0 4px 16px rgba(16, 24, 40, .1); }
.xl-listing .xl-prod-img {
	display: block; width: 100%; aspect-ratio: 1 / 1;
	border: 1px solid var(--xl-line-soft, #f1f3f7); border-radius: 6px; background: #fff; overflow: hidden;
}
.xl-listing .xl-prod-img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.xl-listing .xl-brandline {
	font-size: 14.5px; letter-spacing: .2px; text-transform: uppercase;
	color: var(--xl-muted, #64748b);
	overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.xl-listing .xl-prod-name {
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
	font-size: 17px; font-weight: 500; line-height: 1.4; color: var(--xl-ink-strong, #0f172a);
	min-height: 41px;
}
.xl-listing .xl-prod-name:hover { color: var(--xl-blue, #1e73be); }
.xl-listing .xl-specs { min-height: 34px; font-size: 15.5px; line-height: 1.4; color: var(--xl-muted, #64748b); }
.xl-listing .xl-prod-price { font-size: 18px; font-weight: 700; color: var(--xl-red, #e11d48); }
.xl-listing .xl-state { display: inline-flex; align-items: center; gap: 5px; font-size: 15.5px; white-space: nowrap; }
.xl-listing .xl-state.is-in { color: var(--xl-green, #16a34a); }
.xl-listing .xl-state.is-out { color: #ef4444; }
.xl-listing .xl-badge-new {
	position: absolute; top: 6px; right: 6px; z-index: 1;
	padding: 2px 5px; border-radius: 3px; background: var(--xl-red, #e11d48);
	color: #fff; font-size: 13px; font-weight: 700; letter-spacing: .3px;
}
.xl-listing .xl-card-p .xl-add {
	margin-top: auto; height: 32px; border: 1px solid var(--xl-blue, #1e73be);
	border-radius: 4px; background: #fff; color: var(--xl-blue, #1e73be);
	font-size: 16px; cursor: pointer;
}
.xl-listing .xl-card-p .xl-add:hover { background: var(--xl-blue, #1e73be); color: #fff; }
.xl-listing .xl-card-p .xl-add:disabled { border-color: #94a3b8; color: #64748b; cursor: not-allowed; background: #f8fafc; }

/* ---------- Bảng ---------- */
.xl-listing .xl-table-hint {
	display: flex; align-items: center; gap: 8px;
	margin-bottom: 8px; padding: 8px 12px;
	border: 1px solid #d7e6fb; border-radius: 6px; background: #eef5ff;
	color: #1e4f8f; font-size: 15.5px;
}
.xl-listing .xl-table-hint[hidden] { display: none; }
.xl-listing .xl-table-hint .xl-ico { flex: 0 0 auto; width: 14px; height: 14px; color: var(--xl-blue, #1e73be); }

.xl-listing .xl-view-table {
	position: relative; overflow-x: auto; overflow-y: visible;
	border: 1px solid var(--xl-line, #e5e9f0); border-radius: var(--xl-radius, 8px);
	background: #fff; scroll-behavior: smooth;
}
.xl-listing .xl-view-table::-webkit-scrollbar { height: 10px; }
.xl-listing .xl-view-table::-webkit-scrollbar-thumb { background: #64748b; border-radius: 5px; border: 2px solid #fff; }
.xl-listing .xl-view-table::-webkit-scrollbar-track { background: #eef2f7; }

.xl-listing .xl-tb {
	width: max-content; min-width: 100%;
	border-collapse: separate; border-spacing: 0; font-size: 16px;
}
.xl-listing .xl-tb thead th {
	position: sticky; top: 0; z-index: 5;
	padding: 10px 12px; border-bottom: 1px solid var(--xl-line, #e5e9f0);
	background: #f7f9fc; color: #475569;
	font-size: 15.5px; font-weight: 600; text-align: left; text-transform: uppercase; white-space: nowrap;
}
.xl-listing .xl-tb tbody td {
	padding: 10px 12px; border-bottom: 1px solid var(--xl-line-soft, #f1f3f7); vertical-align: middle;
}
.xl-listing .xl-tb tbody tr:hover { background: #fbfdff; }
.xl-listing .xl-tb-row:last-child td { border-bottom: 0; }

/* cột cố định bên trái (desktop) */
.xl-listing .xl-tb {
	--xl-w-prod: 476px; --xl-w-price: 110px; --xl-w-stock: 120px; --xl-w-buy: 166px;
}
.xl-listing .xl-tb .xl-tb-c-prod {
	position: sticky; left: 0; z-index: 3; background: #fff;
	width: var(--xl-w-prod); min-width: var(--xl-w-prod); max-width: var(--xl-w-prod);
}
.xl-listing .xl-tb .xl-tb-c-price { position: sticky; left: var(--xl-w-prod); z-index: 3; min-width: var(--xl-w-price); background: #fff; }
.xl-listing .xl-tb .xl-tb-c-stock { position: sticky; left: calc(var(--xl-w-prod) + var(--xl-w-price)); z-index: 3; min-width: var(--xl-w-stock); background: #fff; }
/* cột cố định bên phải */
.xl-listing .xl-tb .xl-tb-c-buy {
	position: sticky; right: 0; z-index: 3; background: #fff;
	width: var(--xl-w-buy); min-width: var(--xl-w-buy);
	box-shadow: -8px 0 10px -8px rgba(16, 24, 40, .18);
}
.xl-listing .xl-tb thead th.xl-tb-c-prod { left: 0; z-index: 7; background: #eef3fa; }
.xl-listing .xl-tb thead th.xl-tb-c-price { left: var(--xl-w-prod); z-index: 7; background: #eef3fa; }
.xl-listing .xl-tb thead th.xl-tb-c-stock { left: calc(var(--xl-w-prod) + var(--xl-w-price)); z-index: 7; background: #eef3fa; }
.xl-listing .xl-tb thead th.xl-tb-c-buy { right: 0; z-index: 7; background: #eef3fa; }

.xl-listing .xl-tb .xl-tb-prod { display: flex; align-items: flex-start; gap: 10px; }
.xl-listing .xl-tb .xl-tb-prod img {
	flex: 0 0 auto; width: 56px; height: 56px; object-fit: contain;
	border: 1px solid var(--xl-line, #e5e9f0); border-radius: 6px; background: #fff;
}
.xl-listing .xl-tb .xl-tb-info { min-width: 0; }
.xl-listing .xl-tb .xl-tb-name {
	display: block; font-size: 16px; font-weight: 500; line-height: 1.4;
	color: var(--xl-ink-strong, #0f172a); overflow-wrap: anywhere;
}
.xl-listing .xl-tb .xl-tb-name:hover { color: var(--xl-blue, #1e73be); }
.xl-listing .xl-tb .xl-tb-desc {
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
	margin-top: 3px; font-size: 14.5px; line-height: 1.45; color: var(--xl-muted, #64748b);
}
.xl-listing .xl-tb .xl-tb-price { font-weight: 700; color: var(--xl-red, #e11d48); white-space: nowrap; }
.xl-listing .xl-tb .xl-tb-reg {
	display: block; margin-top: 2px; font-size: 14.5px; color: var(--xl-muted, #64748b); text-decoration: line-through;
}
.xl-listing .xl-tb .xl-tb-attr { min-width: 108px; max-width: 180px; font-size: 16px; color: #374151; vertical-align: top; }
.xl-listing .xl-tb thead th.xl-tb-attr { white-space: normal; line-height: 1.3; vertical-align: bottom; }
.xl-listing .xl-tb .xl-tb-c-sku { min-width: 92px; padding-left: 10px; padding-right: 10px; vertical-align: top; }
.xl-listing .xl-tb thead th.xl-tb-c-sku { white-space: normal; line-height: 1.3; vertical-align: bottom; }
.xl-listing .xl-tb .xl-tb-sku {
	display: block; font-family: ui-monospace, Consolas, monospace;
	font-size: 14.5px; letter-spacing: .2px; color: #4b5563; white-space: nowrap;
}
.xl-listing .xl-tb .xl-tb-none { color: #94a3b8; }

/* stepper + nút thêm giỏ trong bảng */
.xl-listing .xl-tb .xl-buy-wrap { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.xl-listing .xl-tb .xl-buy-wrap.is-disabled { opacity: .55; }
.xl-listing .xl-tb .xl-qty {
	display: flex; justify-content: center; overflow: hidden;
	width: 106px; height: 30px; border: 1px solid var(--xl-line, #e5e9f0); border-radius: 4px;
}
.xl-listing .xl-tb .xl-qty-btn {
	width: 28px; border: 0; background: #f3f6fa; color: #475569;
	font-size: 19px; line-height: 1; cursor: pointer;
}
.xl-listing .xl-tb .xl-qty-btn:hover:not(:disabled) { background: var(--xl-blue, #1e73be); color: #fff; }
.xl-listing .xl-tb .xl-qty-in {
	width: 50px; padding: 0; border: 0;
	border-left: 1px solid var(--xl-line, #e5e9f0); border-right: 1px solid var(--xl-line, #e5e9f0);
	text-align: center; font-family: inherit; font-size: 16px; line-height: 28px; color: var(--xl-ink, #334155);
	-moz-appearance: textfield; appearance: textfield;
}
.xl-listing .xl-tb .xl-qty-in::-webkit-outer-spin-button,
.xl-listing .xl-tb .xl-qty-in::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.xl-listing .xl-tb .xl-buy-btn {
	width: 100%; max-width: 140px; height: 30px; padding: 0 10px;
	border: 0; border-radius: 4px; background: var(--xl-blue, #1e73be);
	color: #fff; font-size: 15.5px; white-space: nowrap; cursor: pointer;
}
.xl-listing .xl-tb .xl-buy-btn:hover:not(:disabled) { background: var(--xl-blue-dark, #175a96); }
.xl-listing .xl-tb .xl-buy-wrap.is-disabled .xl-buy-btn { background: #94a3b8; color: #475569; }
.xl-listing .xl-tb .xl-qty-btn:disabled,
.xl-listing .xl-tb .xl-qty-in:disabled,
.xl-listing .xl-tb .xl-buy-btn:disabled { cursor: not-allowed; }

/* ---------- Phân trang + trạng thái rỗng ---------- */
.xl-listing .xl-pager {
	display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px;
	padding: 20px 0 4px;
}
.xl-listing .xl-page {
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 32px; height: 32px; padding: 0 10px;
	border: 1px solid var(--xl-line, #e5e9f0); border-radius: 4px;
	background: #fff; color: var(--xl-ink, #334155); font-size: 16px; cursor: pointer;
}
.xl-listing .xl-page:hover:not(.is-disabled):not(.is-active) { border-color: var(--xl-blue, #1e73be); color: var(--xl-blue, #1e73be); }
.xl-listing .xl-page.is-active { background: var(--xl-blue, #1e73be); border-color: var(--xl-blue, #1e73be); color: #fff; cursor: default; }
.xl-listing .xl-page.is-disabled { opacity: .45; cursor: default; }
.xl-listing .xl-dots { padding: 0 2px; color: #64748b; }

.xl-listing .xl-empty {
	grid-column: 1 / -1;
	padding: 48px 20px; border: 1px dashed var(--xl-line, #e5e9f0);
	border-radius: var(--xl-radius, 8px); background: #fff;
	text-align: center; color: var(--xl-muted, #64748b);
}
.xl-listing .xl-empty b { display: block; margin-bottom: 6px; color: var(--xl-ink-strong, #0f172a); }

/* ---------- Responsive ---------- */
@media (max-width: 1279px) {
	.xl-listing .xl-tb { --xl-w-prod: 400px; }
}
@media (max-width: 1023px) {
	.xl-listing .xl-tb { --xl-w-prod: 330px; }
	.xl-listing .xl-fgroup { width: 250px; }
}

@media (max-width: 767px) {
	.xl-listing { padding: 0 12px 32px; }
	.xl-listing .xl-cat-head { flex-wrap: wrap; gap: 6px 10px; }

	/* bộ lọc: xếp dọc + accordion theo nhóm */
	.xl-listing .xl-filter-groups { display: block; overflow: visible; padding-bottom: 0; }
	.xl-listing .xl-fgroup {
		width: auto; padding: 10px 0; border-right: 0;
		border-bottom: 1px dashed var(--xl-line, #e5e9f0);
	}
	.xl-listing .xl-fgroup:first-child { padding-top: 0; }
	.xl-listing .xl-fgroup:last-child { border-bottom: 0; padding-bottom: 0; }
	.xl-listing .xl-fgroup .xl-fsearch,
	.xl-listing .xl-fgroup .xl-fopts { display: none; }
	.xl-listing .xl-fgroup.is-open .xl-fsearch,
	.xl-listing .xl-fgroup.is-open .xl-fopts { display: block; }
	.xl-listing .xl-fopts { max-height: none; -webkit-mask-image: none; mask-image: none; }
	.xl-listing .xl-fgtoggle { font-size: 16px; }
	.xl-listing .xl-filter-bar .xl-clear { margin-left: 0; }

	.xl-listing .xl-toolbar { gap: 10px; padding: 12px 0; }
	.xl-listing .xl-sort { margin-left: 0; }
	.xl-listing .xl-view-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }

	/* bảng: KHÔNG cột cố định, cuộn ngang tới cột Mua */
	.xl-listing .xl-tb .xl-tb-c-prod,
	.xl-listing .xl-tb .xl-tb-c-price,
	.xl-listing .xl-tb .xl-tb-c-stock,
	.xl-listing .xl-tb .xl-tb-c-buy { position: static; left: auto; right: auto; box-shadow: none; }
	.xl-listing .xl-tb thead th { position: static; }
	.xl-listing .xl-tb .xl-tb-c-prod { width: 244px; min-width: 244px; max-width: 244px; }
	.xl-listing .xl-tb .xl-tb-c-buy { width: 140px; min-width: 140px; }
	.xl-listing .xl-tb .xl-tb-prod img { width: 42px; height: 42px; }
	.xl-listing .xl-tb .xl-tb-desc { display: none; }
	.xl-listing .xl-tb .xl-tb-name { font-size: 16px; }
	.xl-listing .xl-tb .xl-tb-sku { font-size: 14px; }
}

@media (max-width: 479px) {
	.xl-listing .xl-view-grid { gap: 8px; }
	.xl-listing .xl-card-p { padding: 8px; }
}

/* A11y: vòng focus rõ ràng cho điều khiển trong danh mục */
.xl-listing a:focus-visible,
.xl-listing button:focus-visible,
.xl-listing input:focus-visible,
.xl-listing select:focus-visible,
.xl-listing [tabindex]:focus-visible {
  outline: 2px solid var(--xl-blue, #1e73be);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Dải danh mục tổng + số lượng sản phẩm (đầu trang danh sách) */
.xl-catnav {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 2px 0 16px;
}
.xl-catnav__item {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border: 1px solid #d7dee8; border-radius: 6px;
  background: #fff; color: #1f2937; font-size: 16px; font-weight: 500;
  line-height: 1.25; text-decoration: none; transition: all .15s ease;
}
.xl-catnav__item:hover {
  border-color: var(--xl-blue, #1e73be); color: var(--xl-blue, #1e73be); background: #f6faff;
}
.xl-catnav__item--all {
  background: var(--xl-blue, #1e73be); border-color: var(--xl-blue, #1e73be); color: #fff; font-weight: 600;
}
.xl-catnav__item--all:hover {
  background: var(--xl-blue-dark, #175a96); border-color: var(--xl-blue-dark, #175a96); color: #fff;
}
.xl-catnav__item.is-active { border-color: var(--xl-blue, #1e73be); color: var(--xl-blue, #1e73be); }
.xl-catnav__count {
  font-size: 14px; font-weight: 600; color: #475569;
  background: #f1f5f9; border-radius: 999px; padding: 1px 7px;
}
.xl-catnav__item--all .xl-catnav__count { background: rgba(255, 255, 255, .22); color: #fff; }
@media (max-width: 767px) {
  .xl-catnav {
    flex-wrap: nowrap; overflow-x: auto; gap: 7px;
    padding-bottom: 4px; margin-bottom: 12px; scrollbar-width: none;
  }
  .xl-catnav::-webkit-scrollbar { display: none; }
  .xl-catnav__item { flex: 0 0 auto; }
}
.xl-catnav__item.is-active { background: #eef6ff; font-weight: 600; cursor: default; }
.xl-catnav__item.is-active:hover { background: #eef6ff; }
.xl-catnav__item--back { border-style: dashed; color: #475569; font-weight: 600; }
.xl-catnav__item--back:hover { border-style: solid; }

/* ---------- Mobile: bộ lọc dạng slide ngang + cuộn chọn giá trị ---------- */
.xl-listing .xl-filter-title { display: none; }

@media (max-width: 767px) {
  /* Khung ngoài tràn viền để carousel chạm sát mép màn hình */
  .xl-listing .xl-filter {
    background: transparent; border: 0; border-radius: 0;
    padding: 0; margin: 0 -12px 10px;
  }
  .xl-listing .xl-filter-title {
    display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
    margin: 0 12px 8px; font-size: 16px; font-weight: 700; text-transform: uppercase;
    letter-spacing: .02em; color: var(--xl-ink-strong, #0f172a);
  }
  .xl-listing .xl-filter-hint {
    flex: 0 0 auto; font-size: 13.5px; font-weight: 400; text-transform: none;
    letter-spacing: 0; color: var(--xl-muted, #64748b); white-space: nowrap;
  }

  /* Các nhóm thuộc tính: carousel trượt ngang, snap từng thẻ */
  .xl-listing .xl-filter-groups {
    display: flex; flex-wrap: nowrap; align-items: flex-start; gap: 10px;
    overflow-x: auto; overflow-y: hidden;
    scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
    padding: 2px 12px 10px; scrollbar-width: none;
  }
  .xl-listing .xl-filter-groups::-webkit-scrollbar { display: none; }

  .xl-listing .xl-fgroup {
    flex: 0 0 auto; width: min(85vw, 340px);
    padding: 12px 12px 6px; border: 1px solid var(--xl-line, #e5e9f0); border-right: 1px solid var(--xl-line, #e5e9f0);
    border-radius: 10px; background: #fff; scroll-snap-align: center;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
  }
  .xl-listing .xl-fgroup:first-child { padding-left: 12px; }
  .xl-listing .xl-fgroup:last-child { padding-right: 12px; border-right: 1px solid var(--xl-line, #e5e9f0); }

  /* Mobile: luôn mở sẵn nội dung thay vì accordion.
     Nhóm đang có filter nhận thêm class .is-open (PHP) — phải khai báo lại với
     cùng độ ưu tiên, nếu không rule accordion của desktop (4 lớp) sẽ thắng và
     biến đúng nhóm đó thành danh sách xổ dọc. */
  .xl-listing .xl-fgroup .xl-fsearch,
  .xl-listing .xl-fgroup .xl-fopts,
  .xl-listing .xl-fgroup.is-open .xl-fsearch,
  .xl-listing .xl-fgroup.is-open .xl-fopts { display: block; }
  .xl-listing .xl-fgroup .xl-fopts,
  .xl-listing .xl-fgroup.is-open .xl-fopts { display: flex; }
  .xl-listing .xl-fgroup h3 { margin-bottom: 8px; }
  .xl-listing .xl-fsearch { margin-bottom: 10px; }
  .xl-listing .xl-fsearch input { height: 34px; font-size: 16px; }

  /* Giá trị lọc: dải chip cuộn ngang (cần 3 lớp để thắng rule accordion phía trên) */
  .xl-listing .xl-fgroup .xl-fopts {
    display: flex; flex-wrap: nowrap; gap: 8px;
    overflow-x: auto; overflow-y: hidden;
    max-height: none; padding: 2px 2px 10px; margin-right: -12px;
    scroll-snap-type: x proximity; scrollbar-width: none;
    -webkit-mask-image: none; mask-image: none;
  }
  .xl-listing .xl-fgroup .xl-fopts::-webkit-scrollbar { display: none; }

  .xl-listing .xl-fgroup .xl-fopt {
    flex: 0 0 auto; margin: 0; padding: 7px 12px; gap: 6px;
    border: 1px solid #d7dee8; border-radius: 999px; background: #fff;
    font-size: 16px; line-height: 1.2; white-space: nowrap; scroll-snap-align: start;
    transition: border-color .15s, background .15s, color .15s;
  }
  .xl-listing .xl-fgroup .xl-fopt input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
  .xl-listing .xl-fgroup .xl-fopt em { margin-left: 0; font-size: 14px; }
  .xl-listing .xl-fgroup .xl-fopt:hover span { color: inherit; }
  .xl-listing .xl-fgroup .xl-fopt.is-active,
  .xl-listing .xl-fgroup .xl-fopt:has(input:checked) {
    border-color: var(--xl-blue, #1e73be); background: var(--xl-blue-soft, #eaf2fb);
  }
  .xl-listing .xl-fgroup .xl-fopt.is-active span,
  .xl-listing .xl-fgroup .xl-fopt:has(input:checked) span { color: var(--xl-blue, #1e73be); font-weight: 600; }
  .xl-listing .xl-fgroup .xl-fopt.is-zero { opacity: .4; }

  /* Chip lọc đang bật: cuộn ngang một dòng */
  .xl-listing .xl-filter-bar { margin: 0 12px; padding-top: 0; border-top: 0; gap: 8px; }
  .xl-listing .xl-chips {
    flex-wrap: nowrap; overflow-x: auto; gap: 6px;
    padding-bottom: 4px; scrollbar-width: none;
  }
  .xl-listing .xl-chips::-webkit-scrollbar { display: none; }
  .xl-listing .xl-chip { flex: 0 0 auto; padding: 5px 10px; }
}

/* Nút trên thẻ sản phẩm: đủ lớn để bấm bằng ngón tay trên mobile */
@media (max-width: 767px) {
  .xl-listing .xl-card-p .xl-add { min-height: 40px; font-size: 16px; }
  .xl-listing .xl-card-p .xl-prod-name { font-size: 16px; }
}
