/**
 * WBS ES Search — Styles
 *
 * Two-column autocomplete dropdown:
 * Left: suggestion list (thumb + title + price)
 * Right: product detail preview (large image + title + price + description)
 */

:root {
	--wesf-s-bg: #fff;
	--wesf-s-border: #e0e0e0;
	--wesf-s-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
	--wesf-s-hover: #f8f8f8;
	--wesf-s-accent: #c9a96e;
	--wesf-s-text: #333;
	--wesf-s-muted: #888;
	--wesf-s-sale: #c00;
	--wesf-s-radius: 8px;
}

/* --- Search form --- */

.wesf-search {
	position: relative;
	width: 100%;
	max-width: 600px;
}

.wesf-search__form {
	display: flex;
	align-items: center;
	background: #fff;
	border: 1px solid #707070;
	border-radius: 200px;
	overflow: hidden;
	transition: border-color 0.2s;
}

.wesf-search__form:focus-within {
	border-color: #707070;
	box-shadow: none;
}

.wesf-search__input,
.wesf-search__input[type="search"] {
	flex: 1;
	border: none !important;
	outline: none !important;
	box-shadow: none !important;
	padding: 10px 16px !important;
	font-size: 15px !important;
	background: #fff !important;
	color: var(--wesf-s-text) !important;
	min-width: 0;
	-webkit-appearance: none !important;
	appearance: none !important;
	border-radius: 0 !important;
}

.wesf-search__input:focus,
.wesf-search__input[type="search"]:focus {
	border: none !important;
	outline: none !important;
	box-shadow: none !important;
	background: #fff !important;
}

.wesf-search__input::placeholder {
	color: var(--wesf-s-muted);
}

.wesf-search__clear {
	display: none;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border: none;
	background: none;
	cursor: pointer;
	font-size: 18px;
	color: var(--wesf-s-muted);
	padding: 0;
	flex-shrink: 0;
}

.wesf-search__clear:hover {
	color: var(--wesf-s-text);
}

.wesf-search__submit {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	border: none !important;
	background: none !important;
	cursor: pointer;
	color: var(--wesf-s-muted);
	padding: 0;
	flex-shrink: 0;
	order: -1; /* Move before input (left side). */
}

.wesf-search__submit:hover {
	color: var(--wesf-s-accent);
}

/* --- Dropdown --- */

.wesf-search__dropdown {
	display: none;
	position: absolute;
	top: calc(100% + 4px);
	left: 0;
	right: 0;
	background: var(--wesf-s-bg);
	border: 1px solid var(--wesf-s-border);
	border-radius: var(--wesf-s-radius);
	box-shadow: var(--wesf-s-shadow);
	z-index: 99999;
	max-height: 80vh;
	overflow: hidden;
}

.wesf-search__dropdown--visible {
	display: block;
}

/* --- Two-column layout --- */

.wesf-search__results {
	display: flex;
	min-height: 200px;
}

.wesf-search__list {
	flex: 0 0 55%;
	max-height: 450px;
	overflow-y: auto;
	border-right: 1px solid var(--wesf-s-border);
}

.wesf-search__preview {
	flex: 1;
	padding: 16px;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	overflow-y: auto;
	max-height: 450px;
}

/* --- Suggestion item --- */

.wesf-search__item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 12px;
	text-decoration: none;
	color: var(--wesf-s-text);
	border-bottom: 1px solid #f0f0f0;
	transition: background 0.1s;
	cursor: pointer;
}

.wesf-search__item:hover,
.wesf-search__item--active {
	background: var(--wesf-s-hover);
}

.wesf-search__thumb-small {
	width: 40px;
	height: 40px;
	object-fit: contain;
	flex-shrink: 0;
	border-radius: 4px;
}

.wesf-search__item-info {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.wesf-search__item-title {
	font-size: 13px;
	line-height: 1.3;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.wesf-search__item-title strong {
	font-weight: 700;
}

.wesf-search__item-price {
	font-size: 13px;
	font-weight: 600;
	color: var(--wesf-s-text);
	white-space: nowrap;
}

.wesf-search__item-price del {
	color: var(--wesf-s-muted);
	font-weight: 400;
	font-size: 12px;
}

/* --- See all link --- */

.wesf-search__see-all {
	display: block;
	padding: 10px 12px;
	text-align: center;
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: var(--wesf-s-muted);
	text-decoration: none;
	border-top: 1px solid var(--wesf-s-border);
	transition: background 0.1s, color 0.1s;
}

.wesf-search__see-all:hover {
	background: var(--wesf-s-hover);
	color: var(--wesf-s-accent);
}

/* --- Preview panel --- */

.wesf-search__preview-link {
	text-decoration: none;
	color: var(--wesf-s-text);
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	width: 100%;
}

.wesf-search__preview-img {
	max-width: 200px;
	max-height: 200px;
	object-fit: contain;
	border-radius: 4px;
}

.wesf-search__preview-title {
	font-size: 15px;
	font-weight: 600;
	text-align: center;
	margin: 0;
	line-height: 1.3;
}

.wesf-search__preview-title strong {
	font-weight: 800;
}

.wesf-search__preview-price {
	font-size: 18px;
	font-weight: 700;
	color: var(--wesf-s-text);
}

.wesf-search__preview-price del {
	color: var(--wesf-s-muted);
	font-size: 14px;
	font-weight: 400;
}

.wesf-search__preview-desc {
	font-size: 13px;
	color: var(--wesf-s-muted);
	line-height: 1.5;
	text-align: center;
	margin: 4px 0 0;
	display: -webkit-box;
	-webkit-line-clamp: 4;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.wesf-search__preview-badge {
	display: inline-block;
	background: var(--wesf-s-sale);
	color: #fff;
	font-size: 11px;
	font-weight: 600;
	padding: 2px 8px;
	border-radius: 3px;
	text-transform: uppercase;
}

/* --- Loading / Empty --- */

.wesf-search__loading,
.wesf-search__empty {
	padding: 24px;
	text-align: center;
	color: var(--wesf-s-muted);
	font-size: 14px;
}

/* --- Mobile responsive --- */

@media (max-width: 768px) {
	.wesf-search__results {
		flex-direction: column;
	}

	.wesf-search__list {
		flex: 1;
		border-right: none;
		border-bottom: 1px solid var(--wesf-s-border);
		max-height: 300px;
	}

	.wesf-search__preview {
		display: none; /* Hide preview on mobile — list is enough. */
	}

	.wesf-search__dropdown {
		max-height: 60vh;
	}
}
