/* ===========================
   Carte Mapbox (Mymap)
=========================== */
#mymap {
    position: relative;
    top: 0;
    left: 0;
    width: 100%; /* Largeur pleine */
    height: calc(100vh - 120px);
    z-index: 0; /* En arrière-plan */
}
.page-id-4604 #mymap {
    height: calc(100vh - 120px) !important;
    position: absolute;
    top: 0;
    left: 0;
}

/* ===========================
   Toolbar (Zoom, Geolocalisation)
=========================== */
#map-toolbar {
    position: absolute;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    background-color: rgba(255, 255, 255, 0.9);
    border-radius: 8px;
    padding: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
}

.toolbar-btn {
    background-color: transparent;
    border: none;
    padding: 10px;
    font-size: 24px;
    cursor: pointer;
    color: var(--theme-palette-color-3);
}

.toolbar-btn:hover {
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 50%;
}

/* ===========================
   Boîte de filtres (Map Filters)
=========================== */
#map-filters {
    position: absolute;
    top: 30px;
    left: 20px;
    z-index: 1000;
    width: 108px; /* Largeur uniforme */
    height: calc(100% - 60px); /* Gérer la hauteur */
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--theme-palette-color-8);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.map-filters-title {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-bottom: 1rem;
}

.map-filters-title span {
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9rem;
}

.map-filters button {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    margin: 5px 0 10px;
    padding: 10px;
    width: 88px;
    height: 88px;
    background: var(--theme-palette-color-7);
    color: var(--theme-palette-color-1);
    border: 1px solid var(--theme-palette-color-7);
    border-radius: 12px;
    cursor: pointer;
}

.map-filters button:hover {
    background: var(--theme-palette-color-1);
    color: var(--theme-palette-color-8);
}

.map-filters button span {
    font-size: 0.7rem;
    font-weight: 600;
}

.map-filters button i {
    font-size: 1.4rem;
}

/* ===========================
   Panneau des filtres (Filter Panel)
=========================== */
#filter-panel {
    position: absolute;
    top: 30px;
    left: 150px; /* Juste à droite de map-filters */
    width: 250px;
    height: calc(100% - 60px); /* Gérer la hauteur */
    z-index: 999;
    background: var(--theme-palette-color-8);
    border-radius: 12px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    overflow-y: auto; /* Activer le scroll vertical si nécessaire */
    padding: 0;
    display: none; /* Cache par défaut */
}

/* Titre & reset */
#filter-panel .head {
    padding: 1rem;
    background: var(--theme-palette-color-1);
    border-radius: 12px 12px 0 0;
}

#filter-panel h3 {
    font-size: 1rem;
    margin-bottom: 15px;
    font-weight: 700;
    color: var(--theme-palette-color-8);
}

.reset-filters {
    margin-bottom: 0;
    text-align: left;
}

.reset-filters a {
    color: var(--theme-palette-color-8);
    font-size: 0.7rem;
    text-transform: uppercase;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.reset-filters a i {
    margin-right: 8px;
}

.reset-filters a:hover {
    color: var(--theme-palette-color-11);
}

/* Liste des filtres */
.filter-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 1rem;
}

/* Fermeture du panneau */
.filter-panel-close {
    position: absolute;
    top: 0px;
    right: 10px;
    cursor: pointer;
    font-size: 20px;
    z-index: 10;
}

.filter-panel-close i {
    font-size: 0.9rem;
    color: var(--theme-palette-color-8);
}

.filter-panel-close i:hover {
    color: var(--theme-palette-color-11);
}

.filter-panel .panel-loader {
    padding: 3rem 1rem;
    font-size: 0.9rem;
    text-align: center;
}

/* ===========================
   Checkboxes personnalisées
=========================== */
.custom-checkbox {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.9rem;
}

.custom-checkbox input[type="checkbox"] {
    display: none; /* Masquer l'input réel */
}

