/**
 * BikerTribe Événements – Carte interactive (Leaflet)
 *
 * Design system aligné sur la page liste : dark mode #111, accent #FF6B35.
 * Layout desktop : carte plein espace + sidebar droite minmax(300px, 460px).
 * Layout mobile : carte plein écran + bottom-sheet escamotable.
 */

/* === FIX LARGEUR PAGE ===
   Le thème impose .page-entry { max-width: 720px }, ce qui écrase la
   carte. On s'élargit à 100% du viewport (avec un max raisonnable)
   uniquement sur les pages contenant le shortcode carte. */
body.btk-events-map-page .page-entry,
body.btk-events-map-page article.page-entry,
body.btk-events-map-page .entry-content,
body.btk-events-map-page .page-entry-content {
	max-width: 100% !important;
	width: 100% !important;
	padding-left: 0 !important;
	padding-right: 0 !important;
	margin-left: auto !important;
	margin-right: auto !important;
	box-sizing: border-box !important;
}
body.btk-events-map-page .page-entry-header,
body.btk-events-map-page .entry-header {
	max-width: 1400px;
	margin-left: auto;
	margin-right: auto;
	padding-left: 1.5rem;
	padding-right: 1.5rem;
}
/* Sur la page carte, le hero/banner du thème peut être moins haut pour
   donner plus de place visuelle à la carte. */
body.btk-events-map-page .page-entry {
	padding-top: 0 !important;
	padding-bottom: 0 !important;
}

.btk-events-map-wrap {
	max-width: 1400px;
	width: 100%;
	margin: 0 auto;
	padding: 1.5rem 1.5rem 0;
	padding-bottom: 0;
	box-sizing: border-box;
}

.btk-events-map-counter {
	margin: 0.5rem 0 0;
	font-size: 0.9rem;
	color: var(--btk-events-muted);
	text-align: center;
}

/* Container global : carte + sidebar */
.btk-events-map-layout {
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(300px, 460px);
	gap: 0;
	height: var(--btk-events-map-height, calc(100vh - 220px));
	min-height: 600px;
	max-height: 900px;
	border-radius: var(--btk-events-radius-lg);
	overflow: hidden;
	background: var(--btk-events-surface);
	border: 1px solid rgba(255, 255, 255, 0.06);
	margin-bottom: 1.5rem;
}

/* Sur les très grands écrans on peut s'autoriser une sidebar plus large */
@media (min-width: 1400px) {
	.btk-events-map-layout {
		grid-template-columns: minmax(0, 1fr) minmax(340px, 500px);
	}
}

/* Container de la carte */
.btk-events-map-container {
	position: relative;
	height: 100%;
	min-height: 0;
	background: #111;
}

.btk-events-leaflet-map {
	width: 100%;
	height: 100%;
	background: #1a1a1a;
	border-radius: var(--btk-events-radius);
}

/* Override styles Leaflet pour dark mode */
.leaflet-container {
	font-family: var(--btk-events-font);
	background: #1a1a1a;
}
.leaflet-control-zoom a,
.leaflet-control-zoom-in,
.leaflet-control-zoom-out {
	background: var(--btk-events-surface) !important;
	color: var(--btk-events-text) !important;
	border: 1px solid rgba(255, 255, 255, 0.1) !important;
	transition: background 0.2s ease;
}
.leaflet-control-zoom a:hover {
	background: var(--btk-events-accent) !important;
	color: #fff !important;
}
.leaflet-control-attribution {
	background: rgba(0, 0, 0, 0.65) !important;
	color: #d0d0d0 !important;
	font-size: 10px !important;
	padding: 2px 6px !important;
}
.leaflet-control-attribution a {
	color: var(--btk-events-accent) !important;
	text-decoration: none;
}

/* Boutons custom flottants (recentrer, géolocalisation) */
.btk-events-map-controls {
	position: absolute;
	top: 12px;
	right: 12px;
	display: flex;
	flex-direction: column;
	gap: 6px;
	z-index: 1000;
}

.btk-events-map-control {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	border: 1px solid rgba(255, 255, 255, 0.12);
	background: var(--btk-events-surface);
	color: var(--btk-events-text);
	border-radius: 10px;
	cursor: pointer;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
	transition: all 0.2s ease;
	padding: 0;
}
.btk-events-map-control:hover {
	background: var(--btk-events-accent);
	color: #ffffff;
	border-color: var(--btk-events-accent);
}
.btk-events-map-control svg {
	width: 18px;
	height: 18px;
}
.btk-events-map-control.is-loading svg {
	animation: btk-spin 1s linear infinite;
}
@keyframes btk-spin {
	to { transform: rotate(360deg); }
}

