/* Container de la carte */
.cim-map-container {
    width: 100% !important;
    height: 500px !important;
    min-height: 500px !important;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin: 20px 0;
    position: relative;
    display: block !important;
}

/* Force la hauteur même avec la classe Elementor */
#interactive-map {
    height: 500px !important;
    min-height: 500px !important;
}

/* S'assurer que la carte prend toute la hauteur */
.cim-map-container .leaflet-container {
    height: 100% !important;
    width: 100%;
    position: relative;
    z-index: 2;
}

/* Marqueur personnalisé avec couleur */
.cim-custom-marker {
    background: transparent;
    border: none;
}

.cim-marker-pin {
    width: 30px;
    height: 30px;
    border-radius: 50% 50% 50% 0;
    background: #3388ff;
    position: absolute;
    transform: rotate(-45deg);
    left: 50%;
    top: 50%;
    margin: -15px 0 0 -15px;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
    border: 2px solid #fff;
}

.cim-marker-pin::after {
    content: '';
    width: 12px;
    height: 12px;
    margin: 9px 0 0 9px;
    background: #fff;
    position: absolute;
    border-radius: 50%;
}

/* Animation au survol du marqueur */
.cim-custom-marker:hover .cim-marker-pin {
    transform: rotate(-45deg) scale(1.1);
    transition: transform 0.3s ease;
}

/* Popup personnalisé */
.leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.2);
}

.leaflet-popup-content {
    margin: 15px;
    line-height: 1.6;
    font-size: 14px;
}

.leaflet-popup-content h3,
.leaflet-popup-content h4 {
    margin-top: 0;
    margin-bottom: 10px;
}

.leaflet-popup-content p {
    margin: 8px 0;
}

.leaflet-popup-content img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 10px 0;
}

/* Contrôles de zoom personnalisés */
.leaflet-control-zoom a {
    color: #333;
    font-weight: bold;
}

.leaflet-control-zoom a:hover {
    background-color: #f4f4f4;
}

/* Attribution */
.leaflet-control-attribution {
    background: rgba(255, 255, 255, 0.8);
    font-size: 11px;
}

/* Scroll doux vers la carte */
html {
    scroll-behavior: smooth;
}

/* Responsive */
@media screen and (max-width: 768px) {
    .cim-map-container {
        height: 400px;
        border-radius: 0;
        margin: 15px -15px;
        width: calc(100% + 30px);
    }
    
    .leaflet-popup-content {
        font-size: 13px;
    }
}

@media screen and (max-width: 480px) {
    .cim-map-container {
        height: 300px;
    }
    
    .cim-marker-pin {
        width: 25px;
        height: 25px;
        margin: -12px 0 0 -12px;
    }
    
    .cim-marker-pin::after {
        width: 10px;
        height: 10px;
        margin: 7px 0 0 7px;
    }
}

/* Fix pour Elementor */
.elementor-widget-container .cim-map-container {
    margin: 0;
}

/* Loader supprimé - causait des problèmes */

/* Fix pour les popups qui sortent de l'écran sur mobile */
@media screen and (max-width: 768px) {
    .leaflet-popup {
        max-width: 90vw !important;
    }
}

/* Style pour le mode sombre (si activé sur le site) */
@media (prefers-color-scheme: dark) {
    .cim-map-container {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    }
    
    .leaflet-control-attribution {
        background: rgba(40, 40, 40, 0.9);
        color: #ccc;
    }
    
    .leaflet-control-attribution a {
        color: #7ab8ff;
    }
}

/* Animation de focus sur le marqueur */
@keyframes markerPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(51, 136, 255, 0.7);
    }
    70% {
        box-shadow: 0 0 0 20px rgba(51, 136, 255, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(51, 136, 255, 0);
    }
}

.cim-marker-focused .cim-marker-pin {
    animation: markerPulse 1.5s ease-out;
}