/* So sánh máy in — trang /so-sanh/, ô "So sánh" trên card/PDP, khay nổi (inc/compare/compare.php). */

/* ── Ô "So sánh" ở chân card (.card__foot — link "Mực cho máy này" của thẻ #325 sẽ nằm cùng hàng) ── */
.mitn-cmp-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 8px;
	margin-top: 10px;
	padding-top: 10px;
	border-top: 1px solid var(--color-border-subtle, #e5e7eb);
	font-size: 13px;
}
.mitn-cmp-toggle {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0;
	font-size: 13px;
	font-weight: 500;
	color: var(--color-text-body, #374151);
	cursor: pointer;
	white-space: nowrap;
}
.mitn-cmp-toggle input { margin: 0; width: 16px; height: 16px; accent-color: var(--color-greentech, #047857); }
/* "Mực cho máy này" (Trello #325, inc/ink-drawer/) — <button> trông như link, vùng bấm ≥44px. */
.mitn-cmp-row .mitn-ink-link {
	min-height: 44px !important;
	margin: -10px 0 !important;
	padding: 0 !important;
	border: 0 !important;
	background: none !important;
	color: var(--color-greentech, #047857) !important;
	font-size: 13px !important;
	font-weight: 600;
	text-transform: none !important;
	letter-spacing: 0 !important;
	text-decoration: underline;
	text-underline-offset: 3px;
	white-space: nowrap;
	cursor: pointer;
}
.mitn-cmp-pdp { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin: 12px 0 0; }
.mitn-cmp-with { position: relative; font-size: 13px; }
.mitn-cmp-with summary { list-style: none; cursor: pointer; font-weight: 600; color: var(--color-greentech, #047857); }
.mitn-cmp-with summary::-webkit-details-marker { display: none; }
.mitn-cmp-with summary::after { content: " ▾"; }
.mitn-cmp-with ul { position: absolute; z-index: 20; top: calc(100% + 6px); left: 0; min-width: 220px; margin: 0; padding: 6px; list-style: none; border: 1px solid var(--color-border-subtle, #e5e7eb); border-radius: 8px; background: #fff; box-shadow: 0 6px 24px rgba(0, 0, 0, .12); }
.mitn-cmp-with li { margin: 0; }
.mitn-cmp-with a { display: block; padding: 8px 10px; border-radius: 6px; color: inherit; font-weight: 600; }
.mitn-cmp-with a:hover,
.mitn-cmp-with a:focus-visible { background: var(--color-surface-sunken, #f3f4f6); }

/* ── Khay nổi ── */
.mitn-cmp-bar {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 1000;
	display: flex;
	justify-content: center;
	padding: 0 max(16px, env(safe-area-inset-right, 0px)) calc(12px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
	pointer-events: none;
}
.mitn-cmp-bar[hidden] { display: none; }
.mitn-cmp-bar > * { pointer-events: auto; }
/* Selector 2 class để thắng rule chung ".mitn-cmp-bar button" (background:none) bên dưới —
   trước 3.0.353 rule đó làm nút trong suốt, lẫn vào nền tối của footer. */
.mitn-cmp-bar .mitn-cmp-bar__pill {
	display: inline-flex !important;
	align-items: center;
	gap: 10px;
	margin: 0 !important;
	padding: 10px 18px !important;
	min-height: 0 !important;
	border: 1px solid var(--color-border-subtle, #e5e7eb) !important;
	border-radius: 999px !important;
	background: #fff !important;
	color: var(--color-text-primary, #111827) !important;
	font-weight: 600;
	font-size: 15px !important;
	text-transform: none !important;
	letter-spacing: 0 !important;
	box-shadow: 0 6px 24px rgba(0, 0, 0, .2);
}
.mitn-cmp-bar__pill span { background: var(--color-brand-primary, #dd3333); color: #fff; border-radius: 999px; padding: 0 8px; font-size: 12px; }
.mitn-cmp-bar__tray {
	display: none;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	width: 100%;
	max-width: 1280px;
	padding: 12px;
	border: 1px solid var(--color-border-subtle, #e5e7eb);
	border-radius: 12px;
	background: var(--color-surface-base, #fff);
	box-shadow: 0 10px 30px rgba(0, 0, 0, .18);
}
.mitn-cmp-bar.is-open .mitn-cmp-bar__tray { display: flex; }
.mitn-cmp-bar.is-open .mitn-cmp-bar__pill { display: none !important; }
.mitn-cmp-bar__item {
	display: flex;
	align-items: center;
	gap: 8px;
	flex: 1 1 180px;
	min-width: 0;
	padding: 6px 10px;
	border: 1px solid var(--color-border-subtle, #e5e7eb);
	border-radius: 8px;
	font-size: 13px;
}
.mitn-cmp-bar__item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mitn-cmp-bar__item img { width: 36px; height: 36px; object-fit: contain; flex-shrink: 0; }
.mitn-cmp-bar__item.is-empty { justify-content: center; border-style: dashed; color: var(--color-text-muted, #6b7280); }
.mitn-cmp-bar button {
	margin: 0 !important;
	min-height: 0 !important;
	min-width: 0 !important;
	padding: 6px 12px !important;
	border: 1px solid var(--color-border-subtle, #e5e7eb) !important;
	border-radius: 6px !important;
	background: none !important;
	color: var(--color-text-body, #374151) !important;
	font-size: 13px !important;
	font-weight: 500;
	text-transform: none !important;
	letter-spacing: 0 !important;
	line-height: 1.4 !important;
}
.mitn-cmp-bar__item button { margin-left: auto !important; padding: 0 8px !important; border-radius: 50% !important; }
.mitn-cmp-bar__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-left: auto; }
.mitn-cmp-bar__go {
	padding: 8px 16px;
	border-radius: 6px;
	background: var(--color-brand-primary, #dd3333);
	color: #fff !important;
	font-weight: 600;
}
.mitn-cmp-bar__hint { font-size: 13px; color: var(--color-text-muted, #6b7280); }
.mitn-cmp-toast {
	position: fixed;
	left: 50%;
	bottom: calc(84px + env(safe-area-inset-bottom, 0px));
	z-index: 1001;
	max-width: calc(100% - 32px);
	transform: translateX(-50%);
	padding: 10px 16px;
	border-radius: 8px;
	background: var(--color-surface-inverse, #111827);
	color: var(--color-text-inverse, #fff);
	font-size: 14px;
	box-shadow: 0 6px 20px rgba(0, 0, 0, .2);
}

/* ── Trang so sánh ── */
.mitn-cmp { padding-bottom: 96px; color: var(--color-text-primary, #111827); font-family: var(--font-body); font-size: var(--fs-base); }
/* 1 thang chữ theo tokens.css: H1 → H2 nhóm → H3/tên máy = cỡ thân bài, cùng font tiêu đề của theme. */
.mitn-cmp h1,
.mitn-cmp h2,
.mitn-cmp h3 { font-family: var(--font-heading); font-weight: 700; line-height: var(--lh-snug); color: var(--color-text-primary, #111827); }
.mitn-cmp .container { max-width: 1280px; }
.cmp-crumb { display: flex; flex-wrap: wrap; gap: 6px; padding: 14px 0 8px; font-size: var(--fs-sm); color: var(--color-text-muted, #6b7280); }
.cmp-crumb a { color: inherit; }
.cmp-hero { display: grid; gap: 12px; padding: 8px 0 24px; border-bottom: 1px solid var(--color-border-subtle, #e5e7eb); }
.cmp-hero h1 { margin: 0; font-size: var(--fs-h1); text-wrap: balance; }
.cmp-hero p { margin: 0; max-width: 72ch; }

.cmp-head {
	position: sticky;
	top: 0;
	z-index: 5;
	display: grid;
	grid-template-columns: 220px repeat(var(--cmp-n), minmax(0, 1fr));
	padding: 16px 0 12px;
	border-bottom: 1px solid var(--color-border-subtle, #e5e7eb);
	background: var(--color-surface-base, #fff);
}
.admin-bar .cmp-head { top: 32px; }
.cmp-head__lbl { display: flex; align-items: flex-end; padding-right: 12px; font-size: 13px; color: var(--color-text-muted, #6b7280); }
.cmp-pcard { position: relative; display: flex; flex-direction: column; gap: 8px; min-width: 0; padding: 8px 12px; border-left: 1px solid var(--color-border-subtle, #e5e7eb); }
.cmp-pcard.is-win { background: var(--color-status-warning-bg, #fef3c7); border-radius: 8px 8px 0 0; }
.cmp-pcard__img { display: block; width: 84px; height: 84px; overflow: hidden; transition: width .2s, height .2s; }
.cmp-pcard__img img { width: 100%; height: 100%; object-fit: contain; }
.cmp-pcard__body { display: grid; gap: 4px; min-width: 0; align-content: start; }
.cmp-pcard h2 { margin: 0; font-size: var(--fs-base); }
.cmp-pcard h2 a { color: inherit; }
.cmp-pcard__sub { font-size: var(--fs-xs); color: var(--color-text-muted, #6b7280); }
.cmp-pcard__price { font-size: var(--fs-lg); font-weight: 700; color: var(--color-brand-primary, #dd3333); font-variant-numeric: tabular-nums; }
.cmp-pcard__x {
	position: absolute;
	top: 0;
	right: 6px;
	display: grid;
	place-items: center;
	width: 28px;
	height: 28px;
	border: 1px solid var(--color-border-subtle, #e5e7eb);
	border-radius: 50%;
	color: var(--color-text-muted, #6b7280);
	font-size: 18px;
	line-height: 1;
}
.cmp-slot {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 120px;
	margin: 0 12px;
	border: 1.5px dashed var(--color-border-default, #d1d5db);
	border-radius: 8px;
	color: var(--color-text-muted, #6b7280);
	font-size: 14px;
	text-align: center;
}
.cmp-slot:hover { border-color: var(--color-greentech, #047857); color: var(--color-greentech, #047857); }
.cmp-head.is-compact .cmp-slot { min-height: 48px; }
.cmp-table td.cmp-empty { background: none; }
.cmp-table .cmp-thead th,
.cmp-table .cmp-thead td { height: 0; padding: 0 !important; border: 0; }
.cmp-table .cmp-thead th:first-child { width: 220px; }
.cmp-badge { justify-self: start; padding: 2px 8px; border-radius: 4px; background: var(--color-greentech, #047857); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
/* Header co lại khi cuộn — CHỈ desktop. Trên điện thoại header đổi chiều cao ngay lúc cuộn làm
   nội dung nhảy, IntersectionObserver bật/tắt liên tục → trang giật (3.0.350). */
@media (min-width: 1025px) {
	.cmp-head.is-compact { padding: 8px 0; }
	.cmp-head.is-compact .cmp-pcard__img { width: 40px; height: 40px; }
	.cmp-head.is-compact .cmp-pcard { flex-direction: row; align-items: center; }
	.cmp-head.is-compact .cmp-pcard__sub,
	.cmp-head.is-compact .cmp-badge { display: none; }
}

.cmp-grp { padding: 24px 0; border-bottom: 1px solid var(--color-border-subtle, #e5e7eb); }
.cmp-grp--core { border-bottom: 3px solid var(--color-text-primary, #111827); }
.cmp-grp summary { display: flex; justify-content: space-between; align-items: center; gap: 12px; list-style: none; cursor: pointer; }
.cmp-grp summary::-webkit-details-marker { display: none; }
.cmp-grp summary h2 { margin: 0; font-size: var(--fs-h2); }
.cmp-grp summary:hover h2,
.cmp-grp details[open] > summary h2 { color: var(--color-brand-primary, #dd3333); }
/* Dấu "+" đỏ như khối FAQ của theme (faq.css) — vẽ 2 gạch, ẩn ký tự "+" trong HTML. */
.cmp-chev { flex: 0 0 auto; width: 14px; height: 14px; font-size: 0; background: linear-gradient(var(--color-brand-primary, #dd3333), var(--color-brand-primary, #dd3333)) center / 14px 2px no-repeat, linear-gradient(var(--color-brand-primary, #dd3333), var(--color-brand-primary, #dd3333)) center / 2px 14px no-repeat; transition: transform .2s ease; }
.cmp-grp details[open] .cmp-chev { transform: rotate(45deg); }
.cmp-tw { margin-top: 14px; overflow-x: auto; }
.cmp-table { width: 100%; min-width: 560px; margin: 0; border-collapse: collapse; table-layout: fixed; }
.cmp-table th,
.cmp-table td { padding: 12px !important; border-bottom: 1px solid var(--color-border-subtle, #e5e7eb); text-align: left; vertical-align: top; font-size: var(--fs-base); line-height: var(--lh-normal); }
.cmp-table th[scope="row"] { position: sticky; left: 0; z-index: 1; width: 220px; background: var(--color-surface-base, #fff); font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--color-text-primary, #111827); }
.cmp-table td { font-variant-numeric: tabular-nums; }
/* Nổi bật = nền vàng chữ đen (chủ site 29/10): ô tốt nhất, hàng Greentech®, máy rẻ nhất/trang. */
.cmp-table td.cmp-win { background: var(--color-status-warning-bg, #fef3c7); font-weight: 600; }
.cmp-table td.cmp-same { text-align: center; color: var(--color-text-muted, #4b5563); }
.cmp-table td,
.cmp-table td a { color: var(--color-text-primary, #111827); }
.cmp-table tr.cmp-gt td a { font-weight: 600; }
.cmp-table tr.cmp-gt td { background: var(--color-status-warning-bg, #fef3c7); }
.cmp-table tr.cmp-key td { font-weight: 700; }
.cmp-table tr.cmp-rule th,
.cmp-table tr.cmp-rule td { border-bottom: 2px solid var(--color-text-primary, #111827); }
.cmp-note { display: block; font-size: var(--fs-xs); font-weight: 400; color: var(--color-text-muted, #6b7280); }
.cmp-na { color: var(--color-text-subtle, #9ca3af); font-weight: 400; font-size: 13px; }
.cmp-pill { display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 4px; background: var(--color-greentech, #047857); color: #fff; font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; vertical-align: middle; }
/* Nhãn + ô chọn số trang nằm ngang; chừa padding phải cho mũi tên của theme khỏi đè số. */
.cmp-calc__h { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.cmp-calc__h label { margin: 0; font-weight: inherit; }
.cmp-calc select { flex: 0 0 auto; width: auto; min-width: 84px; height: auto; margin: 0; padding: 4px 28px 4px 10px; font-size: var(--fs-sm); background-position: right 8px center; }
.cmp-calc td span { display: block; }
/* Ô gộp (các máy cùng mực): chính hãng | Greentech® nằm ngang dưới nhãn "Tiền mực/tháng". */
.cmp-calc td.cmp-same span:not(.cmp-note) { display: inline-block; margin: 0 16px; }
.cmp-m-gt { font-weight: 600; }
.cmp-m-oem { color: var(--color-text-muted, #4b5563); }
.cmp-disc { max-width: 80ch; margin: 14px 0 0; font-size: var(--fs-sm); color: var(--color-text-muted, #6b7280); }
.cmp-cta { margin: 20px 0 0; padding: 16px 18px; border-left: 4px solid var(--color-greentech, #047857); border-radius: 0 8px 8px 0; background: var(--color-surface-sunken, #f3f4f6); font-size: var(--fs-base); }
.cmp-cta p { max-width: 80ch; margin: 0; }
.cmp-btn-gt { display: inline-block; padding: 6px 12px; border-radius: 6px; background: var(--color-greentech, #047857); color: #fff !important; font-weight: 600; }
.cmp-tel { font-weight: 700; white-space: nowrap; }
.cmp-trust { display: grid; gap: 8px; margin: 14px 0 0; padding-left: 1.2em; }
.cmp-verdict h2,
.cmp-faq h2 { margin: 0 0 14px; font-size: var(--fs-h2); }
.cmp-verdict__cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; }
.cmp-verdict__col { padding: 14px 16px; border-left: 4px solid var(--color-greentech, #047857); border-radius: 0 8px 8px 0; background: var(--color-surface-sunken, #f3f4f6); }
.cmp-verdict__col h3 { margin: 0 0 6px; font-size: var(--fs-base); }
.cmp-verdict__col p { margin: 0 0 6px; }
.cmp-faq details { border-top: 1px solid var(--color-border-subtle, #e5e7eb); padding: 12px 0; }
.cmp-faq summary h3 { margin: 0; font-size: var(--fs-base); }
.cmp-faq summary:hover h3,
.cmp-faq details[open] > summary h3 { color: var(--color-brand-primary, #dd3333); }
.cmp-faq details p { max-width: 80ch; margin: 10px 0 0; }
/* Ô "+ Thêm máy": hộp tìm nhanh máy cùng nhóm (compare.js). */
.cmp-pick { width: min(520px, calc(100vw - 32px)); max-height: 80vh; padding: 18px; border: 0; border-radius: 10px; box-shadow: 0 10px 40px rgba(0, 0, 0, .25); }
.cmp-pick::backdrop { background: rgba(17, 24, 39, .45); }
.cmp-pick__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 10px; }
.cmp-pick__head h2 { margin: 0; font-size: var(--fs-h3); }
.cmp-pick input[type="search"] { width: 100%; margin: 0 0 10px; }
.cmp-pick ul { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; }
.cmp-pick a { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 6px; color: inherit; }
.cmp-pick a:hover,
.cmp-pick a:focus-visible { background: var(--color-surface-sunken, #f3f4f6); }
.cmp-pick a b { margin-left: auto; color: var(--color-brand-primary, #dd3333); white-space: nowrap; }
.cmp-root-empty { margin: 0; color: var(--color-text-muted, #6b7280); }
.cmp-root-cats { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.cmp-root-cats a { display: inline-block; padding: 8px 14px; border: 1px solid var(--color-border-subtle, #e5e7eb); border-radius: 6px; font-weight: 600; }
.cmp-root-cats a:hover { border-color: var(--color-greentech, #047857); color: var(--color-greentech, #047857); }
.cmp-final__cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.cmp-final__col { display: grid; gap: 8px; padding: 14px; border-radius: 8px; background: var(--color-surface-sunken, #f3f4f6); }
.cmp-final__col span { font-size: var(--fs-lg); font-weight: 700; color: var(--color-brand-primary, #dd3333); font-variant-numeric: tabular-nums; }
.cmp-btn { display: inline-block; justify-self: start; padding: 9px 16px; border-radius: 6px; background: var(--color-brand-primary, #dd3333); color: #fff !important; font-weight: 600; }

/* Điện thoại có thanh điều hướng đáy của theme → đẩy khay + toast lên trên nó. */
/* Nút "So sánh" dạt góc phải: ở giữa thì bị nút Zalo nhô lên của thanh đáy che (3.0.352). */
@media (max-width: 849px) {
	.mitn-cmp-bar { justify-content: flex-end; padding-bottom: calc(92px + env(safe-area-inset-bottom, 0px)); }
	.mitn-cmp-bar.is-open { justify-content: center; }
	.mitn-cmp-toast { bottom: calc(150px + env(safe-area-inset-bottom, 0px)); }
}
@media (max-width: 1024px) {
	.cmp-head { grid-template-columns: repeat(var(--cmp-n), minmax(140px, 1fr)); overflow-x: auto; }
	.cmp-head__lbl { display: none; }
}
@media (max-width: 760px) {
	/* Điện thoại: chỉ cột có máy, không ô trống (spec v1.1: 3 máy desktop, 2 máy mobile). */
	.cmp-head { grid-template-columns: repeat(var(--cmp-real), minmax(140px, 1fr)); }
	.cmp-slot,
	.cmp-table .cmp-empty { display: none; }
	/* Header dính gọn như mẫu: chỉ ảnh + tên (giá, loại máy đã có trong các hàng bên dưới). */
	.cmp-head { padding: 8px 0; }
	.cmp-pcard { align-items: center; gap: 4px; padding: 4px 24px; text-align: center; }
	.cmp-pcard__img { width: 56px; height: 56px; }
	.cmp-pcard h2 { font-size: var(--fs-sm); }
	.cmp-pcard__sub,
	.cmp-pcard__price,
	.cmp-badge { display: none; }
	.cmp-pcard__x { top: 0; right: 0; }
	.mitn-cmp-bar__item { flex-basis: calc(50% - 5px); }
	/* Không dạng bảng: mỗi hàng = thanh tiêu chí phủ ngang + giá trị từng máy xếp cột bên dưới,
	   thẳng cột với header ảnh máy (--cmp-real đặt ở .mitn-cmp). */
	.cmp-tw { overflow: visible; }
	.cmp-table,
	.cmp-table tbody { display: block; min-width: 0; }
	.cmp-table .cmp-thead { display: none; }
	.cmp-table tr { display: grid; grid-template-columns: repeat(var(--cmp-real), minmax(0, 1fr)); margin-bottom: 8px; }
	.cmp-table th[scope="row"] { position: static; grid-column: 1 / -1; width: auto; padding: 10px 12px !important; border: 0; border-radius: 6px; background: var(--color-surface-sunken, #f3f4f6); font-weight: 600; }
	.cmp-table td { padding: 10px 8px !important; border: 0; text-align: center; font-size: var(--fs-sm); }
	.cmp-table td + td { border-left: 1px solid var(--color-border-subtle, #e5e7eb); }
	.cmp-table td.cmp-same { grid-column: 1 / -1; }
	.cmp-table tr.cmp-rule th,
	.cmp-table tr.cmp-rule td { border-bottom: 0; }
	.cmp-final__cols { grid-template-columns: repeat(var(--cmp-real), minmax(0, 1fr)); gap: 8px; }
	.cmp-final__col { padding: 12px; text-align: center; justify-items: center; }
	.cmp-final__col strong { font-size: var(--fs-sm); }
	.cmp-final__col span { font-size: var(--fs-base); }
	.cmp-btn { justify-self: stretch; text-align: center; }
	.cmp-calc td.cmp-same span:not(.cmp-note) { margin: 0 6px; }
}
@media (prefers-reduced-motion: reduce) {
	.cmp-pcard__img img,
	.cmp-chev { transition: none; }
}
