/**
 * Alfa Digital - Smart Search · Overlay de autocompletado (frontend).
 * Prefijado (.alfa-suggest); encolado solo en frontend y solo si el overlay
 * está activo. Hereda tipografía y color del tema (inherit/currentColor); no
 * impone paleta. Sustituye SOLO el dropdown; no toca el markup del tema.
 */

.alfa-suggest-panel {
	position: fixed;
	z-index: 100050; /* Por encima del sticky header de Woodmart. */
	max-width: 96vw;
	max-height: 70vh;
	overflow-y: auto;
	background: #fff;
	color: inherit;
	font-family: inherit;
	font-size: 14px;
	line-height: 1.4;
	border: 1px solid rgba( 0, 0, 0, .12 );
	border-radius: 6px;
	box-shadow: 0 8px 28px rgba( 0, 0, 0, .16 );
	-webkit-overflow-scrolling: touch;
}
.alfa-suggest-panel[hidden] { display: none; }
.alfa-suggest-inner { padding: 6px 0; }

/* ---- Encabezados de sección ---- */
.alfa-suggest-heading {
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: .04em;
	opacity: .6;
	padding: 6px 14px 2px;
}
.alfa-suggest-section + .alfa-suggest-section { border-top: 1px solid rgba( 0, 0, 0, .07 ); }

/* ---- Corrección ---- */
.alfa-suggest-corrected {
	padding: 8px 14px;
	font-size: 13px;
	border-bottom: 1px solid rgba( 0, 0, 0, .07 );
	opacity: .85;
}

/* ---- Opciones (categorías y productos) ---- */
.alfa-suggest-panel a {
	color: inherit;
	text-decoration: none;
}
.alfa-suggest-cat,
.alfa-suggest-product {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 7px 14px;
	cursor: pointer;
}
.alfa-suggest-cat { justify-content: space-between; }
.alfa-suggest-cat-count {
	font-size: 12px;
	opacity: .55;
	border: 1px solid currentColor;
	border-radius: 10px;
	padding: 0 7px;
}
.alfa-suggest-cat.alfa-suggest-active,
.alfa-suggest-product.alfa-suggest-active,
.alfa-suggest-cat:hover,
.alfa-suggest-product:hover,
.alfa-suggest-viewall:hover,
.alfa-suggest-viewall.alfa-suggest-active,
.alfa-suggest-term:hover,
.alfa-suggest-term.alfa-suggest-active,
.alfa-suggest-dym:hover,
.alfa-suggest-dym.alfa-suggest-active {
	background: rgba( 0, 0, 0, .06 );
	outline: none;
}

/* ---- Capa de experiencia (v2.3.0): términos, chips, ¿quisiste decir? ---- */
.alfa-suggest-term { display: block; padding: 6px 14px; cursor: pointer; }
.alfa-suggest-term strong { font-weight: 700; }
.alfa-suggest-dym {
	display: block;
	padding: 9px 14px;
	border-bottom: 1px solid rgba( 0, 0, 0, .07 );
	cursor: pointer;
}
.alfa-suggest-dym strong { font-weight: 700; }
.alfa-suggest-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	padding: 2px 14px 8px;
}
.alfa-suggest-chip {
	display: inline-block;
	padding: 3px 10px;
	border: 1px solid rgba( 0, 0, 0, .15 );
	border-radius: 14px;
	font-size: 13px;
	line-height: 1.5;
	color: inherit;
	cursor: pointer;
}
.alfa-suggest-chip:hover,
.alfa-suggest-chip.alfa-suggest-active {
	background: rgba( 0, 0, 0, .06 );
	outline: none;
}
.alfa-suggest-clear {
	background: none;
	border: none;
	padding: 0;
	margin-left: 8px;
	font: inherit;
	font-size: 11px;
	color: inherit;
	opacity: .6;
	cursor: pointer;
	text-decoration: underline;
}
.alfa-suggest-clear:hover { opacity: 1; }
.alfa-suggest-heading { display: flex; align-items: center; justify-content: space-between; }

.alfa-suggest-thumb {
	flex: 0 0 auto;
	width: 40px;
	height: 40px;
	object-fit: cover;
	border-radius: 4px;
	background: rgba( 0, 0, 0, .05 );
}
.alfa-suggest-body {
	display: flex;
	flex-direction: column;
	min-width: 0;
}
.alfa-suggest-title {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.alfa-suggest-meta {
	display: flex;
	align-items: baseline;
	gap: 8px;
	font-size: 12px;
	opacity: .75;
}
.alfa-suggest-sku { font-variant-numeric: tabular-nums; opacity: .8; }
.alfa-suggest-price { font-weight: 600; opacity: 1; }
.alfa-suggest-price .amount { font-weight: 600; }
/* Oferta activa: par tachado (regular) + precio actual, igual que la ficha. */
.alfa-suggest-price del { opacity: .55; font-weight: 400; margin-right: 4px; text-decoration: line-through; }
.alfa-suggest-price ins { text-decoration: none; font-weight: 600; }
.alfa-suggest-product.alfa-suggest-oos .alfa-suggest-title { opacity: .6; }

/* ---- Footer «ver todos» ---- */
.alfa-suggest-viewall {
	display: block;
	padding: 9px 14px;
	font-weight: 600;
	text-align: center;
	border-top: 1px solid rgba( 0, 0, 0, .09 );
}

/* ---- Estados ---- */
.alfa-suggest-state {
	padding: 12px 14px;
	font-size: 13px;
	opacity: .8;
	display: flex;
	align-items: center;
	gap: 8px;
}
.alfa-suggest-spinner {
	display: inline-block;
	width: 14px;
	height: 14px;
	border: 2px solid currentColor;
	border-top-color: transparent;
	border-radius: 50%;
	opacity: .6;
	animation: alfa-suggest-spin .7s linear infinite;
}
@keyframes alfa-suggest-spin { to { transform: rotate( 360deg ); } }

/* ---- Respaldo: oculta el dropdown nativo de Woodmart mientras el overlay
   está abierto (la supresión primaria es por captura de eventos en el JS). ---- */
body.alfa-suggest-open .wd-search-results,
body.alfa-suggest-open .wd-dropdown-results,
body.alfa-suggest-open .woodmart-ajax-search .wd-dropdown,
body.alfa-suggest-open .search-results-container { display: none !important; }

/* ---- Móvil: buscador fullscreen de Woodmart. ---- */
@media ( max-width: 768px ) {
	.alfa-suggest-panel {
		max-height: 60vh;
		font-size: 15px;
	}
}
