/* ================================================================
   Xufa Product Selector — CSS del buscador [xufa_search]
   ================================================================ */

.xufa-search-wrap {
	position: relative;
	width: 100%;
	max-width: 1000px;
	margin: 0 auto;
}

/* ── Input ───────────────────────────────────────────────────── */
.xufa-search-input-wrap {
	position: relative;
	display: flex;
	align-items: center;
	background: #fff;
	border: 2px solid #e5e5e5;
	border-radius: 50px;
	padding: 0 20px;
	transition: all .2s ease;
}
.xufa-search-input-wrap:focus-within {
	border-color: #1BA09C;
	box-shadow: 0 0 0 3px rgba(27,160,156,.15);
}
.xufa-search-input-wrap svg { width: 20px; height: 20px; color: #888; flex-shrink: 0; }
.xufa-search-input {
	flex: 1;
	border: none !important;
	outline: none !important;
	background: transparent !important;
	padding: 14px 12px !important;
	font-size: 16px;
	box-shadow: none !important;
}
.xufa-search-input::placeholder { color: #999; }
.xufa-search-clear { background: none; border: none; padding: 8px; cursor: pointer; display: none; color: #888; }
.xufa-search-clear:hover { color: #333; }
.xufa-search-input-wrap.has-value .xufa-search-clear { display: block; }

/* ── Dropdown ────────────────────────────────────────────────── */
.xufa-search-dropdown {
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	right: 0;
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 10px 40px rgba(0,0,0,.15);
	max-height: 80vh;
	overflow: hidden;
	display: none;
	z-index: 9999;
}
.xufa-search-dropdown.is-open { display: block; }
.xufa-search-dropdown-inner   { display: flex; max-height: 80vh; }

/* ── Sugerencias ─────────────────────────────────────────────── */
.xufa-search-suggestions {
	width: 260px;
	border-right: 1px solid #eee;
	padding: 16px 0;
	overflow-y: auto;
	flex-shrink: 0;
}
.xufa-search-suggestions-title {
	font-size: 12px;
	font-weight: 700;
	color: #888;
	text-transform: uppercase;
	padding: 8px 20px;
	margin: 0;
}
.xufa-search-suggestion {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 20px;
	cursor: pointer;
	transition: background .15s;
}
.xufa-search-suggestion:hover { background: #f5f5f5; }
.xufa-search-suggestion svg   { width: 16px; height: 16px; color: #888; }
.xufa-search-suggestion span  { font-size: 14px; color: #333; }
.xufa-search-back {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 20px;
	cursor: pointer;
	font-size: 13px;
	color: #888;
	transition: color .15s;
	border-bottom: 1px solid #f0f0f0;
	margin-bottom: 4px;
}
.xufa-search-back:hover { color: #333; }
.xufa-search-back svg   { width: 14px; height: 14px; }

/* ── Resultados ──────────────────────────────────────────────── */
.xufa-search-results { flex: 1; padding: 16px; overflow-y: auto; }
.xufa-search-results-title {
	font-size: 12px;
	font-weight: 700;
	color: #888;
	text-transform: uppercase;
	margin: 0 0 12px;
}
.xufa-search-results-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 12px;
}
.xufa-search-results-empty { text-align: center; padding: 40px 20px; color: #888; }
.xufa-search-product {
	display: flex;
	flex-direction: column;
	text-decoration: none !important;
	color: inherit !important;
	padding: 12px;
	border-radius: 12px;
	transition: background .15s;
}
.xufa-search-product:hover { background: #f8f8f8; }
.xufa-search-product-img {
	width: 100%;
	aspect-ratio: 1;
	object-fit: contain;
	margin-bottom: 8px;
	border-radius: 8px;
	background: #fafafa;
}
.xufa-search-product-colors {
	display: flex;
	gap: 4px;
	margin-bottom: 6px;
	min-height: 12px;
}
.xufa-search-product-color  { width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(0,0,0,.1); }
.xufa-search-product-more   { font-size: 10px; color: #888; line-height: 12px; }
.xufa-search-product-name   { font-size: 13px; font-weight: 600; margin: 0 0 4px; line-height: 1.3; }
.xufa-search-product-price  { font-size: 12px; color: #888; margin: 0; }
.xufa-search-product-price strong { color: #1BA09C; font-size: 14px; font-weight: 700; }

/* ── Spinner ──────────────────────────────────────────────────── */
.xufa-search-loading {
	display: flex;
	justify-content: center;
	align-items: center;
	padding: 40px;
}
.xufa-search-spinner {
	width: 24px;
	height: 24px;
	border: 3px solid #eee;
	border-top-color: #1BA09C;
	border-radius: 50%;
	animation: xufa-spin .8s linear infinite;
}
@keyframes xufa-spin { to { transform: rotate(360deg); } }

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 768px) {
	.xufa-search-dropdown-inner  { flex-direction: column; }
	.xufa-search-suggestions     { width: 100%; border-right: none; border-bottom: 1px solid #eee; max-height: 120px; }
	.xufa-search-results-grid    { grid-template-columns: repeat(2, 1fr); }
}
