/**
 * LinoCrochet: buscador ligero del header y pagina de resultados.
 */

/* ---------- Buscador ligero (header) ---------- */

.lino-buscador {
	position: relative;
	max-width: 420px;
	width: 100%;
}

.lino-buscador__form {
	position: relative;
	display: flex;
	align-items: center;
	margin: 0;
}

.lino-buscador__lupa {
	position: absolute;
	left: 14px;
	width: 17px;
	height: 17px;
	color: #8a7b60;
	pointer-events: none;
}

/* Prefijo "input" y estados explícitos: mismo criterio que el estándar
   de botones, para que los estilos de formularios del tema no se cuelen. */
input[type="search"].lino-buscador__campo {
	width: 100%;
	height: 42px;
	padding: 0 16px 0 40px;
	background: #fff;
	border: 1px solid #e5e0d8;
	border-radius: 999px;
	font-size: 0.92rem;
	color: #4f4636;
	box-shadow: none;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input[type="search"].lino-buscador__campo::placeholder {
	color: #a8987d;
}

input[type="search"].lino-buscador__campo:focus {
	background: #fff;
	color: #4f4636;
	border-color: #c9a227;
	outline: none;
	box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.18);
}

/* Spinner sutil en la lupa mientras llega la respuesta. */
.lino-buscador.esta-buscando .lino-buscador__lupa {
	animation: lino-girar 0.8s linear infinite;
	transform-origin: center;
}

/* Desplegable de resultados */

.lino-buscador__panel {
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	right: 0;
	z-index: 50;
	background: #fff;
	border: 1px solid #eee7da;
	border-radius: 14px;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
	overflow: hidden;
}

.lino-buscador__item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 14px;
	text-decoration: none;
	color: #4f4636;
	transition: background 0.12s ease;
}

.lino-buscador__item:hover,
.lino-buscador__item:focus {
	background: #fdf8e7;
	color: #4f4636;
	outline: none;
}

.lino-buscador__imagen {
	width: 44px;
	height: 44px;
	object-fit: cover;
	border-radius: 8px;
	flex-shrink: 0;
	background: #f4efe6;
}

.lino-buscador__textos {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.lino-buscador__nombre {
	font-size: 0.92rem;
	font-weight: 500;
	color: #2f2a1e;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.lino-buscador__precio {
	font-size: 0.85rem;
	font-weight: 600;
	color: #a08420;
}

.lino-buscador__precio del {
	color: #a8987d;
	font-weight: 400;
	margin-right: 6px;
}

.lino-buscador__todos {
	display: block;
	padding: 11px 14px;
	text-align: center;
	font-size: 0.88rem;
	font-weight: 600;
	color: #a08420;
	text-decoration: none;
	background: #fdf8e7;
	border-top: 1px solid #f0e9d8;
	transition: background 0.12s ease;
}

.lino-buscador__todos:hover,
.lino-buscador__todos:focus {
	background: #f7efd6;
	color: #6b5a12;
	outline: none;
}

.lino-buscador__vacio {
	margin: 0;
	padding: 16px 14px;
	font-size: 0.9rem;
	color: #8a7b60;
	text-align: center;
}

/* Modo modal: solo un botón con lupa en el header */

.lino-buscador--modal {
	max-width: none;
	width: auto;
	height: 100%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

/* Botón de lupa: sin fondo ni borde, queda solo el ícono. Los estados
   explícitos evitan que el tema pinte sus colores de botón. */
button.lino-buscador__abrir,
button.lino-buscador__abrir:hover,
button.lino-buscador__abrir:focus {
	padding: 0 !important;
	background: none;
	border: none;
	box-shadow: none;
	outline: none;
}

button.lino-buscador__abrir {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	color: #a67b5b;
	cursor: pointer;
	transition: color 0.15s ease, transform 0.15s ease;
}

button.lino-buscador__abrir svg {
	width: 20px;
	height: 20px;
}

button.lino-buscador__abrir:hover,
button.lino-buscador__abrir:focus {
	color: #c9a227;
}

button.lino-buscador__abrir:hover {
	transform: scale(1.1);
}

button.lino-buscador__abrir:focus-visible {
	outline: 2px solid #c9a227;
	outline-offset: 3px;
	border-radius: 4px;
}

/* Overlay y diálogo */

/* El display: flex de abajo le ganaría al [hidden] del navegador
   y el modal quedaría siempre abierto; esta regla lo evita. */
.lino-buscador__overlay[hidden] {
	display: none;
}

.lino-buscador__overlay {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: flex;
	justify-content: center;
	align-items: flex-start;
	padding: 12vh 20px 20px;
	background: rgba(47, 42, 30, 0.55);
	backdrop-filter: blur(3px);
	animation: lino-buscador-fondo 0.2s ease both;
}

.lino-buscador__dialogo {
	position: relative;
	width: min(560px, 100%);
	padding: 20px;
	background: #fff;
	border-radius: 18px;
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
	animation: lino-buscador-entrar 0.25s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes lino-buscador-fondo {
	from {
		opacity: 0;
	}

	to {
		opacity: 1;
	}
}

@keyframes lino-buscador-entrar {
	from {
		opacity: 0;
		transform: translateY(-14px) scale(0.98);
	}

	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

button.lino-buscador__cerrar {
	position: absolute;
	top: -14px;
	right: -14px;
	width: 34px;
	height: 34px;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #fff;
	border: 1px solid #e5e0d8;
	border-radius: 50%;
	color: #4f4636;
	font-size: 1.2rem;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
	transition: background 0.15s ease, color 0.15s ease;
}

button.lino-buscador__cerrar:hover,
button.lino-buscador__cerrar:focus {
	background: #c9a227;
	border-color: #c9a227;
	color: #fff;
	outline: none;
}

/* Dentro del modal, los resultados van en flujo (no flotando) y con scroll. */
.lino-buscador--modal .lino-buscador__panel {
	position: static;
	margin-top: 12px;
	max-height: 55vh;
	overflow-y: auto;
	box-shadow: none;
	border-color: #f0e9d8;
}

body.lino-sin-scroll {
	overflow: hidden;
}

@media (prefers-reduced-motion: reduce) {
	.lino-buscador__overlay,
	.lino-buscador__dialogo {
		animation: none;
	}
}

/* ---------- Página de resultados de búsqueda ---------- */

.lino-pagina-busqueda__encabezado {
	margin-bottom: 24px;
}

.lino-pagina-busqueda__antetitulo {
	margin: 0 0 4px;
	font-size: 0.85rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: #a08420;
}

.lino-pagina-busqueda__titulo {
	margin: 0 0 6px;
	font-size: clamp(1.6rem, 4vw, 2.2rem);
	color: #2f2a1e;
}

.lino-pagina-busqueda__contador {
	font-size: 0.95rem;
	color: #8a7b60;
}

.lino-pagina-busqueda__texto {
	margin: 0;
	color: #5c5244;
	line-height: 1.6;
}

.lino-pagina-busqueda__buscador {
	margin-top: 20px;
	max-width: 480px;
}

.lino-pagina-busqueda__orden {
	display: flex;
	justify-content: flex-end;
	margin-bottom: 20px;
}

