/**
 * Trang chủ kiểu sàn TMĐT — inc/home-market.php
 */

/* Trang chủ đã có ô tìm kiếm lớn → ẩn ô tìm kiếm trên header */
body.smt-market-home #masthead .header-search-form {
	display: none;
}

.smt-market {
	--mk-navy: #0b2550;
	--mk-blue: #1e73be;
	--mk-accent: #26b4e9;
	--mk-text: #1f2a44;
	--mk-muted: #5b6475;
	--mk-border: #e3e8f0;
	--mk-soft: #f3f7fc;
}

/* Hero tìm kiếm (nền nhạt) */
.smt-market-hero {
	margin: 0 0 8px;
	padding: 46px 16px 34px;
	background:
		radial-gradient(60% 120% at 0% 0%, rgba(38, 180, 233, 0.12) 0%, transparent 60%),
		radial-gradient(60% 120% at 100% 100%, rgba(124, 92, 255, 0.08) 0%, transparent 60%),
		var(--mk-soft);
	border-bottom: 1px solid var(--mk-border);
}

.smt-market-hero__inner {
	max-width: 860px;
	margin: 0 auto;
	text-align: center;
}

.smt-market-hero__title {
	margin: 0 0 20px;
	font-size: 28px;
	line-height: 1.25;
	color: var(--mk-navy);
}

.smt-market-search {
	display: flex;
	align-items: stretch;
	margin: 0;
	padding: 5px;
	border: 2px solid var(--mk-blue);
	border-radius: 999px;
	background: #fff;
	box-shadow: 0 10px 28px rgba(30, 115, 190, 0.14);
}

.smt-market .smt-market-search__input {
	flex: 1 1 auto;
	min-width: 0;
	height: 50px;
	margin: 0;
	padding: 0 20px;
	border: 0;
	border-radius: 999px;
	box-shadow: none;
	background: transparent;
	font-size: 16px;
	color: var(--mk-text);
}

.smt-market .smt-market-search__input:focus {
	box-shadow: none;
	outline: none;
}

.smt-market-search__btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 0 26px;
	border: 0;
	border-radius: 999px;
	background: linear-gradient(135deg, #2fc0f0 0%, #1e73be 100%);
	color: #fff;
	font-size: 16px;
	font-weight: 700;
	cursor: pointer;
}

.smt-market-search__btn:hover {
	filter: brightness(1.06);
}

.smt-market-hero__hints {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	margin: 16px 0 0;
	font-size: 14px;
}

.smt-market-hero__hints-k {
	padding: 6px 2px;
	color: var(--mk-muted);
}

.smt-market-hero__hints a {
	padding: 6px 14px;
	border: 1px solid var(--mk-border);
	border-radius: 999px;
	background: #fff;
	color: var(--mk-text);
	transition: border-color 0.2s, color 0.2s;
}

.smt-market-hero__hints a:hover {
	border-color: var(--mk-accent);
	color: var(--mk-blue);
}

/* Khối sản phẩm theo dòng */
.smt-market-rows {
	max-width: 1320px;
	margin: 0 auto;
	padding: 10px 15px 20px;
}

.smt-mrow {
	position: relative;
	margin: 26px 0 0;
}

.smt-mrow__head {
	display: flex;
	align-items: baseline;
	gap: 12px;
	margin: 0 0 12px;
}

.smt-mrow__title {
	margin: 0;
	font-size: 22px;
	line-height: 1.25;
	color: var(--mk-navy);
}

.smt-mrow__count {
	font-size: 13px;
	color: var(--mk-muted);
}

.smt-mrow__all {
	margin-left: auto;
	font-size: 14px;
	font-weight: 700;
	color: var(--mk-blue);
	white-space: nowrap;
}

.smt-mrow__track {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: calc((100% - 4 * 16px) / 5);
	gap: 16px;
	margin: 0;
	padding: 4px 2px 12px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: thin;
}

.smt-mrow__track > * {
	scroll-snap-align: start;
	width: auto !important;
	max-width: none !important;
	margin: 0 !important;
	padding: 0 !important;
	flex: none !important;
}

