/* ==========================================================================
   TRANG MINH STORE — Trang danh mục
   Banner danh mục · cột lọc trái · thanh công cụ · khối gợi ý · dải cam kết
   ========================================================================== */

/* ---------------------------------------------------- Banner danh mục */

.tm-cathero {
	background: linear-gradient(120deg, #eef2ff 0%, #ffffff 52%, #fff6e8 100%);
	border-bottom: 1px solid var(--line-soft);
	overflow: hidden;
}
.tm-cathero__inner {
	display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 560px);
	gap: 40px; align-items: center; padding-block: clamp(26px, 3.4vw, 46px);
}
.tm-cathero__eyebrow {
	display: inline-flex; align-items: center; gap: 9px; color: var(--gold-dim);
	font-size: 12px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; margin-bottom: 8px;
}
.tm-cathero__eyebrow::before { content: ""; width: 30px; height: 1px; background: var(--gold); }
.tm-cathero .tm-shop__title { font-size: clamp(28px, 3.6vw, 44px); margin: 0 0 10px; text-align: left; }
.tm-cathero__desc { font-size: 15px; line-height: 1.75; color: var(--text-2); max-width: 620px; margin: 0 0 20px; }
.tm-cathero__desc p:last-child { margin-bottom: 0; }

.tm-cathero__stats { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 12px 34px; }
.tm-cathero__stats li { display: flex; flex-direction: column; position: relative; padding-left: 15px; }
.tm-cathero__stats li::before {
	content: ""; position: absolute; left: 0; top: 5px; bottom: 5px;
	width: 3px; border-radius: 3px; background: linear-gradient(180deg, var(--brand), var(--gold));
}
.tm-cathero__stats strong { font-family: var(--ff-display); font-size: 22px; color: var(--brand); line-height: 1.15; }
.tm-cathero__stats span { font-size: 12px; color: var(--text-3); text-transform: uppercase; letter-spacing: .06em; font-weight: 600; }

.tm-cathero__art { justify-self: end; max-width: 100%; }
.tm-cathero__art img {
	width: 100%; max-height: 290px; object-fit: contain;
	background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg);
	padding: 20px; box-shadow: var(--sh-2);
}
@media (max-width: 1024px) {
	.tm-cathero__inner { grid-template-columns: 1fr; gap: 22px; }
	.tm-cathero__art { display: none; }
}

/* --------------------------------------------------- Danh mục con dạng thẻ */

.tm-subcats ul { gap: 10px; margin-bottom: 18px; }
.tm-subcats a { padding: 9px 16px 9px 9px; gap: 10px; }
.tm-subcats a em { font-style: normal; font-size: 11.5px; color: var(--text-3); font-weight: 700; }

/* ------------------------------------------------------------ Bố cục 2 cột */

.tm-shop__layout { display: grid; grid-template-columns: 286px minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 1100px) { .tm-shop__layout { grid-template-columns: 1fr; } }

/* ------------------------------------------------------------ Cột lọc */

.tm-filters {
	position: sticky; top: calc(var(--hdr-h) + 14px);
	background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg);
	padding: 6px 20px 20px; max-height: calc(100vh - var(--hdr-h) - 28px); overflow-y: auto;
}
.tm-filters__close { display: none; }
.tm-filters__mask { position: fixed; inset: 0; z-index: 79; background: rgba(10, 20, 69, .45); }

.tm-fbox { padding: 18px 0; border-bottom: 1px solid var(--line-soft); }
.tm-fbox:last-of-type { border-bottom: 0; }
.tm-fbox__h {
	font-family: var(--ff-body); font-size: 12px; font-weight: 800; letter-spacing: .1em;
	text-transform: uppercase; color: var(--text); margin: 0 0 12px;
}

