.res-search {
	--res-border: #d9dde3;
	--res-bg: #fff;
	--res-text: #1b1f24;
	--res-muted: #6a7380;
	--res-hover: #f3f5f8;
	position: relative;
	width: 100%;
	max-width: 640px;
	font-size: 15px;
	color: var(--res-text);
}
.res-search *, .res-search *::before, .res-search *::after { box-sizing: border-box; }

.res-field { position: relative; display: flex; align-items: center; }
.res-search .res-input {
	width: 100%;
	height: 46px;
	padding: 0 52px 0 16px;
	border: 1.5px solid var(--res-border);
	border-radius: 8px;
	background: var(--res-bg);
	color: var(--res-text);
	font-size: 15px;
	box-shadow: none;
	-webkit-appearance: none;
	appearance: none;
}
.res-search .res-input:focus { outline: none; border-color: var(--res-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--res-accent) 18%, transparent); }
.res-search .res-input::-webkit-search-cancel-button { display: none; }

.res-search .res-submit {
	position: absolute; right: 4px; top: 4px;
	width: 38px; height: 38px;
	display: flex; align-items: center; justify-content: center;
	padding: 0; border: 0; border-radius: 6px;
	background: var(--res-accent); color: #fff; cursor: pointer;
}
.res-search .res-submit:hover { filter: brightness(.92); }

.res-spinner {
	position: absolute; right: 52px; top: 50%;
	width: 16px; height: 16px; margin-top: -8px;
	border: 2px solid var(--res-border); border-top-color: var(--res-accent);
	border-radius: 50%; opacity: 0; pointer-events: none;
}
.res-search.is-loading .res-spinner { opacity: 1; animation: res-spin .7s linear infinite; }
@keyframes res-spin { to { transform: rotate(360deg); } }

.res-panel {
	position: absolute; z-index: 99999; left: 0; right: 0; top: calc(100% + 6px);
	max-height: min(70vh, 560px); overflow-y: auto;
	background: var(--res-bg);
	border: 1px solid var(--res-border); border-radius: 10px;
	box-shadow: 0 12px 32px rgba(15, 23, 42, .16);
}
.res-panel[hidden] { display: none; }

.res-group { padding: 6px 0; }
.res-group + .res-group { border-top: 1px solid var(--res-border); }
.res-title { padding: 6px 14px 4px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--res-muted); }

.res-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 14px 8px; }
.res-chip {
	display: inline-flex; align-items: center; gap: 6px;
	padding: 5px 11px; border: 1px solid var(--res-border); border-radius: 999px;
	color: var(--res-text); text-decoration: none; font-weight: 600; font-size: 13px;
}
.res-chip small { color: var(--res-muted); font-weight: 500; }
.res-chip:hover, .res-chip.is-active { background: var(--res-hover); border-color: var(--res-accent); }

.res-item {
	display: flex; align-items: center; gap: 12px;
	padding: 8px 14px; color: var(--res-text); text-decoration: none;
}
.res-item:hover, .res-item.is-active, .res-all:hover, .res-all.is-active { background: var(--res-hover); }
.res-item.is-out .res-thumb { opacity: .55; }
.res-thumb { flex: none; width: 56px; height: 56px; object-fit: contain; border-radius: 6px; background: #fff; border: 1px solid var(--res-border); }
.res-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.res-name { font-weight: 600; line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.res-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 12px; color: var(--res-muted); }
.res-brand { font-weight: 700; color: var(--res-text); }
.res-badge { padding: 1px 7px; border-radius: 4px; background: #fdecea; color: #b32d2e; font-weight: 600; }
.res-price { flex: none; font-weight: 700; white-space: nowrap; }

.res-search mark { background: #fff2a8; color: inherit; padding: 0; border-radius: 2px; }

.res-all {
	display: block; padding: 12px 14px; text-align: center;
	border-top: 1px solid var(--res-border);
	font-weight: 700; color: var(--res-accent); text-decoration: none;
}
.res-empty { padding: 18px 14px; color: var(--res-muted); text-align: center; }

@media (max-width: 600px) {
	.res-search { max-width: none; }
	.res-panel { max-height: 65vh; }
	.res-price { display: none; }
}

/* ---- Opciones del panel de resultados ---- */
.res-search { --res-accent: #e30613; }
.res-img-sm .res-thumb { width: 40px; height: 40px; }
.res-img-md .res-thumb { width: 56px; height: 56px; }
.res-img-lg .res-thumb { width: 80px; height: 80px; }

.res-w-wide .res-panel { right: auto; width: min(760px, 92vw); }

.res-layout-grid .res-list { display: grid; grid-template-columns: 1fr 1fr; }
.res-layout-grid .res-item { border-bottom: 1px solid var(--res-border); }

.res-cat { font-style: italic; }
.res-excerpt {
	margin-top: 2px; font-size: 12px; line-height: 1.35; color: var(--res-muted);
	overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}

@media (max-width: 600px) {
	.res-layout-grid .res-list { grid-template-columns: 1fr; }
	.res-w-wide .res-panel { width: auto; right: 0; }
}