.smt-mrow__nav {
	position: absolute;
	top: 46%;
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	margin: 0;
	padding: 0;
	border: 1px solid var(--mk-border);
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 6px 18px rgba(11, 37, 80, 0.15);
	color: var(--mk-navy);
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	transition: opacity 0.2s;
}

.smt-mrow__nav--prev {
	left: -12px;
}

.smt-mrow__nav--next {
	right: -12px;
}

.smt-mrow.at-start .smt-mrow__nav--prev,
.smt-mrow.at-end .smt-mrow__nav--next {
	opacity: 0;
	pointer-events: none;
}

@media (max-width: 1099px) {
	.smt-mrow__track {
		grid-auto-columns: calc((100% - 3 * 14px) / 4);
		gap: 14px;
	}
}

@media (max-width: 849px) {
	.smt-market-hero {
		padding: 30px 14px 24px;
	}

	.smt-market-hero__title {
		font-size: 22px;
	}

	.smt-mrow__track {
		grid-auto-columns: calc((100% - 2 * 12px) / 2.6);
		gap: 12px;
	}

	.smt-mrow__nav {
		display: none;
	}
}

@media (max-width: 549px) {
	.smt-market-search__btn span {
		display: none;
	}

	.smt-market-search__btn {
		padding: 0 18px;
	}

	.smt-market .smt-market-search__input {
		height: 44px;
		padding: 0 14px;
		font-size: 15px;
	}

	.smt-mrow__title {
		font-size: 18px;
	}

	.smt-mrow__track {
		grid-auto-columns: 46%;
	}
}

.smt-market-search__btn {
	white-space: nowrap;
	text-transform: none;
	letter-spacing: 0;
}

.smt-mrow__count {
	white-space: nowrap;
}

/* ===== Banner 595×195 (inc/home-shop.php) ===== */
.smt-hbanners {
	position: relative;
	max-width: 1320px;
	margin: 22px auto 0;
	padding: 0 15px;
}

.smt-hbanners__track {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: calc((100% - 16px) / 2);
	gap: 16px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
}

.smt-hbanners__track::-webkit-scrollbar {
	display: none;
}

.smt-hbanners__item {
	display: block;
	scroll-snap-align: start;
	border-radius: 14px;
	overflow: hidden;
	aspect-ratio: 595 / 195;
	background: #e9eef6;
	box-shadow: 0 6px 18px rgba(11, 37, 80, 0.1);
}

.smt-hbanners__item img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.4s ease;
}

.smt-hbanners__item:hover img {
	transform: scale(1.02);
}

.smt-hbanners__nav {
	position: absolute;
	top: 50%;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	margin: -21px 0 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.92);
	box-shadow: 0 6px 18px rgba(11, 37, 80, 0.2);
	color: #0b2550;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
}

.smt-hbanners__nav--prev {
	left: 30px;
}

.smt-hbanners__nav--next {
	right: 30px;
}

/* ===== Lọc + sắp xếp + lưới ===== */
.smt-hshop {
	max-width: 1320px;
	margin: 20px auto 0;
	padding: 22px 24px 26px;
	border-radius: 16px;
	background: #fff;
	box-shadow: 0 2px 10px rgba(11, 37, 80, 0.05);
}

.smt-hshop__filters {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
}

.smt-hshop__filter {
	position: relative;
}

.smt-hshop__filter-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 52px;
	margin: 0;
	padding: 0 18px;
	border: 1px solid #d5dce7;
	border-radius: 10px;
	background: #fff;
	color: #1f2a44;
	font-size: 16px;
	font-weight: 500;
	text-transform: none;
	letter-spacing: 0;
	cursor: pointer;
}

.smt-hshop__filter-btn.is-active,
.smt-hshop__filter-btn[aria-expanded="true"] {
	border-color: #1e73be;
	color: #1e73be;
}

