/**
 * Healico Ajax Search — Direction Artistique Healico
 * Palette : #20506D (Bleu foncé), #2F52A0 (Bleu Healico), #FF7B5C (Corail/Orange), #31C8D8 (Turquoise)
 * Typographies : Gilroy-SemiBold, Gilroy-Bold, Gilroy-Regular
 */

.healico-search-wrapper {
	position: relative;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	z-index: 1000;
}

.healico-search-form {
	margin: 0;
	padding: 0;
	width: 100%;
}

.healico-search-box {
	position: relative;
	display: flex;
	align-items: center;
	width: 100%;
	height: 54px;
	background: #ffffff;
	border-radius: 30px;
	box-shadow: 0 8px 25px rgba(32, 80, 109, 0.14);
	border: 2px solid transparent;
	overflow: hidden;
	transition: box-shadow 0.25s ease, border-color 0.25s ease, transform 0.2s ease;
}

.healico-search-wrapper.is-focused .healico-search-box {
	box-shadow: 0 12px 32px rgba(47, 82, 160, 0.22);
	border-color: rgba(49, 200, 216, 0.65);
}

.healico-search-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	padding-left: 20px;
	padding-right: 4px;
	flex-shrink: 0;
	pointer-events: none;
	opacity: 0.75;
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.healico-search-wrapper.is-focused .healico-search-icon {
	opacity: 1;
	transform: scale(1.05);
}

.healico-search-input {
	flex: 1 1 auto;
	width: 100%;
	min-width: 0;
	height: 100%;
	border: none !important;
	outline: none !important;
	background: transparent !important;
	padding: 0 12px 0 10px !important;
	margin: 0 !important;
	font-family: "Gilroy-SemiBold", sans-serif;
	font-size: 19px;
	line-height: normal;
	color: #20506D;
	box-shadow: none !important;
	-webkit-appearance: none;
	appearance: none;
}

.healico-search-input::-webkit-search-decoration,
.healico-search-input::-webkit-search-cancel-button,
.healico-search-input::-webkit-search-results-button,
.healico-search-input::-webkit-search-results-decoration {
	display: none;
	-webkit-appearance: none;
}

.healico-search-input::placeholder {
	font-family: "Gilroy-SemiBold", sans-serif;
	font-size: 19px;
	line-height: normal;
	color: #20506D;
	opacity: 0.72;
}

