/* ==========================================================================
   Estudios Ecográficos — Header Search Bar CSS (ee-buscador.css)
   Component: .ee-buscador
   Unified Design System matching the Admin Dashboard and Public Shortcode
   ========================================================================== */

.ee-buscador {
	position: relative;
	display: inline-flex;
	flex-direction: column;
	width: var(--ee-buscador-width, 280px);
	font-family: var(--ee-font, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);
	font-size: 14px;
	line-height: 1.4;
	box-sizing: border-box;
}

.ee-buscador * {
	box-sizing: border-box;
}

/* ── Search Input Row ─────────────────────────────────────────────────────── */
.ee-buscador__inner {
	display: flex;
	align-items: center;
	background: #ffffff;
	border: 1.5px solid var(--ee-border, #e2e8f0);
	border-radius: var(--ee-radius-pill, 9999px);
	padding: 3px 4px 3px 14px;
	transition: var(--ee-transition, all 0.2s ease);
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
}

.ee-buscador__inner:focus-within {
	border-color: var(--ee-primary, #2563eb);
	box-shadow: 0 0 0 3px var(--ee-primary-glow, rgba(37, 99, 235, 0.16));
}

.ee-buscador__icon {
	flex-shrink: 0;
	color: var(--ee-primary, #2563eb);
	display: flex;
	align-items: center;
	margin-right: 8px;
	pointer-events: none;
}

.ee-buscador__icon svg {
	width: 16px;
	height: 16px;
	display: block;
}

.ee-buscador__input {
	flex: 1;
	border: none !important;
	outline: none !important;
	background: transparent !important;
	padding: 7px 4px !important;
	font-size: 0.875rem !important;
	color: var(--ee-text-dark, #1e293b) !important;
	font-family: inherit !important;
	min-width: 0;
	box-shadow: none !important;
	-webkit-appearance: none;
	appearance: none;
}

.ee-buscador__input::-webkit-search-cancel-button,
.ee-buscador__input::-webkit-search-decoration {
	display: none;
}

.ee-buscador__input::placeholder {
	color: var(--ee-text-muted, #64748b);
	opacity: 0.85;
}

.ee-buscador__btn {
	flex-shrink: 0;
	background: var(--ee-primary, #2563eb);
	color: #ffffff !important;
	border: none !important;
	border-radius: var(--ee-radius-pill, 9999px) !important;
	padding: 0 16px !important;
	height: 32px;
	font-size: 0.8125rem !important;
	font-weight: 600;
	font-family: inherit;
	cursor: pointer;
	transition: var(--ee-transition, all 0.2s ease);
	white-space: nowrap;
	box-shadow: 0 1px 3px var(--ee-primary-glow, rgba(37, 99, 235, 0.16));
}

.ee-buscador__btn:hover,
.ee-buscador__btn:focus-visible {
	background: var(--ee-primary-dark, #1d4ed8);
	box-shadow: 0 3px 8px var(--ee-primary-hover, rgba(37, 99, 235, 0.28));
	outline: none;
}

/* ── Live Dropdown Panel ──────────────────────────────────────────────────── */
.ee-buscador__dropdown {
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	right: 0;
	background: #ffffff;
	border: 1.5px solid var(--ee-border, #e2e8f0);
	border-radius: var(--ee-radius-card, 14px);
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.04);
	z-index: 999999;
	overflow: hidden;
	animation: ee-dropdown-in 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes ee-dropdown-in {
	from { opacity: 0; transform: translateY(-6px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* ── Results List ─────────────────────────────────────────────────────────── */
.ee-buscador__list {
	list-style: none;
	margin: 0;
	padding: 6px 0;
	max-height: 340px;
	overflow-y: auto;
	scrollbar-width: thin;
	scrollbar-color: var(--ee-border, #e2e8f0) transparent;
}

.ee-buscador__list::-webkit-scrollbar {
	width: 5px;
}
.ee-buscador__list::-webkit-scrollbar-track {
	background: transparent;
}
.ee-buscador__list::-webkit-scrollbar-thumb {
	background: var(--ee-border, #e2e8f0);
	border-radius: 4px;
}

/* ── Result Item ──────────────────────────────────────────────────────────── */
.ee-buscador__item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 14px;
	cursor: pointer;
	transition: background 0.12s ease;
}

.ee-buscador__item:hover,
.ee-buscador__item--active {
	background: var(--ee-primary-light, #eff6ff);
}

.ee-buscador__item-icon {
	flex-shrink: 0;
	font-size: 1.15rem;
	width: 32px;
	height: 32px;
	background: var(--ee-primary-light, #eff6ff);
	border: 1px solid var(--ee-primary-border, #bfdbfe);
	border-radius: 8px;
	display: flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
}

.ee-buscador__item-text {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.ee-buscador__item-title {
	font-size: 0.88rem;
	font-weight: 600;
	color: var(--ee-primary-title, #0f274a);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.ee-buscador__item-desc {
	font-size: 0.76rem;
	color: var(--ee-text-muted, #64748b);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.ee-buscador__item-arrow {
	flex-shrink: 0;
	color: var(--ee-primary, #2563eb);
	font-size: 1.25rem;
	font-weight: 600;
	line-height: 1;
	opacity: 0.5;
	transition: transform 0.15s ease, opacity 0.15s ease;
}

.ee-buscador__item:hover .ee-buscador__item-arrow,
.ee-buscador__item--active .ee-buscador__item-arrow {
	opacity: 1;
	transform: translateX(3px);
}

/* ── Query Highlight ──────────────────────────────────────────────────────── */
.ee-buscador__hl {
	background: transparent;
	color: var(--ee-primary, #2563eb);
	font-weight: 700;
}

/* ── Loading & Empty ──────────────────────────────────────────────────────── */
.ee-buscador__loading {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 14px 16px;
	color: var(--ee-text-muted, #64748b);
	font-size: 0.82rem;
}

.ee-buscador__spinner {
	display: inline-block;
	width: 16px;
	height: 16px;
	border: 2px solid var(--ee-primary-border, #bfdbfe);
	border-top-color: var(--ee-primary, #2563eb);
	border-radius: 50%;
	animation: ee-spin 0.65s linear infinite;
	flex-shrink: 0;
}

.ee-buscador__empty {
	padding: 18px 16px;
	text-align: center;
	color: var(--ee-text-muted, #64748b);
	font-size: 0.82rem;
}

/* ── Footer ───────────────────────────────────────────────────────────────── */
.ee-buscador__footer {
	border-top: 1px solid var(--ee-border, #e2e8f0);
	padding: 8px 14px;
	background: var(--ee-bg-soft, #f8fafc);
}

.ee-buscador__ver-todos {
	display: block;
	text-align: center;
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--ee-primary, #2563eb);
	text-decoration: none;
	padding: 4px 0;
	transition: color 0.15s;
}

.ee-buscador__ver-todos:hover {
	color: var(--ee-primary-dark, #1d4ed8);
	text-decoration: underline;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
	.ee-buscador {
		width: 100% !important;
		--ee-buscador-width: 100% !important;
	}
}
