/*!
 * Sentio for Elementor - wc-product-search widget styles
 * Extracted from frontend.css during WC Batch 1 sub-batch 3 mechanical extraction (2026-04-20).
 * Tier 3 mechanical extraction — verbatim from monolith.
 *
 * UPDATE 2026-04-20: the cross-widget `.sentio-pp*` and `.sentio-cd*` rules
 * that previously lived in the @media (max-width: 767px) block of this file
 * (pulled in verbatim from the monolith's interleaved multi-widget block)
 * have been moved to their owning widget files during the CSS cross-
 * contamination rescue: `.sentio-cd*` → wc-sale-countdown.css (new @media
 * block). `.sentio-pp*` was a duplicate of rules already correctly present
 * at wc-product-price.css:150-158 so was simply deleted here. See
 * `_audits/ports/css-contamination-rescue.md`.
 */

/* ── WC-10  Product Search ────────────────────────────────────────── */

.sentio-ps {
	position: relative;
	width: 100%;
	max-width: 600px;
}

.sentio-ps__form {
	position: relative;
	display: flex;
	align-items: center;
	gap: 0;
}

.sentio-ps__cat {
	appearance: none;
	-webkit-appearance: none;
	padding: 12px 32px 12px 16px;
	border: 2px solid #e0e0e0;
	border-right: none;
	border-radius: 8px 0 0 8px;
	background: #f9f9f9 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23666'/%3E%3C/svg%3E") no-repeat right 12px center;
	font-size: 14px;
	color: #333;
	cursor: pointer;
	min-width: 140px;
	/* Themes commonly reset `select { width: 100% }` — Hello Elementor's
	   assets/css/reset.css does. Left as-is that width resolves this flex item's
	   basis to the full row, so the adjacent input collapses to its min-content
	   width (~34px) and becomes unusable. Pin the basis to the select's own size. */
	flex: 0 0 auto;
	width: auto;
	height: 48px;
	box-sizing: border-box;
}

.sentio-ps__input-wrap {
	flex: 1;
	min-width: 0;	/* allow the field to shrink instead of overflowing the row */
	position: relative;
	display: flex;
	align-items: center;
}

.sentio-ps__input {
	width: 100%;
	padding: 12px 42px 12px 16px;
	border: 2px solid #e0e0e0;
	border-radius: 0 8px 8px 0;
	font-size: 14px;
	color: #333;
	outline: none;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
	height: 48px;
	box-sizing: border-box;
}

/* Remove native search clear button (webkit) */
.sentio-ps__input::-webkit-search-cancel-button {
	-webkit-appearance: none;
	display: none;
}

.sentio-ps--no-cat .sentio-ps__input {
	border-radius: 8px;
}

.sentio-ps__input:focus {
	border-color: #333;
	box-shadow: 0 0 0 3px rgba(0,0,0,0.06);
}

/* Search icon (magnifying glass) */
.sentio-ps__search-icon {
	position: absolute;
	right: 14px;
	top: 50%;
	transform: translateY(-50%);
	width: 18px;
	height: 18px;
	color: #999;
	pointer-events: none;
	transition: color 0.2s ease, opacity 0.15s ease;
	z-index: 1;
}

.sentio-ps__input:focus ~ .sentio-ps__search-icon {
	color: #333;
}

/* Hide search icon when input has text (has-value state set by JS) */
.sentio-ps--has-value .sentio-ps__search-icon {
	opacity: 0;
	pointer-events: none;
}

/* Clear button */
.sentio-ps__clear {
	position: absolute;
	right: 10px;
	top: 50%;
	transform: translateY(-50%);
	display: flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	padding: 0;
	border: none;
	background: #e5e7eb;
	border-radius: 50%;
	color: #6b7280;
	cursor: pointer;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
	z-index: 2;
}

.sentio-ps__clear svg { width: 12px; height: 12px; }

.sentio-ps--has-value .sentio-ps__clear {
	opacity: 1;
	pointer-events: auto;
}

.sentio-ps__clear:hover {
	background: #d1d5db;
	color: #374151;
}

/* Spinner */
.sentio-ps__spinner {
	position: absolute;
	right: 14px;
	top: 50%;
	transform: translateY(-50%);
	width: 18px;
	height: 18px;
	display: none;
	color: #999;
	z-index: 3;
}

.sentio-ps__spinner svg {
	width: 18px;
	height: 18px;
	animation: sentio-ps-spin 0.6s linear infinite;
}

.sentio-ps--loading .sentio-ps__spinner {
	display: flex;
	align-items: center;
	justify-content: center;
}

