/*
 * Search Products — Light Ideas
 */


/* ================================================================
   1. BASE / LAYOUT
   ================================================================ */

.sp-search-products,
.sp-seller-search,
.sp-search-products *,
.sp-seller-search * {
	box-sizing: border-box;
}

.sp-search-products {
	max-width: 1300px;
	margin: 10px auto 58px;
}

.sp-section-title {
	margin: 0 0 20px;
	font-size: clamp(2rem, 5vw, 3.2rem);
	font-weight: 400;
	letter-spacing: -.04em;
}


/* ================================================================
   2. SEARCH
   ================================================================ */

.sp-search-form {
	position: relative;
	display: flex;
	width: 100%;
	margin: 0 0 22px;
}

.sp-search-form input[type="search"] {
	width: 100%;
	height: 58px;
	padding: 0 58px 0 18px;
	border: 1px solid #ddd;
	border-radius: 16px;
	background: #fff;
	box-shadow: none;
	color: #222;
	font-size: 1rem;
	outline: none;
	-webkit-appearance: none;
	appearance: none;
}

.sp-search-form input[type="search"]:focus {
	border-color: #8d8d8d;
}

.sp-search-form button {
	position: absolute;
	top: 50%;
	right: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	padding: 0;
	border: 0;
	border-radius: 12px;
	background: transparent;
	box-shadow: none;
	color: #222;
	font: inherit;
	transform: translateY(-50%);
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}

.sp-search-form button:hover,
.sp-search-form button:focus,
.sp-search-form button:active {
	background: #f4f4f4;
}

.sp-search-form button:focus,
.sp-search-form button:active {
	outline: none;
	box-shadow: none;
}

.sp-search-form button::before,
.sp-search-form button::after {
	content: none !important;
	display: none !important;
}

.sp-search-form svg {
	display: block;
	width: 22px;
	height: 22px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
	stroke-linejoin: round;
}


/* Clear search button */

.sp-clear-search {
	position: absolute;
	top: 50%;
	right: 52px;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	margin: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	box-shadow: none;
	color: #777;
	text-decoration: none;
	transform: translateY(-50%);
}

.sp-clear-search:hover,
.sp-clear-search:focus {
	background: #f5f5f5;
	color: #222;
}

.sp-clear-search svg {
	display: block;
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
}

.sp-search-active input[type="search"] {
	padding-right: 102px;
}


/* Search placement */

.sp-product-search-form {
	margin: 0 0 30px;
}

.sp-product-search-form .sp-search-form {
	margin-bottom: 12px;
}

.sp-marketplace-search,
.sp-store-search {
	margin-top: 0;
	margin-bottom: 32px;
}


/* ================================================================
   3. HERO MENU
   ================================================================ */

.sp-hero-menu {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 12px;
}

.sp-hero-group {
	overflow: hidden;
	border: 1px solid #e5e5e5;
	border-radius: 16px;
	background: #fff;
}

.sp-hero-group summary {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 5px;
	min-height: auto;
	padding: 18px 48px 18px 18px;
	list-style: none;
	cursor: pointer;
}

.sp-hero-group summary::-webkit-details-marker {
	display: none;
}

.sp-hero-group summary > span:first-child {
	font-size: 1.08rem;
	font-weight: 500;
	color: #222;
}

.sp-hero-group summary small {
	color: #767676;
	line-height: 1.45;
}

.sp-hero-group[open] summary {
	border-bottom: 1px solid #ededed;
}

.sp-chevron {
	position: absolute;
	top: 50%;
	right: 20px;
	width: 9px;
	height: 9px;
	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	transform: translateY(-70%) rotate(45deg);
	transition: transform .2s ease;
}

.sp-hero-group[open] .sp-chevron {
	transform: translateY(-30%) rotate(225deg);
}

.sp-hero-terms {
	display: grid;
	grid-template-columns: 1fr;
	gap: 0;
	padding: 0 12px 12px;
}

.sp-hero-terms a {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 8px;
	border-top: 1px solid #ededed;
	color: #222;
	text-decoration: none;
}

.sp-hero-terms a:hover {
	color: #000;
}


/* ================================================================
   4. CARDS / DIRECTORY
   ================================================================ */

.sp-card-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 16px;
}

