/**
 * Silky Seek search overlay — front-end styles.
 *
 * Full-screen Silky Seek overlay that appears when the user focuses
 * any configured search input. Results are rendered inside a centred panel.
 *
 * @package Silky_Seek
 */

/* ── Prevent page scroll when overlay is open ────────────────────────────── */

body.silky-seek-overlay-open {
	overflow: hidden;
}

/* ── Overlay root ────────────────────────────────────────────────────────── */

.silky-seek-overlay {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	flex-direction: column;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s ease;
}

/* 'hidden' attribute keeps it out of the DOM flow between searches */
.silky-seek-overlay[hidden] {
	display: none !important;
}

.silky-seek-overlay.silky-seek-overlay--visible {
	opacity: 1;
	pointer-events: all;
}

/* ── Inline layout ─────────────────────────────────────────────────────── */

.silky-seek-overlay--inline {
	display: block;
	inset: auto;
	margin: 16px 0 28px;
	opacity: 1;
	pointer-events: auto;
	position: static;
	z-index: auto;
}

.silky-seek-overlay--inline[hidden] {
	display: none !important;
}

.silky-seek-overlay--inline .silky-seek-overlay__backdrop,
.silky-seek-overlay--inline .silky-seek-overlay__header {
	display: none;
}

.silky-seek-overlay--inline .silky-seek-overlay__panel {
	border: none;
	border-radius: 0;
	box-shadow: none;
	max-height: none;
	min-height: 0;
	overflow: visible;
	transform: none;
}

.silky-seek-overlay--inline .silky-seek-overlay__body {
	min-height: 0;
	overflow: visible;
}

.silky-seek-overlay--inline .silky-seek-overlay__main {
	overflow: visible;
}

.silky-seek-overlay--inline .silky-seek-overlay__results {
	min-height: 0;
}

.silky-seek-inline-cancel {
	display: none;
}

.silky-seek-overlay--inline .silky-seek-inline-cancel {
	display: inline-flex;
	align-items: center;
	margin: 0 0 12px;
	padding: 0;
	border: none;
	background: transparent !important;
	box-shadow: none !important;
	color: #2f6f39 !important;
	cursor: pointer;
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.3;
	text-decoration: underline;
	text-underline-offset: 2px;
	-webkit-appearance: none;
	appearance: none;
}

.silky-seek-overlay--inline .silky-seek-inline-cancel:hover,
.silky-seek-overlay--inline .silky-seek-inline-cancel:focus {
	background: transparent !important;
	box-shadow: none !important;
	color: #2f6f39 !important;
	outline: none;
	text-decoration: underline;
}

/* ── Backdrop ─────────────────────────────────────────────────────────────── */

.silky-seek-overlay__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
	backdrop-filter: blur(2px);
	-webkit-backdrop-filter: blur(2px);
}

/* ── Panel ────────────────────────────────────────────────────────────────── */

.silky-seek-overlay__panel {
	position: relative;
	z-index: 1;
	background: #fff;
	width: 100%;
	min-height: 80px;
	max-height: 90vh;
	display: flex;
	flex-direction: column;
	box-shadow: 0 8px 40px rgba(0, 0, 0, 0.28);
	overflow: hidden;
	transform: translateY(-8px);
	transition: transform 0.2s ease;
}

.silky-seek-overlay--visible .silky-seek-overlay__panel {
	transform: translateY(0);
}

/* ── Header / search bar ─────────────────────────────────────────────────── */

.silky-seek-overlay__header {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 14px 16px;
	border-bottom: 1px solid #ebebeb;
	flex-shrink: 0;
}

/* Logo (1.1.0) */
.silky-seek-overlay__logo {
	flex-shrink: 0;
	height: auto;
	max-width: none;
	object-fit: contain;
	display: block;
}

.silky-seek-overlay .silky-seek-overlay__input-wrap {
	flex: 1;
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
	background: #fff;
	border: 1px solid #c3c4c7;
	border-radius: 6px;
	padding: 0 12px;
	box-sizing: border-box;
	transition: border-color 0.15s, box-shadow 0.15s;
}