.smt-hshop__filter-panel {
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	z-index: 20;
	display: grid;
	grid-template-columns: repeat(2, minmax(200px, 1fr));
	gap: 2px 10px;
	width: max-content;
	max-width: 92vw;
	padding: 12px;
	border: 1px solid #e3e8f0;
	border-radius: 12px;
	background: #fff;
	box-shadow: 0 16px 36px rgba(11, 37, 80, 0.16);
}

.smt-hshop__filter-panel[hidden] {
	display: none;
}

.smt-hshop__filter-panel a {
	display: flex;
	justify-content: space-between;
	gap: 10px;
	padding: 8px 10px;
	border-radius: 8px;
	color: #1f2a44;
	font-size: 14px;
}

.smt-hshop__filter-panel a small {
	color: #9aa3b2;
}

.smt-hshop__filter-panel a:hover,
.smt-hshop__filter-panel a.is-active {
	background: #f1f6fc;
	color: #1e73be;
}

.smt-hshop__brand {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 52px;
	padding: 0 16px;
	border: 1px solid transparent;
	border-radius: 10px;
	background: #f1f4f9;
	transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s;
}

.smt-hshop__brand img {
	display: block;
	width: auto;
	height: 28px;
	mix-blend-mode: multiply;
}

.smt-hshop__brand:hover {
	background: #e8eef7;
}

.smt-hshop__brand.is-active {
	border-color: #1e73be;
	background: #fff;
	box-shadow: 0 0 0 3px rgba(30, 115, 190, 0.14);
}

.smt-hshop__sort {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 4px;
	margin: 22px 0 18px;
	font-size: 16px;
}

.smt-hshop__sort-k {
	margin-right: 14px;
	color: #1f2a44;
}

.smt-hshop__sort-item {
	position: relative;
	padding: 4px 12px;
	color: #5b6475;
}

.smt-hshop__sort-item + .smt-hshop__sort-item::before {
	content: "";
	position: absolute;
	left: -4px;
	top: 50%;
	width: 5px;
	height: 5px;
	margin-top: -2px;
	border-radius: 50%;
	background: #d5dce7;
}

.smt-hshop__sort-item:hover,
.smt-hshop__sort-item.is-active {
	color: #1e73be;
}

.smt-hshop__sort-item.is-active {
	font-weight: 600;
}

.smt-hshop__total {
	margin-left: auto;
	font-size: 14px;
	color: #9aa3b2;
}

.smt-hshop__grid {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: 16px;
	margin: 0;
}

.smt-hshop__grid > * {
	width: auto !important;
	max-width: none !important;
	margin: 0 !important;
	padding: 0 !important;
	flex: none !important;
}

.smt-hshop__more {
	margin: 22px 0 0;
	text-align: center;
}

.smt-hshop__more .button {
	margin: 0;
	padding: 0 34px;
	border: 1px solid #1e73be;
	border-radius: 999px;
	background: #fff;
	color: #1e73be;
	text-transform: none;
	letter-spacing: 0;
}

.smt-hshop__empty {
	padding: 40px 0;
	text-align: center;
	color: #5b6475;
}

@media (max-width: 1099px) {
	.smt-hshop__grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

@media (max-width: 849px) {
	.smt-hbanners__track {
		grid-auto-columns: 88%;
		gap: 12px;
	}

	.smt-hbanners__nav {
		display: none;
	}

	.smt-hshop {
		margin: 16px 10px 0;
		padding: 16px 12px 20px;
	}

	.smt-hshop__filters {
		flex-wrap: nowrap;
		overflow-x: auto;
		scrollbar-width: none;
	}

	.smt-hshop__filter-btn,
	.smt-hshop__brand {
		flex: 0 0 auto;
		height: 44px;
	}

	.smt-hshop__brand img {
		height: 20px;
	}

	.smt-hshop__filter-panel {
		position: fixed;
		top: auto;
		bottom: 0;
		left: 0;
		right: 0;
		width: auto;
		max-width: none;
		max-height: 70vh;
		overflow-y: auto;
		grid-template-columns: 1fr;
		border-radius: 16px 16px 0 0;
	}

	.smt-hshop__sort {
		flex-wrap: nowrap;
		overflow-x: auto;
		white-space: nowrap;
		font-size: 14px;
		scrollbar-width: none;
	}

	.smt-hshop__total {
		display: none;
	}

	.smt-hshop__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 10px;
	}
}

