/*
 * Bistrot Locator — styles front.
 *
 * Palette et typographies alignées sur l'identité visuelle de Bistrot Bertha :
 *  - Bleu marine  #213963 (principal / texte)
 *  - Vert         #24765F (secondaire)
 *  - Jaune        #FFD01F (accent)
 *  - Beige        #EDDED1 (fond)
 *  - Josefin Sans (corps) / Josefin Slab (titres)
 *  - Boutons en pilule (rayon 50px), comme le bouton « Prendre rendez-vous ».
 */

.bistrot-locator {
	--bl-blue: #213963;
	--bl-blue-dark: #162745;
	--bl-green: #24765F;
	--bl-green-dark: #164B3C;
	--bl-yellow: #FFD01F;
	--bl-yellow-dark: #E5B500;
	--bl-beige: #EDDED1;
	--bl-beige-dark: #CABBAF;
	--bl-ink: #181819;
	--bl-grey: #848482;

	--bl-font-sans: "Josefin Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	--bl-font-slab: "Josefin Slab", Georgia, "Times New Roman", serif;

	--bl-radius: 16px;
	--bl-radius-sm: 10px;
	--bl-radius-pill: 50px;

	font-family: var(--bl-font-sans);
	color: var(--bl-blue);
}

.bistrot-locator [hidden] {
	display: none !important;
}

/* ---------- Recherche ---------- */

.bistrot-locator__search {
	grid-area: search;
	min-width: 0;
}

.bistrot-locator__form {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	align-items: center;
}

.bistrot-locator__input-wrap {
	position: relative;
	flex: 1;
	min-width: 240px;
}

.bistrot-locator .bistrot-locator__input {
	box-sizing: border-box;
	width: 100%;
	height: 48px;
	padding: 0 100px 0 52px;
	border: 2px solid var(--bl-beige-dark);
	border-radius: var(--bl-radius-pill);
	background: #fff;
	font-family: var(--bl-font-sans);
	font-size: 1rem;
	color: var(--bl-blue);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.bistrot-locator .bistrot-locator__input::placeholder {
	color: var(--bl-grey);
}

.bistrot-locator .bistrot-locator__input:focus {
	border-color: var(--bl-green);
	outline: none;
	box-shadow: 0 0 0 3px rgba(36, 118, 95, 0.18);
}

/* Boutons-icônes intégrés au champ. */
.bistrot-locator .bistrot-locator__submit,
.bistrot-locator .bistrot-locator__locate,
.bistrot-locator .bistrot-locator__reset {
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--bl-blue);
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.bistrot-locator .bistrot-locator__submit svg,
.bistrot-locator .bistrot-locator__locate svg,
.bistrot-locator .bistrot-locator__reset svg {
	width: 20px;
	height: 20px;
	flex: 0 0 auto;
}

/* Loupe (lancer la recherche) : à gauche, dans le champ. */
.bistrot-locator .bistrot-locator__submit {
	position: absolute;
	top: 50%;
	left: 6px;
	transform: translateY(-50%);
}

/* Boutons de droite (« autour de moi » + réinitialiser). */
.bistrot-locator .bistrot-locator__actions {
	position: absolute;
	top: 50%;
	right: 6px;
	transform: translateY(-50%);
	display: flex;
	align-items: center;
	gap: 2px;
}

.bistrot-locator .bistrot-locator__submit:hover,
.bistrot-locator .bistrot-locator__locate:hover,
.bistrot-locator .bistrot-locator__reset:hover {
	background: var(--bl-beige);
	color: var(--bl-green-dark);
}

.bistrot-locator .bistrot-locator__submit:focus-visible,
.bistrot-locator .bistrot-locator__locate:focus-visible,
.bistrot-locator .bistrot-locator__reset:focus-visible {
	outline: 2px solid var(--bl-green);
	outline-offset: 2px;
}

.bistrot-locator .bistrot-locator__reset {
	color: var(--bl-grey);
}

.bistrot-locator__status {
	min-height: 1.2em;
	margin: 10px 0 0;
	font-size: 0.95rem;
	color: var(--bl-green-dark);
}

/* ---------- Suggestions (autocomplétion) ---------- */

.bistrot-locator__suggest {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	right: 0;
	z-index: 1000;
	margin: 0;
	padding: 6px;
	list-style: none;
	background: #fff;
	border: 1px solid var(--bl-beige-dark);
	border-radius: 14px;
	box-shadow: 0 8px 24px rgba(22, 39, 69, 0.16);
}

.bistrot-locator__suggest-group {
	padding: 8px 12px 4px;
	font-size: 0.72rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--bl-grey);
}

.bistrot-locator__suggest-item {
	margin: 0;
}

.bistrot-locator__suggest-btn {
	display: flex;
	align-items: baseline;
	gap: 8px;
	width: 100%;
	padding: 9px 12px;
	border: 0;
	border-radius: 8px;
	background: transparent;
	text-align: left;
	cursor: pointer;
	font-family: var(--bl-font-sans);
	font-size: 0.95rem;
	color: var(--bl-blue);
}

