/* BW3D — buscador de productos del header ([bw3d_product_search]).
 * Pill gris claro sobre la fila blanca del logo; foco con el rojo de marca;
 * panel de sugerencias blanco con fillet de 16px como el resto del header. */

.bw3d-search {
	position: relative;
	display: flex;
	align-items: center;
	width: 100%;
	max-width: 560px;
	height: 48px;
	margin: 0 auto;
	padding: 0 6px 0 18px;
	background: #F0F2F4;
	border: 1.5px solid transparent;
	border-radius: 999px;
	font-family: "Space Grotesk", sans-serif;
	transition: border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

.bw3d-search:focus-within {
	background: #fff;
	border-color: #F14F44;
	box-shadow: 0 0 0 4px rgba(241, 79, 68, 0.12);
}

.bw3d-search__icon {
	flex: none;
	width: 18px;
	height: 18px;
	fill: none;
	stroke: #242021;
	stroke-width: 2;
	stroke-linecap: round;
	opacity: 0.55;
}

.bw3d-search .bw3d-search__input {
	flex: 1;
	min-width: 0;
	height: 100%;
	margin: 0;
	padding: 0 12px;
	background: transparent;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	outline: none;
	color: #242021;
	font: 500 14px/1 "Space Grotesk", sans-serif;
}

.bw3d-search .bw3d-search__input::placeholder { color: rgba(36, 32, 33, 0.5); }
.bw3d-search .bw3d-search__input::-webkit-search-cancel-button { cursor: pointer; }

.bw3d-search .bw3d-search__submit {
	flex: none;
	display: grid;
	place-items: center;
	width: 36px;
	height: 36px;
	margin: 0;
	padding: 0;
	background: #242021;
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	transition: background-color 0.18s ease, transform 0.18s ease;
}

.bw3d-search .bw3d-search__submit:hover,
.bw3d-search .bw3d-search__submit:focus-visible { background: #F14F44; }

.bw3d-search__submit svg {
	width: 16px;
	height: 16px;
	fill: none;
	stroke: #fff;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.bw3d-search.is-loading .bw3d-search__icon { animation: bw3d-search-pulse 0.8s ease-in-out infinite alternate; }
@keyframes bw3d-search-pulse { to { opacity: 0.15; } }

/* Ubicacion en el header (plantilla 91): el buscador ocupa el espacio libre de la
   fila del logo sin apretar al menu "Superior BW3D". */
@media (min-width: 1025px) {
	/* Por id: el contenedor 8b9c0d1e (logo + menu) no imprime su clase bw-left. */
	.elementor-element-7a8b9c0d > .elementor-element-8b9c0d1e { flex: 1 1 auto; width: auto; }
	.elementor-element-7a8b9c0d > .elementor-element-c2d3e4f5 { flex: 0 0 auto; width: auto; }
	.elementor-element-8b9c0d1e > .elementor-element-b1c2d3e4 { flex-shrink: 0; }
	.elementor-element-b1c2d3e4 .elementor-nav-menu { flex-wrap: nowrap; white-space: nowrap; }
	.elementor-element-8b9c0d1e > .bw-search--desk { flex: 1 1 auto; min-width: 220px; }
}

/* Panel de sugerencias */
.bw3d-search__panel {
	position: absolute;
	top: calc(100% + 8px);
	right: 0;
	z-index: 1001;
	width: max(100%, 440px);
	max-width: calc(100vw - 32px);
	max-height: min(70vh, 480px);
	overflow-y: auto;
	padding: 8px;
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 18px 40px -12px rgba(0, 0, 0, 0.25);
}

.bw3d-search__panel[hidden] { display: none; }

.bw3d-search__item {
	display: grid;
	grid-template-columns: 48px 1fr auto;
	align-items: center;
	gap: 12px;
	padding: 8px 10px;
	border-radius: 10px;
	color: #242021;
	text-decoration: none;
	transition: background-color 0.12s ease;
}

.bw3d-search__item img {
	width: 48px;
	height: 48px;
	object-fit: contain;
	background: #F0F2F4;
	border-radius: 8px;
}

.bw3d-search .bw3d-search__name {
	color: #242021;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.3;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.bw3d-search .bw3d-search__price {
	color: #242021;
	font-size: 13px;
	font-weight: 600;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

.bw3d-search__item:hover,
.bw3d-search__item.is-active { background: #F0F2F4; color: #242021; }
.bw3d-search .bw3d-search__item:hover .bw3d-search__name,
.bw3d-search .bw3d-search__item.is-active .bw3d-search__name { color: #F14F44; }

.bw3d-search .bw3d-search__all {
	display: block;
	margin-top: 6px;
	padding: 12px 10px;
	border-top: 1px solid #F0F2F4;
	color: #242021;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-decoration: none;
	border-radius: 0 0 10px 10px;
}

.bw3d-search .bw3d-search__all:hover,
.bw3d-search .bw3d-search__all.is-active { color: #F14F44; background: #F0F2F4; }

.bw3d-search__empty {
	margin: 0;
	padding: 14px 10px;
	font-size: 14px;
	color: rgba(36, 32, 33, 0.7);
}

@media (max-width: 1024px) {
	.bw3d-search { height: 44px; max-width: none; }
	.bw3d-search__panel { width: 100%; }
	.bw3d-search .bw3d-search__input { font-size: 16px; } /* evita el zoom de iOS */
}

@media (prefers-reduced-motion: reduce) {
	.bw3d-search, .bw3d-search__submit, .bw3d-search__item { transition: none; }
	.bw3d-search.is-loading .bw3d-search__icon { animation: none; }
}
