/* ==============================> BUSCADOR GENERAL */

/* -> FORMULARIO */
.bsc .bsc-formulario {
	position: relative;
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	padding: 0 16px;
	height: 46px;
	background: #fff;
	border: 1px solid #dcdcdc;
	border-radius: 30px;
	transition: border-color .3s ease, box-shadow .3s ease;
}

.bsc .bsc-formulario:hover {
	border-color: #b5b5b5;
}

.bsc .bsc-formulario:focus-within {
	border-color: var(--e-global-color-primary);
	box-shadow: 0 0 0 3px rgba(0, 0, 0, .05);
}

.bsc .bsc-formulario > i {
	flex: 0 0 auto;
	font-size: 20px;
	line-height: 1;
	color: #777;
	transition: color .3s ease;
}

.bsc .bsc-formulario:focus-within > i {
	color: var(--e-global-color-primary);
}

.bsc .bsc-formulario .bsc-entrada {
	flex: 1 1 auto;
	min-width: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	font-size: 16px;
	color: #222;
	background: transparent;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	outline: none;
	-webkit-appearance: none;
	appearance: none;
}

.bsc .bsc-formulario .bsc-entrada::-webkit-search-cancel-button,
.bsc .bsc-formulario .bsc-entrada::-webkit-search-decoration {
	-webkit-appearance: none;
}

.bsc .bsc-formulario .bsc-entrada::placeholder {
	color: #999;
}

/* -> INDICADOR DE CARGA */
.bsc .bsc-formulario .bsc-cargando {
	flex: 0 0 auto;
	width: 16px;
	height: 16px;
	border: 2px solid #e3e3e3;
	border-top-color: var(--e-global-color-primary);
	border-radius: 50%;
	opacity: 0;
	transition: opacity .2s ease;
	-webkit-animation: bsc-girar .7s linear infinite;
	animation: bsc-girar .7s linear infinite;
}

.bsc.bsc-buscando .bsc-formulario .bsc-cargando {
	opacity: 1;
}

@-webkit-keyframes bsc-girar {
	to { -webkit-transform: rotate(360deg); }
}

@keyframes bsc-girar {
	to { transform: rotate(360deg); }
}

/* -> RESULTADOS */
.bsc .bsc-resultados .bsc-grupo {
	padding: 6px 0;
}

.bsc .bsc-resultados .bsc-grupo + .bsc-grupo {
	border-top: 1px solid #efefef;
}

.bsc .bsc-resultados .bsc-grupo-titulo {
	display: block;
	padding: 8px 16px 4px;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .5px;
	text-transform: uppercase;
	color: #8a8a8a;
}

.bsc .bsc-resultados mark {
	padding: 0;
	font-weight: 700;
	color: var(--e-global-color-primary);
	background: transparent;
}

.bsc .bsc-resultados .bsc-item,
.bsc .bsc-resultados .bsc-categoria {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 16px;
	color: #222;
	text-decoration: none;
	transition: background-color .25s ease, padding-left .25s ease;
}

.bsc .bsc-resultados .bsc-item:hover,
.bsc .bsc-resultados .bsc-categoria:hover {
	background: #f6f6f6;
	padding-left: 20px;
}

.bsc .bsc-resultados .bsc-item > i,
.bsc .bsc-resultados .bsc-categoria > i {
	flex: 0 0 auto;
	font-size: 16px;
	color: #aaa;
	transition: color .25s ease, transform .25s ease;
}

.bsc .bsc-resultados .bsc-item:hover > i,
.bsc .bsc-resultados .bsc-categoria:hover > i {
	color: var(--e-global-color-primary);
	-webkit-transform: translateX(3px);
	transform: translateX(3px);
}

/* -> PRODUCTO */
.bsc .bsc-resultados .bsc-item-imagen {
	flex: 0 0 auto;
	width: 52px;
	height: 52px;
	overflow: hidden;
	background: #f3f3f3;
	border-radius: 8px;
}

