/* MW Map - Styles pour la carte et les popups */

.mw-map {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Cartes avec ratio d'aspect */
.mw-map-ratio {
    position: relative;
    height: 0;
    padding-bottom: var(--aspect-ratio, 56.25%); /* 16:9 par défaut */
}

.mw-map-ratio .leaflet-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
}

/* Styles pour les popups */
.mw-map-popup .leaflet-popup-content-wrapper {
    border-radius: 8px;
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.15);
}

.mw-map-popup .leaflet-popup-content {
    margin: 0;
    padding: 0;
    max-width: 380px;
}

.mw-popup-content {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.mw-popup-logo {
    text-align: center;
    margin-bottom: 15px;
    padding: 10px;
    background: #fff;
    border-bottom: 1px solid #e9ecef;
}

.mw-popup-logo img {
    max-width: 100%;
    max-height: 60px;
    width: auto;
    height: auto;
    border-radius: 0;
    object-fit: contain;
}

.mw-popup-title {
    margin: 0 0 10px 0;
    padding: 0 15px;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
}

.mw-popup-description {
    margin: 0 0 15px 0;
    padding: 0 15px;
    font-size: 14px;
    line-height: 1.4;
    color: #666;
}

.mw-popup-info {
    padding: 0 15px 15px 15px;
}

.mw-popup-phone,
.mw-popup-website,
.mw-popup-maps {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-size: 14px;
}

.mw-popup-phone:last-child,
.mw-popup-website:last-child,
.mw-popup-maps:last-child {
    margin-bottom: 0;
}

/* Icônes SVG dans les popups */
.mw-icon {
    margin-right: 8px;
    flex-shrink: 0;
    vertical-align: middle;
}

.mw-popup-phone a,
.mw-popup-website a,
.mw-popup-maps a {
    color: #26929b;
    text-decoration: none;
    transition: color 0.2s ease;
}

.mw-popup-phone a:hover,
.mw-popup-website a:hover,
.mw-popup-maps a:hover {
    color: #22d1e0;
    text-decoration: underline;
}

/* Responsive design */
@media (max-width: 768px) {
    .mw-map {
        height: 300px !important;
    }
    
    .mw-map-popup .leaflet-popup-content {
        max-width: 300px;
    }
    
    .mw-popup-title {
        font-size: 15px;
    }
    
    .mw-popup-description,
    .mw-popup-phone,
    .mw-popup-website,
    .mw-popup-maps {
        font-size: 13px;
    }
}

/* Animation pour les markers */
@keyframes markerBounce {
    0% { transform: translateY(-20px); opacity: 0; }
    60% { transform: translateY(-10px); opacity: 1; }
    80% { transform: translateY(-5px); }
    100% { transform: translateY(0); }
}

.leaflet-marker-icon {
    animation: markerBounce 0.6s ease-out;
}

/* Effet hover pour les marqueurs personnalisés */
.leaflet-marker-icon:hover {
    transform: scale(1.1);
    transition: transform 0.2s ease;
}

/* Style pour les boutons dans les popups */
.mw-popup-button {
    display: inline-block;
    padding: 6px 12px;
    background: #26929b;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 13px;
    transition: background 0.2s ease;
    margin-top: 8px;
}

.mw-popup-button:hover {
    background: #22d1e0;
    color: white;
    text-decoration: none;
}

/* Amélioration de l'accessibilité */
.mw-popup-content a:focus {
    outline: 2px solid #22d1e0;
    outline-offset: 2px;
}

/* Style pour les erreurs de chargement */
.mw-map-error {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    color: #6c757d;
    font-size: 14px;
    padding: 40px 20px;
    text-align: center;
}

.mw-map-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 8px;
    color: #6c757d;
    font-size: 14px;
    padding: 40px 20px;
    text-align: center;
}

.mw-map-loading:before {
    content: "";
    width: 20px;
    height: 20px;
    border: 2px solid #dee2e6;
    border-top-color: #26929b;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

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