/**
 * Maithu Search — frontend autocomplete. Mọi selector scope dưới .mtsr-search (cài đa site, không break theme).
 * Không style element global, không !important.
 */
.mtsr-search {
	position: relative;
	width: 100%;
	max-width: 480px;
}
.mtsr-search,
.mtsr-search * {
	box-sizing: border-box;
}
.mtsr-search__form {
	display: flex;
	align-items: stretch;
	margin: 0;
}
.mtsr-search__input {
	flex: 1 1 auto;
	min-width: 0;
	padding: 10px 12px;
	border: 1px solid #ccc;
	border-radius: 4px 0 0 4px;
	font-size: 14px;
	line-height: 1.4;
	background: #fff;
	color: #222;
}
.mtsr-search__submit {
	flex: 0 0 auto;
	padding: 0 14px;
	border: 1px solid #ccc;
	border-left: 0;
	border-radius: 0 4px 4px 0;
	background: #f5f5f5;
	color: #333;
	font-size: 15px;
	line-height: 1;
	cursor: pointer;
}
.mtsr-search__dropdown {
	position: absolute;
	left: 0;
	right: 0;
	top: calc( 100% + 4px );
	z-index: 99999;
	max-height: 70vh;
	overflow-y: auto;
	padding: 4px;
	background: #fff;
	border: 1px solid #e2e2e2;
	border-radius: 6px;
	box-shadow: 0 6px 24px rgba( 0, 0, 0, 0.12 );
}
.mtsr-search__item {
	display: flex;
	gap: 10px;
	align-items: center;
	padding: 8px;
	border-radius: 4px;
	text-decoration: none;
	color: #222;
}
.mtsr-search__item:hover,
.mtsr-search__item:focus {
	background: #f3f6fb;
}
.mtsr-search__thumb {
	flex: 0 0 auto;
	width: 44px;
	height: 44px;
	object-fit: cover;
	border-radius: 4px;
	background: #f0f0f0;
}
.mtsr-search__thumb--ph {
	display: inline-block;
}
.mtsr-search__info {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}
.mtsr-search__name {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	font-size: 13px;
	line-height: 1.35;
	color: #222;
}
.mtsr-search__price {
	font-size: 13px;
	color: #c0392b;
}
.mtsr-search__price del {
	margin-right: 6px;
	color: #999;
	font-weight: 400;
}
.mtsr-search__stock--out {
	font-size: 11px;
	color: #999;
}
.mtsr-search__empty {
	padding: 14px;
	text-align: center;
	font-size: 13px;
	color: #888;
}

/* Attach mode: form search header của theme làm ngữ cảnh định vị cho .mtsr-search__dropdown. */
.mtsr-attached {
	position: relative;
}

/* Trang kết quả /?s= (layout C). Scope .mtsr-results*, không global. */
.mtsr-results {
	/* Bọc trong .container của theme → rộng + mép khớp logo/menu/footer site. max-width là fallback cho theme không có .container. */
	max-width: 1200px;
	margin: 0 auto;
}
/* Banner tiêu đề: tự render, đồng nhất mọi mode/theme. Nền = màu chủ đạo theme đè thêm lớp tối
   → xanh đậm hơn (không chói, không trùng màu nút menu) mà vẫn tự bám màu từng site. Fallback nếu thiếu var. */
.mtsr-results__header {
	background: linear-gradient( rgba( 0, 0, 0, .25 ), rgba( 0, 0, 0, .25 ) ), var(--fs-color-primary, #2c3e50);
	color: #fff;
	/* Nền full-bleed ra mép viewport, nội dung căn đúng content-box của .mtsr-results (cùng mép lưới body). */
	margin: 0 calc( 50% - 50vw ) 24px;
	padding: 28px calc( 50vw - 50% );
}
.mtsr-results__title {
	font-size: 26px;
	text-transform: uppercase;
	margin: 0 0 8px;
	color: #fff;
}
.mtsr-results__title span {
	color: #fff;
}
.mtsr-results__crumbs {
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: .02em;
	color: rgba(255, 255, 255, .8);
	margin: 0;
}
.mtsr-results__crumbs a {
	color: rgba(255, 255, 255, .85);
	text-decoration: none;
}
.mtsr-results__crumbs a:hover {
	color: #fff;
}
.mtsr-results__crumbs-sep {
	margin: 0 6px;
	opacity: .55;
}
.mtsr-results__heading {
	font-size: 18px;
	margin: 22px 0 12px;
	padding-bottom: 6px;
	border-bottom: 1px solid #eee;
}
.mtsr-results__pagination {
	margin: 16px 0;
	text-align: center;
}
.mtsr-results__posts {
	list-style: none;
	margin: 0;
	padding: 0;
}
.mtsr-results__post {
	margin: 0 0 4px;
}
.mtsr-results__post-link {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px;
	border-radius: 4px;
	text-decoration: none;
	color: #222;
}
.mtsr-results__post-link:hover {
	background: #f3f6fb;
}
.mtsr-results__post-thumb {
	width: 40px;
	height: 40px;
	object-fit: cover;
	border-radius: 4px;
}
.mtsr-results__empty {
	padding: 30px 0;
	text-align: center;
	color: #888;
}
/* Bài viết là section chính: lưới card 3 cột (thumbnail lớn + ngày + tiêu đề + trích đoạn). */
.mtsr-results__posts-grid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 28px 24px;
}
@media (max-width: 1024px) {
	.mtsr-results__posts-grid {
		grid-template-columns: repeat(3, 1fr);
	}
}
@media (max-width: 849px) {
	.mtsr-results__posts-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}
@media (max-width: 549px) {
	.mtsr-results__posts-grid {
		grid-template-columns: 1fr;
	}
}
.mtsr-results__pcard {
	display: flex;
	flex-direction: column;
}
.mtsr-results__pcard-thumb-link {
	display: block;
	margin: 0 0 12px;
}
.mtsr-results__pcard-thumb {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 10;
	object-fit: cover;
	border-radius: 8px;
}
.mtsr-results__pcard-thumb--empty {
	background: #eee;
}
.mtsr-results__pcard-body {
	flex: 1 1 auto;
}
.mtsr-results__pcard-meta {
	font-size: 12px;
	color: #999;
	margin: 0 0 6px;
}
.mtsr-results__pcard-title {
	font-size: 16px;
	line-height: 1.4;
	margin: 0 0 8px;
}
.mtsr-results__pcard-title a {
	color: #222;
	text-decoration: none;
}
.mtsr-results__pcard-title a:hover {
	color: #c0392b;
}
.mtsr-results__pcard-excerpt {
	font-size: 14px;
	line-height: 1.5;
	color: #555;
	margin: 0;
}