.silky-seek-overlay .silky-seek-overlay__input-wrap:focus-within {
	border-color: #2271b1;
	box-shadow: 0 0 0 1px #2271b1;
}

.silky-seek-icon-search {
	width: 20px;
	height: 20px;
	flex-shrink: 0;
	color: #888;
}

.silky-seek-overlay input.silky-seek-overlay__input[type="search"] {
	flex: 1;
	width: 100%;
	min-width: 0;
	height: auto;
	min-height: 0;
	margin: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	outline: 0 !important;
	font-size: 17px;
	font-weight: 400;
	color: #1a1a1a;
	padding: 12px 0 !important;
	line-height: 1.3;
	-webkit-appearance: none;
	appearance: none;
}

.silky-seek-overlay__input::placeholder {
	color: #aaa;
}

/* Hide browser-native clear button on search inputs */
.silky-seek-overlay__input::-webkit-search-cancel-button {
	-webkit-appearance: none;
}

.silky-seek-overlay__clear {
	display: flex;
	align-items: center;
	justify-content: center;
	background: #bbb;
	border: none;
	border-radius: 50%;
	width: 20px;
	height: 20px;
	padding: 0;
	cursor: pointer;
	flex-shrink: 0;
	transition: background 0.15s;
}

.silky-seek-overlay__clear:hover {
	background: #888;
}

.silky-seek-overlay__clear svg {
	width: 12px;
	height: 12px;
	color: #fff;
}

/* Close / cancel button */
.silky-seek-overlay__close {
	display: flex;
	align-items: center;
	gap: 5px;
	flex-shrink: 0;
	background: none;
	border: none;
	cursor: pointer;
	color: #555;
	font-size: 14px;
	padding: 6px 8px;
	border-radius: 6px;
	transition: background 0.15s, color 0.15s;
}

.silky-seek-overlay__close:hover {
	background: #f0f0f0;
	color: #111;
}

.silky-seek-overlay__close svg {
	width: 16px;
	height: 16px;
}

/* ── Body / results area ─────────────────────────────────────────────────── */

.silky-seek-overlay__body {
	flex: 1;
	display: flex;
	min-height: 0;
	overflow: hidden;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
}

.silky-seek-overlay__main {
	flex: 1;
	min-width: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
}

.silky-seek-overlay__results {
	padding: 8px 0;
}

/* State messages */
.silky-seek-loading,
.silky-seek-no-results,
.silky-seek-error {
	padding: 20px 20px;
	margin: 0;
	font-size: 15px;
	color: #666;
}

.silky-seek-error {
	color: #b32d2e;
}

/* ── Product Catalogue Grid ─────────────────────────────────────────────── */

.silky-seek-overlay__results {
	padding: 24px;
}

.silky-seek-overlay--landing .silky-seek-overlay__filters {
	display: none;
}

.silky-seek-landing {
	display: grid;
	grid-template-columns: minmax(160px, 220px) minmax(0, 1fr);
	gap: 28px;
	align-items: start;
}

.silky-seek-landing__popular h2,
.silky-seek-landing__recommended h2 {
	margin: 0 0 14px;
	font-size: 18px;
	font-weight: 700;
	line-height: 1.2;
	color: #223322;
}

.silky-seek-popular-list {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 6px;
}

.silky-seek-popular-term {
	display: inline-flex;
	align-items: center;
	max-width: 100%;
	padding: 5px 0;
	border: none;
	background: transparent;
	color: #3f4f3f;
	font-size: 15px;
	font-weight: 500;
	line-height: 1.35;
	text-align: left;
	cursor: pointer;
}

.silky-seek-popular-term:hover,
.silky-seek-popular-term:focus {
	color: #2f6f39;
	text-decoration: underline;
	outline: none;
}

.silky-seek-recommended-list.silky-seek-results-list {
	grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
	gap: 18px;
}

