/* Product Search Bar – frontend */
.psb {
	--psb-accent: #111;
	--psb-bg: #fff;
	--psb-text: #1d1d1f;
	--psb-muted: #6e6e73;
	--psb-border: #d9d9de;
	--psb-hover: #f4f4f6;
	--psb-radius: 10px;
	position: relative;
	width: 100%;
	font: inherit;
	color: var(--psb-text);
}

.psb-sr {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

.psb-form {
	position: relative;
	display: flex;
	align-items: center;
	margin: 0;
}

.psb-icon {
	position: absolute;
	left: 14px;
	width: 18px; height: 18px;
	color: var(--psb-muted);
	pointer-events: none;
}

.psb .psb-input {
	width: 100%;
	height: 48px;
	margin: 0;
	padding: 0 44px 0 42px;
	border: 1px solid var(--psb-border);
	border-radius: var(--psb-radius);
	background: var(--psb-bg);
	color: var(--psb-text);
	font: inherit;
	font-size: 16px; /* evita el zoom en iOS */
	box-shadow: none;
	outline: none;
	transition: border-color .15s, box-shadow .15s;
	-webkit-appearance: none;
	appearance: none;
}
.psb .psb-input::-webkit-search-cancel-button { display: none; }
.psb .psb-input:focus {
	border-color: var(--psb-accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--psb-accent) 18%, transparent);
}
.psb.is-open .psb-input { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }

.psb .psb-clear {
	position: absolute;
	right: 8px;
	width: 32px; height: 32px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--psb-muted);
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
}
.psb .psb-clear:hover { background: var(--psb-hover); color: var(--psb-text); }
.psb .psb-clear[hidden] { display: none; }

.psb-spinner {
	position: absolute;
	right: 46px;
	width: 16px; height: 16px;
	border: 2px solid var(--psb-border);
	border-top-color: var(--psb-accent);
	border-radius: 50%;
	opacity: 0;
	pointer-events: none;
}
body:has(.psb-loading) .psb-spinner { opacity: 1; animation: psb-spin .7s linear infinite; }

.psb-dropdown {
	position: absolute;
	z-index: 9999;
	top: 100%;
	left: 0; right: 0;
	max-height: min(70vh, 520px);
	overflow-y: auto;
	padding: 6px;
	border: 1px solid var(--psb-accent);
	border-top: 0;
	border-radius: 0 0 var(--psb-radius) var(--psb-radius);
	background: var(--psb-bg);
	box-shadow: 0 12px 28px rgba(0, 0, 0, .12);
}
.psb-dropdown[hidden] { display: none; }

.psb-group + .psb-group { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--psb-hover); }

.psb-heading {
	padding: 6px 10px 4px;
	color: var(--psb-muted);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .04em;
	text-transform: uppercase;
}

.psb-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 10px;
	border-radius: 6px;
	color: var(--psb-text);
	text-decoration: none;
	cursor: pointer;
	line-height: 1.3;
}
.psb-item:hover, .psb-item.is-active { background: var(--psb-hover); color: var(--psb-text); }
.psb-item mark { background: transparent; color: inherit; font-weight: 700; padding: 0; }

.psb-item-icon { display: flex; flex: none; color: var(--psb-muted); }
.psb-item-icon svg { width: 16px; height: 16px; }

.psb-product img {
	flex: none;
	width: 44px; height: 44px;
	object-fit: cover;
	border-radius: 6px;
	background: var(--psb-hover);
}
.psb-product-info { display: flex; flex-direction: column; min-width: 0; }
.psb-product-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.psb-product-price { color: var(--psb-muted); font-size: 13px; }
.psb-product-price del { opacity: .7; }
.psb-product-price ins { text-decoration: none; color: var(--psb-text); }

.psb-fix { color: var(--psb-muted); }
.psb-fix strong { color: var(--psb-accent); font-weight: 700; }

.psb-all {
	margin-top: 4px;
	justify-content: center;
	color: var(--psb-accent);
	font-weight: 600;
	font-size: 14px;
}

/* Listing mientras carga */
.psb-loading {
	opacity: .45;
	pointer-events: none;
	transition: opacity .15s;
}

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

@media (prefers-reduced-motion: reduce) {
	.psb *, .psb-loading { transition: none !important; animation: none !important; }
}