.bistrot-locator__suggest-btn:hover,
.bistrot-locator__suggest-btn:focus {
	background: var(--bl-beige);
	outline: none;
}

.bistrot-locator__suggest-label {
	font-weight: 600;
}

.bistrot-locator__suggest-sub {
	font-size: 0.85rem;
	color: var(--bl-grey);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* ---------- Layout carte + liste ---------- */

.bistrot-locator__layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 540px;
	grid-template-areas:
		"map search"
		"map list";
	grid-template-rows: auto minmax(0, 1fr);
	height: var(--bl-map-height, 500px);
	gap: 20px;
}

.bistrot-locator__map {
	grid-area: map;
	background: var(--bl-beige);
	border: 2px solid var(--bl-beige-dark);
	border-radius: var(--bl-radius);
	overflow: hidden;
	z-index: 1;
	box-shadow: 0 6px 20px rgba(22, 39, 69, 0.08);
}

/* ---------- Liste (compacte) ---------- */

.bistrot-locator__list {
	list-style: none;
	margin: 0;
	padding: 0 6px 0 0;
	grid-area: list;
	min-height: 0;
	overflow-y: auto;
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 10px;
	scrollbar-width: thin;
	scrollbar-color: var(--bl-green) transparent;
	scrollbar-gutter: stable;
	overscroll-behavior: contain;
}

.bistrot-locator__list::-webkit-scrollbar {
	width: 10px;
}

.bistrot-locator__list::-webkit-scrollbar-thumb {
	background: var(--bl-green);
	border-radius: 5px;
}

.bistrot-locator__list::-webkit-scrollbar-thumb:hover {
	background: var(--bl-green-dark);
}

.bistrot-locator__list::-webkit-scrollbar-track {
	background: transparent;
}

.bistrot-locator__item {
	margin: 0;
	min-width: 0;
}

.bistrot-locator__card {
	display: flex;
	gap: 12px;
	padding: 10px;
	background: var(--bl-beige);
	border: 2px solid transparent;
	border-radius: 12px;
	cursor: pointer;
	transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}

.bistrot-locator__card:hover {
	border-color: var(--bl-green);
	background: #fff;
	transform: translateY(-1px);
	box-shadow: 0 4px 14px rgba(22, 39, 69, 0.12);
}

.bistrot-locator__card:focus-visible {
	border-color: var(--bl-green);
	outline: 3px solid rgba(36, 118, 95, 0.35);
	outline-offset: 2px;
}

/* Taille fixe quelle que soit la longueur du texte : sélecteur doublé car le thème
   (Elementor) force `height: auto` sur les <img>, et align-self évite l'étirement flex. */
.bistrot-locator .bistrot-locator__thumb {
	width: 64px;
	height: 128px;
	max-width: none;
	align-self: flex-start;
	object-fit: cover;
	flex-shrink: 0;
	border-radius: 10px;
	background: var(--bl-beige-dark);
}

.bistrot-locator__thumb:not(.bistrot-locator__thumb--placeholder) {
	cursor: zoom-in;
}

.bistrot-locator .bistrot-locator__thumb--placeholder {
	object-fit: contain;
	padding: 8px;
	box-sizing: border-box;
	background: #fff;
	border: 1px solid var(--bl-beige-dark);
}

.bistrot-locator__body {
	min-width: 0;
}