.silky-seek-recommended-list .silky-seek-result__img {
	height: 180px;
}

.silky-seek-results-list {
	list-style: none;
	margin: 0;
	padding: 0;

	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 20px;
}

.silky-seek-results-list li {
	margin: 0;
	padding: 0;
}

/* ── Product Card ──────────────────────────────────────────────────────── */

a.silky-seek-result {
	display: flex;
	flex-direction: column;
	height: 100%;

	background: #ffffff;
	border: 1px solid #e5ece5;
	border-radius: 10px;

	overflow: hidden;
	text-decoration: none;
	color: inherit;

	padding: 0;

	transition:
		transform 0.2s ease,
		box-shadow 0.2s ease,
		border-color 0.2s ease;
}

a.silky-seek-result:hover,
a.silky-seek-result.silky-seek-result--active {
	background: #ffffff;
	transform: translateY(-3px);

	border-color: #b8d8bb;

	box-shadow:
		0 10px 25px rgba(0,0,0,0.08),
		0 2px 6px rgba(0,0,0,0.04);
}

/* ── Product Image ─────────────────────────────────────────────────────── */

.silky-seek-result__img {
	width: 100%;
	height: 220px;

	border-radius: 0;
	background: #f5f7f4;

	display: flex;
	align-items: center;
	justify-content: center;

	overflow: hidden;
}

.silky-seek-result__img img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;

	transition: transform 0.3s ease;
}

/* a.silky-seek-result:hover .silky-seek-result__img img {
	transform: scale(1.05);
} */

.silky-seek-result__img-placeholder {
	width: 100%;
	height: 100%;
	background:
		linear-gradient(
			135deg,
			#edf4ed 0%,
			#dce8dc 100%
		);
}

/* ── Product Content ───────────────────────────────────────────────────── */

.silky-seek-result__info {
	display: flex;
	flex-direction: column;
	flex: 1;

	padding: 16px;
	min-width: 0;
}

/* Product Title */

.silky-seek-result__title {
	display: block;

	font-size: 15px;
	font-weight: 600;
	line-height: 1.45;

	color: #223322;

	margin-bottom: 12px;

	white-space: normal;
	overflow: visible;
	text-overflow: initial;

	min-height: 44px;
}

/* Search highlights */

.silky-seek-result__title mark,
.silky-seek-result__info mark {
	background: #dff2df;
	color: #184718;
	padding: 0 3px;
	border-radius: 3px;
}

/* ── Meta Area ─────────────────────────────────────────────────────────── */

.silky-seek-result__meta {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 8px;

	margin-top: auto;
}

/* Price */

.silky-seek-result__price {
	font-size: 18px;
	font-weight: 700;
	color: #215a26;
	line-height: 1.2;
}

.silky-seek-price--sale {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
}

.silky-seek-price--sale del {
	font-size: 14px;
	font-weight: 400;
	color: #999;
	margin: 0;
}

/* Stock Badge */

.silky-seek-result__stock {
	font-size: 12px;
	font-weight: 600;

	padding: 4px 10px;

	border-radius: 999px;
	letter-spacing: 0.02em;
}

.silky-seek-stock--in {
	background: #e8f7ea;
	color: #1c6d28;
}

.silky-seek-stock--out {
	background: #fdecec;
	color: #b42318;
}

.silky-seek-stock--back {
	background: #fff4dd;
	color: #9a6700;
}

/* Category */

.silky-seek-result__cat {
	font-size: 12px;
	color: #6b7a6b;
	line-height: 1.4;
}

/* ── Loading / Messages ───────────────────────────────────────────────── */

.silky-seek-loading,
.silky-seek-no-results,
.silky-seek-error {
	text-align: center;
	padding: 50px 20px;
	font-size: 15px;
}

.silky-seek-error {
	color: #b42318;
}

/* ── SKU (1.1.0) ──────────────────────────────────────────────────────── */