.sp-card {
	display: flex;
	flex-direction: column;
	min-height: 170px;
	padding: 24px;
	border: 1px solid #e7e7e7;
	border-radius: 18px;
	background: #fff;
	color: #181818;
	text-decoration: none;
}

.sp-card-title {
	font-size: 1.25rem;
	font-weight: 500;
}

.sp-card-description {
	margin-top: 8px;
	color: #6d6d6d;
	line-height: 1.5;
}

.sp-card-arrow {
	margin-top: auto;
	padding-top: 20px;
	font-size: 1.25rem;
}

.sp-directory {
	margin-top: 46px;
}

.sp-directory-section {
	padding: 30px 0;
	border-top: 1px solid #e7e7e7;
	scroll-margin-top: 100px;
}

.sp-directory-section h3,
.sp-seller-group h2 {
	margin: 0 0 16px;
	font-size: 1.35rem;
	font-weight: 500;
}

.sp-term-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 10px;
}

.sp-term-link,
.sp-seller-links a {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 13px 15px;
	border: 1px solid #e8e8e8;
	border-radius: 12px;
	background: #fff;
	color: #222;
	text-decoration: none;
}

.sp-term-link:hover,
.sp-seller-links a:hover {
	border-color: #bdbdbd;
	color: #111;
}

.sp-hero-terms small,
.sp-term-link small,
.sp-seller-links small {
	color: #929292;
	font-variant-numeric: tabular-nums;
}


/* ================================================================
   5. SELLER SEARCH / DIRECTORY
   ================================================================ */

.sp-seller-search {
	margin: 8px 0 52px;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
}

.sp-seller-search-only {
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
}

.sp-seller-search .sp-search-form {
	margin-bottom: 22px;
}

.sp-seller-search-only .sp-search-form {
	margin: 0;
}

.sp-seller-group + .sp-seller-group {
	margin-top: 24px;
}

.sp-seller-links {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 10px;
}


/* ================================================================
   6. PRODUCT FILTER TABS
   ================================================================ */

.sp-advanced-tabs {
	position: relative;
}

.sp-advanced-tabbar {
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
}

.sp-advanced-tablist {
	display: flex;
	flex: 1 1 auto;
	gap: 6px;
	overflow-x: auto;
	padding: 8px 0 10px;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
}

.sp-advanced-tablist::-webkit-scrollbar {
	display: none;
}

.sp-advanced-tab {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	gap: 7px;
	min-height: 38px;
	padding: 0 13px;
	border: 1px solid transparent;
	border-radius: 999px;
	background: transparent;
	background-image: none;
	box-shadow: none;
	color: #777;
	font: inherit;
	font-size: .9rem;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}

.sp-advanced-tab:hover {
	background: #f5f5f5;
	color: #222;
}

.sp-advanced-tab.is-active {
	border-color: #d9d9d9;
	background: #f7f7f7;
	color: #111;
	font-weight: 500;
}

.sp-advanced-tab small {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 20px;
	height: 20px;
	padding: 0 6px;
	border-radius: 10px;
	background: #111;
	color: #fff;
	font-size: .7rem;
	font-weight: 500;
}

.sp-advanced-panels {
	padding: 8px 0 0;
}

.sp-advanced-panel[hidden] {
	display: none !important;
}

.sp-advanced-panel.is-active {
	display: block;
}


/* Checkbox lists */

.sp-checkbox-list {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	max-height: 270px;
	overflow: auto;
	gap: 4px 16px;
	padding: 6px 0 10px;
}

.sp-checkbox-list label {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr) auto;
	align-items: center;
	gap: 9px;
	min-height: 40px;
	padding: 7px 8px;
	border-radius: 9px;
	color: #333;
	cursor: pointer;
}

.sp-checkbox-list label:hover {
	background: #f7f7f7;
}

.sp-checkbox-list input[type="checkbox"] {
	width: 18px;
	height: 18px;
	margin: 0;
}

.sp-checkbox-list small {
	color: #999;
}


/* ================================================================
   7. DELIVERY
   ================================================================ */

.sp-delivery-featured {
	margin-bottom: 8px;
}

.sp-country-name {
	display: flex;
	align-items: center;
	gap: 8px;
	min-width: 0;
}

