/*
 * Clic Gourmands — recherche : champ, panneau de suggestions, page de résultats.
 *
 * Charte : aucun angle arrondi, aucune ombre ; filets 1 px rgba(0,56,144,.4)
 * ou 2 px #003890 ; Archivo 800 pour titres, chiffres et boutons, 400 pour le
 * texte ; chiffres tabulaires ; cibles tactiles ≥ 44 px.
 * Le panneau reprend les règles .cg-suggest de l'ancien style.css du thème
 * (commit 17b22b2^, lignes 462-489).
 */

.cg-recherche,
.cg-recherche *,
.cg-recherche-resultats,
.cg-recherche-resultats * {
	border-radius: 0;
	box-shadow: none;
}

/* --- Champ ---------------------------------------------------------------- */

.cg-recherche {
	position: relative;
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
	margin: 0;
}

/* Champ gris uni sans bordure, loupe Bleu clic à droite : reprend l'aspect du
   widget Recherche d'Elementor utilisé avant le plugin. */
.cg-recherche .cg-recherche-champ {
	flex: 1 1 auto;
	min-width: 0;
	min-height: 44px;
	padding: 0 14px;
	font: inherit;
	font-weight: 400;
	color: #003890;
	background: #E8ECF2;
	border: 0;
	-webkit-appearance: none;
	appearance: none;
}

.cg-recherche .cg-recherche-champ::placeholder {
	color: #6C798D;
	opacity: 1;
}

.cg-recherche .cg-recherche-champ:focus {
	outline: 2px solid #1E6FD9;
	outline-offset: 0;
}

.cg-recherche .cg-recherche-bouton {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	color: #1E6FD9;
	background: transparent;
	border: 0;
	cursor: pointer;
}

.cg-recherche .cg-recherche-bouton svg {
	display: block;
}

.cg-recherche .cg-recherche-bouton:hover {
	color: #003890;
	background: transparent;
}

.cg-recherche .cg-recherche-bouton:focus-visible {
	color: #003890;
	background: transparent;
	outline: 2px solid #1E6FD9;
	outline-offset: 0;
}

/* --- Panneau de suggestions ------------------------------------------------ */

.cg-suggest {
	position: absolute;
	z-index: 60;
	top: 100%;
	left: 0;
	right: 0;
	max-height: min(70vh, 560px);
	overflow-y: auto;
	overscroll-behavior: contain;
	background: #F4F6F9;
	border: 2px solid #003890;
	color: #003890;
	text-align: left;
}

.cg-suggest[hidden] {
	display: none;
}

.cg-suggest .cg-suggest-groupe {
	font-size: 11px;
	font-weight: 800;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: #3F5C8C;
	padding: 10px 14px 6px;
	border-bottom: 1px solid rgba(0, 56, 144, .4);
}

.cg-suggest [role="option"] {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 44px;
	padding: 10px 14px;
	border-bottom: 1px solid rgba(0, 56, 144, .4);
	cursor: pointer;
}

.cg-suggest > [role="option"]:last-child {
	border-bottom: 0;
}

.cg-suggest [role="option"][aria-selected="true"],
.cg-suggest [role="option"]:hover {
	background: #E8ECF2;
}

.cg-suggest [role="option"][aria-selected="true"] {
	outline: 2px solid #1E6FD9;
	outline-offset: -2px;
}

/* Vignette : bichromie froide + voile marine 8 %. */
.cg-suggest .cg-suggest-visuel {
	position: relative;
	flex: 0 0 40px;
	width: 40px;
	height: 40px;
}

.cg-suggest .cg-suggest-visuel::after {
	content: "";
	position: absolute;
	inset: 0;
	background: rgba(0, 56, 144, .08);
	pointer-events: none;
}

.cg-suggest img {
	display: block;
	width: 40px;
	height: 40px;
	object-fit: cover;
	filter: grayscale(1) contrast(1.08);
}

.cg-suggest .cg-suggest-texte {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
}

