/* =============================================================
   Chantiers Cartographie — Styles carte & panneau fiche
   ============================================================= */

/* ── Wrapper ──────────────────────────────────────────────── */
.chantiers-map-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 0px;
    background: #e8e0d8;
}

/* ── Carte Leaflet ────────────────────────────────────────── */
#chantiers-map {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Légère désaturation des tuiles CartoDB pour un rendu plus neutre */
#chantiers-map .leaflet-tile-pane {
    filter: grayscale(50%) brightness(0.95);
}

/*ZOOM LEAFLET*/
#chantiers-map .leaflet-control-zoom.leaflet-bar {
    box-shadow:none;
    border:none;
	margin-top:150px;
}

#chantiers-map .leaflet-control-zoom a {
background: #ffffff;
color: #ad0f0a;
border: none;
box-shadow: 0 0 5px rgba(0,0,0,0.25);
text-decoration:none;
padding : 0px 6px 8px 5px;
margin-top:5px;
border-radius:999px;
line-height:1em;
}

#chantiers-map .leaflet-control-zoom a:hover {
background: #ad0f0a;
color:#ffffff;
}


/* ── Message zoom molette ─────────────────────────────────── */
.chantiers-scroll-hint {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	background: rgba(0, 0, 0, 0.65);
	color: #ffffff;
	padding: 10px 16px;
	border-radius: 0px;
	font-size: 20px;
	text-transform:uppercase;
	line-height: 1.1;
	z-index: 1000;
	pointer-events: none;
	opacity: 0;
	transition: opacity 0.25s ease;
	box-shadow: 0 4px 20px rgba(0,0,0,0.1);
	white-space: nowrap;
}

.chantiers-scroll-hint.is-visible {
    opacity: 1;
}

.chantiers-scroll-hint kbd {
    display: inline-block;
    background: rgba(255, 255, 255, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 3px;
    padding: 1px 7px;
    font-family: monospace;
    font-size: 0.9em;
}

/* ── Barre de filtres ─────────────────────────────────────── */
.chantiers-filterbar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 400;
    display: flex;
    align-items: start;
    gap: 10px;
    padding: 10px 60px 20px 360px;
    background: rgba(255, 255, 255, 1);
    /*backdrop-filter: blur(4px);*/
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    flex-wrap: wrap;
}

/* Groupe boutons catégories */
.filterbar-cats {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    flex: 1;
	border-right:1px solid #ccc;
}

.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 12px;
    background: #f0f0f0;
    color: #000;
    border: 0px solid #ddd;
    border-radius: 0px;
    font-size: 0.8rem;
    font-weight: 600;
	text-transform:uppercase;
    cursor: pointer;
    transition: background 0.18s, color 0.18s, border-color 0.18s;
    white-space: nowrap;
}

.filter-btn:hover {
    background: #e0e0e0;
	color:#c90d0f;
}

.filter-btn.is-active {
    background: #c0392b;
    color: #fff;
    border-color: #c0392b;
}

.filter-btn-icon {
    width: 18px;
    height: 18px;
    object-fit: contain;
    flex-shrink: 0;
}

.filter-btn.is-active .filter-btn-icon {
    filter: brightness(0) invert(1);
}

/* Champ de recherche texte */
.filterbar-search {
    display: flex;
    align-items: center;
    gap: 6px;
    
    border: 0px solid #ddd;
    border-radius: 0px;
    padding: 0px;
    min-width: 220px;
}

.filterbar-search svg {
	width:20px;
	height:20px;
}

.filterbar-search svg:first-child  {
    flex-shrink: 0;
    color: #c90d0f;
	 
}

.filterbar-search svg:last-child  {
    flex-shrink: 0;
    color: #ffffff;
}

.filterbar-search input {
    border: none;
    background:#f0f0f0;
    outline: none;
    font-size: 0.85rem;
	font-weight:600;
    color: #000;
    width: 100%;
	padding:6px 15px;
	margin:0;
	line-height:1em;
	height:auto;
}

.filterbar-search input::placeholder {
    color: #666;
}

.filterbar-clear-btn {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    background: #c90d0f;
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.18s;
}

.filterbar-clear-btn:hover {
    background: #000000;
}

/* ── Marqueur personnalisé (divIcon) ──────────────────────── */
.chantier-marker-wrap {
    position: relative;
    width: 30px;
    height: 60px;
    cursor: pointer;
    transition: transform 0.15s ease, filter 0.15s ease;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.40));
}

.chantier-marker-img {
    display: block;
    width: 30px;
    height: 60px;
}