.sp-country-flag {
	font-size: 1.15rem;
	line-height: 1;
}

/*
 * Windows does not reliably render Unicode country flags and may
 * display the country code instead (for example, GB).
 * Keep flags on mobile and hide them on larger screens.
 */
@media (min-width: 601px) {
	.sp-country-flag {
		display: none !important;
	}
}

.sp-delivery-search-wrap {
	margin: 10px 0 12px;
}

.sp-delivery-country-search {
	width: 100%;
	height: 46px;
	padding: 0 14px;
	border: 1px solid #ddd;
	border-radius: 12px;
	background: #fff;
	box-shadow: none;
	color: #222;
	font: inherit;
	-webkit-appearance: none;
	appearance: none;
}

.sp-delivery-country-search:focus {
	border-color: #999;
	outline: none;
}

.sp-delivery-all[hidden],
.sp-delivery-all label[hidden] {
	display: none !important;
}


/* ================================================================
   8. COLOUR SWATCHES
   ================================================================ */

.sp-term-name {
	display: flex;
	align-items: center;
	gap: 9px;
	min-width: 0;
}

.sp-colour-swatch {
	display: inline-block;
	flex: 0 0 18px;
	width: 18px;
	height: 18px;
	border: 1px solid rgba(0, 0, 0, .18);
	border-radius: 50%;
	background: var(--sp-swatch);
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .16);
}


/* ================================================================
   9. WOOCOMMERCE NO RESULTS
   ================================================================ */

.woocommerce-no-products-found .sp-search-products,
.woocommerce-no-products-found .sp-seller-search {
	margin-top: 0;
	margin-bottom: 28px;
}


/* ================================================================
   10. TABLET
   ================================================================ */

@media (max-width: 900px) {

	.sp-hero-menu,
	.sp-card-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.sp-term-grid,
	.sp-seller-links {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 800px) {

	.sp-checkbox-list {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}


/* ================================================================
   11. MOBILE
   ================================================================ */

@media (max-width: 600px) {

	.sp-search-products {
		margin: 8px 0 64px;
	}

	.sp-seller-search {
		margin: 6px 0 58px;
	}

	.sp-section-title {
		margin-bottom: 16px;
	}


	/* Search */

	.sp-search-form input[type="search"] {
		height: 54px;
		border-radius: 14px;
	}

	.sp-clear-search {
		right: 50px;
		width: 36px;
		height: 36px;
	}

	.sp-search-active input[type="search"] {
		padding-right: 98px;
	}

	.sp-marketplace-search,
	.sp-store-search {
		margin-bottom: 36px;
	}


	/* Hero */

	.sp-hero-menu {
		grid-template-columns: 1fr;
		gap: 10px;
	}

	.sp-hero-group summary {
		padding: 16px 46px 16px 16px;
	}

	.sp-hero-group summary small {
		display: none;
	}

	.sp-hero-group:not([open]) {
		min-height: auto;
	}


	/* Cards / directory */

	.sp-card-grid {
		grid-template-columns: 1fr;
	}

	.sp-card {
		min-height: 130px;
		padding: 18px;
	}

	.sp-term-grid,
	.sp-seller-links {
		grid-template-columns: 1fr 1fr;
	}


	/* Filter tabs */

	.sp-product-search-form {
		margin-bottom: 34px;
	}

	.sp-advanced-tabbar {
		gap: 6px;
	}

	.sp-advanced-tablist {
		gap: 4px;
		padding-top: 9px;
		padding-bottom: 11px;
	}

	.sp-advanced-tab {
		min-height: 36px;
		padding: 0 12px;
		font-size: .86rem;
	}

	.sp-advanced-panels {
		padding-top: 9px;
	}

	.sp-checkbox-list {
		grid-template-columns: 1fr;
		max-height: none !important;
		overflow: visible !important;
	}


	/* Delivery */

	.sp-delivery-panel .sp-checkbox-list {
		grid-template-columns: 1fr !important;
		max-height: none !important;
		overflow: visible !important;
	}

	.sp-delivery-country-search {
		height: 48px;
	}
}


/* ================================================================
   12. SMALL MOBILE
   ================================================================ */

@media (max-width: 420px) {

	.sp-term-grid,
	.sp-seller-links {
		grid-template-columns: 1fr;
	}
}
