/**
 * Shared search form + search page layout.
 */

.shop-search-form__row {
	display: flex !important;
	align-items: center !important;
	gap: 0.6rem !important;
	width: 100% !important;
}

.shop-search-form__row .shop-header-search__field {
	flex: 1 1 auto !important;
}

.shop-search-form__submit {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	min-height: 42px !important;
	min-width: 78px !important;
	padding: 0 1rem !important;
	border: 0 !important;
	border-radius: 8px !important;
	background: var(--color-button-primary-background, rgb(43, 73, 51)) !important;
	color: var(--color-secondary, #ffffff) !important;
	font-size: 14px !important;
	font-weight: 400 !important;
	line-height: 1 !important;
	white-space: nowrap !important;
	cursor: pointer !important;
}

.shop-search-form__submit:hover,
.shop-search-form__submit:focus {
	opacity: 0.92 !important;
	outline: none !important;
}

/* Search / archive main — không tràn quá viewport (kể cả Elementor) */
.site-main.shop-search-page {
	max-width: 100% !important;
	width: 100% !important;
	min-width: 0 !important;
	box-sizing: border-box !important;
}

.shop-search-page {
	padding: clamp(2rem, 4vw, 3.2rem) 1rem !important;
	overflow-x: clip !important;
	overflow-x: hidden !important;
	box-sizing: border-box !important;
}

@media (max-width: 1023px) {
	.site-main.shop-search-page {
		overflow-x: hidden !important;
		overflow-x: clip !important;
		/* 100vw gồm cả thanh cuộn — dùng 100% + min-width 0 để khớp khung cha */
		max-width: 100% !important;
	}

	.shop-search-page .shop-product-cards,
	.shop-search-page .shop-search-page__header,
	.shop-search-page .shop-search-page__results {
		max-width: 100% !important;
		min-width: 0 !important;
		box-sizing: border-box !important;
	}
}

.shop-archive-page {
	overflow-x: clip !important;
	overflow-x: hidden !important;
}

body.post-type-archive-product,
body.tax-product_cat,
body.tax-product_tag,
body.search.search-results {
	overflow-x: hidden !important;
}

.shop-search-page [style*="margin-inline-end: -"],
.shop-search-page [style*="margin-inline-end:-"],
.shop-search-page [style*="margin-inline-start: -"],
.shop-search-page [style*="margin-inline-start:-"],
.shop-search-page [style*="margin-right: -"],
.shop-search-page [style*="margin-right:-"],
.shop-search-page [style*="margin-left: -"],
.shop-search-page [style*="margin-left:-"],
.shop-archive-page [style*="margin-inline-end: -"],
.shop-archive-page [style*="margin-inline-end:-"],
.shop-archive-page [style*="margin-inline-start: -"],
.shop-archive-page [style*="margin-inline-start:-"],
.shop-archive-page [style*="margin-right: -"],
.shop-archive-page [style*="margin-right:-"],
.shop-archive-page [style*="margin-left: -"],
.shop-archive-page [style*="margin-left:-"],
body.post-type-archive-product [style*="margin-inline-end: -"],
body.post-type-archive-product [style*="margin-inline-end:-"],
body.post-type-archive-product [style*="margin-inline-start: -"],
body.post-type-archive-product [style*="margin-inline-start:-"],
body.post-type-archive-product [style*="margin-right: -"],
body.post-type-archive-product [style*="margin-right:-"],
body.post-type-archive-product [style*="margin-left: -"],
body.post-type-archive-product [style*="margin-left:-"],
body.tax-product_cat [style*="margin-inline-end: -"],
body.tax-product_cat [style*="margin-inline-end:-"],
body.tax-product_cat [style*="margin-inline-start: -"],
body.tax-product_cat [style*="margin-inline-start:-"],
body.tax-product_cat [style*="margin-right: -"],
body.tax-product_cat [style*="margin-right:-"],
body.tax-product_cat [style*="margin-left: -"],
body.tax-product_cat [style*="margin-left:-"],
body.tax-product_tag [style*="margin-inline-end: -"],
body.tax-product_tag [style*="margin-inline-end:-"],
body.tax-product_tag [style*="margin-inline-start: -"],
body.tax-product_tag [style*="margin-inline-start:-"],
body.tax-product_tag [style*="margin-right: -"],
body.tax-product_tag [style*="margin-right:-"],
body.tax-product_tag [style*="margin-left: -"],
body.tax-product_tag [style*="margin-left:-"] {
	margin-inline-end: 0 !important;
	margin-inline-start: 0 !important;
	margin-right: 0 !important;
	margin-left: 0 !important;
}

.shop-search-page__header {
	width: min(100%, 1440px) !important;
	margin: 0 auto 1.5rem !important;
}

/* Tiêu đề: .shop-page-heading + .shop-search-page__title — elementor-globals-custom.css */

.shop-search-page__form {
	margin: 0 0 1rem !important;
}

/* Trang tìm kiếm: bộ lọc — mobile giảm khoảng cách dưới (mặc định .shop-product-filters là 4.5rem) */
@media (max-width: 1023px) {
	.shop-product-filters.shop-search-page__filters {
		margin-bottom: 1.5rem !important;
	}
}

.shop-search-page__results {
	width: min(100%, 1440px) !important;
	margin: 0 auto !important;
}

.shop-search-page__list {
	display: grid !important;
	grid-template-columns: 1fr !important;
	gap: 1rem !important;
}

.shop-search-page__item {
	display: grid !important;
	grid-template-columns: 140px 1fr !important;
	gap: 1rem !important;
	padding: 1rem !important;
	border: 1px solid var(--color-border, #0303031a) !important;
	border-radius: 10px !important;
	background: #fff !important;
}

.shop-search-page__thumb img {
	width: 100% !important;
	height: auto !important;
	display: block !important;
	border-radius: 8px !important;
}

.shop-search-page__item-title {
	margin: 0 0 0.45rem !important;
	font-size: 20px !important;
	font-weight: 400 !important;
	line-height: 1.25 !important;
}

.shop-search-page__item-title a {
	color: var(--color-text, #1a1a1a) !important;
	text-decoration: none !important;
}

.shop-search-page__excerpt {
	font-size: 15px !important;
}

.shop-search-page__empty {
	margin: 0 !important;
	padding: 1rem !important;
	border: 1px solid var(--color-border, #0303031a) !important;
	border-radius: 8px !important;
}

.shop-search-page__pagination {
	width: min(100%, 1440px) !important;
	margin: 1.8rem auto 0 !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	gap: 0.5rem !important;
}

.shop-search-page__pagination-item {
	display: inline-flex !important;
}

.shop-search-page__pagination-item a,
.shop-search-page__pagination-item .current,
.shop-search-page__pagination-item .dots {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	min-width: 28px !important;
	height: 28px !important;
	padding: 0 0.4rem !important;
	border-radius: 7px !important;
	font-size: 12px !important;
	font-weight: 400 !important;
	line-height: 1 !important;
	text-decoration: none !important;
}

.shop-search-page__pagination-item a {
	border: 1px solid var(--color-border, #0303031a) !important;
	background: #fff !important;
	color: var(--color-text, #1a1a1a) !important;
}

.shop-search-page__pagination-item a:hover,
.shop-search-page__pagination-item a:focus {
	opacity: 0.9 !important;
	outline: none !important;
}

.shop-search-page__pagination-item .current {
	border: 1px solid var(--color-button-background, #1a1a1a) !important;
	background: var(--color-button-background, #1a1a1a) !important;
	color: var(--color-button-text, #fff) !important;
}

.shop-search-page__pagination-item .dots {
	border: 0 !important;
	background: transparent !important;
	color: var(--color-text, #1a1a1a) !important;
	min-width: auto !important;
	padding: 0 0.15rem !important;
}

.shop-search-page__pagination-item .prev,
.shop-search-page__pagination-item .next {
	border: 0 !important;
	background: transparent !important;
	min-width: 20px !important;
	width: 20px !important;
	padding: 0 !important;
	font-size: 16px !important;
	color: var(--color-text, #1a1a1a) !important;
}


@media (max-width: 767px) {
	.shop-search-form__row {
		flex-wrap: wrap !important;
	}

	.shop-search-form__submit {
		width: 100% !important;
	}

	.shop-search-page__item {
		grid-template-columns: 1fr !important;
	}
}
