/* Mapa Lojas - Custom Mapbox Styles */

/* Custom Marker Styles */
.custom-marker {
    cursor: pointer;
    transition: transform 0.2s ease;
    width: 32px;
    height: 40px;
}

.custom-marker:hover {
    transform: scale(1.15);
    z-index: 1000;
}

.custom-marker svg {
    display: block;
    width: 100%;
    height: 100%;
}

/* Cluster Marker Styles */
.custom-cluster-marker {
    width: 50px;
    height: 50px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.custom-cluster-marker:hover {
    transform: scale(1.15);
}

.cluster-inner {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, #D33163 0%, #E85A86 100%);
    box-shadow: 0 4px 12px rgba(211, 49, 99, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 3px solid white;
}

.cluster-count {
    color: white;
    font-size: 16px;
    font-weight: 700;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Search Marker Style */
.search-marker {
    cursor: pointer;
    animation: bounce 1s ease infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* Popup Container */
.mapboxgl-popup-content {
    padding: 0;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    max-width: 300px;
}

.mapa-popup {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.popup-title {
    margin: 0;
    padding: 16px;
    background: linear-gradient(135deg, #D33163 0%, #E85A86 100%);
    color: white;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
}

.popup-content {
    padding: 16px;
    background: white;
}

.popup-content p {
    margin: 0 0 12px 0;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.popup-content p:last-child {
    margin-bottom: 0;
}

.popup-content svg {
    flex-shrink: 0;
    margin-top: 2px;
}

.popup-content a {
    color: #D33163;
    text-decoration: none;
    transition: color 0.2s ease;
}

.popup-content a:hover {
    color: #E85A86;
    text-decoration: underline;
}

.popup-address {
    color: #555;
}

.popup-phone,
.popup-email {
    font-size: 13px;
}

/* Popup close button */
.mapboxgl-popup-close-button {
    width: 28px;
    height: 28px;
    font-size: 22px;
    color: white;
    padding: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease;
    outline: none;
}

.mapboxgl-popup-close-button:hover {
    transform: scale(1.2);
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
}

.mapboxgl-popup-close-button:focus {
    outline: 2px solid white;
    outline-offset: 2px;
}

/* Popup tip (arrow) */
.mapboxgl-popup-anchor-bottom .mapboxgl-popup-tip {
    border-top-color: #D33163;
}

.mapboxgl-popup-anchor-top .mapboxgl-popup-tip {
    border-bottom-color: white;
}

.mapboxgl-popup-anchor-left .mapboxgl-popup-tip {
    border-right-color: white;
}

.mapboxgl-popup-anchor-right .mapboxgl-popup-tip {
    border-left-color: white;
}

/* Map Controls */
.mapboxgl-ctrl-group {
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    background: white;
}

.mapboxgl-ctrl-group button {
    width: 36px;
    height: 36px;
}

.mapboxgl-ctrl-group button:hover {
    background-color: #f8f8f8;
}

/* Map attribution - Hidden */
.mapboxgl-ctrl-attrib,
.mapboxgl-ctrl-bottom-right,
.mapboxgl-ctrl-logo,
.mapboxgl-ctrl-attrib-inner,
a[href*="mapbox.com"],
a[href*="openstreetmap.org"] {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    width: 0 !important;
    overflow: hidden !important;
}

/* Hide the entire attribution container */
.mapboxgl-ctrl-bottom-right {
    display: none !important;
}

/* Also target any elements with Mapbox text */
.mapboxgl-ctrl-attrib-inner,
.mapboxgl-ctrl-attrib-inner a {
    display: none !important;
}

/* Map container */
#map {
    position: relative;
    border: 2px solid #e8e8e8;
}

/* Loading state */
.map-loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 20px 40px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
}

.map-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #D33163;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

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

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .popup-title {
        font-size: 16px;
        padding: 12px;
    }
    
    .popup-content {
        padding: 12px;
    }
    
    .popup-content p {
        font-size: 13px;
    }
    
    .mapboxgl-popup-content {
        max-width: 260px;
    }
    
    .custom-marker {
        width: 28px;
        height: 35px;
    }
    
    .custom-cluster-marker {
        width: 45px;
        height: 45px;
    }
    
    .cluster-count {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    #map {
        border-radius: 8px;
    }
    
    .popup-title {
        font-size: 15px;
        padding: 10px;
    }
    
    .popup-content {
        padding: 10px;
    }
    
    .mapboxgl-popup-content {
        max-width: 220px;
    }
    
    .custom-marker {
        width: 24px;
        height: 30px;
    }
}

/* Smooth transitions */
.mapboxgl-marker {
    transition: opacity 0.3s ease;
}

/* Error message styling */
#map div[style*="color: #D33163"] {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    font-weight: 500;
}