.bistrot-locator .bistrot-locator__name {
	margin: 0 0 3px;
	font-family: var(--bl-font-slab);
	font-weight: 700;
	font-size: 2marem;
	line-height: 1.2;
	color: var(--bl-blue);
	display: -webkit-box;
	-webkit-line-clamp: 1;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.bistrot-locator__etablissement {
	display: inline-block;
	margin: 0 0 3px;
	padding: 1px 7px;
	background: var(--bl-green);
	color: var(--bl-beige);
	font-size: 0.8rem;
	font-weight: 600;
	letter-spacing: 0.02em;
	border-radius: 4px;
}

.bistrot-locator__address {
	margin: 0 0 3px;
	font-family: var(--bl-font-slab);
	font-size: 0.85rem;
	line-height: 1.2;
	color: var(--bl-blue);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.bistrot-locator__email {
	margin: 0 0 1px;
	font-size: 0.85rem;
	line-height: 1.2;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.bistrot-locator__email a {
	color: var(--bl-green);
	text-decoration: none;
}

.bistrot-locator__email a:hover {
	text-decoration: underline;
}

.bistrot-locator__description {
	margin: 3px 0 0;
	font-size: 0.85rem;
	line-height: 1.25;
	color: var(--bl-blue-dark);
	display: -webkit-box;
	-webkit-line-clamp: 1;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.bistrot-locator__distance {
	margin: 4px 0 0;
	font-size: 0.85rem;
	font-weight: 700;
	color: var(--bl-green-dark);
}

/* ---------- Marqueurs Leaflet ---------- */

.bistrot-locator__marker {
	filter: drop-shadow(0 2px 4px rgba(24, 24, 25, 0.35));
}

/* ---------- Infobulles Leaflet ---------- */

.bistrot-locator .leaflet-popup-content-wrapper {
	border-radius: 12px;
	font-family: var(--bl-font-sans);
	color: var(--bl-blue);
	box-shadow: 0 6px 20px rgba(22, 39, 69, 0.15);
}

.bistrot-locator .leaflet-popup-content {
	margin: 12px 16px;
	line-height: 1.4;
}

.bistrot-locator .leaflet-popup-tip {
	box-shadow: none;
}

.bistrot-locator .leaflet-popup-close-button {
	color: var(--bl-grey);
}

.bistrot-locator__popup-name {
	display: block;
	margin-bottom: 4px;
	font-family: var(--bl-font-slab);
	font-weight: 700;
	font-size: 1.05rem;
	color: var(--bl-blue);
}

.bistrot-locator__popup-etablissement {
	margin-bottom: 2px;
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--bl-green);
}

.bistrot-locator__popup-address {
	font-size: 0.85rem;
	color: var(--bl-grey);
}

.bistrot-locator__popup-email {
	font-size: 0.85rem;
}

.bistrot-locator__popup-email a {
	color: var(--bl-green);
	text-decoration: none;
}

.bistrot-locator__popup-email a:hover {
	text-decoration: underline;
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
	.bistrot-locator__layout {
		grid-template-columns: 1fr;
		grid-template-areas:
			"search"
			"map"
			"list";
		grid-template-rows: auto auto auto;
		height: auto;
	}

	.bistrot-locator__map {
		height: var(--bl-map-height, 500px);
		min-height: 300px;
	}

	.bistrot-locator__list {
		max-height: none;
		scrollbar-gutter: auto;
	}
}

@media (max-width: 560px) {
	.bistrot-locator__input-wrap {
		flex: 1 1 100%;
		min-width: 0;
	}
}

/* ---- Lightbox (ajoutée au <body>, hors du scope des variables .bistrot-locator) ---- */

.bistrot-locator-lightbox {
	position: fixed;
	inset: 0;
	z-index: 2147483000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	box-sizing: border-box;
	background: rgba(22, 39, 69, 0.6);
	cursor: zoom-out;
	animation: bistrot-locator-fade 0.15s ease;
}

.bistrot-locator-lightbox[hidden] {
	display: none;
}

/* La popup : cadre blanc centré contenant la photo et le nom du bistrot. */
.bistrot-locator-lightbox__figure {
	position: relative;
	margin: 0;
	max-width: min(900px, 100%);
	max-height: 100%;
	padding: 12px;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
	cursor: default;
}

.bistrot-locator-lightbox__img {
	display: block;
	max-width: 100%;
	max-height: calc(100vh - 120px);
	width: auto;
	height: auto;
	object-fit: contain;
	border-radius: 10px;
}

.bistrot-locator-lightbox__caption {
	font-family: "Josefin Slab", Georgia, "Times New Roman", serif;
	font-weight: 700;
	font-size: 1.2rem;
	color: #213963;
	text-align: center;
}

.bistrot-locator-lightbox__caption[hidden] {
	display: none;
}

/* Sélecteurs doublés : le thème (Elementor/Hello) style globalement tous les <button>. */
.bistrot-locator-lightbox .bistrot-locator-lightbox__close {
	position: absolute;
	top: -16px;
	right: -16px;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	min-width: 0;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 3px solid #fff;
	border-radius: 50%;
	background: #FFD01F;
	color: #162745;
	font-size: 0;
	line-height: 1;
	text-transform: none;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
	cursor: pointer;
	transition: background-color 0.15s ease, transform 0.15s ease;
}

.bistrot-locator-lightbox .bistrot-locator-lightbox__close:hover,
.bistrot-locator-lightbox .bistrot-locator-lightbox__close:focus,
.bistrot-locator-lightbox .bistrot-locator-lightbox__close:focus-visible {
	background: #E5B500;
	color: #162745;
	border-color: #fff;
	outline: none;
	transform: scale(1.08);
}

.bistrot-locator-lightbox .bistrot-locator-lightbox__close svg {
	display: block;
	width: 16px;
	height: 16px;
	pointer-events: none;
}

body.bistrot-locator-lightbox-open {
	overflow: hidden;
}

@keyframes bistrot-locator-fade {
	from { opacity: 0; }
	to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
	.bistrot-locator-lightbox {
		animation: none;
	}

	.bistrot-locator-lightbox .bistrot-locator-lightbox__close {
		transition: none;
	}

	.bistrot-locator__card,
	.bistrot-locator__input,
	.bistrot-locator__submit,
	.bistrot-locator__locate,
	.bistrot-locator__reset {
		transition: none;
	}
}
