.romay-buscador {
	--romay-verde: #06a82b;
	--romay-verde-oscuro: #05881f;
	--romay-texto: #16202b;
	--romay-suave: #6b7783;
	--romay-borde: #dde2e8;
	--romay-fondo: #fff;
	--romay-alto: 54px;

	position: relative;
	width: 100%;
	font-size: 15px;
	color: var(--romay-texto);
	box-sizing: border-box;
}

.romay-buscador *,
.romay-buscador *::before,
.romay-buscador *::after {
	box-sizing: border-box;
}

/* ---------- Barra ---------- */

.romay-buscador__barra {
	display: flex;
	align-items: stretch;
	gap: 0;
	width: 100%;
}

.romay-buscador__campo {
	position: relative;
	flex: 1 1 auto;
	min-width: 0;
	width: auto;
	display: flex;
	align-items: center;
	background: var(--romay-fondo);
	border: 1px solid var(--romay-borde);
	border-right: 0;
	border-radius: 8px 0 0 8px;
	transition: border-color .15s ease, box-shadow .15s ease;
}

.romay-buscador__campo:focus-within {
	border-color: var(--romay-verde);
	box-shadow: 0 0 0 3px rgba(6, 168, 43, .14);
}

.romay-buscador__lupa {
	flex: 0 0 auto;
	width: 20px;
	height: 20px;
	margin-left: 16px;
	fill: none;
	stroke: var(--romay-suave);
	stroke-width: 2;
	stroke-linecap: round;
}

.romay-buscador .romay-buscador__input {
	flex: 1 1 auto;
	width: 100%;
	min-width: 0;
	height: var(--romay-alto);
	margin: 0;
	padding: 0 14px;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: var(--romay-texto);
	font-size: 15px;
	box-shadow: none;
	outline: none;
}

.romay-buscador .romay-buscador__input::placeholder {
	color: var(--romay-suave);
	opacity: 1;
}