/* Marqueurs événements — alignés app (disque violet + calendrier + pastille statut) */
.btk-map-event-marker-wrap {
	background: transparent !important;
	border: 0 !important;
}
.btk-map-event-marker {
	position: relative;
	width: 40px;
	height: 40px;
}
.btk-map-event-marker-disc {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	margin: 2px auto 0;
	border-radius: 50%;
	background: #7C4DFF;
	border: 2px solid #ffffff;
	box-shadow: 0 4px 10px rgba(0, 0, 0, 0.45);
	color: #ffffff;
}
.btk-map-event-marker-disc svg {
	width: 18px;
	height: 18px;
	display: block;
}
.btk-map-event-marker-status {
	position: absolute;
	top: 0;
	right: 0;
	width: 11px;
	height: 11px;
	border-radius: 50%;
	border: 2px solid #111;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}
.btk-map-event-marker-status--today {
	background: #4CAF50;
}
.btk-map-event-marker-status--upcoming {
	background: #2196F3;
}
.btk-map-event-marker-wrap:hover .btk-map-event-marker-disc,
.btk-map-event-marker-wrap:focus .btk-map-event-marker-disc {
	transform: scale(1.08);
}
.btk-map-event-marker-disc {
	transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Pin legacy (conservé si réutilisé ailleurs) */
.btk-map-pin-wrap {
	background: transparent !important;
	border: 0 !important;
}
.btk-map-pin {
	position: relative;
	width: 32px;
	height: 44px;
	filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.5));
	transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.btk-map-pin-wrap:hover .btk-map-pin,
.btk-map-pin-wrap:focus .btk-map-pin {
	transform: translateY(-3px) scale(1.08);
}
.btk-map-pin-bg {
	position: absolute;
	inset: 0;
	width: 32px;
	height: 44px;
}
.btk-map-pin-icon {
	position: absolute;
	top: 6px;
	left: 8px;
	width: 16px;
	height: 16px;
	color: var(--pin-color, #FF6B35);
}

/* Cluster custom */
.btk-map-cluster {
	background: transparent !important;
	border: 0 !important;
}
.btk-map-cluster .btk-map-cluster-inner {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	background: #7C4DFF;
	border: 2px solid #ffffff;
	color: #ffffff;
	font-weight: 700;
	font-size: 0.95rem;
	box-shadow: 0 0 0 6px rgba(255, 107, 53, 0.18), 0 6px 16px rgba(0, 0, 0, 0.4);
	border: 2px solid #ffffff;
}
.btk-map-cluster--medium .btk-map-cluster-inner {
	width: 50px;
	height: 50px;
	font-size: 1.05rem;
}
.btk-map-cluster--large .btk-map-cluster-inner {
	width: 58px;
	height: 58px;
	font-size: 1.15rem;
	background: #ff5722;
}

/* === POPUP CUSTOM — design moderne avec hero photo + meta + progress bar === */
.btk-map-popup-wrap .leaflet-popup-content-wrapper {
	background: linear-gradient(180deg, #1f1f1f 0%, #181818 100%);
	color: var(--btk-events-text);
	border-radius: 16px;
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.06);
	padding: 0;
	overflow: hidden;
}
.btk-map-popup-wrap .leaflet-popup-content {
	margin: 0;
	width: 320px !important;
	max-width: 90vw;
}
.btk-map-popup-wrap .leaflet-popup-tip {
	background: #181818;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}
.btk-map-popup-wrap .leaflet-popup-close-button {
	color: #ffffff !important;
	font-size: 0 !important;
	width: 32px !important;
	height: 32px !important;
	right: 8px !important;
	top: 8px !important;
	z-index: 4;
	background: rgba(0, 0, 0, 0.55) !important;
	border-radius: 50% !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	transition: all 0.2s ease;
	border: 1px solid rgba(255, 255, 255, 0.12) !important;
	backdrop-filter: blur(6px);
}
.btk-map-popup-wrap .leaflet-popup-close-button::before {
	content: '';
	position: absolute;
	width: 14px;
	height: 14px;
	background: linear-gradient(currentColor, currentColor) center/100% 2px no-repeat,
		linear-gradient(currentColor, currentColor) center/2px 100% no-repeat;
	transform: rotate(45deg);
	color: #ffffff;
}
.btk-map-popup-wrap .leaflet-popup-close-button:hover {
	background: var(--btk-events-accent) !important;
	border-color: var(--btk-events-accent) !important;
	transform: rotate(90deg);
}

.btk-map-popup {
	display: flex;
	flex-direction: column;
	border-radius: 16px;
	overflow: hidden;
}

/* HERO : photo en bandeau, gradient overlay, chips, titre superposé */
.btk-map-popup-hero {
	position: relative;
	height: 160px;
	overflow: hidden;
	background: #0a0a0a;
}
.btk-map-popup-hero-img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.btk-map-popup:hover .btk-map-popup-hero-img {
	transform: scale(1.06);
}
.btk-map-popup-hero-placeholder {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--cat-color, #FF6B35);
	background:
		radial-gradient(circle at 30% 30%, color-mix(in srgb, var(--cat-color, #FF6B35) 38%, transparent) 0%, transparent 60%),
		linear-gradient(135deg, color-mix(in srgb, var(--cat-color, #FF6B35) 18%, #2a2a2a) 0%, #111 100%);
}
.btk-map-popup-hero-placeholder svg {
	opacity: 0.85;
	filter: drop-shadow(0 4px 14px rgba(0, 0, 0, 0.5));
}
.btk-map-popup-hero-overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.3) 50%, rgba(24, 24, 24, 1) 100%);
	pointer-events: none;
}

.btk-map-popup-chip {
	position: absolute;
	top: 12px;
	left: 12px;
	z-index: 3;
	padding: 0.3rem 0.7rem;
	border-radius: 999px;
	font-size: 0.65rem;
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	line-height: 1;
	white-space: nowrap;
}
.btk-map-popup-chips {
	position: absolute;
	top: 12px;
	left: 12px;
	z-index: 3;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.35rem;
	max-width: calc(100% - 7rem);
}
.btk-map-popup-chips .btk-map-popup-chip {
	position: static;
}
.btk-map-popup-chip--cat {
	background: var(--cat-color, #FF6B35);
	color: #ffffff;
	box-shadow: 0 4px 12px color-mix(in srgb, var(--cat-color, #FF6B35) 50%, transparent);
}

/* Date sticker en haut à droite */
.btk-map-popup-chip-date {
	position: absolute;
	top: 12px;
	right: 50px;
	z-index: 3;
	display: flex;
	flex-direction: column;
	align-items: center;
	background: rgba(0, 0, 0, 0.65);
	border: 1px solid rgba(255, 255, 255, 0.15);
	border-radius: 10px;
	padding: 0.35rem 0.55rem;
	backdrop-filter: blur(6px);
	min-width: 44px;
	line-height: 1;
}
.btk-map-popup-chip-day {
	font-size: 1.1rem;
	font-weight: 800;
	color: #ffffff;
}
.btk-map-popup-chip-month {
	font-size: 0.6rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--cat-color, #FF6B35);
	margin-top: 2px;
}

.btk-map-popup-hero-title {
	position: absolute;
	left: 14px;
	right: 14px;
	bottom: 12px;
	z-index: 3;
	margin: 0;
	font-size: 1.15rem;
	font-weight: 700;
	line-height: 1.25;
	color: #ffffff;
	text-shadow: 0 2px 8px rgba(0, 0, 0, 0.6);
	overflow-wrap: break-word;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* BODY */
.btk-map-popup-body {
	padding: 0.9rem 1rem 1rem;
	display: flex;
	flex-direction: column;
	gap: 0.65rem;
}
.btk-map-popup-meta-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
}
.btk-map-popup-meta-item {
	display: flex;
	align-items: flex-start;
	gap: 0.55rem;
	margin: 0;
	font-size: 0.85rem;
	line-height: 1.4;
	color: var(--btk-events-text);
	overflow-wrap: break-word;
}
.btk-map-popup-meta-item svg {
	flex-shrink: 0;
	color: var(--cat-color, var(--btk-events-accent));
	margin-top: 2px;
}
.btk-map-popup-meta-item span {
	min-width: 0;
	flex: 1 1 auto;
	color: var(--btk-events-muted);
}
.btk-map-popup-region {
	display: inline-block;
	margin-left: 0.35rem;
	padding: 0.05rem 0.45rem;
	background: rgba(255, 255, 255, 0.06);
	color: var(--cat-color, var(--btk-events-accent));
	border-radius: 999px;
	font-size: 0.7rem;
	font-weight: 600;
	white-space: nowrap;
}

/* Barre de progression inscrits */
.btk-map-popup-progress {
	display: flex;
	flex-direction: column;
	gap: 0.3rem;
	padding: 0.5rem 0.65rem;
	background: rgba(255, 255, 255, 0.03);
	border: 1px solid rgba(255, 255, 255, 0.06);
	border-radius: 10px;
}
.btk-map-popup-progress-info {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	font-size: 0.78rem;
}
.btk-map-popup-progress-label {
	color: var(--btk-events-muted);
	font-weight: 500;
}
.btk-map-popup-progress-pct {
	color: var(--cat-color, var(--btk-events-accent));
	font-weight: 700;
}
.btk-map-popup-progress-bar {
	height: 6px;
	background: rgba(255, 255, 255, 0.08);
	border-radius: 999px;
	overflow: hidden;
}
.btk-map-popup-progress-fill {
	height: 100%;
	background: linear-gradient(90deg, var(--cat-color, #FF6B35), color-mix(in srgb, var(--cat-color, #FF6B35) 80%, #fff));
	border-radius: 999px;
	transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}
.btk-map-popup-registered-simple {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	margin: 0;
	font-size: 0.8rem;
	color: var(--btk-events-muted);
}
.btk-map-popup-registered-simple svg {
	color: var(--cat-color, var(--btk-events-accent));
}

/* CTA principal */
.btk-map-popup-cta {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	margin-top: 0.25rem;
	padding: 0.7rem 1rem;
	background: linear-gradient(135deg, var(--btk-events-accent), color-mix(in srgb, var(--btk-events-accent) 75%, #fff));
	color: #ffffff !important;
	border-radius: 10px;
	text-decoration: none !important;
	font-weight: 700;
	font-size: 0.9rem;
	text-align: center;
	letter-spacing: 0.01em;
	transition: all 0.25s ease;
	box-shadow: 0 6px 16px rgba(255, 107, 53, 0.35);
}
.btk-map-popup-cta:hover {
	transform: translateY(-2px);
	box-shadow: 0 10px 22px rgba(255, 107, 53, 0.5);
}
.btk-map-popup-cta svg {
	transition: transform 0.25s ease;
}
.btk-map-popup-cta:hover svg {
	transform: translateX(3px);
}
.btk-map-popup-cta.is-full {
	background: rgba(255, 255, 255, 0.08);
	color: var(--btk-events-text) !important;
	border: 1px solid rgba(255, 255, 255, 0.12);
	box-shadow: none;
}

/* Sidebar liste */
.btk-events-map-sidebar {
	background: var(--btk-events-surface);
	border-left: 1px solid rgba(255, 255, 255, 0.06);
	display: flex;
	flex-direction: column;
	height: 100%;
	min-height: 0;
	min-width: 0;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	overflow: hidden;
}
.btk-events-map-sidebar-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	padding: 0.85rem 1rem;
	border-bottom: 1px solid rgba(255, 255, 255, 0.06);
	flex-shrink: 0;
}
.btk-events-map-sidebar-titlewrap {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	min-width: 0;
}
.btk-events-map-sidebar-title {
	margin: 0;
	font-size: 0.95rem;
	font-weight: 700;
	color: var(--btk-events-text);
	letter-spacing: 0.02em;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.btk-events-map-sidebar-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 28px;
	height: 22px;
	padding: 0 0.5rem;
	background: rgba(255, 107, 53, 0.16);
	border: 1px solid rgba(255, 107, 53, 0.32);
	color: #FF6B35;
	font-size: 0.78rem;
	font-weight: 700;
	font-feature-settings: 'tnum';
	border-radius: 999px;
	flex-shrink: 0;
	transition: all 0.2s ease;
}
/* Actions du header (toggle densité + fermeture mobile) */
.btk-events-map-sidebar-actions {
	display: flex;
	align-items: center;
	gap: 0.4rem;
	flex-shrink: 0;
}
.btk-events-map-sidebar-density {
	display: inline-flex;
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 8px;
	padding: 2px;
	gap: 2px;
}
.btk-events-map-sidebar-density-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 24px;
	background: transparent;
	border: 0;
	color: var(--btk-events-muted);
	cursor: pointer;
	border-radius: 6px;
	padding: 0;
	transition: all 0.18s ease;
}
.btk-events-map-sidebar-density-btn svg {
	width: 14px;
	height: 14px;
}
.btk-events-map-sidebar-density-btn:hover {
	color: var(--btk-events-text);
}
.btk-events-map-sidebar-density-btn.is-active {
	background: rgba(255, 107, 53, 0.16);
	color: #FF6B35;
}

.btk-events-map-sidebar-close {
	display: none;
	background: transparent;
	border: 0;
	color: var(--btk-events-muted);
	cursor: pointer;
	width: 32px;
	height: 32px;
	border-radius: 8px;
	padding: 0;
	transition: all 0.2s ease;
	flex-shrink: 0;
}
.btk-events-map-sidebar-close:hover {
	background: rgba(255, 255, 255, 0.05);
	color: var(--btk-events-text);
}
.btk-events-map-sidebar-close svg {
	width: 18px;
	height: 18px;
}

/* Barre de recherche */
.btk-events-map-sidebar-search {
	position: relative;
	display: flex;
	align-items: center;
	margin: 0.7rem 0.7rem 0;
	flex-shrink: 0;
}
.btk-events-map-sidebar-search > svg {
	position: absolute;
	left: 0.7rem;
	width: 16px;
	height: 16px;
	color: var(--btk-events-muted);
	pointer-events: none;
}
.btk-events-map-sidebar-search-input {
	width: 100%;
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 10px;
	padding: 0.55rem 2.2rem 0.55rem 2.1rem;
	color: var(--btk-events-text);
	font-family: inherit;
	font-size: 0.88rem;
	transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
	-webkit-appearance: none;
	appearance: none;
}
.btk-events-map-sidebar-search-input::placeholder {
	color: var(--btk-events-muted);
}
.btk-events-map-sidebar-search-input::-webkit-search-cancel-button {
	-webkit-appearance: none;
	appearance: none;
}
.btk-events-map-sidebar-search-input:focus {
	outline: none;
	border-color: #FF6B35;
	background: rgba(255, 107, 53, 0.06);
	box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.16);
}
.btk-events-map-sidebar-search-clear {
	position: absolute;
	right: 0.45rem;
	top: 50%;
	transform: translateY(-50%);
	background: rgba(255, 255, 255, 0.06);
	border: 0;
	color: var(--btk-events-muted);
	width: 24px;
	height: 24px;
	border-radius: 6px;
	padding: 0;
	display: grid;
	place-items: center;
	cursor: pointer;
	transition: all 0.18s ease;
}
.btk-events-map-sidebar-search-clear:hover {
	background: rgba(255, 255, 255, 0.12);
	color: var(--btk-events-text);
}
.btk-events-map-sidebar-search-clear svg {
	width: 14px;
	height: 14px;
}
.btk-events-map-sidebar-list {
	flex: 1 1 0;
	min-height: 0;
	max-height: 100%;
	overflow-y: auto;
	overflow-x: hidden;
	padding: 0.6rem 0.45rem 0.85rem 0.6rem;
	display: flex;
	flex-direction: column;
	align-items: stretch;
	width: 100%;
	min-width: 0;
	gap: 0.6rem;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
	scrollbar-gutter: stable;
	scrollbar-width: thin;
	scrollbar-color: rgba(255, 255, 255, 0.28) rgba(255, 255, 255, 0.06);
}
.btk-events-map-sidebar-list::-webkit-scrollbar {
	width: 8px;
}
.btk-events-map-sidebar-list::-webkit-scrollbar-track {
	background: rgba(255, 255, 255, 0.06);
	border-radius: 999px;
	margin: 4px 0;
}
.btk-events-map-sidebar-list::-webkit-scrollbar-thumb {
	background: rgba(255, 255, 255, 0.28);
	border-radius: 999px;
	border: 2px solid transparent;
	background-clip: padding-box;
}
.btk-events-map-sidebar-list::-webkit-scrollbar-thumb:hover {
	background: rgba(255, 255, 255, 0.4);
	border: 2px solid transparent;
	background-clip: padding-box;
}
.btk-events-map-sidebar-empty {
	margin: 0;
	padding: 2rem 1rem;
	text-align: center;
	color: var(--btk-events-muted);
	font-size: 0.9rem;
	line-height: 1.5;
}

/* === CARD SIDEBAR — vue détaillée option B : vignette portrait + contenu === */
.btk-map-card {
	position: relative;
	display: grid;
	grid-template-columns: 96px minmax(0, 1fr);
	gap: 0.65rem 0.75rem;
	padding: 0.65rem 0.7rem;
	align-items: stretch;
	background: linear-gradient(135deg, #1a1a1a 0%, #181818 100%);
	border: 1px solid rgba(255, 255, 255, 0.06);
	border-radius: 12px;
	cursor: pointer;
	transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
	text-align: left;
	font-family: inherit;
	color: inherit;
	width: 100%;
	max-width: 100%;
	min-width: 0;
	box-sizing: border-box;
	margin: 0;
	overflow-x: clip;
	overflow-y: visible;
	flex-shrink: 0;
}
.btk-map-card::before {
	content: '';
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 3px;
	background: var(--cat-color, #FF6B35);
	transform: scaleY(0);
	transform-origin: center;
	transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.btk-map-card:hover,
.btk-map-card:focus-visible {
	background: linear-gradient(135deg, #222 0%, #1a1a1a 100%);
	border-color: color-mix(in srgb, var(--cat-color, #FF6B35) 50%, transparent);
	transform: translateY(-2px);
	box-shadow: 0 10px 24px rgba(0, 0, 0, 0.4);
}
.btk-map-card:focus-visible {
	outline: 2px solid color-mix(in srgb, var(--cat-color, #FF6B35) 75%, #fff);
	outline-offset: 2px;
}
.btk-map-card:hover::before,
.btk-map-card:focus-visible::before {
	transform: scaleY(1);
}

/* Vue détaillée : sticker date masqué (chip inline dans l'en-tête) */
.btk-events-map-sidebar:not(.is-dense) .btk-map-card-date {
	display: none;
}
.btk-map-card-date-inline {
	flex-shrink: 0;
	font-size: 0.65rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--cat-color, #FF6B35);
	line-height: 1.3;
}
.btk-map-card-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	width: 100%;
	max-width: 100%;
	flex-wrap: wrap;
}
.btk-map-card-registered--head {
	margin-left: auto;
}
.btk-map-card-registered--helloasso,
.btk-map-card-registered--external-link {
	color: #2196F3;
	font-weight: 600;
}
.btk-map-popup-registered-helloasso,
.btk-map-popup-registered-external-link {
	color: #2196F3;
}
.btk-map-popup-cta--helloasso,
.btk-map-popup-cta--external-link {
	background: rgba(33, 150, 243, 0.16);
	border-color: rgba(33, 150, 243, 0.45);
	color: #64B5F6;
}
.btk-map-popup-cta--helloasso:hover,
.btk-map-popup-cta--external-link:hover {
	background: rgba(33, 150, 243, 0.28);
	border-color: rgba(33, 150, 243, 0.75);
}

/* Date sticker (vue dense) : jour en gros + mois en petit */
.btk-map-card-date {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	grid-column: 1;
	grid-row: 1;
	background: rgba(255, 255, 255, 0.04);
	border: 1px solid rgba(255, 255, 255, 0.08);
	border-radius: 10px;
	padding: 0.45rem 0.3rem;
	/* Ne pas utiliser min-width:0 ici : ça permet au sticker date d'être écrasé par la grille sur mobile */
	min-width: 48px;
	width: 48px;
	max-width: 48px;
	box-sizing: border-box;
	flex-shrink: 0;
	line-height: 1;
	transition: all 0.25s ease;
}
.btk-map-card:hover .btk-map-card-date {
	background: color-mix(in srgb, var(--cat-color, #FF6B35) 14%, rgba(0, 0, 0, 0.4));
	border-color: color-mix(in srgb, var(--cat-color, #FF6B35) 40%, transparent);
}
.btk-map-card-date-day {
	font-size: 1.25rem;
	font-weight: 800;
	color: var(--btk-events-text);
	letter-spacing: -0.02em;
}
.btk-map-card-date-month {
	font-size: 0.6rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--cat-color, #FF6B35);
	margin-top: 4px;
}

.btk-map-card-registered--head {
	margin-left: auto;
}

/* Photo (col 1) : portrait 3:4 */
.btk-map-card-photo {
	position: relative;
	grid-column: 1;
	grid-row: 1;
	width: 96px;
	min-width: 96px;
	min-height: 120px;
	height: 100%;
	border-radius: 10px;
	overflow: hidden;
	background: linear-gradient(135deg, #2a2a2a, #1a1a1a);
	flex-shrink: 0;
	align-self: stretch;
	justify-self: stretch;
}
.btk-map-card-photo img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.btk-map-card-photo.has-poster-open:hover img {
	transform: scale(1.05);
}
.btk-map-card-photo-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	color: var(--cat-color, #FF6B35);
	background:
		radial-gradient(circle at 30% 25%, color-mix(in srgb, var(--cat-color, #FF6B35) 35%, transparent) 0%, transparent 70%),
		linear-gradient(135deg, color-mix(in srgb, var(--cat-color, #FF6B35) 14%, #1a1a1a) 0%, #141414 100%);
	border: 1px solid color-mix(in srgb, var(--cat-color, #FF6B35) 24%, transparent);
}
.btk-map-card-photo-placeholder svg {
	filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
}

/* Corps (col 2) */
.btk-map-card-body {
	grid-column: 2;
	grid-row: 1;
	min-width: 0;
	width: 100%;
	max-width: 100%;
	padding: 0;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	justify-content: center;
	gap: 0.25rem;
	text-align: left;
}
.btk-map-card-cat {
	display: inline-block;
	width: max-content;
	max-width: 100%;
	overflow-wrap: break-word;
	flex-shrink: 0;
	align-self: flex-start;
	padding: 0.15rem 0.5rem;
	border-radius: 999px;
	background: color-mix(in srgb, var(--cat-color, #FF6B35) 18%, transparent);
	color: var(--cat-color, #FF6B35);
	font-size: 0.6rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	line-height: 1.4;
}
.btk-map-card-title {
	margin: 0.1rem 0 0;
	font-size: 0.92rem;
	font-weight: 700;
	color: var(--btk-events-text);
	line-height: 1.35;
	overflow-wrap: break-word;
	word-break: normal;
	hyphens: auto;
	width: 100%;
	max-width: 100%;
	align-self: stretch;
	display: block;
}
.btk-map-card-meta {
	display: flex;
	align-items: flex-start;
	gap: 0.3rem;
	margin: 0;
	width: 100%;
	max-width: 100%;
	align-self: stretch;
	font-size: 0.75rem;
	color: var(--btk-events-muted);
	line-height: 1.45;
}
.btk-map-card-meta svg {
	flex-shrink: 0;
	color: var(--cat-color, var(--btk-events-accent));
	opacity: 0.85;
	margin-top: 0.15em;
}
.btk-map-card-meta span {
	min-width: 0;
	flex: 1 1 auto;
	overflow-wrap: break-word;
	word-break: normal;
	white-space: normal;
}
.btk-map-card-meta-time {
	color: var(--btk-events-text);
	font-weight: 500;
}
.btk-map-card-footer {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: 0.15rem;
	padding-top: 0.35rem;
	border-top: 1px solid rgba(255, 255, 255, 0.05);
	width: 100%;
	max-width: 100%;
	align-self: stretch;
}
.btk-map-card-region {
	display: inline-block;
	padding: 0.1rem 0.45rem;
	background: rgba(255, 255, 255, 0.04);
	color: var(--cat-color, var(--btk-events-accent));
	border-radius: 999px;
	font-size: 0.65rem;
	font-weight: 600;
	max-width: 100%;
	overflow-wrap: break-word;
	word-break: normal;
	white-space: normal;
	line-height: 1.35;
}
.btk-map-card-registered {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
	font-size: 0.7rem;
	color: var(--btk-events-muted);
	font-weight: 500;
	min-width: 0;
	overflow-wrap: break-word;
	word-break: normal;
	white-space: normal;
}
.btk-map-card-registered svg {
	color: var(--cat-color, var(--btk-events-accent));
	opacity: 0.7;
}
.btk-map-card-fiche-actions {
	margin: 0.15rem 0 0;
	width: 100%;
}
.btk-map-card-fiche-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	margin: 0;
	padding: 0.35rem 0.6rem;
	border: 1px solid rgba(255, 107, 53, 0.45);
	border-radius: 7px;
	background: rgba(255, 107, 53, 0.12);
	color: #ff6b35;
	font-family: inherit;
	font-size: 0.72rem;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	text-decoration: none;
	transition: background 0.2s ease, border-color 0.2s ease;
}
.btk-map-card-fiche-btn:hover,
.btk-map-card-fiche-btn:focus-visible {
	background: rgba(255, 107, 53, 0.22);
	border-color: rgba(255, 107, 53, 0.75);
	outline: none;
}
.btk-events-map-sidebar.is-dense .btk-map-card-fiche-actions {
	display: none;
}
.btk-map-card-poster-actions {
	margin: 0.15rem 0 0;
	width: 100%;
}
.btk-events-map-sidebar.is-dense .btk-map-card-poster-actions {
	display: none;
}

/* ===========================================================
   VUE DENSE (cards compactes — moitié hauteur)
   Activée via .btk-events-map-sidebar.is-dense sur la sidebar.
   =========================================================== */

.btk-events-map-sidebar.is-dense .btk-events-map-sidebar-list {
	gap: 0.35rem;
	padding: 0.5rem;
}
.btk-events-map-sidebar.is-dense .btk-map-card {
	display: grid;
	grid-template-columns: 44px minmax(0, 1fr) auto;
	gap: 0.55rem;
	padding: 0.55rem 0.7rem;
	border-radius: 9px;
	overflow: visible;
}
.btk-events-map-sidebar.is-dense .btk-map-card-date {
	display: flex;
	grid-column: 1;
	grid-row: 1;
	min-width: 44px;
	width: 44px;
	max-width: 44px;
	border-radius: 7px;
	padding: 0.3rem 0.2rem;
}
.btk-events-map-sidebar.is-dense .btk-map-card-date-day {
	font-size: 0.95rem;
}
.btk-events-map-sidebar.is-dense .btk-map-card-date-month {
	font-size: 0.5rem;
	margin-top: 2px;
}
.btk-events-map-sidebar.is-dense .btk-map-card-photo {
	display: none;
}
.btk-events-map-sidebar.is-dense .btk-map-card-head {
	display: none;
}
.btk-events-map-sidebar.is-dense .btk-map-card-body {
	grid-column: 2;
	grid-row: 1;
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
	width: 100%;
	max-width: 100%;
	justify-self: stretch;
	align-items: stretch;
	padding: 0;
}
.btk-events-map-sidebar.is-dense .btk-map-card-cat {
	display: none;
}
.btk-events-map-sidebar.is-dense .btk-map-card-title {
	font-size: 0.92rem;
	font-weight: 600;
	margin: 0;
	white-space: normal;
	overflow-wrap: break-word;
	word-break: normal;
	line-height: 1.35;
	display: block;
	width: 100%;
	max-width: 100%;
}
.btk-events-map-sidebar.is-dense .btk-map-card-meta-time {
	display: none;
}
.btk-events-map-sidebar.is-dense .btk-map-card-meta-loc {
	font-size: 0.75rem;
	margin: 0;
	white-space: normal;
	overflow-wrap: break-word;
	word-break: normal;
	line-height: 1.4;
	color: var(--btk-events-muted);
	align-items: flex-start;
}
.btk-events-map-sidebar.is-dense .btk-map-card-meta-loc svg {
	flex-shrink: 0;
	margin-top: 0.15em;
}
.btk-events-map-sidebar.is-dense .btk-map-card-footer {
	display: none;
}
/* En vue dense, on remonte le tag catégorie comme une mini pastille à droite */
.btk-events-map-sidebar.is-dense .btk-map-card::after {
	content: '';
	grid-column: 3;
	grid-row: 1;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--cat-color, #FF6B35);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--cat-color, #FF6B35) 18%, transparent);
	align-self: center;
	justify-self: center;
}

/* Handle bottom-sheet (mobile uniquement, caché desktop) */
.btk-events-map-sidebar-handle {
	display: none;
	position: absolute;
	bottom: 16px;
	right: 16px;
	z-index: 1000;
	background: var(--btk-events-accent);
	color: #ffffff;
	border: 0;
	border-radius: 999px;
	padding: 0.65rem 1rem;
	box-shadow: 0 8px 24px rgba(255, 107, 53, 0.45);
	cursor: pointer;
	font-weight: 700;
	font-size: 0.85rem;
	gap: 0.4rem;
	align-items: center;
	transition: all 0.2s ease;
}
.btk-events-map-sidebar-handle:hover {
	background: var(--btk-events-accent-hover);
	transform: translateY(-2px);
	box-shadow: 0 10px 28px rgba(255, 107, 53, 0.5);
}
.btk-events-map-sidebar-handle svg {
	width: 16px;
	height: 16px;
}
.btk-events-map-sidebar-handle-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 22px;
	height: 22px;
	padding: 0 7px;
	background: rgba(0, 0, 0, 0.25);
	border-radius: 999px;
	font-size: 0.75rem;
	font-weight: 800;
}

/* === Tablette/Mobile : la sidebar devient un bottom-sheet === */
@media (max-width: 1024px) {
	.btk-events-map-layout {
		grid-template-columns: 1fr;
		min-height: calc(100vh - 200px);
		height: calc(100vh - 200px);
		max-height: none;
	}
	.btk-events-map-sidebar {
		position: absolute;
		left: 0;
		right: 0;
		bottom: 0;
		width: 100%;
		max-width: 100%;
		box-sizing: border-box;
		min-width: 0;
		max-height: 70vh;
		border-left: 0;
		border-top-left-radius: 18px;
		border-top-right-radius: 18px;
		box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.55);
		transform: translateY(calc(100% - 0px));
		transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
		z-index: 1100;
		visibility: hidden;
	}
	.btk-events-map-sidebar.is-open {
		transform: translateY(0);
		visibility: visible;
	}
	.btk-events-map-sidebar-close {
		display: inline-flex;
		align-items: center;
		justify-content: center;
	}
	.btk-events-map-sidebar-handle {
		display: inline-flex;
	}
	.btk-events-map-sidebar-handle.is-hidden {
		display: none;
	}
	.btk-events-map-sidebar-header::before {
		content: '';
		position: absolute;
		top: 6px;
		left: 50%;
		transform: translateX(-50%);
		width: 40px;
		height: 4px;
		border-radius: 999px;
		background: rgba(255, 255, 255, 0.2);
	}
	.btk-events-map-sidebar-header {
		padding-top: 1.2rem;
		position: relative;
	}
}

/* Plein écran immersif sous 600px */
@media (max-width: 600px) {
	.btk-events-map-wrap {
		padding-left: 0.75rem;
		padding-right: 0.75rem;
	}
	.btk-events-map-layout {
		min-height: calc(100vh - 180px);
		height: calc(100vh - 180px);
		border-radius: 12px;
	}
	.btk-events-map-counter {
		padding: 0 0.5rem;
	}
}

/* Sous 480px, on passe en edge-to-edge (pas de marges) */
@media (max-width: 480px) {
	.btk-events-map-wrap {
		padding-left: 0;
		padding-right: 0;
	}
	.btk-events-map-layout {
		border-radius: 0;
		border-left: 0;
		border-right: 0;
	}
}