/* Loading state: hide search icon and clear, show spinner */
.sentio-ps--loading .sentio-ps__search-icon {
	opacity: 0;
}

.sentio-ps--loading .sentio-ps__clear {
	opacity: 0;
	pointer-events: none;
}

@keyframes sentio-ps-spin {
	to { transform: rotate(360deg); }
}

/* Expanding bar */
.sentio-ps--expand {
	max-width: 48px;
	transition: max-width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
	overflow: hidden;
}

.sentio-ps--expand.sentio-ps--expanded {
	max-width: 600px;
}

.sentio-ps--expand .sentio-ps__input {
	padding-left: 44px;
}

.sentio-ps--expand .sentio-ps__search-icon {
	left: 14px;
	right: auto;
	cursor: pointer;
	pointer-events: auto;
}

/* In expand mode, search icon stays visible even with text */
.sentio-ps--expand.sentio-ps--has-value .sentio-ps__search-icon {
	opacity: 1;
}

/* Dropdown */
.sentio-ps__dropdown {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	right: 0;
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 10px;
	box-shadow: 0 8px 30px rgba(0,0,0,0.12);
	z-index: 9999;
	max-height: 420px;
	overflow-y: auto;
	display: none;
}

.sentio-ps__dropdown--open {
	display: block;
	animation: sentio-ps-fadeIn 0.2s ease;
}

@keyframes sentio-ps-fadeIn {
	from { opacity: 0; transform: translateY(-6px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* Result item */
.sentio-ps__result {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 14px;
	text-decoration: none;
	color: #333;
	transition: background 0.15s ease;
	cursor: pointer;
}

.sentio-ps__result:hover,
.sentio-ps__result--active {
	background: #f5f5f5;
}

.sentio-ps__result-thumb {
	width: 44px;
	height: 44px;
	border-radius: 6px;
	object-fit: cover;
	flex-shrink: 0;
	background: #f0f0f0;
}

.sentio-ps__result-info {
	flex: 1;
	min-width: 0;
}

.sentio-ps__result-title {
	font-size: 14px;
	font-weight: 500;
	color: #333;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	line-height: 1.3;
}

.sentio-ps__result-price {
	font-size: 13px;
	color: #666;
	margin-top: 2px;
}

.sentio-ps__result-price del {
	color: #bbb;
	margin-right: 4px;
}

.sentio-ps__result-price ins {
	text-decoration: none;
	color: #e53935;
	font-weight: 600;
}

.sentio-ps__result-sale {
	display: inline-block;
	background: #e53935;
	color: #fff;
	font-size: 10px;
	font-weight: 600;
	padding: 2px 6px;
	border-radius: 3px;
	margin-left: 6px;
	line-height: 1;
}

/* Stars in results */
.sentio-ps__result-rating {
	display: inline-flex;
	gap: 1px;
	margin-top: 2px;
}

.sentio-ps__result-rating svg {
	width: 12px;
	height: 12px;
}

/* Section headers in dropdown */
.sentio-ps__section {
	padding: 8px 14px 4px;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: #999;
}

/* Popular / Recent search tags */
.sentio-ps__tags {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	padding: 8px 14px 12px;
}

.sentio-ps__tag {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 5px 10px;
	background: #f0f0f0;
	border: none;
	border-radius: 16px;
	font-size: 12px;
	color: #555;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease;
}

.sentio-ps__tag:hover {
	background: #e0e0e0;
	color: #333;
}

.sentio-ps__tag svg {
	width: 12px;
	height: 12px;
}

/* No results */
.sentio-ps__empty {
	padding: 24px 14px;
	text-align: center;
	color: #999;
	font-size: 14px;
}

.sentio-ps__empty-icon {
	width: 40px;
	height: 40px;
	margin: 0 auto 8px;
	color: #ccc;
}

/* View all link */
.sentio-ps__view-all {
	display: block;
	text-align: center;
	padding: 10px;
	font-size: 13px;
	font-weight: 500;
	color: #333;
	text-decoration: none;
	border-top: 1px solid #eee;
	transition: background 0.15s ease;
}

.sentio-ps__view-all:hover {
	background: #f5f5f5;
}

/* Keyboard nav highlight */
.sentio-ps__result--kb {
	background: #eef2ff;
}

/* Responsive */
@media (max-width: 767px) {
	.sentio-ps__cat {
		min-width: 100px;
		font-size: 12px;
	}

	.sentio-ps__dropdown {
		max-height: 340px;
	}
}
