/**
 * Bloc map
 *
 * Reprend les styles de l'ancien bloc-map, archivé dans archives/bloc-map.php
 * (qui les imprimait dans un <style> inline)
 * + les styles que init_lmap.js appliquait en JS au menu, celui-ci étant
 * désormais rendu en PHP + l'état de chargement des filtres.
 */

/* Menu de filtres (anciennement stylé en JS) */
.lmap-v2 .lmenu {
    position: absolute;
    z-index: 1200;
}

.lmap-v2 .lmenu-mobile {
    position: absolute;
    top: 10px;
    left: 104%;
    background: #494b4a;
    z-index: 1150;
}

.lmap .lmenu {
    padding: 0 !important;
    background: #ffffff !important;
    color: #000000;
    width: 260px;
    top: initial !important;
    left: 20px !important;
    bottom: 20px;
    border-radius: 30px;
    height: auto !important;
    box-shadow: 0px 10px 20px #00000029;
}

#lmenu-filter {
    padding: 20px;
    cursor: pointer;
    border-radius: 30px;
    transition: background-color 0.3s ease-in-out, border-radius 0.3s ease-in-out;
}

#lmenu-filter.menu-open {
    border-radius: 30px 30px 0 0;
}

#lmenu-filter:hover {
    background-color: #DFDFDF;
}

.lmenu-btn-close {
    width: 18px;
    height: 18px;
    padding-bottom: 2px;
    font-size: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50px;
    background-color: #DFDFDF;
    color: #ffffff;
}

#filterControls {
    padding: 20px;
}

.border-top {
    border-top: 3px solid #EEEEEE;
}

.lmap .lmenu .custom_title {
    padding: 15px 20px;
    margin: 0;
    width: 100%;
    font-size: 18px;
    text-transform: uppercase;
    line-height: 1;
    text-align: center;
}

.lmap .lmenu .generated_controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.lmap .lmenu .maincat.level0.active {
    border-left: 1px solid #000000;
}

.lmap .lmenu .maincat .loption {
    position: relative;
    z-index: 10;
    display: block;
    overflow: hidden;
    border-radius: 20px;
}

.lmap .lmenu .custom_controls .maincat .loption:before,
.lmap .lmenu .maincat.level0>.loption:before {
    content: "";
    width: 100%;
    height: 100%;
    top: 0;
    left: 100%;
    background-color: rgba(255, 255, 255, 0.2);
    position: absolute;
    z-index: -1;
    transition: opacity 0.75s ease, left 0.75s ease;
}

.lmap .lmenu .custom_controls .maincat .loption.selected:before,
.lmap .lmenu .maincat.level0>.loption.selected:before {
    left: 0;
}

.lmap .lmenu .maincat .loption>.lcat-switch {
    cursor: pointer;
    margin: 0;
    position: absolute;
    left: 10px;
    top: 9px;
}

.lmap .lmenu .maincat .loption>input {
    display: none;
}

.lmap .lmenu .maincat .loption>label {
    font-weight: normal;
    font-size: 14px;
    cursor: pointer;
    padding: 0;
    line-height: 1;
    margin: 0;
    background: #ffffff;
    transition: color 0.3s ease, background-color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 12px;
}

.lmap .lmenu .custom_controls .maincat .loption.selected>label,
.lmap .lmenu .maincat.level0>.loption.selected>label {
    background: initial;
    color: #ffffff;
}

.lmap .lmenu .maincat .loption>label .wrapper-img {
    border-radius: 100%;
    overflow: hidden;
    display: flex;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex: 0 0 auto;
}

.lmap .lmenu .maincat .loption>label .wrapper-img img {
    display: inline-block;
    width: 30px;
}

.lmap .lmenu .maincat .loption>label:hover,
.lmap .lmenu .maincat .loption>label:active,
.lmap .lmenu .maincat .loption>label:focus {
    background: #ececec;
}

.lmap .lmenu .maincat .souscat .loption {
    margin-left: 15px;
}

/* Etat de chargement d'une thématique (markers récupérés en AJAX) */
.lmap .lmenu .maincat .loption>label .wrapper-label {
    flex: 1 1 auto;
}

.lmap .lmenu .maincat .lcat-spinner {
    width: 14px;
    height: 14px;
    margin-right: 12px;
    flex: 0 0 auto;
    border-radius: 50%;
    border: 2px solid currentColor;
    border-top-color: transparent;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.lmap .lmenu .maincat.is-loading .lcat-spinner {
    opacity: 1;
    animation: lcat-spin 0.7s linear infinite;
}

.lmap .lmenu .maincat.is-loading .loption>label {
    cursor: progress;
}

.lmap .lmenu .maincat.is-error .loption>label {
    color: #d80000;
}

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

@media (prefers-reduced-motion: reduce) {

    .lmap .lmenu .maincat.is-loading .lcat-spinner {
        animation-duration: 2s;
    }
}

/* Popups */
.lmap .leaflet-popup-content-wrapper .leaflet-popup-content .img-round-top {
    border-radius: 30px 30px 0 0;
}

.lmap .leaflet-popup-content-wrapper .leaflet-popup-content .picto-title {
    font-size: 16px;
    font-weight: bold;
    text-transform: uppercase;
}

.lmap .leaflet-popup-content-wrapper .leaflet-popup-content .picto-description {
    font-size: 14px;
}

.lmap .leaflet-popup-content-wrapper .leaflet-popup-content .picto-link {
    padding: 0px 15px 10px;
}

.lmap .leaflet-popup-content-wrapper .leaflet-popup-content .picto-link a {
    display: inline-block;
    font-size: 14px !important;
    color: #000000 !important;
    transition: color 0.3s ease, background-color 0.3s ease;
}

.lmap .leaflet-popup-content-wrapper .leaflet-popup-content .picto-link a:active,
.lmap .leaflet-popup-content-wrapper .leaflet-popup-content .picto-link a:focus,
.lmap .leaflet-popup-content-wrapper .leaflet-popup-content .picto-link a:hover {
    color: #6ccaf4 !important;
}

.lmap .leaflet-left {
    left: 45px;
    transition: left 0.3s ease;
}

.lmap .lmenu.active~.leaflet-control-container .leaflet-left {
    left: 300px;
}