.silky-seek-result__sku {
	font-size: 11px;
	color: #8a9a8a;
	font-family: monospace;
	letter-spacing: 0.03em;
}

/* ── Inline link button (used in "no results" clear-filter prompt) ────── */

.silky-seek-link {
	background: none;
	border: none;
	padding: 0;
	color: #2f6f39;
	font-size: inherit;
	cursor: pointer;
	text-decoration: underline;
}

.silky-seek-link:hover {
	color: #1c4a24;
}

/* ── Filters (desktop sidebar, mobile panel) ───────────────────────────── */

.silky-seek-overlay__filters {
	width: 260px;
	flex: 0 0 260px;
	border-right: 1px solid #e5ece5;
	background: #fbfcfb;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 22px 18px;
}

.silky-seek-filter-toggle {
	display: none;
}

.silky-seek-filter-panel {
	display: flex;
	flex-direction: column;
	gap: 22px;
}

.silky-seek-clear-filters {
	align-self: flex-start;
	min-height: 16px;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: #2f6f39;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.2;
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}

.silky-seek-clear-filters--hidden {
	visibility: hidden;
	pointer-events: none;
}

.silky-seek-clear-filters:hover,
.silky-seek-clear-filters:focus {
	background: transparent;
	color: #1f4f28;
	outline: none;
}

.silky-seek-filter-section h3 {
	margin: 0 0 10px;
	color: #223322;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.2;
}

.silky-seek-filter-pill {
	display: flex;
	align-items: center;
	width: 100%;
	gap: 6px;
	padding: 8px 10px;
	border: 1.5px solid #d0dcd0;
	border-radius: 10px;
	background: #fff;
	color: #445544;
	font-size: 13px;
	font-weight: 500;
	cursor: pointer;
	transition: background 0.15s, border-color 0.15s, color 0.15s;
	text-align: left;
	white-space: normal;
	line-height: 1.35;
}

.silky-seek-filter-pill:hover,
.silky-seek-filter-pill:focus {
	background: #fff;
	color: #445544;
	outline: none;
}

.silky-seek-filter-pill:focus-visible {
	box-shadow: 0 0 0 2px #e8f7ea;
}

.silky-seek-filter-pill::before {
	content: '';
	width: 12px;
	height: 12px;
	border-radius: 50%;
	border: 1.5px solid #aabcaa;
	display: inline-block;
	flex-shrink: 0;
	transition: background 0.15s, border-color 0.15s;
}

.silky-seek-filter-pill--active {
	background: #2f6f39;
	border-color: #2f6f39;
	color: #fff;
}

.silky-seek-filter-pill--active:hover,
.silky-seek-filter-pill--active:focus {
	background: #2f6f39;
	border-color: #2f6f39;
	color: #fff;
}

.silky-seek-filter-pill--active::before {
	background: #fff;
	border-color: rgba(255,255,255,0.5);
}

#silky-seek-content-type-pills,
#silky-seek-cat-pills,
.silky-seek-attribute-pills {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

#silky-seek-attribute-filter-sections {
	display: flex;
	flex-direction: column;
	gap: 22px;
}

/* Category pills use the same .silky-seek-filter-pill base but with a tag-style indicator */
.silky-seek-filter-pill--cat::before {
	border-radius: 3px; /* square-ish instead of circular to distinguish from stock pill */
}

.silky-seek-filter-pill--attr::before {
	border-radius: 4px;
}

/* ── Tablet ───────────────────────────────────────────────────────────── */

@media (max-width: 900px) {

	.silky-seek-results-list {
		grid-template-columns: repeat(3, 1fr);
		gap: 16px;
	}

	.silky-seek-result__img {
		height: 180px;
	}
}

/* ── Mobile ───────────────────────────────────────────────────────────── */