/* Petite icône de catégorie en bas à droite du marqueur */
.marker-cat-icon {
    position: absolute;
    bottom: 10px;
    right: -10px;
    width: 20px;
    height: 20px;
    object-fit: contain;
    background: #fff;
    border-radius: 50%;
    padding: 2px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.chantier-marker-wrap:hover,
.chantier-marker-wrap.is-active {
    transform: scale(1.2) translateY(-4px);
    filter: drop-shadow(0 5px 8px rgba(0, 0, 0, 0.50));
    z-index: 1000 !important;
}

/* ── Info-bulle (tooltip Leaflet) ────────────────────────── */
.chantier-tooltip {
    background: rgba(0, 0, 0, 0.85) !important;
    border: none !important;
    border-radius: 5px !important;
    color: #fff !important;
    font-size: 0.8rem;
    line-height: 1.1em;
    padding: 6px 10px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3) !important;
    pointer-events: none;
}

.chantier-tooltip::before {
    border-top-color: rgba(20, 20, 20, 0.88) !important;
}

.chantier-tooltip strong {
	text-transform:uppercase;
    /*display: block;*/
}

.chantier-tooltip .tooltip-loc {
    opacity: 1;
    font-size: 0.9rem;
}

/* ── Panneau fiche chantier ───────────────────────────────── */
.chantier-panel {
    position: absolute;
    top: 140px;   /* en dessous de la barre de filtres (~56px) + 14px */
    left: 20px;
    width: 360px;
    max-height: calc(100% - 140px);
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.28);
    z-index: 500;
    overflow-y: auto;
    scrollbar-width: thin;

    transform: translateX(420px);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                opacity   0.35s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

.chantier-panel.is-open {
    transform: translateX(0);
    opacity: 1;
    pointer-events: all;
}

/* ── Bouton fermer ────────────────────────────────────────── */
.chantier-panel-close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    width: 28px;
    height: 28px;
    background: #c0392b;
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.2s;
    font-family: Arial, sans-serif;
}

.chantier-panel-close:hover,
.chantier-panel-close:focus {
    background: #a93226;
    outline: none;
}

/* ── Photo ────────────────────────────────────────────────── */
.chantier-panel-photo {
    width: 100%;
    height: 190px;
    overflow: hidden;
    background: #ddd;
    border-radius: 6px 6px 0 0;
}

.chantier-panel-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.chantier-panel-photo.is-hidden {
    display: none;
}

/* ── Corps du panneau ─────────────────────────────────────── */
.chantier-panel-body {
    padding: 16px 18px 20px;
}

/* ── En-tête : logo + nom ─────────────────────────────────── */
.chantier-panel-header {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 12px;
}

.chantier-logo-box {
    flex-shrink: 0;
    width: 90px;
}

.chantier-logo-box img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

.chantier-logo-box.is-hidden {
    display: none;
}

.chantier-panel-header h2 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    line-height: 1.35;
    color: #1a1a1a;
    word-break: break-word;
}

/* ── Adresse postale ──────────────────────────────────────── */
.chantier-panel-adresse {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
    font-size: 0.82rem;
}

.chantier-panel-adresse.is-hidden {
    display: none;
}

.adresse-label {
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #222;
    text-transform: uppercase;
    flex-shrink: 0;
}

#chantier-adresse {
    color: #555;
    font-style: normal;
    line-height: 1.5;
}

/* ── Coordonnées GPS ──────────────────────────────────────── */
.chantier-panel-coords {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
    font-size: 0.78rem;
}

.coords-label {
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #222;
    text-transform: uppercase;
}

#chantier-coords {
    color: #888;
    font-size: 0.75rem;
}

/* ── Badges catégories ────────────────────────────────────── */
.chantier-panel-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}

.chantier-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px 3px 6px;
    background: #c0392b;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 2px;
}

.badge-icone {
    width: 18px;
    height: 18px;
    object-fit: contain;
    flex-shrink: 0;
    filter: brightness(0) invert(1);
}

/* ── Description ──────────────────────────────────────────── */
.chantier-panel-description .desc-label {
    margin: 0 0 6px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #222;
    text-transform: uppercase;
}

#chantier-desc {
    font-size: 0.875rem;
    line-height: 1.65;
    color: #444;
}

#chantier-desc p { margin: 0 0 0.8em; }
#chantier-desc p:last-child { margin-bottom: 0; }

/* ── Responsive mobile ────────────────────────────────────── */
@media (max-width: 600px) {
    .chantiers-filterbar {
        flex-direction: column;
        align-items: stretch;
        padding: 8px 10px;
    }

    .filterbar-search {
        min-width: 0;
    }

    .chantier-panel {
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        max-height: 60%;
        border-radius: 12px 12px 0 0;
        transform: translateY(100%);
    }

    .chantier-panel.is-open {
        transform: translateY(0);
        opacity: 1;
    }

    .chantier-panel-photo {
        height: 150px;
        border-radius: 12px 12px 0 0;
    }
}
