/**
 * Tom Luxury — Section "Danh muc san pham" (.tl-cats)
 * -----------------------------------------------------------------------------
 * The CAO (mac dinh 4:5), anh phu kin, gradient toi tu duoi len.
 * Goc duoi trai: o vuong vien vang chua bieu tuong, ten danh muc in hoa serif,
 * duoi cung la dong "Xem bo suu tap" kem mui ten truot khi hover.
 *
 * Chi dung design token, khong dung !important.
 * -----------------------------------------------------------------------------
 */

/* =============================================================================
 * 1. KHUNG SECTION
 * ========================================================================== */
.tl-cats--bg-none {
	background-color: transparent;
}

.tl-cats__grid {
	align-items: stretch;
}

/* It the thi thu be luoi lai cho can doi, tranh the qua rong */
.tl-cats--count-1 .tl-cats__grid {
	max-width: 400px;
	margin-inline: auto;
}

.tl-cats--count-2 .tl-cats__grid {
	max-width: 800px;
	margin-inline: auto;
}

.tl-cats--count-3 .tl-cats__grid {
	max-width: var(--container-md);
	margin-inline: auto;
}

/* =============================================================================
 * 2. THE DANH MUC
 * ========================================================================== */
/* Xep chong bang grid (KHONG dung position:absolute cho phan noi dung):
   nho vay .tl-cat__body van la phan tu tinh, va lien ket phu kin the
   (.tl-cat__link::after) lay dung .tl-cat lam khoi chua. */
.tl-cat {
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	min-width: 0;
	height: 100%;
	margin: 0;
	background-color: var(--color-primary);
	border-radius: var(--radius-md);
	overflow: hidden;
	isolation: isolate;
	transition: box-shadow var(--dur) var(--ease),
		transform var(--dur) var(--ease);
}

.tl-cat__media,
.tl-cat__body {
	grid-column: 1;
	grid-row: 1;
}

.tl-cat:hover,
.tl-cat:focus-within {
	box-shadow: var(--shadow-lift);
	transform: translateY(-4px);
}

/* --- 2.1 Anh phu kin + lop phu toi ---------------------------------------- */
/* z-index am: anh + lop phu nam duoi phan chu, nhung van trong pham vi the
   (the da tao stacking context bang isolation: isolate). */
.tl-cat__media {
	z-index: -1;
	width: 100%;
	background-color: var(--color-secondary);
	border-radius: inherit;
}

.tl-cat__media > img {
	transition: transform var(--dur-slow) var(--ease-out);
}

.tl-cat:hover .tl-cat__media > img,
.tl-cat:focus-within .tl-cat__media > img {
	transform: scale(1.06);
}

/* Lop phu bao dam chu trang van du tuong phan tren anh sang mau */
.tl-cat__media::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	background-image: linear-gradient(to top,
		var(--color-primary) 0%,
		var(--color-overlay) 48%,
		var(--color-overlay-soft) 68%,
		transparent 92%);
	pointer-events: none;
}

/* --- 2.2 Noi dung goc duoi trai ------------------------------------------ */
.tl-cat__body {
	align-self: end;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: var(--space-2xs);
	padding: var(--space-md);
	color: var(--color-on-dark);
	text-shadow: 0 1px 10px var(--color-overlay);
}

/* span la inline: bat buoc dat flex cho wrapper icon, neu khong SVG se phinh */
.tl-cat__badge {
	display: inline-flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	margin-bottom: var(--space-3xs);
	background-color: var(--color-overlay-soft);
	border: var(--rule-w) solid var(--color-gold-line);
	border-radius: var(--radius-sm);
	color: var(--color-gold-light);
	transition: background-color var(--dur-fast) var(--ease),
		border-color var(--dur-fast) var(--ease),
		color var(--dur-fast) var(--ease);
}

.tl-cat__badge > svg {
	display: block;
	width: 18px;
	height: 18px;
}

.tl-cat:hover .tl-cat__badge,
.tl-cat:focus-within .tl-cat__badge {
	background-color: var(--color-gold-soft);
	border-color: var(--color-luxury-gold);
	color: var(--color-gold-light);
}

.tl-cat__title {
	margin: 0;
	font-family: var(--font-heading);
	font-size: var(--font-size-xl);
	font-weight: var(--weight-medium);
	line-height: var(--leading-snug);
	letter-spacing: var(--tracking-wide);
	text-transform: uppercase;
	color: var(--color-on-dark);
	overflow-wrap: break-word;
}

.tl-cat__link {
	color: inherit;
}

/* Lien ket phu kin the — van giu mot the <a> that su cho ban phim */
.tl-cat__link::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
}