.healico-search-clear {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	margin-right: 8px;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: #f0f5f9;
	color: #20506D;
	cursor: pointer;
	flex-shrink: 0;
	transition: background-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.healico-search-clear[hidden] {
	display: none !important;
}

.healico-search-clear:hover {
	background: #FF7B5C;
	color: #ffffff;
	transform: scale(1.06);
}

.healico-search-spinner {
	display: flex;
	align-items: center;
	justify-content: center;
	margin-right: 10px;
	flex-shrink: 0;
}

.healico-search-spinner[hidden] {
	display: none !important;
}

.healico-search-spinner svg {
	animation: healico-search-spin 0.75s linear infinite;
}

@keyframes healico-search-spin {
	to {
		transform: rotate(360deg);
	}
}

.healico-search-submit {
	display: flex;
	align-items: center;
	justify-content: center;
	height: 100%;
	min-width: 82px;
	padding: 0 22px;
	border: none;
	background: #FF7B5C;
	color: #ffffff;
	font-family: "Gilroy-SemiBold", sans-serif;
	font-size: 22px;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	cursor: pointer;
	flex-shrink: 0;
	transition: background-color 0.2s ease;
}

.healico-search-submit:hover,
.healico-search-submit:focus-visible {
	background: #f06747;
}

/* Panneau de résultats AJAX */
.healico-search-dropdown {
	position: absolute;
	top: calc(100% + 12px);
	left: 0;
	right: 0;
	width: 100%;
	background: #ffffff;
	border-radius: 24px;
	box-shadow: 0 18px 48px rgba(32, 80, 109, 0.22), 0 2px 8px rgba(0, 0, 0, 0.06);
	border: 1px solid rgba(47, 82, 160, 0.08);
	overflow: hidden;
	z-index: 11000;
	opacity: 0;
	transform: translateY(-6px);
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.healico-search-dropdown[hidden] {
	display: none !important;
}

.healico-search-dropdown.is-open {
	opacity: 1;
	transform: translateY(0);
}

.healico-search-results-inner {
	max-height: 410px;
	overflow-y: auto;
	padding: 10px;
	scrollbar-width: thin;
	scrollbar-color: rgba(47, 82, 160, 0.25) transparent;
}

.healico-search-results-inner::-webkit-scrollbar {
	width: 6px;
}

.healico-search-results-inner::-webkit-scrollbar-track {
	background: transparent;
}

.healico-search-results-inner::-webkit-scrollbar-thumb {
	background-color: rgba(47, 82, 160, 0.22);
	border-radius: 10px;
}

/* Item de résultat */
.healico-search-item {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 12px 14px;
	border-radius: 16px;
	text-decoration: none !important;
	color: inherit;
	transition: background-color 0.18s ease, transform 0.18s ease;
	position: relative;
}

.healico-search-item + .healico-search-item {
	margin-top: 4px;
}

.healico-search-item:hover,
.healico-search-item.is-active,
.healico-search-item:focus-visible {
	background: #F4F9FB;
	outline: none;
}

.healico-search-thumb-wrap {
	width: 96px;
	height: 76px;
	border-radius: 12px;
	overflow: hidden;
	flex-shrink: 0;
	background: linear-gradient(135deg, #31C8D8 0%, #2F52A0 100%);
	display: flex;
	align-items: center;
	justify-content: center;
}

.healico-search-thumb {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block;
    transition: transform 0.3s ease;
    position: relative !important;
    top: 0 !important;
}

.healico-search-item:hover .healico-search-thumb {
	transform: scale(1.05);
}

.healico-search-thumb-fallback {
	color: #ffffff;
	opacity: 0.85;
}

.healico-search-content {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.healico-search-meta {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
}

.healico-search-badge {
	display: inline-block;
	background: rgba(255, 123, 92, 0.12);
	color: #FF7B5C;
	font-family: "Gilroy-SemiBold", sans-serif;
	font-size: 12px;
	line-height: 1;
	padding: 5px 10px;
	border-radius: 20px;
}

.healico-search-date {
	font-family: "Gilroy-Bold", sans-serif;
	font-size: 12px;
	color: #2F52A0;
	opacity: 0.75;
}

.healico-search-title {
	margin: 0 !important;
	font-family: "Gilroy-Bold", sans-serif !important;
	font-size: 17px !important;
	line-height: 1.28 !important;
	color: #2F52A0 !important;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	transition: color 0.18s ease;
}

.healico-search-item:hover .healico-search-title,
.healico-search-item.is-active .healico-search-title {
	color: #FF7B5C !important;
}

.healico-search-excerpt {
	margin: 0 !important;
	font-family: "Gilroy-Regular", sans-serif;
	font-size: 13.5px;
	line-height: 1.38;
	color: #20506D;
	opacity: 0.88;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.healico-search-highlight {
	background: rgba(255, 123, 92, 0.22);
	color: #20506D;
	font-family: "Gilroy-Bold", sans-serif;
	padding: 0 3px;
	border-radius: 4px;
}

/* État vide */
.healico-search-empty {
	padding: 26px 20px;
	text-align: center;
	font-family: "Gilroy-SemiBold", sans-serif;
	font-size: 16px;
	color: #20506D;
}

.healico-search-empty-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: #F4F9FB;
	color: #FF7B5C;
	margin-bottom: 10px;
}

/* Responsive Mobile & Tablette */
@media screen and (max-width: 767px) {
	.healico-search-box {
		height: 48px;
	}

	.healico-search-icon {
		padding-left: 15px;
	}

	.healico-search-input,
	.healico-search-input::placeholder {
		font-size: 16px;
	}

	.healico-search-submit {
		min-width: 66px;
		padding: 0 16px;
		font-size: 16px;
	}

	.healico-search-results-inner {
		max-height: 300px;
		padding: 8px;
	}

	.healico-search-thumb-wrap {
		width: 72px;
		height: 60px;
	}

	.healico-search-title {
		font-size: 15px !important;
	}

	.healico-search-excerpt {
		font-size: 12.5px;
		-webkit-line-clamp: 1;
	}
}
