/**
 * Iroise Bellevie — [etablissement-search-list]
 * Recherche ville / code postal (homepage) → popup des 3 établissements
 * (EHPAD + Résidences Seniors) les plus proches, une ville par ligne.
 *
 * Design calqué sur « irz2-home », palette établissement : fond popup #ffeee3,
 * texte / accent #ac371c.
 * ========================================================================= */

.esl,
.esl-overlay,
.esl-suggestions {
	/* Aussi sur .esl-overlay et .esl-suggestions : le JS les déplace vers <body>
	   (position:fixed), ils perdraient sinon l'héritage de ces variables. */
	--esl-accent: #ac371c;
	--esl-bg: #ffeee3;
}
.esl {
	max-width: 420px;
	font-family: inherit;
	color: inherit;
}
.esl * { box-sizing: border-box; }

/* ---- Champ + bouton ---- */
.esl-row { display: flex; gap: .5rem; }
.esl-input {
	flex: 1 1 auto;
	min-width: 0;
	height: 44px!important;
	padding: 0 18px;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 30px !important;
}
.esl-input::placeholder { color: #d1d1d1; font-style: italic; opacity: 1; }
.esl-input:focus { outline: 2px solid var(--esl-accent); outline-offset: 1px; border-color: var(--esl-accent); }

.esl-btn {
	flex: 0 0 auto;
	width: 44px;
	height: 44px;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 0;
	border-radius: 50%;
	background: var(--esl-accent);
	color: #fff;
	cursor: pointer;
	transition: opacity .15s;
}
.esl-btn:hover { opacity: .9; }
.esl-btn svg { width: 20px; height: 20px; flex-shrink: 0; }

.esl-error { margin: .5rem 0 0; font-size: .9rem; color: var(--esl-accent); }
.esl-error[hidden] { display: none; }

.esl-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;
}

/* ---- Suggestions (autocomplétion / désambiguïsation des homonymes) ----
   Détaché dans <body> par le JS (comme .esl-overlay) pour échapper au
   contexte d'empilement piégé par les colonnes animées Flatsome
   (data-animate-transform). position/top/left/width fixés dynamiquement
   en JS (positionSuggestions()) ; ici uniquement l'apparence. */
.esl-suggestions {
	position: fixed; /* valeur de repli avant le premier calcul JS */
	z-index: 99998;
	margin: 0;
	padding: 6px;
	list-style: none;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 16px;
	box-shadow: 0 12px 28px rgba(16, 24, 40, .16);
	max-height: 260px;
	overflow-y: auto;
}
.esl-suggestions[hidden] { display: none; }

.esl-suggestion {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 10px;
	padding: 10px 14px;
	border-radius: 10px;
	cursor: pointer;
	color: var(--esl-accent);
}
.esl-suggestion:hover,
.esl-suggestion.is-active {
	background: var(--esl-bg);
}
.esl-suggestion-city { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.esl-suggestion-ctx { flex: 0 0 auto; font-size: .8rem; color: #8a8a8a; white-space: nowrap; }
.esl-suggestion.is-active .esl-suggestion-ctx { color: var(--esl-accent); opacity: .75; }

/* ---- Overlay + popup ---- */
.esl-overlay {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	background: rgba(17, 24, 39, .55);
	opacity: 0;
	visibility: hidden;
	transition: opacity .2s ease, visibility 0s linear .2s;
}
.esl-overlay[data-esl-open] {
	opacity: 1;
	visibility: visible;
	transition: opacity .2s ease, visibility 0s linear 0s;
}
.esl-popup {
	position: relative;
	width: 100%;
	max-width: 680px;
	max-height: 85vh;
	overflow-y: auto;
	padding: 56px 30px 40px;
	background: var(--esl-bg);
	color: var(--esl-accent);
	border-radius: 24px;
	box-shadow: 0 20px 50px rgba(16, 24, 40, .35);
	transform: translateY(10px) scale(.97);
	opacity: 0;
	transition: transform .22s ease, opacity .22s ease;
}
.esl-overlay[data-esl-open] .esl-popup { transform: translateY(0) scale(1); opacity: 1; }

.esl-close {
	position: absolute;
	top: 14px;
	right: 14px;
	width: 32px;
	height: 32px;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 0;
	border-radius: 50%;
	background: rgba(172, 55, 28, .15);
	color: var(--esl-accent);
	font: 15px/1 Tahoma, Verdana, sans-serif;
	cursor: pointer;
	transition: background .15s;
}
.esl-close:hover { background: rgba(172, 55, 28, .28); }

.esl-title { margin: 20px 0 20px; color: var(--esl-accent); text-align: center; }

/* ---- Liste : une ville par ligne ---- */
.esl-list {
	margin: 0 0 24px;
	padding: 0;
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 12px;
}
.esl-item {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 12px 18px;
	background: #fff;
	border-radius: 16px;
	color: var(--esl-accent);
}
.esl-item-icon { width: 40px; height: 40px; flex: 0 0 auto; object-fit: contain; }
.esl-item-ville { color: var(--esl-accent); font-weight: 700; white-space: nowrap; }
.esl-item-distance { white-space: nowrap; }
.esl-item-actions { flex: 0 0 auto; margin-left: auto; display: flex; flex-wrap: wrap; gap: 8px; }
.esl-item-link {
    display: inline-block;
    padding: .55rem 1.2rem;
    background: var(--esl-accent);
    border-radius: 999px;
    font-size: .76rem;
    color: #fff !important;
    text-decoration: none;
    white-space: nowrap;
    transition: opacity .15s;
    letter-spacing: 0;
}
.esl-item-link:hover { opacity: .88; color: #fff; }

/* ---- Deux boutons finaux centrés ---- */
.esl-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 14px;
	justify-content: center;
}
.esl-action {
	display: inline-block;
	padding: .7rem 1.6rem;
	border: 1px solid var(--esl-accent);
	border-radius: 999px;
	font-size: .9rem;
	font-weight: 700;
	text-decoration: none;
	transition: opacity .15s;
}
.esl-action--primary { background: var(--esl-accent); color: #fff !important; }
.esl-action--secondary { background: #fff; color: var(--esl-accent) !important; }
.esl-action:hover { opacity: .88; }

/* ---- Responsive (bottom-sheet + lignes empilées) ---- */
@media (max-width: 640px) {
	.esl-overlay { align-items: flex-end; padding: 0; }
	.esl-popup {
		max-width: 100%;
		max-height: 88vh;
		padding: 44px 18px calc(24px + env(safe-area-inset-bottom));
		border-radius: 16px 16px 0 0;
		transform: translateY(100%);
	}
	.esl-overlay[data-esl-open] .esl-popup { transform: translateY(0); }

	.esl-item { flex-wrap: wrap; gap: 6px 12px; }
	.esl-item-actions { flex: 1 1 100%; order: 6; margin-top: 6px; margin-left: 0; justify-content: flex-start; }
}