/**
 * Styles Leaflet - Utilise uniquement le thème Pompiers
 * 
 * IMPORTANT: Tous les styles principaux sont définis dans le thème SCSS
 * Ce fichier ne contient que le minimum technique nécessaire pour Leaflet
 */

/* Techniques Leaflet uniquement - Les styles visuels sont dans le thème SCSS */

/* Reset des styles par défaut Leaflet */
.leaflet-div-icon {
    background: transparent !important;
    border: none !important;
}

/* Marqueurs - les styles visuels sont définis dans le thème */
.store-locator .structures-map .custom-marker {
    background: transparent !important;
    border: none !important;
}

.store-locator .structures-map .custom-marker .marker-truck {
    width: 80px;
    height: 80px;
    position: absolute;
    left: 0px;
    top: 0px;
    margin-left: -33px;
    margin-top: -60px;
    background-image: url("https://www.pompiers.fr/wp-content/themes/pompiers/assets/marker.svg");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center center;
}

/* Clusters - éviter le glitch de positionnement */
.store-locator .structures-map .custom-cluster:hover {
    /* Utiliser filter pour éviter les problèmes de transform avec Leaflet */
    filter: brightness(1.1) !important;
}

/* Forcer le centrage parfait des chiffres dans les clusters Leaflet */
.store-locator .structures-map .custom-cluster > div {
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
    line-height: 1 !important;
    text-align: center !important;
}

/* Supprimer le triangle/pointe de la popup */
.leaflet-popup-tip {
    display: none !important;
}

/* Popup optimisée pour ne jamais cacher le marker */
.leaflet-popup {
    margin-bottom: 0 !important;
    z-index: 1000 !important;
}

.leaflet-pane, .leaflet-top, .leaflet-left {
    z-index: 10 !important;
}

.structure-popup .leaflet-popup-content {
    margin: 0 !important;
    max-height: 400px;
    overflow-y: auto;
}

/* Assurer que la popup reste dans la fenêtre */
.leaflet-popup-content-wrapper {
    max-width: calc(100vw - 40px) !important;
}

@media (max-width: 780px) {
    .structure-popup .leaflet-popup-content-wrapper {
        max-width: calc(100vw - 20px) !important;
    }
}

/* Responsive mobile - les dimensions sont gérées par le thème */
@media (max-width: 780px) {
    .store-locator .structures-map {
        /* Utiliser la même hauteur que le thème pour mobile */
        min-height: 26.1875rem; /* $height-map-mobile du thème */
        margin-bottom: 1.25rem; /* $spacing-md du thème */
        margin-right: 0;
        width: 100%;
    }
}

/* Contrôles Leaflet - styles minimaux cohérents avec le thème */
.leaflet-control-zoom {
    border: none !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
}

.leaflet-control-zoom a {
    background-color: var(--wp--preset--color--white) !important;
    color: #333 !important;
    border: none !important;
    border-radius: 4px !important;
    font-size: 18px !important;
    font-weight: bold !important;
    transition: all 0.2s ease !important;
}

.leaflet-control-zoom a:hover {
    background-color: #f5f5f5 !important;
    color: var(--wp--preset--color--primary) !important;
}

.leaflet-control-zoom a:first-child {
    border-radius: 4px 4px 0 0 !important;
}

.leaflet-control-zoom a:last-child {
    border-radius: 0 0 4px 4px !important;
}

/* Attribution */
.leaflet-control-attribution {
    background-color: rgba(255, 255, 255, 0.8) !important;
    font-size: 10px !important;
    color: #666 !important;
    padding: 2px 6px !important;
    border-radius: 4px !important;
}

.leaflet-control-attribution a {
    color: var(--wp--preset--color--primary) !important;
    text-decoration: none !important;
}

.leaflet-control-attribution a:hover {
    text-decoration: underline !important;
}

/* Placeholder lazy loading - identique à Google Maps */
.store-locator .structures-map .ax-map-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    position: relative;
    overflow: hidden;
    width: 100%;
    height: 100%;
    min-height: inherit;
}

.store-locator .structures-map .ax-map-placeholder::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: shimmer 2s infinite;
}

.store-locator .structures-map .ax-map-placeholder::after {
    content: '🗺️';
    font-size: 48px;
    opacity: 0.5;
    z-index: 1;
    position: relative;
}

@keyframes shimmer {
    0% { left: -100%; }
    100% { left: 100%; }
} 