/* Selector de sector pegado a la barra (modo compacto) */
.romay-buscador__tipo {
	flex: 0 0 132px;
	width: 132px;
	max-width: 132px;
	min-width: 132px;
	height: var(--romay-alto);
	margin: 0;
	padding: 0 30px 0 16px;
	border: 1px solid var(--romay-borde);
	border-right: 0;
	border-radius: 8px 0 0 8px;
	background-color: #f5f7f9;
	color: var(--romay-texto);
	font-size: 14px;
	line-height: 1.2;
	cursor: pointer;
	appearance: none;
	background-image: linear-gradient(45deg, transparent 50%, #6b7783 50%), linear-gradient(135deg, #6b7783 50%, transparent 50%);
	background-position: calc(100% - 19px) calc(50% + 2px), calc(100% - 14px) calc(50% + 2px);
	background-size: 5px 5px, 5px 5px;
	background-repeat: no-repeat;
}

.romay-buscador__tipo + .romay-buscador__campo {
	border-radius: 0;
}

.romay-buscador .romay-buscador__boton {
	flex: 0 0 auto;
	width: auto;
	height: var(--romay-alto);
	padding: 0 28px;
	border: 0;
	border-radius: 0 8px 8px 0;
	background: var(--romay-verde);
	color: #fff;
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
	transition: background-color .15s ease;
}

.romay-buscador .romay-buscador__boton:hover,
.romay-buscador .romay-buscador__boton:focus {
	background: var(--romay-verde-oscuro);
	color: #fff;
}

.romay-buscador.is-cargando .romay-buscador__boton {
	opacity: .75;
}

/* ---------- Panel completo con filtros ---------- */

.romay-buscador--panel {
	max-width: 940px;
	padding: 22px;
	background: var(--romay-fondo);
	border: 1px solid #e8ecf0;
	border-radius: 14px;
	box-shadow: 0 18px 40px rgba(16, 24, 32, .10);
}

.romay-buscador__filtros {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 14px;
	margin-top: 16px;
}

.romay-buscador__filtro {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
	margin: 0;
}

.romay-buscador__etiqueta {
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .09em;
	text-transform: uppercase;
	color: var(--romay-suave);
}

.romay-buscador .romay-buscador__select {
	width: 100%;
	max-width: 100%;
	height: 46px;
	margin: 0;
	padding: 0 34px 0 14px;
	border: 1px solid var(--romay-borde);
	border-radius: 8px;
	background-color: #f7f9fa;
	color: var(--romay-texto);
	font-size: 14px;
	line-height: 1.2;
	cursor: pointer;
	appearance: none;
	background-image: linear-gradient(45deg, transparent 50%, #6b7783 50%), linear-gradient(135deg, #6b7783 50%, transparent 50%);
	background-position: calc(100% - 21px) calc(50% + 2px), calc(100% - 16px) calc(50% + 2px);
	background-size: 5px 5px, 5px 5px;
	background-repeat: no-repeat;
}

.romay-buscador .romay-buscador__select:focus {
	outline: none;
	border-color: var(--romay-verde);
	box-shadow: 0 0 0 3px rgba(6, 168, 43, .14);
}

.romay-buscador__atajos {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-top: 16px;
	padding-top: 14px;
	border-top: 1px solid #eef1f4;
}

.romay-buscador__atajos-titulo {
	font-size: 13px;
	color: var(--romay-suave);
}

.romay-buscador__atajo {
	display: inline-block;
	padding: 5px 12px;
	border: 1px solid var(--romay-borde);
	border-radius: 999px;
	background: #f7f9fa;
	color: var(--romay-texto);
	font-size: 13px;
	text-decoration: none;
	transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}

.romay-buscador__atajo:hover,
.romay-buscador__atajo:focus {
	border-color: var(--romay-verde);
	background: rgba(6, 168, 43, .08);
	color: var(--romay-verde-oscuro);
}

/* ---------- Sugerencias ---------- */

.romay-buscador__panel {
	position: absolute;
	z-index: 9999;
	top: calc(100% + 8px);
	left: 0;
	right: 0;
	min-width: 320px;
	max-height: 70vh;
	overflow-y: auto;
	background: var(--romay-fondo);
	border: 1px solid #e6eaee;
	border-radius: 10px;
	box-shadow: 0 16px 38px rgba(16, 24, 32, .18);
	text-align: left;
}

.romay-buscador.is-cargando .romay-buscador__panel {
	opacity: .45;
	pointer-events: none;
}

.romay-buscador__grupo {
	padding: 11px 16px 6px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .09em;
	text-transform: uppercase;
	color: var(--romay-suave);
}

.romay-buscador__item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 9px 16px;
	text-decoration: none;
	color: var(--romay-texto);
	border-top: 1px solid #f1f3f6;
}

.romay-buscador__item:hover,
.romay-buscador__item.is-activo {
	background: #f5f8fa;
}

.romay-buscador__img {
	flex: 0 0 auto;
	width: 48px;
	height: 48px;
	object-fit: contain;
	border-radius: 6px;
	background: #f4f6f8;
}

.romay-buscador__img--vacia {
	display: block;
	border: 1px dashed var(--romay-borde);
	background: #fafbfc;
}

.romay-buscador__texto {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 3px;
}

.romay-buscador__titulo {
	font-weight: 600;
	line-height: 1.3;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.romay-buscador__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	font-size: 12px;
	color: var(--romay-suave);
}

.romay-buscador__ref {
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.romay-buscador__stock.es-stock {
	color: #1c7a3c;
	font-weight: 600;
}

.romay-buscador__precio {
	flex: 0 0 auto;
	font-weight: 700;
	white-space: nowrap;
}

.romay-buscador__precio del {
	font-weight: 400;
	opacity: .6;
	margin-right: 4px;
}

.romay-buscador__todo {
	display: block;
	padding: 13px 16px;
	text-align: center;
	font-weight: 600;
	color: var(--romay-verde-oscuro);
	text-decoration: none;
	border-top: 1px solid #f1f3f6;
}

.romay-buscador__todo:hover {
	background: #f5f8fa;
}

.romay-buscador__vacio {
	padding: 20px 16px;
	color: var(--romay-suave);
	line-height: 1.55;
}

/* ---------- Zona automática en tienda y resultados ---------- */

.romay-buscador-zona {
	margin: 0 auto 30px;
	max-width: 940px;
}

/* ---------- Móvil ---------- */

@media (max-width: 782px) {
	.romay-buscador__filtros {
		grid-template-columns: 1fr;
		gap: 10px;
	}

	.romay-buscador--panel {
		padding: 16px;
	}
}

@media (max-width: 600px) {
	.romay-buscador__tipo {
		display: none;
	}

	.romay-buscador__campo {
		border-radius: 8px 0 0 8px;
	}

	.romay-buscador__lupa {
		margin-left: 12px;
	}

	.romay-buscador .romay-buscador__boton {
		padding: 0 18px;
	}

	.romay-buscador__panel {
		min-width: 0;
	}
}
