/**
 * FTI Carto — habillage de la carte de localisation (widget Elementor).
 * Reprend l'aspect des contrôles et du tooltip FTImmo, en autonome (préfixe .fti-carto).
 */

/* Conteneur carte : hauteur pilotée par le widget (variable), coins arrondis, fond neutre au chargement. */
.fti-carto {
	width: 100%;
	height: var( --fti-carto-h, 420px );
	min-height: 260px;
	border-radius: 8px;
	overflow: hidden;
	background: #eef2f6;
}
.fti-carto .leaflet-container {
	font-family: inherit;
	border-radius: 8px;
}

/* Bloc de 3 onglets (haut-droite) : Recentrer / Satellite / Carte. Pilule blanche, onglet actif en primaire. */
.fti-carto-tabs {
	display: flex;
	align-items: center;
	gap: 2px;
	height: 40px;
	padding: 4px;
	background: #fff;
	background-clip: padding-box;
	border: 1px solid rgba( 0, 0, 0, 0.15 );
	border-radius: 999px;
	box-shadow: 0 1px 4px rgba( 0, 0, 0, 0.2 );
}
.fti-carto-tabs .fti-carto-tab {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	padding: 0;
	margin: 0;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: #333;
	cursor: pointer;
	line-height: 0;
	transition: background 0.15s, color 0.15s;
}
.fti-carto-tabs .fti-carto-tab[data-act="sat"] svg { transform: translateX( -1px ); }
.fti-carto-tabs .fti-carto-tab:hover {
	background: #c3dcff;
	background: color-mix( in srgb, var( --fti-primary, #3889ff ) 30%, #fff );
	color: #333;
}
.fti-carto-tabs .fti-carto-tab.is-active,
.fti-carto-tabs .fti-carto-tab:active { background: var( --fti-primary, #3889ff ); color: #fff; }
.fti-carto-tabs .fti-carto-tab.is-active svg,
.fti-carto-tabs .fti-carto-tab:active svg { stroke: #fff; color: #fff; }
.fti-carto-tabs .fti-carto-tab svg { display: block; width: 16px; height: 16px; margin: 0 auto; }

/* Zoom +/- Leaflet (haut-gauche) : même aspect « pastille ». */
.fti-carto .leaflet-control-zoom {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 4px;
	background: #fff;
	border: 1px solid rgba( 0, 0, 0, 0.15 ) !important;
	border-radius: 999px !important;
	box-shadow: 0 1px 4px rgba( 0, 0, 0, 0.2 );
}
.fti-carto .leaflet-control-zoom a.leaflet-control-zoom-in,
.fti-carto .leaflet-control-zoom a.leaflet-control-zoom-out {
	width: 32px;
	height: 32px;
	line-height: 32px;
	border: 0 !important;
	border-radius: 999px !important;
	background: transparent;
	color: #333;
	font-size: 18px;
	text-decoration: none !important;
	transition: background 0.15s, color 0.15s;
}
.fti-carto .leaflet-control-zoom a.leaflet-control-zoom-in:hover,
.fti-carto .leaflet-control-zoom a.leaflet-control-zoom-out:hover {
	background: #c3dcff;
	background: color-mix( in srgb, var( --fti-primary, #3889ff ) 30%, #fff );
	color: #333;
	text-decoration: none !important;
}
.fti-carto .leaflet-control-zoom a.leaflet-control-zoom-in:active,
.fti-carto .leaflet-control-zoom a.leaflet-control-zoom-out:active { background: var( --fti-primary, #3889ff ); color: #fff; }
.fti-carto .leaflet-control-zoom a.leaflet-disabled { background: transparent; color: #c8c8c8; }

/* Bouton plein écran (bas-gauche) : même pastille, bouton rond. */
.fti-carto-fs { background: none; border: 0; box-shadow: none; }
.fti-carto-fsbtn {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 1px solid rgba( 0, 0, 0, 0.15 );
	border-radius: 999px;
	background: #fff;
	color: #333;
	cursor: pointer;
	box-shadow: 0 1px 4px rgba( 0, 0, 0, 0.2 );
	transition: background 0.15s, color 0.15s;
}
.fti-carto-fsbtn:hover,
.fti-carto-fsbtn:focus-visible {
	background: #c3dcff;
	background: color-mix( in srgb, var( --fti-primary, #3889ff ) 30%, #fff );
	color: #333;
}
.fti-carto-fsbtn svg { display: block; width: 18px; height: 18px; }

/* Info-bulles des contrôles (data-tip). */
.fti-carto-tabs .fti-carto-tab[data-tip]::after,
.fti-carto-fsbtn[data-tip]::after {
	content: attr( data-tip );
	position: absolute;
	pointer-events: none;
	white-space: nowrap;
	background: #123347;
	color: #fff;
	font-size: 12px;
	line-height: 1;
	padding: 6px 8px;
	border-radius: 4px;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.15s;
	z-index: 1000;
}
.fti-carto-tabs .fti-carto-tab[data-tip]::after { top: 50%; right: calc( 100% + 8px ); transform: translateY( -50% ); }
.fti-carto-fsbtn[data-tip]::after { bottom: 50%; left: calc( 100% + 8px ); transform: translateY( 50% ); }
.fti-carto-tabs .fti-carto-tab[data-tip]:hover::after,
.fti-carto-tabs .fti-carto-tab[data-tip]:focus-visible::after,
.fti-carto-fsbtn[data-tip]:hover::after,
.fti-carto-fsbtn[data-tip]:focus-visible::after { opacity: 1; visibility: visible; transition-delay: 0.4s; }

/* Focus clavier accessible sur les contrôles. */
.fti-carto-tabs .fti-carto-tab:focus-visible,
.fti-carto-fsbtn:focus-visible { outline: 2px solid var( --fti-primary, #3889ff ); outline-offset: 2px; }

/* Marqueur : pin rouge plein SVG, pointe basse, léger halo. */
.fti-carto-pin { background: none; border: 0; }
.fti-carto-pin svg { display: block; width: 32px; height: 32px; filter: drop-shadow( 0 1px 2px rgba( 0, 0, 0, 0.4 ) ); }

/* Tooltip « carte » : photo à gauche, corps à droite (entreprise, filet, adresse / NPA localité). */
/* Dimensions réduites de 20 %. Largeur bornée à l'écran moins le padding d'auto-pan Leaflet (2×24 px)
   pour éviter tout décalage horizontal en mobile : le tooltip tient toujours → reste centré sur le pin. */
.fti-cartopop { position: relative; display: flex; align-items: center; padding: 8px; box-sizing: border-box; background: #fff; border: 1px solid var( --fti-card-border, #e2e8f0 ); border-radius: 20px; width: min( 304px, calc( 100vw - 56px ) ); }
.fti-cartopop__img { flex: 0 0 88px; width: 88px; height: 88px; border-radius: 14px; background-size: cover; background-position: center; background-color: var( --fti-bg-soft, #eef2f6 ); display: block; }
.fti-cartopop__img--empty { background-color: var( --fti-bg-soft, #eef2f6 ); }
.fti-cartopop__body { flex: 1 1 0; min-width: 0; padding: 0 8px 0 14px; }
/* Croix : cible tactile élargie sans déplacer le glyphe 15px. */
.fti-cartopop__close { position: absolute; top: 5px; right: 5px; padding: 8px; width: 12px; height: 12px; box-sizing: content-box; display: flex; align-items: center; justify-content: center; border: 0; background: transparent; color: var( --fti-ink, #123347 ); cursor: pointer; line-height: 0; }
.fti-cartopop__close svg { display: block; width: 12px; height: 12px; }
.fti-cartopop__close:hover,
.fti-cartopop__close:focus-visible { color: var( --fti-primary, #3889ff ); }
.fti-cartopop__info { display: block; font-size: .75rem; line-height: 16px; color: var( --fti-ink, #123347 ); padding-right: 18px; }
.fti-cartopop__addr { display: block; font-size: .7rem; line-height: 15px; color: var( --fti-ink, #123347 ); }
.fti-cartopop__l { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fti-cartopop__name { font-weight: 700; color: var( --fti-primary, #3889ff ); }
.fti-cartopop__sep { display: block; height: 1px; background: var( --fti-card-border, #e2e8f0 ); margin: 8px 0; }

/* Popup Leaflet : neutraliser l'habillage par défaut, la carte visible est portée par .fti-cartopop. */
.fti-carto-popup .leaflet-popup-content-wrapper { background: transparent; box-shadow: none; padding: 0; border-radius: 0; }
.fti-carto-popup .leaflet-popup-content { margin: 0; width: auto !important; display: flex; justify-content: center; }
.fti-carto-popup .leaflet-popup-tip { background: #fff; border: 1px solid var( --fti-card-border, #e2e8f0 ); }
