.sqs-search-wrap,
.sqs-search-wrap * {
	box-sizing: border-box;
}

.sqs-search-wrap {
	position: relative;
	max-width: 480px;
	width: 100%;
	font-family: inherit;
}

.sqs-search-form {
	margin: 0;
}

.sqs-search-box {
	display: flex;
	align-items: stretch;
	background: #fff;
	border: 1px solid #ddd !important;
	border-radius: 4px;
	overflow: hidden;
}

.sqs-search-input,
input.sqs-search-input[type="text"],
input.sqs-search-input[type="search"] {
	flex: 1;
	min-width: 0;
	border: none !important;
	outline: none !important;
	box-shadow: none !important;
	padding: 10px 12px;
	font-size: 14px;
	line-height: 1.4;
	color: #333;
	background: transparent !important;
	margin: 0;
	border-radius: 0 !important;
	height: auto;
}

.sqs-clear-btn {
	cursor: pointer;
	color: #999;
	font-size: 20px;
	line-height: 1;
	padding: 0 8px;
	display: flex;
	align-items: center;
}

.sqs-search-btn,
button.sqs-search-btn {
	background: #222 !important;
	color: #fff !important;
	border: none !important;
	width: 46px;
	min-width: 46px;
	height: auto;
	margin: 0;
	padding: 0;
	display: flex !important;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	flex-shrink: 0;
	border-radius: 0 !important;
	box-shadow: none !important;
}

.sqs-search-btn:hover {
	background: #444 !important;
}

.sqs-search-btn.sqs-btn-disabled {
	opacity: 0.5;
	cursor: default;
}

.sqs-search-btn.sqs-btn-disabled:hover {
	background: #222 !important;
}

.sqs-search-btn svg {
	display: block !important;
	width: 18px !important;
	height: 18px !important;
	stroke: #fff !important;
	fill: none !important;
	flex-shrink: 0;
	pointer-events: none;
}

.sqs-results-dropdown {
	position: absolute;
	top: calc(100% + 4px);
	left: 0;
	right: 0;
	background: #fff;
	border: 1px solid #eee;
	border-radius: 4px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
	max-height: 420px;
	overflow-y: auto;
	z-index: 99999;
}

.sqs-result-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 12px;
	text-decoration: none;
	color: inherit;
	border-bottom: 1px solid #f2f2f2;
	transition: background 0.15s;
}

.sqs-result-item:last-child {
	border-bottom: none;
}

.sqs-result-item:hover {
	background: #f8f8f8;
}

.sqs-result-img {
	width: 44px;
	height: 44px;
	object-fit: cover;
	border-radius: 3px;
	flex-shrink: 0;
	background: #f2f2f2;
}

.sqs-result-info {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.sqs-result-title {
	font-size: 13px;
	color: #222;
	font-weight: 500;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.sqs-result-desc {
	font-size: 11px;
	color: #999;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	margin-top: 1px;
}

.sqs-result-meta {
	font-size: 12px;
	color: #888;
	display: flex;
	gap: 8px;
	margin-top: 2px;
}

.sqs-result-price {
	color: #c0392b;
	font-weight: 600;
}

.sqs-mobile-close {
	display: none;
}

.sqs-result-title strong,
.sqs-result-desc strong,
.sqs-result-sku strong {
	font-weight: 700;
	color: inherit;
}

.sqs-no-results,
.sqs-loading {
	padding: 16px 12px;
	font-size: 13px;
	color: #999;
	text-align: center;
}

/* ---------- Mobile-first special mode ---------- */
/* On small screens, the dropdown becomes a full-screen overlay for easier tapping,
   and the search box gets an overlay/close treatment for better UX. */
@media (max-width: 600px) {

	/* Icon-only mode (admin setting): collapse to just the round search icon. */
	.sqs-search-wrap.sqs-mode-icon:not(.sqs-mobile-active) {
		max-width: 46px;
	}

	.sqs-search-wrap.sqs-mode-icon:not(.sqs-mobile-active) .sqs-search-input,
	.sqs-search-wrap.sqs-mode-icon:not(.sqs-mobile-active) .sqs-clear-btn {
		display: none;
	}

	.sqs-search-wrap.sqs-mode-icon:not(.sqs-mobile-active) .sqs-search-box {
		border: none !important;
		border-radius: 50%;
		width: 46px;
		height: 46px;
	}

	.sqs-search-wrap.sqs-mode-icon:not(.sqs-mobile-active) .sqs-search-btn {
		width: 46px;
		min-width: 46px;
		height: 46px;
		border-radius: 50%;
	}

	.sqs-search-wrap.sqs-mobile-active {
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 999999;
		background: #fff;
		max-width: 100%;
		padding: 10px;
		display: flex;
		flex-direction: column;
	}

	.sqs-search-wrap.sqs-mobile-active .sqs-search-box {
		border-radius: 24px;
		border: 1px solid #ccc;
	}

	.sqs-search-wrap.sqs-mobile-active .sqs-search-input {
		padding: 12px 14px;
		font-size: 16px; /* prevents iOS zoom on focus */
	}

	.sqs-mobile-close {
		display: none;
		background: none;
		border: none;
		font-size: 22px;
		color: #333;
		padding: 6px 10px;
		cursor: pointer;
	}

	.sqs-search-wrap.sqs-mobile-active .sqs-mobile-close {
		display: block;
	}

	.sqs-search-wrap.sqs-mobile-active .sqs-search-box {
		flex: 1;
	}

	.sqs-search-wrap.sqs-mobile-active .sqs-results-dropdown {
		position: static;
		display: block !important;
		flex: 1;
		margin-top: 10px;
		max-height: none;
		box-shadow: none;
		border: none;
		overflow-y: auto;
	}

	.sqs-search-wrap.sqs-mobile-active .sqs-result-item {
		padding: 12px;
	}

	.sqs-search-wrap.sqs-mobile-active .sqs-result-img {
		width: 56px;
		height: 56px;
	}
}
