/**
 * Public Map Styles
 */

/* Map container spinner loader */
.nsm-loader {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.2);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.4s ease;
}
.nsm-spinner {
    width: 45px;
    height: 45px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #3858f6;
    animation: nsm-spin 1s ease-in-out infinite;
}
@keyframes nsm-spin {
    to { transform: rotate(360deg); }
}

/* Premium Custom Heart Pin Styling */
.nsm-custom-marker {
    position: relative;
    width: 40px !important;
    height: 40px !important;
}
.nsm-heart-pin {
    width: 40px !important;
    height: 40px !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    z-index: 2 !important;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.15)) !important;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275) !important;
    cursor: pointer !important;
    box-sizing: border-box !important;
}
.nsm-heart-pin:hover {
    transform: scale(1.2) translateY(-2px) !important;
    z-index: 10 !important;
}
.nsm-heart-svg {
    width: 100% !important;
    height: 100% !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Lobe center circle for company logo(s) */
.nsm-heart-logo-container {
    width: 22px !important;
    height: 22px !important;
    border-radius: 50% !important;
    position: absolute !important;
    top: 8px !important;
    left: 9px !important;
    background: #ffffff !important;
    overflow: hidden !important;
    display: grid !important;
    border: 1px solid rgba(0,0,0,0.06) !important;
    box-sizing: border-box !important;
    padding: 0 !important;
    margin: 0 !important;
}

.nsm-heart-logo-container.count-1 {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Robust reset for logo images inside the heart pin */
.nsm-heart-logo-container img {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
    display: block !important;
    object-fit: contain !important;
    object-position: center !important;
    transform: none !important;
    position: static !important;
    background: transparent !important;
}

/* Grouped grid settings inside the heart logo circle */
.nsm-heart-logo-container.count-2 {
    grid-template-columns: repeat(2, 1fr) !important;
    grid-template-rows: 1fr !important;
    gap: 0.5px !important;
}
.nsm-heart-logo-container.count-3,
.nsm-heart-logo-container.count-4,
.nsm-heart-logo-container.count-5,
.nsm-heart-logo-container.count-6,
.nsm-heart-logo-container.count-7,
.nsm-heart-logo-container.count-8,
.nsm-heart-logo-container.count-9,
.nsm-heart-logo-container.count-10 {
    grid-template-columns: repeat(2, 1fr) !important;
    grid-template-rows: repeat(2, 1fr) !important;
    gap: 0.5px !important;
}
.nsm-heart-grid-logo {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    background: #ffffff !important;
}
.nsm-heart-grid-more {
    background: #334155 !important;
    color: #ffffff !important;
    font-size: 6px !important;
    font-weight: 700 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Glowing Pulse Heartbeat under Marker */
.nsm-marker-pulse {
    width: 48px !important;
    height: 48px !important;
    background: rgba(255, 75, 114, 0.5) !important;
    border-radius: 50% !important;
    position: absolute !important;
    top: -4px !important;
    left: -4px !important;
    animation: nsm-heartbeat 1.6s infinite ease-in-out !important;
    z-index: 1 !important;
    pointer-events: none !important;
    will-change: transform, opacity !important;
}

@keyframes nsm-heartbeat {
    0% {
        transform: scale(0.6);
        opacity: 0.9;
    }
    14% {
        transform: scale(0.85);
        opacity: 0.9;
    }
    28% {
        transform: scale(0.7);
        opacity: 0.9;
    }
    42% {
        transform: scale(1.1);
        opacity: 0.4;
    }
    70% {
        transform: scale(1.4);
        opacity: 0;
    }
    100% {
        transform: scale(0.6);
        opacity: 0;
    }
}

/* Premium Glassmorphic Leaflet Popups */
.leaflet-popup-content-wrapper {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(12px) !important;
    -webkit-backdrop-filter: blur(12px) !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
    border-radius: 14px !important;
    box-shadow: 0 10px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1) !important;
    padding: 2px !important;
}

/* If map uses Dark Theme, style popup dark glassmorphic */
.nsm-map-dark .leaflet-popup-content-wrapper {
    background: rgba(15, 23, 42, 0.85) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 10px 25px -5px rgb(0 0 0 / 0.4), 0 8px 10px -6px rgb(0 0 0 / 0.4) !important;
}

.leaflet-popup-tip {
    background: rgba(255, 255, 255, 0.85) !important;
    backdrop-filter: blur(12px) !important;
}
.nsm-map-dark .leaflet-popup-tip {
    background: rgba(15, 23, 42, 0.85) !important;
}

.leaflet-popup-content {
    margin: 12px 16px !important;
    min-width: 200px;
}

/* Popup Inside Card */
.nsm-popup-card {
    display: flex;
    align-items: center;
    gap: 14px;
}
.nsm-popup-logo {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: contain;
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.06);
    padding: 2px;
    flex-shrink: 0;
}
.nsm-popup-body {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.nsm-popup-body h4 {
    font-size: 15px !important;
    font-weight: 700 !important;
    color: #0f172a !important;
    margin: 0 !important;
    line-height: 1.2 !important;
}
.nsm-map-dark .nsm-popup-body h4 {
    color: #ffffff !important;
}
.nsm-popup-address {
    font-size: 11px !important;
    color: #64748b !important;
    margin: 0 !important;
    line-height: 1.3 !important;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.nsm-map-dark .nsm-popup-address {
    color: #94a3b8 !important;
}
.nsm-popup-orders {
    align-self: flex-start;
    background: rgba(56, 88, 246, 0.1);
    color: #3858f6;
    font-size: 10px !important;
    font-weight: 700 !important;
    padding: 2px 8px !important;
    border-radius: 9999px !important;
    margin-top: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.nsm-map-dark .nsm-popup-orders {
    background: rgba(56, 88, 246, 0.2);
    color: #60a5fa;
}

/* Hide fallback lists but keep them accessible for screen readers and SEO crawlers */
.nsm-seo-fallback,
.nsm-seo-fallback-accessible {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}



/* Stacking rows in popup */
.nsm-popup-card-multiple {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 2px 0;
}
.nsm-popup-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 2px 0;
}
.nsm-popup-row:not(:last-child) {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    padding-bottom: 6px;
}
.nsm-map-dark .nsm-popup-row:not(:last-child) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