.tm-fcats { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.tm-fcats a {
	display: flex; align-items: center; gap: 9px; padding: 8px 10px;
	border-radius: var(--r-sm); font-size: 13.5px; transition: all .2s var(--ease);
}
.tm-fcats a:hover { background: var(--brand-soft); color: var(--brand); }
.tm-fcats a.is-on { background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.tm-fcats__ico { font-size: 14px; line-height: 1; }
.tm-fcats__name { flex: 1; min-width: 0; }
.tm-fcats__n { font-size: 11.5px; color: var(--text-3); font-weight: 700; }
.tm-fcats__up { color: var(--text-3); font-weight: 600; }

.tm-fchecks { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.tm-fchecks a { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: var(--r-sm); font-size: 13.5px; }
.tm-fchecks a:hover { background: var(--line-soft); }
.tm-fchecks__box {
	width: 17px; height: 17px; flex: none; border: 1.5px solid var(--line);
	border-radius: 4px; background: #fff; position: relative; transition: all .2s var(--ease);
}
.tm-fchecks a.is-on .tm-fchecks__box { background: var(--brand); border-color: var(--brand); }
.tm-fchecks a.is-on .tm-fchecks__box::after {
	content: "✓"; position: absolute; inset: 0; color: #fff; font-size: 11px;
	font-weight: 900; display: grid; place-items: center;
}
.tm-fchecks a.is-on { color: var(--brand); font-weight: 600; }
.tm-fchecks__name { flex: 1; min-width: 0; }
.tm-fchecks__n { font-size: 11.5px; color: var(--text-3); font-weight: 700; }
.tm-fchecks[data-more] li:nth-child(n+7) { display: none; }
.tm-fchecks[data-more].is-open li { display: block; }
.tm-fmore { background: none; border: 0; color: var(--brand); font-size: 12.5px; font-weight: 700; padding: 8px 8px 0; }

.tm-fprice__track { position: relative; height: 26px; margin: 6px 2px 10px; }
.tm-fprice__track::before {
	content: ""; position: absolute; left: 0; right: 0; top: 11px; height: 4px;
	background: var(--line); border-radius: 999px;
}
.tm-fprice__fill { position: absolute; top: 11px; height: 4px; background: var(--gold); border-radius: 999px; }
.tm-fprice__track input[type=range] {
	position: absolute; left: 0; right: 0; top: 0; width: 100%; height: 26px;
	margin: 0; background: none; -webkit-appearance: none; appearance: none; pointer-events: none;
}
.tm-fprice__track input[type=range]::-webkit-slider-thumb {
	-webkit-appearance: none; pointer-events: auto; width: 17px; height: 17px; border-radius: 50%;
	background: #fff; border: 3px solid var(--brand); cursor: pointer; box-shadow: var(--sh-1);
}
.tm-fprice__track input[type=range]::-moz-range-thumb {
	pointer-events: auto; width: 17px; height: 17px; border-radius: 50%;
	background: #fff; border: 3px solid var(--brand); cursor: pointer;
}
.tm-fprice__inputs { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.tm-fprice__inputs input {
	flex: 1; min-width: 0; height: 40px; padding: 0 10px; text-align: center;
	border: 1.5px solid var(--line); border-radius: var(--r-sm); font-size: 13px; -moz-appearance: textfield;
}
.tm-fprice__inputs input::-webkit-outer-spin-button, .tm-fprice__inputs input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.tm-fprice__inputs span { color: var(--text-3); }

.tm-fclear { margin-top: 16px; }
.tm-fhelp {
	margin-top: 18px; padding: 16px; border-radius: var(--r);
	background: linear-gradient(120deg, var(--brand-soft), #fff 70%); border: 1px solid var(--brand-line);
}
.tm-fhelp strong { display: block; font-size: 14px; margin-bottom: 4px; }
.tm-fhelp span { display: block; font-size: 12.5px; color: var(--text-2); margin-bottom: 12px; }

/* --------------------------------------------------------- Thanh công cụ */

.tm-sortbar { gap: 12px; }
.tm-sortbar__filter { display: none; align-items: center; gap: 7px; font-size: 13px; font-weight: 700; color: var(--brand); background: none; border: 0; }
.tm-sortbar__filter svg { width: 17px; height: 17px; }
.tm-viewtoggle { display: inline-flex; border: 1.5px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.tm-viewtoggle button { width: 36px; height: 34px; display: grid; place-items: center; color: var(--text-3); background: #fff; border: 0; }
.tm-viewtoggle button svg { width: 16px; height: 16px; }
.tm-viewtoggle button.is-on { background: var(--brand); color: #fff; }
.tm-sortbar__count { font-size: 13px; color: var(--text-2); }
.tm-sortbar__count strong { color: var(--text); font-weight: 700; }
.tm-sortbar__opts { margin-left: auto; align-items: center; }
@media (max-width: 1100px) { .tm-sortbar__filter { display: inline-flex; } }
@media (max-width: 700px) { .tm-sortbar__count { display: none; } .tm-sortbar__opts { margin-left: 0; } }

.tm-applied { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 16px; }
.tm-applied__label { font-size: 12.5px; color: var(--text-3); font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.tm-applied__tag {
	display: inline-flex; align-items: center; gap: 6px; padding: 6px 13px;
	background: var(--brand-soft); border: 1px solid var(--brand-line); border-radius: 999px;
	font-size: 12.5px; color: var(--brand); font-weight: 600;
}
.tm-applied__tag:hover { background: var(--brand); color: #fff; border-color: var(--brand); }
.tm-applied__clear { font-size: 12.5px; color: var(--sale); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* ------------------------------------------------------- Lưới dạng danh sách */

.tm-grid.is-list { grid-template-columns: 1fr; gap: 14px; }
.tm-grid.is-list .tm-card { flex-direction: row; align-items: stretch; }
.tm-grid.is-list .tm-card__link { flex-direction: row; flex: 1; }
.tm-grid.is-list .tm-card__media { width: 210px; flex: none; aspect-ratio: 4/5; }
.tm-grid.is-list .tm-card__body { padding: 20px 24px; justify-content: center; }
.tm-grid.is-list .tm-card__title { font-size: 16.5px; -webkit-line-clamp: 2; min-height: 0; }
.tm-grid.is-list .tm-price__now { font-size: 22px; }
.tm-grid.is-list .tm-card__cta { padding: 20px 24px 20px 0; flex-direction: column; justify-content: center; min-width: 200px; }
@media (max-width: 700px) {
	.tm-grid.is-list .tm-card { flex-direction: column; }
	.tm-grid.is-list .tm-card__link { flex-direction: column; }
	.tm-grid.is-list .tm-card__media { width: 100%; }
	.tm-grid.is-list .tm-card__cta { padding: 0 12px 12px; flex-direction: row; min-width: 0; }
}

/* --------------------------------------------------------- Khối gợi ý */

.tm-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 28px; }
@media (max-width: 1024px) { .tm-tiles { grid-template-columns: 1fr; } }
.tm-tiles__box { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); padding: 20px 22px 22px; }
.tm-tiles__head { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.tm-tiles__head h2 {
	font-family: var(--ff-body); font-size: 13px; font-weight: 800; letter-spacing: .1em;
	text-transform: uppercase; margin: 0;
}
.tm-tiles__row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 640px) { .tm-tiles__row { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tm-tile { display: flex; flex-direction: column; gap: 8px; text-align: center; }
.tm-tile__img {
	aspect-ratio: 4/3; border-radius: var(--r-sm); overflow: hidden;
	background: linear-gradient(165deg, #f8faff, #eef2fc); display: grid; place-items: center;
	border: 1px solid var(--line); transition: all .25s var(--ease);
}
.tm-tile:hover .tm-tile__img { border-color: var(--gold); transform: translateY(-3px); box-shadow: var(--sh-2); }
.tm-tile__img img { width: 100%; height: 100%; object-fit: cover; }
.tm-tile__img em { font-size: 26px; font-style: normal; }
.tm-tile__name { font-size: 12.5px; font-weight: 700; line-height: 1.3; }
.tm-tile:hover .tm-tile__name { color: var(--brand); }
.tm-tile__n { font-size: 11px; color: var(--text-3); }

.tm-usp--bottom { margin-top: 30px; }

/* --------------------------------------------- Cột lọc trên điện thoại */

@media (max-width: 1100px) {
	.tm-filters {
		position: fixed; inset: 0 auto 0 0; z-index: 80; width: min(330px, 88vw);
		max-height: none; border-radius: 0; border: 0; padding: 52px 20px 30px;
		transform: translateX(-100%); transition: transform .26s var(--ease);
		box-shadow: var(--sh-3);
	}
	.tm-filters.is-open { transform: none; }
	.tm-filters__close {
		display: grid; place-items: center; position: absolute; top: 10px; right: 12px;
		width: 36px; height: 36px; border: 0; background: none; font-size: 26px; color: var(--text-3);
	}
}