.tl-cat__link:hover,
.tl-cat__link:focus-visible {
	color: var(--color-gold-light);
}

.tl-cat__link:focus-visible {
	outline: none;
}

.tl-cat__link:focus-visible::after {
	outline: var(--focus-w) solid var(--color-gold-light);
	outline-offset: calc(var(--focus-offset) * -1);
	border-radius: var(--radius-md);
}

.tl-cat__count,
.tl-cat__desc {
	margin: 0;
	font-family: var(--font-body);
	font-size: var(--font-size-sm);
	line-height: var(--leading-snug);
	color: var(--color-on-dark-muted);
}

.tl-cat__count {
	font-size: var(--font-size-xs);
	letter-spacing: var(--tracking-wide);
	text-transform: uppercase;
}

.tl-cat__desc {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	overflow: hidden;
}

/* --- 2.3 Dong "Xem bo suu tap" + mui ten --------------------------------- */
.tl-cat__cta {
	display: inline-flex;
	align-items: center;
	gap: var(--space-2xs);
	margin-top: var(--space-3xs);
	font-family: var(--font-body);
	font-size: var(--font-size-xs);
	font-weight: var(--weight-semibold);
	letter-spacing: var(--tracking-wide);
	text-transform: uppercase;
	color: var(--color-gold-light);
	transition: color var(--dur-fast) var(--ease);
}

.tl-cat__cta::after {
	content: "";
	flex: none;
	width: 18px;
	height: 9px;
	background-color: currentColor;
	clip-path: polygon(
		0 calc(50% - .75px),
		calc(100% - 6px) calc(50% - .75px),
		calc(100% - 6px) 0,
		100% 50%,
		calc(100% - 6px) 100%,
		calc(100% - 6px) calc(50% + .75px),
		0 calc(50% + .75px)
	);
	transition: translate var(--dur-fast) var(--ease);
}

.tl-cat:hover .tl-cat__cta::after,
.tl-cat:focus-within .tl-cat__cta::after {
	translate: 5px 0;
}

/* =============================================================================
 * 3. NEN NAU DEN — the can vien mo de tach khoi nen
 * ========================================================================== */
.tl-section--dark .tl-cat {
	border: var(--rule-w) solid var(--color-border-dark);
}

/* =============================================================================
 * 4. RESPONSIVE
 *    1920 / 1440 / 1366 / 1024 / 820 / 768 / 430 / 390 / 360
 * ========================================================================== */

/* --- Man hinh rat rong: noi dung the thoang hon ------------------------- */
@media (min-width: 1600px) {

	.tl-cat__body {
		padding: var(--space-lg);
	}

	.tl-cat__title {
		font-size: var(--font-size-2xl);
	}
}

/* --- 1366 va nho hon: giu chu tieu de vua khung ------------------------- */
@media (max-width: 1366px) {

	.tl-cat__title {
		font-size: var(--font-size-lg);
	}
}

/* --- May tinh bang ------------------------------------------------------ */
@media (max-width: 1024px) {

	.tl-cat__body {
		padding: var(--space-sm);
		gap: var(--space-3xs);
	}

	.tl-cat__badge {
		width: 34px;
		height: 34px;
	}

	.tl-cats--count-2 .tl-cats__grid {
		max-width: none;
	}
}

/* --- 820 / 768: tablet doc --------------------------------------------- */
@media (max-width: 820px) {

	.tl-cat__title {
		font-size: var(--font-size-base);
		letter-spacing: var(--tracking-tight);
	}

	.tl-cat__desc {
		-webkit-line-clamp: 2;
		line-clamp: 2;
		font-size: var(--font-size-xs);
	}
}

/* --- Dien thoai --------------------------------------------------------- */
@media (max-width: 640px) {

	.tl-cats--count-1 .tl-cats__grid {
		max-width: none;
	}

	.tl-cat {
		border-radius: var(--radius-sm);
	}

	.tl-cat__body {
		padding: var(--space-sm);
		gap: var(--space-2xs);
	}

	.tl-cat__title {
		font-size: var(--font-size-lg);
	}

	.tl-cat__badge {
		width: 36px;
		height: 36px;
	}
}

/* --- 430 / 390 ---------------------------------------------------------- */
@media (max-width: 430px) {

	.tl-cat__title {
		font-size: var(--font-size-base);
	}

	.tl-cat__desc {
		display: none;
	}
}

/* --- 360 ---------------------------------------------------------------- */
@media (max-width: 360px) {

	.tl-cat__body {
		padding: var(--space-xs);
	}

	.tl-cat__badge {
		width: 32px;
		height: 32px;
		margin-bottom: 0;
	}

	.tl-cat__badge > svg {
		width: 16px;
		height: 16px;
	}
}