@media (max-width: 700px) {

	.silky-seek-overlay__panel {
		max-height: 100dvh;
		min-height: 100dvh;
	}

	.silky-seek-overlay__header {
		gap: 8px;
		padding: 10px 12px;
	}

	.silky-seek-overlay__logo {
		max-width: none;
	}

	.silky-seek-overlay .silky-seek-overlay__input-wrap {
		min-width: 0;
		border-radius: 6px;
		padding: 0 10px;
	}

	.silky-seek-overlay input.silky-seek-overlay__input[type="search"] {
		min-width: 0;
		font-size: 16px;
		padding: 10px 0 !important;
	}

	.silky-seek-overlay__close {
		width: 36px;
		height: 36px;
		justify-content: center;
		padding: 0;
		font-size: 0;
	}

	.silky-seek-overlay__close svg {
		width: 18px;
		height: 18px;
	}

	.silky-seek-overlay__body {
		flex-direction: column;
		overflow: hidden;
	}

	.silky-seek-overlay__main {
		flex: 1;
	}

	.silky-seek-overlay__filters {
		width: auto;
		flex: 0 0 auto;
		border-right: none;
		border-bottom: 1px solid #e5ece5;
		padding: 0;
		overflow: visible;
		background: #fff;
	}

	.silky-seek-overlay__filters--empty {
		display: none;
	}

	.silky-seek-filter-toggle {
		display: flex;
		align-items: center;
		justify-content: space-between;
		width: 100%;
		padding: 12px 14px;
		border: none;
		background: #fbfcfb;
		color: #223322;
		font-size: 14px;
		font-weight: 700;
		cursor: pointer;
	}

	.silky-seek-filter-toggle svg {
		width: 18px;
		height: 18px;
		transition: transform 0.15s ease;
	}

	.silky-seek-overlay__filters--open .silky-seek-filter-toggle svg {
		transform: rotate(180deg);
	}

	.silky-seek-filter-toggle--active {
		color: #2f6f39;
	}

	.silky-seek-filter-count {
		margin-left: auto;
		margin-right: 10px;
		min-width: 20px;
		height: 20px;
		padding: 0 6px;
		border-radius: 10px;
		background: #2f6f39;
		color: #fff;
		font-size: 12px;
		line-height: 20px;
		text-align: center;
	}

	.silky-seek-filter-panel {
		display: none;
		max-height: min(46vh, 360px);
		overflow-y: auto;
		padding: 12px 14px 14px;
		border-top: 1px solid #e5ece5;
		background: #fbfcfb;
	}

	.silky-seek-overlay__filters--open .silky-seek-filter-panel {
		display: flex;
	}

	.silky-seek-filter-section h3 {
		font-size: 12px;
	}

	.silky-seek-filter-pill {
		min-height: 38px;
	}

	.silky-seek-overlay__results {
		padding: 12px;
	}

	.silky-seek-landing {
		display: flex;
		flex-direction: column;
		gap: 22px;
	}

	.silky-seek-landing__popular h2,
	.silky-seek-landing__recommended h2 {
		font-size: 16px;
		margin-bottom: 10px;
	}

	.silky-seek-popular-list {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 8px 14px;
	}

	.silky-seek-popular-term {
		padding: 4px 0;
		font-size: 14px;
	}

	.silky-seek-overlay--inline .silky-seek-overlay__panel {
		max-height: none;
		min-height: 0;
	}

	.silky-seek-overlay--inline .silky-seek-overlay__body {
		overflow: visible;
	}

	.silky-seek-overlay--inline .silky-seek-overlay__main {
		flex: 1 1 auto;
	}

	.silky-seek-results-list {
		grid-template-columns: repeat(2, 1fr);
		gap: 12px;
	}

	.silky-seek-recommended-list.silky-seek-results-list {
		grid-template-columns: repeat(2, 1fr);
		gap: 12px;
	}

	.silky-seek-result__img {
		height: 140px;
	}

	.silky-seek-result__info {
		padding: 12px;
	}

	.silky-seek-result__title {
		font-size: 14px;
		min-height: 40px;
	}

	.silky-seek-result__price {
		font-size: 16px;
	}

}
