/* MAF-Widgets — Search Bar styles */

.maf-searchbar-wrapper {
	position: relative;
	display: block;
	width: 100%;
}

.maf-searchbar-wrapper * {
	box-sizing: border-box;
}

.maf-searchbar-form {
	display: flex;
	align-items: stretch;
	gap: 8px;
	width: 100%;
}

.maf-searchbar-input {
	flex: 1 1 auto;
	min-width: 0;
	padding: 10px 14px;
	border: 1px solid #dcdcdc;
	border-radius: 4px;
	background-color: #ffffff;
	font-size: 15px;
	line-height: 1.4;
	outline: none;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.maf-searchbar-input:focus {
	border-color: #999999;
}

.maf-searchbar-submit {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: none;
	border-radius: 4px;
	background-color: #222222;
	color: #ffffff;
	cursor: pointer;
	transition: opacity 0.2s ease;
}

.maf-searchbar-submit:hover {
	opacity: 0.85;
}

.maf-searchbar-submit svg {
	width: 16px;
	height: 16px;
	fill: currentColor;
}

/* Resultados desplegables */
.maf-searchbar-results {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	right: 0;
	z-index: 999;
	background-color: #ffffff;
	border: 1px solid #e5e5e5;
	border-radius: 4px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
	max-height: 400px;
	overflow-y: auto;
}

.maf-searchbar-modal .maf-searchbar-results {
	position: static;
	margin-top: 12px;
	box-shadow: none;
	border: 1px solid #eeeeee;
}

.maf-searchbar-result-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 14px;
	text-decoration: none;
	color: inherit;
	border-bottom: 1px solid #f0f0f0;
	transition: background-color 0.15s ease;
}

.maf-searchbar-result-item:last-child {
	border-bottom: none;
}

.maf-searchbar-result-item:hover,
.maf-searchbar-result-item:focus {
	background-color: #f7f7f7;
}

.maf-searchbar-result-thumb {
	flex: 0 0 auto;
	width: 60px;
	height: 60px;
	border-radius: 4px;
	overflow: hidden;
	background-color: #f0f0f0;
	display: block;
}

.maf-searchbar-result-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.maf-searchbar-result-body {
	display: flex;
	flex-direction: column;
	gap: 4px;
	min-width: 0;
}

.maf-searchbar-result-title {
	font-size: 14px;
	font-weight: 600;
	line-height: 1.3;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.maf-searchbar-result-excerpt {
	font-size: 12px;
	line-height: 1.4;
	color: #6b6b6b;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.maf-searchbar-result-badge {
	align-self: flex-start;
	font-size: 10px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	padding: 2px 8px;
	border-radius: 100px;
	background-color: #eeeeee;
	color: #555555;
}

.maf-searchbar-no-results {
	padding: 16px 14px;
	font-size: 13px;
	color: #888888;
	text-align: center;
}

/* Modo minimalista: botón disparador */
.maf-searchbar-trigger {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: transparent;
	border: none;
	cursor: pointer;
	padding: 8px;
	border-radius: 4px;
	color: inherit;
	line-height: 0;
	transition: opacity 0.2s ease;
}

.maf-searchbar-trigger:hover {
	opacity: 0.75;
}

.maf-searchbar-trigger svg {
	width: 22px;
	height: 22px;
	fill: currentColor;
}

/* Modal */
.maf-searchbar-modal-overlay {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: 8vh 20px;
	background-color: rgba(0, 0, 0, 0.7);
}

.maf-searchbar-modal-overlay[hidden] {
	display: none;
}

.maf-searchbar-modal {
	position: relative;
	width: 600px;
	max-width: 100%;
	max-height: 84vh;
	overflow-y: auto;
	background-color: #ffffff;
	border-radius: 8px;
	padding: 30px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.maf-searchbar-modal .maf-searchbar-form {
	margin: 0;
}

.maf-searchbar-modal-close {
	position: absolute;
	top: 12px;
	right: 14px;
	background: transparent;
	border: none;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	color: #666666;
	padding: 4px 8px;
}

.maf-searchbar-modal-close:hover {
	color: #222222;
}

body.maf-searchbar-modal-open {
	overflow: hidden;
}

@media (max-width: 480px) {
	.maf-searchbar-modal {
		padding: 20px;
	}
}
