/* =========================================================
   TaroSports v2 - Trang danh sách sản phẩm (danh mục, tìm kiếm, ưu đãi)
   ========================================================= */

/* ---------- Banner danh mục: chiều cao cố định để không nhảy bố cục ---------- */
.tr-ds-banner
{
	position: relative;
	display: flex;
	align-items: center;
	height: 160px;
	padding: 0 40px;
	border-radius: var(--tr-radius);
	overflow: hidden;
	color: #fff;
	background: radial-gradient(circle at 85% 20%, rgba(10, 63, 165, .9), transparent 55%), linear-gradient(115deg, var(--tr-navy) 0%, #0B2A6B 60%, var(--tr-blue) 100%);
}

.tr-ds-banner::after
{
	content: '';
	position: absolute;
	right: -60px;
	top: -80px;
	width: 320px;
	height: 320px;
	border-radius: 50%;
	border: 36px solid rgba(255, 255, 255, .06);
	pointer-events: none;
}

.tr-ds-banner--img::after
{
	display: none;
}

.tr-ds-banner__img
{
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100% !important;
	object-fit: cover;
}

.tr-ds-banner--img::before
{
	content: '';
	position: absolute;
	inset: 0;
	z-index: 1;
	background: linear-gradient(90deg, rgba(7, 29, 73, .88) 0%, rgba(7, 29, 73, .55) 45%, rgba(7, 29, 73, 0) 75%);
}

.tr-ds-banner__txt
{
	position: relative;
	z-index: 2;
	max-width: 640px;
}

.tr-body .tr-ds-banner__title
{
	font-size: 36px;
	font-weight: 800;
	line-height: 1.15;
	text-transform: uppercase;
	letter-spacing: .01em;
	color: #fff;
}

.tr-body .tr-ds-banner__desc
{
	margin-top: 8px;
	font-size: 15px;
	line-height: 1.45;
	color: rgba(255, 255, 255, .88);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* ---------- Lối tắt danh mục (thẻ ảnh) ---------- */
.tr-ds-lt
{
	margin-top: 16px;
}

.tr-ds-lt__list
{
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: calc((100% - 5 * 12px) / 6);
	gap: 12px;
	margin: 0;
	padding: 8px 2px 10px;
	list-style: none;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: thin;
}

.tr-ds-lt__list > li
{
	scroll-snap-align: start;
}

.tr-ds-lt__item
{
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	height: 100%;
	padding: 10px 8px 12px;
	background: #fff;
	border: 1px solid var(--tr-line);
	border-radius: var(--tr-radius);
	box-shadow: var(--tr-shadow);
	text-align: center;
	transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.tr-ds-lt__item.is-active
{
	border: 2px solid var(--tr-navy);
	padding: 9px 7px 11px;
}

.tr-ds-lt__img
{
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	color: var(--tr-muted);
}

.tr-ds-lt__img img
{
	width: 100%;
	height: 100% !important;
	object-fit: contain;
}

.tr-ds-lt__img .tr-i
{
	width: 36px;
	height: 36px;
}

.tr-ds-lt__ten
{
	font-size: 13px;
	font-weight: 800;
	line-height: 1.3;
	text-transform: uppercase;
	color: var(--tr-navy);
	min-height: 2.6em;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* ---------- Khung chính: bộ lọc trái + lưới ---------- */
.tr-ds-body
{
	display: block;
	margin-top: 24px;
}

.tr-ds-body--loc
{
	display: grid;
	grid-template-columns: 260px minmax(0, 1fr);
	gap: 24px;
	align-items: start;
}

/* Bộ lọc: desktop là cột trái cố định, mobile là drawer */
.tr-ds-loc.tr-drawer
{
	position: static;
	visibility: visible;
	z-index: auto;
}

.tr-ds-loc .tr-drawer__bg,
.tr-ds-loc .tr-drawer__head
{
	display: none;
}

.tr-ds-loc .tr-drawer__panel
{
	position: static;
	width: auto;
	transform: none;
	transition: none;
	overflow: visible;
	background: #fff;
	border: 1px solid var(--tr-line);
	border-radius: var(--tr-radius);
	box-shadow: var(--tr-shadow);
}

.tr-ds-form
{
	padding: 4px 16px 16px;
}

.tr-ds-nhom
{
	padding: 14px 0;
	border-bottom: 1px solid var(--tr-line);
}

.tr-body .tr-ds-nhom__title
{
	margin-bottom: 10px;
	font-size: 14px;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: .02em;
	color: var(--tr-navy);
}

.tr-ds-dm
{
	margin: 0;
	padding: 0;
	list-style: none;
}

.tr-ds-dm a
{
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	min-height: 36px;
	padding: 6px 8px;
	border-radius: 6px;
	font-size: 15px;
	color: var(--tr-text);
}

.tr-ds-dm a .tr-i
{
	width: 16px;
	height: 16px;
	color: var(--tr-muted);
}

.tr-body .tr-ds-dm a:hover
{
	background: var(--tr-bg-soft);
	color: var(--tr-navy);
}

.tr-body .tr-ds-dm a.is-active
{
	background: var(--tr-blue-50);
	color: var(--tr-navy);
	font-weight: 700;
}

/* Checkbox/radio tùy biến */
.tr-ds-chk
{
	margin: 0;
	padding: 0;
	list-style: none;
}

.tr-ds-chk li.is-an
{
	display: none;
}

.tr-ds-chk.is-mo li.is-an
{
	display: block;
}

.tr-ds-chk label
{
	position: relative;
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 34px;
	font-size: 15px;
	cursor: pointer;
}

.tr-ds-chk input
{
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
}

.tr-ds-chk__box
{
	position: relative;
	flex: none;
	width: 18px;
	height: 18px;
	border: 1.5px solid #A9B5C6;
	border-radius: 4px;
	background: #fff;
	transition: background .15s, border-color .15s;
}

.tr-ds-chk--radio .tr-ds-chk__box
{
	border-radius: 50%;
}

.tr-ds-chk input:checked + .tr-ds-chk__box
{
	background: var(--tr-navy);
	border-color: var(--tr-navy);
}

.tr-ds-chk input:checked + .tr-ds-chk__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);
}

.tr-ds-chk--radio input:checked + .tr-ds-chk__box::after
{
	left: 4px;
	top: 4px;
	width: 7px;
	height: 7px;
	border: 0;
	border-radius: 50%;
	background: #fff;
	transform: none;
}

.tr-ds-chk input:focus-visible + .tr-ds-chk__box
{
	outline: 2px solid var(--tr-blue);
	outline-offset: 2px;
}

.tr-ds-chk__ten
{
	flex: 1;
	min-width: 0;
}

.tr-ds-chk__so
{
	font-size: 13px;
	color: var(--tr-muted);
}

.tr-ds-mau
{
	flex: none;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	border: 1px solid rgba(7, 29, 73, .2);
}

/* Size dạng ô chọn */
.tr-ds-size
{
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.tr-ds-size label
{
	position: relative;
	cursor: pointer;
}

.tr-ds-size input
{
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
}

.tr-ds-size span
{
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	height: 36px;
	padding: 0 10px;
	border: 1px solid var(--tr-line);
	border-radius: 6px;
	font-size: 14px;
	font-weight: 600;
	background: #fff;
	transition: border-color .15s, background .15s, color .15s;
}

.tr-ds-size input:checked + span
{
	border-color: var(--tr-navy);
	background: var(--tr-navy);
	color: #fff;
}

.tr-ds-size input:focus-visible + span
{
	outline: 2px solid var(--tr-blue);
	outline-offset: 2px;
}

/* Khoảng giá tự nhập */
.tr-ds-gia
{
	display: flex;
	align-items: center;
	gap: 8px;
	margin-top: 10px;
	color: var(--tr-muted);
}

.tr-ds-gia .tr-input
{
	height: 40px;
	padding: 0 10px;
	font-size: 14px;
	min-width: 0;
}

.tr-ds-gia__btn
{
	margin-top: 10px;
}

.tr-ds-more
{
	margin-top: 4px;
	padding: 4px 0;
	border: 0;
	background: none;
	font-size: 14px;
	font-weight: 600;
	color: var(--tr-blue);
	cursor: pointer;
}

.tr-ds-form__act
{
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
	padding-top: 16px;
}

/* ---------- Đầu lưới: tiêu đề, đếm, sắp xếp, kiểu xem ---------- */
.tr-ds-head
{
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 16px;
}

.tr-body .tr-ds-title
{
	font-size: 26px;
	font-weight: 800;
	line-height: 1.2;
	text-transform: uppercase;
	color: var(--tr-navy);
}

.tr-body .tr-ds-count
{
	margin-top: 4px;
	font-size: 14px;
	color: var(--tr-muted);
}

.tr-ds-tools
{
	display: flex;
	align-items: center;
	gap: 10px;
	flex: none;
}

.tr-ds-btn-loc
{
	display: none;
	text-transform: none;
	letter-spacing: 0;
	font-size: 14px;
}

.tr-ds-btn-loc__so
{
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 20px;
	height: 20px;
	padding: 0 6px;
	border-radius: 10px;
	background: var(--tr-red);
	color: #fff;
	font-size: 12px;
}

.tr-ds-sort
{
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	color: var(--tr-muted);
}

.tr-ds-sort .tr-select
{
	width: 170px;
	height: 40px;
	padding: 0 32px 0 12px;
	font-size: 14px;
	color: var(--tr-text);
	-webkit-appearance: none;
	appearance: none;
	background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23071D49' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center / 16px 16px;
	cursor: pointer;
}

.tr-ds-view
{
	display: flex;
	gap: 6px;
}

.tr-ds-view__btn
{
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border: 1px solid var(--tr-line);
	border-radius: var(--tr-radius-sm);
	background: #fff;
	color: var(--tr-muted);
	cursor: pointer;
	transition: background .15s, color .15s, border-color .15s;
}

.tr-ds-view__btn.is-active
{
	background: var(--tr-navy);
	border-color: var(--tr-navy);
	color: #fff;
}

/* Chip bộ lọc đang chọn */
.tr-ds-chips
{
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 0 16px;
	padding: 0;
	list-style: none;
}

.tr-ds-chips a
{
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 32px;
	padding: 0 10px 0 12px;
	border: 1px solid var(--tr-line);
	border-radius: 16px;
	background: var(--tr-bg-soft);
	font-size: 13px;
	font-weight: 600;
	color: var(--tr-navy);
}

.tr-ds-chips a .tr-i
{
	width: 14px;
	height: 14px;
}

.tr-body .tr-ds-chips a:hover
{
	border-color: var(--tr-navy);
}

.tr-body .tr-ds-chips .tr-ds-chips__xoa
{
	border-color: transparent;
	background: none;
	color: var(--tr-red);
}

/* ---------- Lưới sản phẩm + nhãn bán chạy ---------- */
.tr-ds-item
{
	position: relative;
	min-width: 0;
}

.tr-ds-hot
{
	position: absolute;
	top: 12px;
	left: 12px;
	z-index: 3;
	pointer-events: none;
	transition: transform .25s ease;
}

.tr-ds-hot--duoi
{
	top: 36px;
}

.tr-ds-item:hover .tr-ds-hot,
.tr-ds-item:focus-within .tr-ds-hot
{
	transform: translateY(-6px);
}

/* Dạng danh sách */
.tr-ds-grid.is-list
{
	grid-template-columns: minmax(0, 1fr);
}

.tr-ds-grid.is-list .tr-sp
{
	flex-direction: row;
	align-items: stretch;
	gap: 20px;
}

.tr-ds-grid.is-list .tr-sp__img
{
	flex: none;
	width: 180px;
}

.tr-ds-grid.is-list .tr-sp__body
{
	padding-top: 4px;
}

.tr-ds-grid.is-list .tr-sp__name
{
	font-size: 18px;
	min-height: 0;
}

.tr-ds-empty
{
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
}

.tr-ds-empty .tr-i
{
	width: 40px;
	height: 40px;
}

/* ---------- Khối chuyển môn ---------- */
.tr-ds-cm
{
	display: grid;
	grid-template-columns: 1fr 1fr;
	margin-top: 40px;
	border: 1px solid var(--tr-line);
	border-radius: var(--tr-radius);
	overflow: hidden;
	box-shadow: var(--tr-shadow);
}

.tr-ds-cm__item
{
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 14px;
	min-height: 72px;
	padding: 12px 16px;
	background: #fff;
	font-size: 18px;
	font-weight: 800;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: var(--tr-navy);
	transition: background .2s, color .2s;
}

.tr-ds-cm__item + .tr-ds-cm__item
{
	border-left: 1px solid var(--tr-line);
}

.tr-body .tr-ds-cm__item:hover
{
	background: var(--tr-blue-50);
	color: var(--tr-navy);
}

.tr-body .tr-ds-cm__item.is-active
{
	background: var(--tr-navy);
	color: #fff;
}

.tr-ds-cm__ic
{
	width: 34px;
	height: 34px;
	flex: none;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.6;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.tr-ds-commit
{
	margin: 24px 0 48px;
}

/* ---------- Responsive ---------- */
@media (max-width: 1199px)
{
	.tr-ds-body--loc
	{
		grid-template-columns: 230px minmax(0, 1fr);
	}

	.tr-ds-lt__list
	{
		grid-auto-columns: calc((100% - 4 * 12px) / 5);
	}
}

@media (max-width: 991px)
{
	/* Bộ lọc thành drawer trên tablet/mobile */
	.tr-ds-body--loc
	{
		display: block;
	}

	.tr-ds-loc.tr-drawer
	{
		position: fixed;
		inset: 0;
		z-index: 200;
		visibility: hidden;
	}

	.tr-ds-loc.tr-drawer.is-open
	{
		visibility: visible;
	}

	.tr-ds-loc .tr-drawer__bg
	{
		display: block;
	}

	.tr-ds-loc .tr-drawer__head
	{
		display: flex;
	}

	.tr-ds-loc .tr-drawer__panel
	{
		position: absolute;
		top: 0;
		bottom: 0;
		left: 0;
		width: min(88vw, 360px);
		border: 0;
		border-radius: 0;
		overflow-y: auto;
		transform: translateX(-100%);
		transition: transform .25s;
	}

	.tr-ds-loc.is-open .tr-drawer__panel
	{
		transform: none;
	}

	.tr-ds-form
	{
		padding-bottom: 0;
	}

	.tr-ds-form__act
	{
		position: sticky;
		bottom: 0;
		margin: 0 -16px;
		padding: 12px 16px;
		background: #fff;
		border-top: 1px solid var(--tr-line);
	}

	.tr-ds-btn-loc
	{
		display: inline-flex;
	}

	.tr-ds-lt__list
	{
		grid-auto-columns: calc((100% - 3 * 12px) / 4);
	}
}

@media (max-width: 767px)
{
	.tr-ds-banner
	{
		height: 116px;
		padding: 0 20px;
	}

	.tr-body .tr-ds-banner__title
	{
		font-size: 24px;
	}

	.tr-body .tr-ds-banner__desc
	{
		font-size: 13px;
	}

	.tr-ds-lt__list
	{
		grid-auto-columns: 30%;
		gap: 10px;
	}

	.tr-ds-lt__ten
	{
		font-size: 12px;
	}

	.tr-ds-body
	{
		margin-top: 16px;
	}

	.tr-ds-head
	{
		flex-direction: column;
		align-items: stretch;
		gap: 12px;
	}

	.tr-body .tr-ds-title
	{
		font-size: 20px;
	}

	.tr-ds-tools
	{
		gap: 8px;
	}

	.tr-ds-sort
	{
		flex: 1;
		min-width: 0;
	}

	.tr-ds-sort__label
	{
		display: none;
	}

	.tr-ds-sort .tr-select
	{
		width: 100%;
	}

	.tr-ds-hot
	{
		top: 8px;
		left: 8px;
	}

	.tr-ds-hot--duoi
	{
		top: 32px;
	}

	.tr-ds-grid.is-list .tr-sp
	{
		gap: 12px;
	}

	.tr-ds-grid.is-list .tr-sp__img
	{
		width: 120px;
	}

	.tr-ds-grid.is-list .tr-sp__name
	{
		font-size: 15px;
	}

	.tr-ds-cm
	{
		margin-top: 32px;
	}

	.tr-ds-cm__item
	{
		flex-direction: column;
		gap: 6px;
		min-height: 88px;
		font-size: 15px;
	}

	.tr-ds-commit
	{
		margin: 16px 0 32px;
	}

	.tr-ds-item:hover .tr-ds-hot,
	.tr-ds-item:focus-within .tr-ds-hot
	{
		transform: none;
	}
}
