/* ============================================================
   ifs-Boutique 2.90.0 — champ de recherche de produits (page de
   résultats et module du menu), avec liste de suggestions.
   Variables --ifs-* : reprennent celles du gabarit (--accent, --ink…).
   ============================================================ */

.ifs-recherche {
	--ifs-accent: var(--accent, #127a94);
	--ifs-accent-dark: var(--accent-dark, #0d5f73);
	--ifs-ink: var(--ink, #123c4b);
	--ifs-text-2: var(--text-2, #4a6570);
	--ifs-border-2: var(--border-2, #cfe0e5);
	--ifs-pale: var(--blue-pale, #e9f6fa);
	--ifs-pill: var(--radius-pill, 999px);
	--ifs-radius-sm: var(--radius-sm, 14px);
	position: relative;
	width: 100%;
	max-width: 40rem;
	margin: 0 0 1.5rem;
	font-family: var(--font-sans, inherit);
}

.ifs-recherche .visually-hidden {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.ifs-recherche__champ {
	display: flex;
	align-items: center;
	gap: .25rem;
	padding: .25rem .25rem .25rem 1rem;
	background: #fff;
	border: 1.5px solid var(--ifs-border-2);
	border-radius: var(--ifs-pill);
	transition: border-color .15s ease, box-shadow .15s ease;
}

.ifs-recherche__champ:focus-within {
	border-color: var(--ifs-accent);
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--ifs-accent) 18%, transparent);
}

.ifs-recherche__loupe {
	flex: none;
	color: var(--ifs-text-2);
}

.ifs-recherche__input {
	flex: 1 1 auto;
	min-width: 0;
	padding: .6rem .25rem;
	border: 0;
	background: transparent;
	color: var(--ifs-ink);
	font: inherit;
	font-size: 1rem;
	line-height: 1.3;
	outline: 0;
	-webkit-appearance: none;
	appearance: none;
}

/* Le gabarit ne doit pas redessiner le champ (cadre ou ombre au focus) : le cadre est porté par .ifs-recherche__champ. */
.ifs-recherche .ifs-recherche__input,
.ifs-recherche .ifs-recherche__input:focus,
.ifs-recherche .ifs-recherche__input:focus-visible {
	border: 0;
	outline: 0;
	box-shadow: none;
	background: transparent;
}

.ifs-recherche__input::-webkit-search-cancel-button {
	cursor: pointer;
}

.ifs-recherche__bouton {
	flex: none;
	padding: .6rem 1.15rem;
	border: 0;
	border-radius: var(--ifs-pill);
	background: var(--ifs-accent);
	color: #fff;
	font: inherit;
	font-weight: 700;
	line-height: 1.3;
	cursor: pointer;
	transition: background-color .15s ease;
}

.ifs-recherche__bouton:hover,
.ifs-recherche__bouton:focus-visible {
	background: var(--ifs-accent-dark);
	color: #fff;
}

.ifs-recherche__bouton:focus-visible {
	outline: 3px solid var(--ifs-accent-dark);
	outline-offset: 2px;
}

/* Version compacte (menu) : champ plus bas, bouton réduit à la loupe sur petit écran. */
.ifs-recherche--compact {
	max-width: 22rem;
	margin: 0;
}

.ifs-recherche--compact .ifs-recherche__champ {
	padding: .15rem .15rem .15rem .85rem;
}

.ifs-recherche--compact .ifs-recherche__input {
	padding: .45rem .2rem;
	font-size: .95rem;
}

.ifs-recherche--compact .ifs-recherche__bouton {
	padding: .45rem .9rem;
	font-size: .9rem;
}

/* Liste des suggestions */
.ifs-recherche__liste {
	position: absolute;
	z-index: 1050;
	top: calc(100% + .4rem);
	left: 0;
	right: 0;
	min-width: 18rem;
	max-height: min(70vh, 32rem);
	overflow-y: auto;
	margin: 0;
	padding: .35rem;
	list-style: none;
	background: #fff;
	border: 1px solid var(--ifs-border-2);
	border-radius: var(--ifs-radius-sm);
	box-shadow: 0 18px 40px rgba(18, 60, 75, .16);
}

.ifs-recherche__liste[hidden] {
	display: none;
}

.ifs-recherche__option a,
.ifs-recherche__option--tous a {
	display: flex;
	align-items: center;
	gap: .75rem;
	padding: .45rem .55rem;
	border-radius: calc(var(--ifs-radius-sm) - 4px);
	color: var(--ifs-ink);
	text-decoration: none;
}

.ifs-recherche__option[aria-selected="true"] a,
.ifs-recherche__option a:hover,
.ifs-recherche__option--tous[aria-selected="true"] a,
.ifs-recherche__option--tous a:hover {
	background: var(--ifs-pale);
	color: var(--ifs-ink);
	text-decoration: none;
}

.ifs-recherche__vignette {
	flex: none;
	width: 2.75rem;
	height: 2.75rem;
	object-fit: contain;
	background: #fff;
	border-radius: 8px;
}

.ifs-recherche__vignette--vide {
	background: var(--ifs-pale);
}

.ifs-recherche__textes {
	display: flex;
	flex-direction: column;
	min-width: 0;
	flex: 1 1 auto;
}

.ifs-recherche__nom {
	font-weight: 600;
	font-size: .95rem;
	line-height: 1.3;
	overflow: hidden;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.ifs-recherche__nom mark {
	padding: 0;
	background: transparent;
	color: var(--ifs-accent-dark);
	font-weight: 800;
}

.ifs-recherche__marque {
	color: var(--ifs-text-2);
	font-size: .8rem;
}

.ifs-recherche__prix {
	flex: none;
	color: var(--ifs-ink);
	font-weight: 700;
	font-size: .9rem;
	white-space: nowrap;
}

.ifs-recherche__prix.is-action {
	color: #b3261e;
}

.ifs-recherche__option--tous {
	margin-top: .25rem;
	border-top: 1px solid var(--ifs-border-2);
	padding-top: .25rem;
}

.ifs-recherche__option--tous a {
	justify-content: center;
	font-weight: 700;
	color: var(--ifs-accent-dark);
}

.ifs-recherche__vide {
	padding: .75rem .6rem;
	color: var(--ifs-text-2);
	font-size: .95rem;
}

/* Page de résultats */
.ifs-recherche-page .ifs-recherche {
	margin-bottom: 1rem;
}

.ifs-recherche-page__nb,
.ifs-recherche-page__aide {
	margin: 0 0 1.25rem;
	color: var(--text-2, #4a6570);
}

@media (max-width: 575.98px) {
	.ifs-recherche--compact .ifs-recherche__bouton-texte {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0, 0, 0, 0);
	}

	.ifs-recherche--compact .ifs-recherche__bouton::before {
		content: "→";
		font-weight: 700;
	}

	.ifs-recherche__liste {
		min-width: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ifs-recherche__champ,
	.ifs-recherche__bouton {
		transition: none;
	}
}

/* ------------------------------------------------------------
   2.90.1 — présentation « bouton loupe » du module : bouton rond
   (comme le panier) qui ouvre une barre de recherche sous l'en-tête.
   ------------------------------------------------------------ */

/* Le bouton se place à côté des autres éléments de la même position (panier…). */
:has(> .mod-ifs-recherche--bouton) {
	display: flex;
	align-items: center;
	gap: .6rem;
}

.mod-ifs-recherche--bouton {
	--ifs-accent: var(--accent, #127a94);
	--ifs-accent-dark: var(--accent-dark, #0d5f73);
	--ifs-ink: var(--ink, #123c4b);
	--ifs-border-2: var(--border-2, #cfe0e5);
	display: inline-flex;
}

.ifs-recherche-loupe {
	display: inline-grid;
	place-items: center;
	width: 42px;
	height: 42px;
	padding: 0;
	border: 1.5px solid var(--ifs-border-2);
	border-radius: 50%;
	background: #fff;
	color: var(--ifs-ink);
	cursor: pointer;
	transition: border-color .15s ease, color .15s ease, background-color .15s ease;
}

.ifs-recherche-loupe:hover,
.ifs-recherche-loupe[aria-expanded="true"] {
	border-color: var(--ifs-accent);
	color: var(--ifs-accent-dark);
	background: #fff;
}

.ifs-recherche-loupe:focus-visible,
.ifs-recherche-panneau__fermer:focus-visible {
	outline: 3px solid var(--ifs-accent-dark);
	outline-offset: 2px;
}

.ifs-recherche-panneau {
	position: fixed;
	z-index: 1040;
	left: 0;
	right: 0;
	top: var(--ifs-recherche-haut, 0px);
	padding: 1rem 1.25rem 1.25rem;
	background: #fff;
	border-top: 1px solid var(--ifs-border-2);
	box-shadow: 0 18px 36px rgba(18, 60, 75, .14);
}

.ifs-recherche-panneau[hidden] {
	display: none;
}

.ifs-recherche-panneau__contenu {
	display: flex;
	align-items: flex-start;
	gap: .75rem;
	max-width: 46rem;
	margin: 0 auto;
}

.ifs-recherche-panneau .ifs-recherche {
	max-width: none;
	margin: 0;
	flex: 1 1 auto;
}

.ifs-recherche-panneau__fermer {
	flex: none;
	display: inline-grid;
	place-items: center;
	width: 44px;
	height: 44px;
	margin-top: .2rem;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--ifs-ink);
	cursor: pointer;
}

.ifs-recherche-panneau__fermer:hover {
	background: var(--blue-pale, #e9f6fa);
}

@media (max-width: 575.98px) {
	.ifs-recherche-panneau {
		padding: .75rem .75rem 1rem;
	}

	.ifs-recherche-panneau .ifs-recherche__bouton-texte {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0, 0, 0, 0);
	}

	.ifs-recherche-panneau .ifs-recherche__bouton::before {
		content: "→";
		font-weight: 700;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ifs-recherche-loupe {
		transition: none;
	}
}