.cg-suggest .cg-suggest-nom {
	font-weight: 400;
	overflow: hidden;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.cg-suggest .cg-suggest-unite {
	font-size: 13px;
	color: #3F5C8C;
}

.cg-suggest .price {
	flex: 0 0 auto;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	font-weight: 800;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.cg-suggest .price ins {
	text-decoration: none;
	background: none;
}

.cg-suggest .price del {
	font-weight: 400;
	font-size: 13px;
	color: #6C798D;
}

.cg-suggest .cg-suggest-tout {
	font-weight: 800;
	color: #1E6FD9;
}

.cg-suggest .cg-suggest-rien {
	padding: 14px;
	font-weight: 800;
	border-bottom: 1px solid rgba(0, 56, 144, .4);
}

/* Étroit : le prix passe sous le nom, rien ne déborde à 320 px. */
@media (max-width: 380px) {
	.cg-suggest [role="option"] {
		flex-wrap: wrap;
		gap: 4px 10px;
	}

	.cg-suggest .cg-suggest-texte {
		flex-basis: calc(100% - 50px);
	}

	.cg-suggest .price {
		flex-direction: row;
		gap: 8px;
		align-items: baseline;
		margin-left: 50px;
	}
}

/* --- Page de résultats ----------------------------------------------------- */
.cg-recherche-resultats {
	color: #003890;
}

.cg-recherche-rappel {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 8px 24px;
	padding-bottom: 12px;
	margin-bottom: 24px;
	border-bottom: 2px solid #003890;
}

.cg-recherche-rappel h1 {
	margin: 0;
	font-size: 22px !important;
	font-weight: 800;
	font-variant-numeric: tabular-nums;
}

.cg-recherche-rappel a,
.cg-recherche-vide a {
	color: #1E6FD9;
}

.cg-recherche-tri {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 16px;
}

.cg-recherche-tri select {
	min-height: 44px;
	padding: 0 10px;
	font: inherit;
	color: #003890;
	background: #F4F6F9;
	border: 1px solid rgba(0, 56, 144, .4);
}

.cg-recherche-tri button,
.cg-recherche-pagination a,
.cg-recherche-pagination span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	min-width: 44px;
	padding: 0 12px;
	font: inherit;
	font-weight: 800;
	font-variant-numeric: tabular-nums;
	border: 2px solid #003890;
	background: #F4F6F9;
	color: #003890;
	text-decoration: none;
	cursor: pointer;
}

.cg-recherche-pagination span[aria-current] {
	background: #003890;
	color: #F4F6F9;
}

.cg-recherche-groupe {
	margin: 0 0 40px;
}

.cg-recherche-groupe > h2 {
	margin: 0 0 16px;
	font-size: 16px !important;
	font-weight: 800;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: #3F5C8C;
	font-variant-numeric: tabular-nums;
}

.cg-recherche-grille {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 24px;
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Repli WooCommerce (content-product) : la liste ul.products devient la grille. */
.cg-recherche-grille ul.products {
	display: contents;
}

.cg-recherche-grille ul.products::before,
.cg-recherche-grille ul.products::after {
	display: none;
}

.cg-recherche-grille > *,
.cg-recherche-grille ul.products li.product {
	min-width: 0; /* un élément de grille ne s'élargit pas à son image */
}

.cg-recherche-grille ul.products li.product {
	width: auto;
	margin: 0;
	float: none;
	list-style: none;
}

.cg-recherche-grille img {
	max-width: 100%;
	height: auto;
}

@media (max-width: 1024px) {
	.cg-recherche-grille {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 16px;
	}
}

.cg-recherche-liste {
	margin: 0;
	padding: 0;
	list-style: none;
	border-top: 1px solid rgba(0, 56, 144, .4);
}

.cg-recherche-liste li {
	border-bottom: 1px solid rgba(0, 56, 144, .4);
}

.cg-recherche-liste a {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 44px;
	padding: 10px 0;
	color: #003890;
	text-decoration: none;
	font-weight: 800;
}

.cg-recherche-liste p {
	margin: 0 0 10px;
	font-weight: 400;
}

.cg-recherche-liste img {
	width: 40px;
	height: 40px;
	object-fit: cover;
	filter: grayscale(1) contrast(1.08);
}

.cg-recherche-pagination {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 24px;
}

.cg-recherche-vide ul {
	padding: 0;
	list-style: none;
}