.bsc .bsc-resultados .bsc-item-imagen img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.bsc .bsc-resultados .bsc-item-info {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.bsc .bsc-resultados .bsc-item-titulo {
	font-size: 14px;
	font-weight: 600;
	line-height: 1.3;
}

.bsc .bsc-resultados .bsc-item-sku {
	font-size: 12px;
	color: #8a8a8a;
}

.bsc .bsc-resultados .bsc-item-precio {
	font-size: 13px;
	font-weight: 600;
	color: var(--e-global-color-primary);
}

.bsc .bsc-resultados .bsc-item-precio del {
	font-weight: 400;
	color: #999;
}

.bsc .bsc-resultados .bsc-item-precio ins {
	text-decoration: none;
}

/* -> CATEGORÍA */
.bsc .bsc-resultados .bsc-categoria-nombre {
	flex: 1 1 auto;
	font-size: 14px;
	font-weight: 500;
}

.bsc .bsc-resultados .bsc-categoria-total {
	flex: 0 0 auto;
	min-width: 24px;
	padding: 2px 8px;
	font-size: 12px;
	text-align: center;
	color: #666;
	background: #efefef;
	border-radius: 20px;
}

/* -> VER TODOS Y VACÍO */
.bsc .bsc-resultados .bsc-ver-todos {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 14px 16px;
	font-size: 14px;
	font-weight: 600;
	color: var(--e-global-color-primary);
	text-decoration: none;
	border-top: 1px solid #efefef;
	transition: background-color .25s ease;
}

.bsc .bsc-resultados .bsc-ver-todos:hover {
	background: #f6f6f6;
}

.bsc .bsc-resultados .bsc-ver-todos i {
	font-size: 16px;
	transition: transform .25s ease;
}

.bsc .bsc-resultados .bsc-ver-todos:hover i {
	-webkit-transform: translateX(4px);
	transform: translateX(4px);
}

.bsc .bsc-resultados .bsc-vacio {
	margin: 0;
	padding: 24px 16px;
	font-size: 14px;
	text-align: center;
	color: #777;
}

/* ==============================> BUSCADOR PC */
.bsc.bsc-pc {
	position: relative;
	width: 100%;
}

.bsc.bsc-pc .bsc-resultados {
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	right: 0;
	z-index: 999;
	max-height: 70vh;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
	background: #fff;
	border-radius: 14px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, .15);
	opacity: 0;
	visibility: hidden;
	-webkit-transform: translateY(8px);
	transform: translateY(8px);
	transition: opacity .3s ease, transform .3s ease, visibility 0s linear .3s;
}

.bsc.bsc-pc.bsc-abierto .bsc-resultados {
	opacity: 1;
	visibility: visible;
	-webkit-transform: translateY(0);
	transform: translateY(0);
	transition: opacity .3s ease, transform .3s ease, visibility 0s linear 0s;
}

/* ==============================> BUSCADOR MÓVIL */

/* -> DISPARADOR */
.bsc-movil .bsc-disparador {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	font-size: 24px;
	color: inherit;
	text-decoration: none;
	border-radius: 50%;
	-webkit-tap-highlight-color: transparent;
	transition: color .3s ease, background-color .3s ease;
}

.bsc-movil .bsc-disparador:hover {
	color: var(--e-global-color-primary);
	background: rgba(0, 0, 0, .05);
}

.bsc-movil .bsc-disparador i {
	line-height: 1;
}

/* -> POPUP */
.bsc.bsc-popup {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 100000;
	display: flex;
	flex-direction: column;
	height: 100vh;
	height: 100dvh;
	background: #fff;
	opacity: 0;
	visibility: hidden;
	-webkit-transform: translateY(20px);
	transform: translateY(20px);
	transition: opacity .3s ease, transform .3s ease, visibility 0s linear .3s;
}

.bsc.bsc-popup.bsc-visible {
	opacity: 1;
	visibility: visible;
	-webkit-transform: translateY(0);
	transform: translateY(0);
	transition: opacity .3s ease, transform .3s ease, visibility 0s linear 0s;
}

.bsc.bsc-popup .bsc-popup-cabecera {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 12px 16px;
	padding-top: calc(12px + env(safe-area-inset-top));
	border-bottom: 1px solid #efefef;
}

.bsc.bsc-popup .bsc-popup-cabecera .bsc-formulario {
	flex: 1 1 auto;
	min-width: 0;
}

.bsc.bsc-popup .bsc-cerrar {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	font-size: 22px;
	color: #222;
	text-decoration: none;
	border-radius: 50%;
	-webkit-tap-highlight-color: transparent;
	transition: color .3s ease, background-color .3s ease;
}

.bsc.bsc-popup .bsc-cerrar:hover {
	color: var(--e-global-color-primary);
	background: #f3f3f3;
}

.bsc.bsc-popup .bsc-resultados {
	flex: 1 1 auto;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
	padding-bottom: env(safe-area-inset-bottom);
}

/* -> BLOQUEO DE SCROLL */
html.bsc-bloqueado,
html.bsc-bloqueado body {
	overflow: hidden;
}

/* ==============================> BUSCADOR RESPONSIVE */

/* -> PC (desde 769px) */
@media (min-width: 769px) {
	.bsc-movil {
		display: none;
	}
}

/* -> MÓVIL (hasta 768px) */
@media (max-width: 768px) {
	.bsc.bsc-pc .bsc-resultados {
		max-height: 60vh;
		border-radius: 12px;
	}

	.bsc .bsc-resultados .bsc-item:hover,
	.bsc .bsc-resultados .bsc-categoria:hover {
		padding-left: 16px;
	}
}