.custom-checkbox i {
    margin-right: 10px;
    font-size: 18px;
    color: var(--theme-palette-color-12);
}

.custom-checkbox input[type="checkbox"]:checked + i {
    color: var(--theme-palette-color-1);
}

.custom-checkbox:hover,
.custom-checkbox:hover i {
    color: var(--theme-palette-color-1);
}

/* ===========================
   Radios personnalisées
   (nécessaires pour Région & Projets)
=========================== */
.custom-radio {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 0.9rem;
}

.custom-radio input[type="radio"] {
    display: none;
}

.custom-radio i {
    margin-right: 10px;
    font-size: 18px;
    color: var(--theme-palette-color-12);
}

.custom-radio input[type="radio"]:checked + i {
    color: var(--theme-palette-color-1);
}

.custom-radio:hover,
.custom-radio:hover i {
    color: var(--theme-palette-color-1);
}

/* ===========================
   Scrollbar personnalisée
=========================== */
#filter-panel::-webkit-scrollbar {
    width: 6px;
}

#filter-panel::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 10px;
}

#filter-panel::-webkit-scrollbar-thumb:hover {
    background-color: #bbb;
}

/* ===========================
   Popup POI
=========================== */

.mapboxgl-popup-content {
    padding: 1rem;
    border-radius: 12px;
}

.mapboxgl-popup-content h3 {
    font-size: 1.0rem;
}

.mapboxgl-popup-content p {
    font-size: 0.9rem;
    margin-bottom: 10px;
    display: flex;
}

.mapboxgl-popup-content p img {
    margin-right: 6px;
}

.mapboxgl-popup-content p i {
    font-size: 1.2rem;
    margin-right: 6px;
}

.mapboxgl-popup-content .view-link {
    font-size: 0.9rem;
    font-weight: 400;
}

.mapboxgl-popup-close-button {
    right: 10px;
    top: 10px;
}

/* ===========================
   Divers
=========================== */

#filter-publics {
    display: none;
}
.disabled-filter {
    opacity: 0.4;
    pointer-events: auto; /* on veut cliquer dessus pour réactiver */
}


#map-loader {
    position: absolute;
    top: 0; left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(255,255,255,0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 999999;
}

#map-loader .spinner {
    width: 48px;
	margin-top: -100px !important;
    height: 48px;
    border: 4px solid var(--theme-palette-color-3);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}


/* ===========================
   Version responsive (mobile)
   → Optionnelle :
   → Ne modifie RIEN en desktop.
=========================== */
@media (max-width: 768px) {

    #map-filters {
        width: 70px;
        padding: 0.5rem;
    }

    .map-filters button {
        width: 60px;
        height: 60px;
        margin: 8px 0;
    }

    .map-filters button span,
    .map-filters-title span {
        display: none;
    }

    #filter-panel {
        left: 95px;
        width: 230px;
		height: 82vh !important;
    }
	#map-toolbar {
    	bottom: 10px;
    	right: 10px;
	}
}

.poi-popup {
    font-family: inherit;
    max-width: 260px;
}

.poi-header {
    display: flex;
	flex-direction: column;
    align-items: start;
    gap: 8px;
}

.poi-flag {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #ccc;
}

.poi-pays {
    display: flex;
    align-items: center;
    gap: 8px;
}
.poi-country {
    font-weight: 600;
    font-size: 0.9rem;
}

.poi-region {
    margin-left: auto;
    font-size: 0.8rem;
    opacity: 0.7;
    display: flex;
    align-items: center;
    gap: 8px;
}

.poi-separator {
    margin: 8px 0;
    border-bottom: 1px solid #eee;
}

.poi-title {
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.poi-body .poi-field {
    margin-bottom: 6px;
    font-size: 0.85rem;
}

.poi-link a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.85rem;
    color: var(--theme-palette-color-1);
    text-decoration: none;
}

.poi-link a:hover {
    text-decoration: underline;
}