/* Logo thương hiệu đối tác (Our Partners) sau 4 hãng JIT */
.smt-hshop__sep {
	width: 1px;
	height: 32px;
	margin: 0 4px;
	background: #dfe5ee;
}

.smt-hshop__brand--partner {
	padding: 0 14px;
	background: #fff;
	border-color: #e6ebf2;
}

.smt-hshop__brand--partner img {
	height: 24px;
	max-width: 120px;
	object-fit: contain;
}

/* Dòng 2: thương hiệu đối tác */
.smt-hshop__partners {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin: 12px 0 0;
}

.smt-hshop__partners-k {
	margin-right: 6px;
	font-size: 14px;
	color: #5b6475;
}

.smt-hshop__partners .smt-hshop__brand--partner {
	height: 42px;
	padding: 0 12px;
}

.smt-hshop__partners .smt-hshop__brand--partner img {
	height: 20px;
}

@media (max-width: 849px) {
	.smt-hshop__partners {
		flex-wrap: nowrap;
		overflow-x: auto;
		scrollbar-width: none;
	}

	.smt-hshop__partners > * {
		flex: 0 0 auto;
	}
}

/* ===== Màu nền trang chủ (27/10): nền xám xanh nhạt, các khối là thẻ trắng nổi lên — kiểu sàn TMĐT ===== */
body.smt-market-home,
body.smt-market-home #wrapper,
body.smt-market-home #main {
	background-color: #eef2f7;
}

.smt-market-hero {
	background:
		radial-gradient(55% 140% at 0% 0%, rgba(38, 180, 233, 0.22) 0%, transparent 62%),
		radial-gradient(50% 140% at 100% 100%, rgba(124, 92, 255, 0.14) 0%, transparent 62%),
		linear-gradient(180deg, #e6f0fb 0%, #eef2f7 100%);
	border-bottom: 0;
}

.smt-market-search {
	box-shadow: 0 14px 34px rgba(30, 115, 190, 0.18);
}

.smt-market-hero__hints a {
	border-color: #d9e3ef;
	box-shadow: 0 1px 2px rgba(11, 37, 80, 0.04);
}

.smt-hbanners__item {
	box-shadow: 0 8px 22px rgba(11, 37, 80, 0.12);
}

.smt-hshop {
	border: 1px solid #e2e8f1;
	box-shadow: 0 4px 18px rgba(11, 37, 80, 0.06);
}

.smt-hshop__brand {
	background: #f3f6fa;
}

.smt-hshop__brand--partner {
	background: #fff;
}

/* Khối sản phẩm theo dòng: mỗi dòng là một thẻ trắng */
.smt-market-rows {
	padding-top: 4px;
}

.smt-mrow {
	margin-top: 20px;
	padding: 18px 20px 8px;
	border: 1px solid #e2e8f1;
	border-radius: 16px;
	background: #fff;
	box-shadow: 0 4px 18px rgba(11, 37, 80, 0.05);
}

.smt-mrow__nav--prev {
	left: 6px;
}

.smt-mrow__nav--next {
	right: 6px;
}

@media (max-width: 849px) {
	.smt-mrow {
		margin: 14px 0 0;
		padding: 14px 12px 6px;
	}
}

/* Căn thẳng mép: banner, thẻ lọc và các thẻ dòng sản phẩm cùng chiều rộng (1320 − 2×15px lề) */
.smt-hshop {
	width: calc(100% - 30px);
	max-width: 1290px;
}

.smt-market-rows {
	max-width: 1320px;
	padding: 4px 15px 24px;
}

@media (max-width: 849px) {
	.smt-hbanners {
		padding: 0 10px;
	}

	.smt-hshop {
		width: calc(100% - 20px);
		margin: 16px auto 0;
	}

	.smt-market-rows {
		padding: 4px 10px 20px;
	}
}
