
/* --- Duo loupe + bascule : un seul créneau flex dans le header (space-between). --- */
.cpme-srch-duo {
	display: inline-flex !important;
	align-items: center !important;
	flex: 0 0 auto;
	vertical-align: middle;
}
.cpme-srch-duo .cpme-srch-btn { margin: 0 !important; }

/* --- Bouton loupe : mêmes cotes que la bascule jour/nuit (.cpme-theme-toggle). --- */
.cpme-srch-btn {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	box-sizing: border-box !important;
	width: 40px !important;
	height: 40px !important;
	min-width: 0 !important;
	padding: 0 !important;
	margin: 0 0 0 6px !important;
	border: 1.5px solid #d8e2e5 !important;
	border-radius: 50% !important;
	background: #ffffff !important;
	color: #114D61 !important;
	line-height: 1 !important;
	cursor: pointer;
	vertical-align: middle;
	box-shadow: 0 1px 3px rgba(13, 58, 72, .10) !important;
	transition: background-color .2s ease, border-color .2s ease, color .2s ease, box-shadow .2s ease, transform .12s ease;
	-webkit-appearance: none;
	appearance: none;
}
.cpme-srch-btn:hover {
	border-color: #A81815 !important;
	color: #A81815 !important;
	box-shadow: 0 3px 8px rgba(168, 24, 21, .18) !important;
}
.cpme-srch-btn:active { transform: translateY(1px); }
.cpme-srch-btn:focus-visible { outline: 2px solid #A81815; outline-offset: 2px; }
.cpme-srch-btn svg { width: 18px !important; height: 18px !important; flex: 0 0 auto; display: block; }
@media (max-width: 1024px) {
	.cpme-srch-btn { width: 38px !important; height: 38px !important; margin: 0 0 0 4px !important; }
}
/* Tranche desktop la plus serrée (déconnecté, 1151-1279px, cf cpme-menu-fit) :
   version compacte 32px pour ne pas faire déborder le menu sur 2 lignes. */
@media (min-width: 1151px) and (max-width: 1279px) {
	body:not(.logged-in) .cpme-srch-btn { width: 32px !important; height: 32px !important; margin: 0 0 0 2px !important; }
	body:not(.logged-in) .cpme-srch-btn svg { width: 15px !important; height: 15px !important; }
}
html.cpme-dark .cpme-srch-btn {
	background: #12333f !important;
	border-color: #2a7d99 !important;
	color: #eaf3f6 !important;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .35) !important;
}
html.cpme-dark .cpme-srch-btn:hover {
	border-color: #f08a83 !important;
	color: #f08a83 !important;
	box-shadow: 0 3px 8px rgba(0, 0, 0, .5) !important;
}

/* --- Overlay plein écran --- */
.cpme-srch-overlay {
	position: fixed;
	inset: 0;
	z-index: 100000;
	background: rgba(13, 48, 60, .72);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
	overflow-y: auto;
	padding: 7vh 16px 40px;
}
.cpme-srch-overlay[hidden] { display: none; }
.cpme-srch-card {
	max-width: 680px;
	margin: 0 auto;
	background: #ffffff;
	color: #22343c;
	border-radius: 14px;
	box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
	overflow: hidden;
	animation: cpmeSrchIn .18s ease-out;
}
@keyframes cpmeSrchIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .cpme-srch-card { animation: none; } }
.cpme-srch-bar {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 16px 18px;
	border-bottom: 1px solid #e4ecef;
}
.cpme-srch-bar svg { width: 20px; height: 20px; flex: 0 0 auto; color: #114D61; }
.cpme-srch-input {
	flex: 1 1 auto;
	min-width: 0;
	border: 0 !important;
	outline: none !important;
	background: transparent !important;
	color: #12303c !important;
	font-size: 17px !important;
	line-height: 1.4;
	padding: 4px 0 !important;
	box-shadow: none !important;
}
.cpme-srch-input::placeholder { color: #8aa2ac; }
.cpme-srch-input::-webkit-search-cancel-button,
.cpme-srch-input::-webkit-search-decoration { -webkit-appearance: none; display: none; }
.cpme-srch-close {
	flex: 0 0 auto;
	width: 34px; height: 34px;
	display: inline-flex; align-items: center; justify-content: center;
	border: 0 !important;
	border-radius: 50% !important;
	background: #f1f6f8 !important;
	color: #114D61 !important;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	padding: 0 !important;
}
.cpme-srch-close:hover { background: #A81815 !important; color: #fff !important; }
.cpme-srch-hint {
	padding: 8px 18px;
	font-size: 12px;
	color: #7f97a1;
	border-bottom: 1px solid #eef4f6;
}
.cpme-srch-results { max-height: 58vh; overflow-y: auto; padding: 6px 8px 8px; }
.cpme-srch-group {
	margin: 10px 10px 4px;
	font-size: 11.5px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .1em;
	color: #114D61;
}
.cpme-srch-item {
	display: block;
	padding: 10px 12px;
	border-radius: 9px;
	text-decoration: none !important;
	color: inherit !important;
}
.cpme-srch-item:hover, .cpme-srch-item:focus { background: #f2f7f9; }
.cpme-srch-item .t {
	display: block;
	font-size: 15px;
	font-weight: 700;
	color: #12303c;
	margin: 0 0 3px;
}
.cpme-srch-item:hover .t { color: #A81815; }
.cpme-srch-item .x { display: block; font-size: 13px; line-height: 1.55; color: #52666e; }
.cpme-srch-item mark {
	background: #f8d7d5;
	color: #7c100e;
	padding: 0 2px;
	border-radius: 3px;
	font-weight: 600;
}
.cpme-srch-empty, .cpme-srch-error, .cpme-srch-typing {
	padding: 26px 18px;
	text-align: center;
	font-size: 14px;
	color: #7f97a1;
}
.cpme-srch-error { color: #A81815; }
.cpme-srch-foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
	padding: 12px 18px;
	border-top: 1px solid #e4ecef;
	background: #f8fbfc;
	font-size: 13px;
	color: #52666e;
}
.cpme-srch-foot[hidden] { display: none; }
.cpme-srch-annu {
	color: #A81815 !important;
	font-weight: 700;
	text-decoration: none !important;
}
.cpme-srch-annu:hover { text-decoration: underline !important; }
@media (max-width: 560px) {
	.cpme-srch-overlay { padding: 12px 8px 24px; }
	.cpme-srch-input { font-size: 16px !important; } /* évite le zoom iOS */
	.cpme-srch-results { max-height: 62vh; }
}

/* --- Overlay en mode sombre (variables --cd-* du dark CPME, avec repli) --- */
html.cpme-dark .cpme-srch-card { background: var(--cd-surface, #152730); color: var(--cd-text, #e8eef0); }
html.cpme-dark .cpme-srch-bar { border-bottom-color: var(--cd-soft, #25404b); }
html.cpme-dark .cpme-srch-bar svg { color: var(--cd-petrol-text, #79c2da); }
html.cpme-dark .cpme-srch-input { color: var(--cd-text, #e8eef0) !important; }
html.cpme-dark .cpme-srch-input::placeholder { color: var(--cd-muted, #7f97a1); }
html.cpme-dark .cpme-srch-close { background: var(--cd-surface2, #1b323d) !important; color: var(--cd-text2, #a9bcc4) !important; }
html.cpme-dark .cpme-srch-close:hover { background: var(--cd-red-fill, #cf3a33) !important; color: #fff !important; }
html.cpme-dark .cpme-srch-hint { color: var(--cd-muted, #7f97a1); border-bottom-color: var(--cd-soft, #25404b); }
html.cpme-dark .cpme-srch-group { color: var(--cd-petrol-text, #79c2da); }
html.cpme-dark .cpme-srch-item:hover, html.cpme-dark .cpme-srch-item:focus { background: var(--cd-surface2, #1b323d); }
html.cpme-dark .cpme-srch-item .t { color: var(--cd-text, #e8eef0); }
html.cpme-dark .cpme-srch-item:hover .t { color: var(--cd-red-text, #f08a83); }
html.cpme-dark .cpme-srch-item .x { color: var(--cd-text2, #a9bcc4); }
html.cpme-dark .cpme-srch-item mark { background: #5a1a17; color: #ffd9d6; }
html.cpme-dark .cpme-srch-foot { background: var(--cd-surface2, #1b323d); border-top-color: var(--cd-soft, #25404b); color: var(--cd-text2, #a9bcc4); }
html.cpme-dark .cpme-srch-annu { color: var(--cd-red-text, #f08a83) !important; }
html.cpme-dark .cpme-srch-empty, html.cpme-dark .cpme-srch-typing { color: var(--cd-muted, #7f97a1); }
