/**
 * DS Elements — Bảng chất liệu
 *
 * Thẻ chỉ để xem, không bấm được: dùng <li> chứ không phải <a>, và không có
 * trạng thái hover kiểu "bấm được" để khỏi mời gọi nhầm.
 */

.elementor-widget-ds-material-cards {
	width: 100%;
	min-width: 0;
}

.ds-mc {
	width: 100%;
	min-width: 0;

	--ds-mc-cols: 5;
	--ds-mc-ratio: 1.35;
}

.ds-mc *,
.ds-mc *::before,
.ds-mc *::after {
	box-sizing: border-box;
}

/* Hàng tiêu đề: tên cụm bên trái, link phụ dạt phải. */
.ds-mc__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--ds-space-4);
	margin-bottom: var(--ds-mc-head-gap, var(--ds-space-6));
}

.ds-mc__heading {
	margin: 0;
	color: var(--ds-mc-heading-color, var(--ds-color-brand));
	font-size: var(--ds-mc-heading-fs, var(--ds-fs-h4));
	font-weight: var(--ds-fw-bold);
	line-height: var(--ds-lh-h4);
	text-transform: uppercase;
	letter-spacing: var(--ds-ls-nav);
}

.ds-mc__more {
	flex: 0 0 auto;
	color: var(--ds-mc-more-color, var(--ds-color-brand-light));
	font-size: var(--ds-fs-small);
	line-height: var(--ds-lh-small);
	text-decoration: none;
	white-space: nowrap;
}

.ds-mc__more:hover {
	text-decoration: underline;
}

@media (max-width: 767px) {
	.ds-mc__head {
		flex-direction: column;
		align-items: flex-start;
		gap: var(--ds-space-2);
	}
}

.ds-mc__grid {
	margin: 0;
	padding: 0;
	list-style: none;

	display: grid;
	grid-template-columns: repeat(var(--ds-mc-cols), minmax(0, 1fr));
	gap: var(--ds-mc-gap, var(--ds-space-4));
}

.ds-mc__card {
	display: flex;
	flex-direction: column;
	min-width: 0;
	overflow: hidden;

	background: var(--ds-color-white);
	border: 1px solid var(--ds-mc-border, var(--ds-color-border));
	border-radius: var(--ds-mc-radius, var(--ds-radius-md));
}

.ds-mc__media {
	display: block;
	background: var(--ds-color-surface);
}

/* Tỉ lệ đặt thẳng lên <img>, KHÔNG đặt trên khung bọc. aspect-ratio trên khung
   chỉ là kích thước "ưu tiên": img height:100% của khung height:auto rơi về
   chiều cao tự nhiên, và ảnh dọc hơn tỉ lệ (ảnh vải 3:4 = .75 < .82) đẩy khung
   cao theo — đo được 179×239 thay vì 179×218 ở màn 1920, cột chất liệu dài hơn
   cột combo 38px. Placeholder ngang nên trước đây không lộ. Giống .ds-cbc__media img. */
.ds-mc__media img {
	width: 100%;
	height: auto; /* thuộc tính height của <img> WordPress thắng aspect-ratio nếu thiếu dòng này */
	display: block;
	aspect-ratio: var(--ds-mc-ratio);
	object-fit: cover;
}

.ds-mc__body {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: var(--ds-space-3);
	min-width: 0;
}

.ds-mc__title {
	color: var(--ds-mc-title-color, var(--ds-color-brand));
	font-size: var(--ds-fs-small);
	font-weight: var(--ds-fw-bold);
	line-height: var(--ds-lh-tight);
}

.ds-mc__subtitle {
	color: var(--ds-mc-subtitle-color, var(--ds-color-muted));
	font-size: var(--ds-fs-topbar);
	line-height: var(--ds-lh-small);
}

@media (max-width: 767px) {
	.ds-mc {
		--ds-mc-gap: var(--ds-space-3);
	}
}

/* Nằm trong cột ds-grow đã giãn hết hàng (cột combo bên cạnh ẩn vì ngành chưa
   có combo) thì bày 6 thẻ MỘT hàng. Giữ 3 cột ở bề rộng 1200 thì thẻ ra
   389×554, cả hàng cao 1236px (đo /nganh/tra-sua/ 19/09). Chỉ bám .ds-grow —
   widget này còn dùng ở trang danh mục (368) với số cột riêng. */
@container (min-width: 900px) {
	.ds-grow .ds-mc__grid {
		grid-template-columns: repeat(6, minmax(0, 1fr));
	}
}
