/* ── Carto Assos Bretagne — map.css ── */

#carto-assos-wrap {
	position: relative;
	font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
	border: 1px solid #e2e5ec;
	border-radius: 8px;
	overflow: hidden;
	background: #f4f6f9;
	margin: 20px 0;
}

/* HEADER */
#carto-assos-header {
	background: #1a1f2e;
	color: #fff;
	padding: 10px 16px;
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
}

.carto-filters {
	display: flex;
	gap: 5px;
	flex-wrap: wrap;
	align-items: center;
}

.carto-btn-all {
	padding: 5px 12px;
	border-radius: 99px;
	border: 1.5px solid rgba(255,255,255,.4);
	background: rgba(255,255,255,.12);
	color: #fff;
	font-weight: 700;
	font-size: .75rem;
	cursor: pointer;
	transition: all .15s;
}
.carto-btn-all:hover,
.carto-btn-all.active {
	background: rgba(255,255,255,.25);
	border-color: #fff;
	box-shadow: 0 0 0 2px rgba(255,255,255,.4);
}

.carto-dept-btn {
	padding: 5px 12px;
	border-radius: 99px;
	border: 1.5px solid transparent;
	font-weight: 700;
	font-size: .75rem;
	cursor: pointer;
	transition: all .15s;
}
.carto-dept-btn[data-dept="22"] { background:#4a1a05; border-color:#fb923c; color:#fed7aa; }
.carto-dept-btn[data-dept="29"] { background:#14412a; border-color:#4ade80; color:#bbf7d0; }
.carto-dept-btn[data-dept="35"] { background:#4a1515; border-color:#f87171; color:#fecaca; }
.carto-dept-btn[data-dept="56"] { background:#3b1a5c; border-color:#c084fc; color:#e9d5ff; }
.carto-dept-btn.active-filter    { box-shadow: 0 0 0 2px #fff; opacity:1 !important; }
.carto-dept-btn:hover             { opacity:1 !important; filter:brightness(1.2); }

.carto-stats {
	margin-left: auto;
	font-size: .75rem;
	color: rgba(255,255,255,.6);
	white-space: nowrap;
}
.carto-stats strong { color: #fbbf24; font-weight: 700; }

/* MAIN */
#carto-assos-main {
	display: flex;
	height: 580px;
	position: relative;
}

#carto-map {
	flex: 1;
	z-index: 1;
	min-width: 0;
}

/* MODE BADGE */
#carto-mode-badge {
	position: absolute;
	bottom: 10px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 800;
	background: rgba(26,31,46,.82);
	color: #fff;
	padding: 5px 16px;
	border-radius: 20px;
	font-size: .72rem;
	font-weight: 700;
	pointer-events: none;
	white-space: nowrap;
}

/* TOGGLE SIDEBAR */
#carto-toggle-sidebar {
	position: absolute;
	right: 320px;
	top: 50%;
	transform: translateY(-50%);
	z-index: 500;
	background: #fff;
	border: 1px solid #e2e5ec;
	border-right: none;
	color: #6b7280;
	width: 18px;
	height: 44px;
	cursor: pointer;
	border-radius: 6px 0 0 6px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: .65rem;
	transition: right .28s ease;
	box-shadow: -2px 0 6px rgba(0,0,0,.08);
	padding: 0;
}
#carto-toggle-sidebar:hover { color: #1a1f2e; background: #f4f6f9; }

/* SIDEBAR */
#carto-sidebar {
	width: 320px;
	background: #fff;
	border-left: 1px solid #e2e5ec;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	flex-shrink: 0;
	transition: width .28s ease;
}

.carto-sidebar-header {
	padding: 10px 14px 8px;
	border-bottom: 1px solid #e2e5ec;
	flex-shrink: 0;
}
.carto-sidebar-header h3 {
	font-size: .72rem;
	font-weight: 700;
	color: #6b7280;
	text-transform: uppercase;
	letter-spacing: .06em;
	margin: 0;
}

.carto-search-box {
	padding: 8px 10px;
	flex-shrink: 0;
	border-bottom: 1px solid #e2e5ec;
}
.carto-search-box input {
	width: 100%;
	background: #f4f6f9;
	border: 1px solid #e2e5ec;
	border-radius: 6px;
	padding: 7px 10px;
	color: #1a1f2e;
	font-size: .81rem;
	font-family: inherit;
	outline: none;
	box-sizing: border-box;
}
.carto-search-box input:focus { border-color: #d97706; }

#carto-asso-list {
	flex: 1;
	overflow-y: auto;
	scrollbar-width: thin;
	scrollbar-color: #e2e5ec transparent;
}

.carto-dept-header {
	position: sticky;
	top: 0;
	padding: 7px 12px 5px;
	font-size: .68rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .07em;
	display: flex;
	align-items: center;
	gap: 6px;
	z-index: 10;
	background: #fff;
	border-bottom: 1px solid #e2e5ec;
}
.carto-dept-header[data-dept="22"] { color:#c2410c; border-left:3px solid #c2410c; }
.carto-dept-header[data-dept="29"] { color:#15803d; border-left:3px solid #15803d; }
.carto-dept-header[data-dept="35"] { color:#b91c1c; border-left:3px solid #b91c1c; }
.carto-dept-header[data-dept="56"] { color:#7c3aed; border-left:3px solid #7c3aed; }
.carto-dept-count { margin-left:auto; font-size:.68rem; opacity:.7; }

.carto-asso-item {
	padding: 9px 14px;
	border-bottom: 1px solid #e2e5ec;
	cursor: pointer;
	transition: background .1s;
}
.carto-asso-item:hover  { background: #f8fafc; }
.carto-asso-item.active { background: #fffbeb; border-left: 3px solid #d97706; }

.carto-asso-name {
	font-size: .82rem;
	font-weight: 500;
	color: #1a1f2e;
	line-height: 1.3;
	margin-bottom: 2px;
}
.carto-asso-meta {
	font-size: .71rem;
	color: #6b7280;
	display: flex;
	align-items: center;
	gap: 5px;
}
.carto-asso-dot {
	width: 7px; height: 7px;
	border-radius: 50%;
	flex-shrink: 0;
}
.carto-asso-dot[data-dept="22"] { background:#c2410c; }
.carto-asso-dot[data-dept="29"] { background:#15803d; }
.carto-asso-dot[data-dept="35"] { background:#b91c1c; }
.carto-asso-dot[data-dept="56"] { background:#7c3aed; }

/* LOADING OVERLAY */
#carto-loading {
	position: absolute;
	inset: 0;
	background: #1a1f2e;
	z-index: 9000;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: opacity .5s;
}
#carto-loading.done { opacity: 0; pointer-events: none; }
.carto-loading-inner { text-align: center; }
.carto-loading-title { color:#fff; font-size:1rem; font-weight:700; margin-bottom:14px; }
.carto-loading-bar {
	width: 240px; height: 4px;
	background: rgba(255,255,255,.15);
	border-radius: 2px; overflow: hidden;
	margin: 0 auto;
}
.carto-loading-fill {
	height: 100%; background: #fbbf24;
	border-radius: 2px; width: 0;
	transition: width .4s;
}

/* POPUP LEAFLET */
.carto-popup .leaflet-popup-content-wrapper {
	background: #fff;
	border: 1px solid #e2e5ec;
	border-radius: 10px;
	box-shadow: 0 8px 24px rgba(0,0,0,.15);
	padding: 0;
	min-width: 230px;
	max-width: 290px;
}
.carto-popup .leaflet-popup-tip { background: #fff; }
.carto-popup .leaflet-popup-content { margin: 0; width: auto !important; }

.carto-popup-inner    { padding: 13px 15px; }
.carto-popup-badge    {
	display: inline-block;
	padding: 2px 8px; border-radius: 4px;
	font-size: .66rem; font-weight: 700;
	letter-spacing: .04em; margin-bottom: 7px;
}
.carto-popup-badge[data-dept="22"] { background:#ffedd5; color:#c2410c; }
.carto-popup-badge[data-dept="29"] { background:#dcfce7; color:#15803d; }
.carto-popup-badge[data-dept="35"] { background:#fee2e2; color:#b91c1c; }
.carto-popup-badge[data-dept="56"] { background:#ede9fe; color:#7c3aed; }

.carto-popup-name { font-weight:700; font-size:.88rem; line-height:1.3; color:#1a1f2e; margin-bottom:8px; }
.carto-popup-row  { font-size:.76rem; color:#6b7280; margin-bottom:3px; display:flex; gap:5px; align-items:flex-start; }
.carto-popup-row a { color:#1d4ed8; text-decoration:none; }
.carto-popup-row a:hover { text-decoration:underline; }
.carto-popup-comment {
	font-size:.72rem; color:#6b7280;
	background:#f4f6f9; border-radius:5px;
	padding:6px 8px; margin-top:7px;
	max-height:80px; overflow-y:auto;
	line-height:1.5; white-space:pre-line;
}

/* OVERVIEW BUBBLES */
.carto-overview-bubble {
	display: flex; align-items: center; justify-content: center; flex-direction: column;
	border-radius: 50%; cursor: pointer; font-weight: 800;
	box-shadow: 0 4px 24px rgba(0,0,0,.28);
	transition: transform .15s, box-shadow .15s;
	border: 3px solid rgba(255,255,255,.7);
}
.carto-overview-bubble:hover {
	transform: scale(1.1);
	box-shadow: 0 6px 30px rgba(0,0,0,.38);
}
.carto-bubble-count  { font-size: 1.5rem; line-height:1; color:#fff; }
.carto-bubble-label  { font-size: .62rem; color:rgba(255,255,255,.9); letter-spacing:.06em; margin-top:3px; }

/* FINE CLUSTER */
.carto-fine-cluster {
	display: flex; align-items: center; justify-content: center;
	border-radius: 50%; border: 2.5px solid rgba(255,255,255,.85);
	font-weight: 800; font-size: .8rem; color: #fff; cursor: pointer;
	box-shadow: 0 2px 10px rgba(0,0,0,.25); transition: transform .12s;
}
.carto-fine-cluster:hover { transform: scale(1.1); }

/* CITY SEARCH CIRCLE */
.carto-city-label {
	background: rgba(217,119,6,.9); color:#fff;
	padding: 3px 9px; border-radius: 12px;
	font-size: .7rem; font-weight: 700;
	white-space: nowrap; box-shadow: 0 2px 6px rgba(0,0,0,.3);
}

/* Responsive */
@media (max-width: 640px) {
	#carto-assos-main { height: 460px; }
	#carto-sidebar    { display: none; }
	#carto-toggle-sidebar { display: none; }
}
