/* ── Utility ── */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ── EMBEDDED CUSTOMER MAP (all-reviews.php) ── */

.map-embed-section {
    background: linear-gradient(135deg, var(--navy-mid) 0%, var(--navy) 100%);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 3rem 5vw 0;
    position: relative;
    overflow: hidden;
}

.map-embed-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 55% 90% at 50% 50%, rgba(51, 204, 204, 0.07) 0%, transparent 70%);
    pointer-events: none;
}

/* ── Header ── */
.map-embed-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
    max-width: 1240px;
    margin: 0 auto 2rem;
    position: relative;
    z-index: 1;
}

.map-embed-title .section-tag {
    margin-bottom: 0.75rem;
}

.map-embed-title h2 {
    font-size: clamp(1.6rem, 3.5vw, 2.4rem);
    font-weight: 800;
    color: var(--white);
    line-height: 1.2;
    margin: 0;
}

.map-embed-title h2 span {
    color: var(--teal);
}

.map-embed-kpis {
    display: flex;
    gap: 0.75rem;
    flex-shrink: 0;
}

.map-kpi {
    background: rgba(51, 204, 204, 0.08);
    border: 1px solid rgba(51, 204, 204, 0.2);
    border-radius: 10px;
    padding: 0.5rem 1.25rem;
    text-align: center;
}

.map-kpi-val {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--teal);
    line-height: 1.2;
}

.map-kpi-lbl {
    font-size: 0.65rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}

/* ── Map body (sidebar + map) ── */
.map-embed-body {
    display: flex;
    max-width: 1240px;
    margin: 0 auto 6em;
    border-radius: 16px 16px 16px 16px;
    overflow: hidden;
    border: 1px solid var(--border);
    height: 520px;
    position: relative;
    z-index: 1;
}

/* ── Sidebar ── */
.map-embed-sidebar {
    width: 280px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: rgba(14, 42, 58, 0.95);
    border-right: 1px solid var(--border);
    overflow: hidden;
}

.map-search-wrap {
    padding: 12px;
    border-bottom: 1px solid var(--border);
}

#map-search {
    width: 100%;
    padding: 9px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.04);
    color: var(--white);
    font-family: 'Montserrat', sans-serif;
    font-size: 0.82rem;
    outline: none;
    transition: border-color 0.2s;
}

#map-search:focus {
    border-color: var(--teal);
}

#map-search::placeholder {
    color: var(--muted);
}

#list-label {
    padding: 8px 14px 4px;
    font-size: 0.65rem;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    font-weight: 600;
}

#city-list {
    flex: 1;
    overflow-y: auto;
    padding: 4px 8px 12px;
}

#city-list::-webkit-scrollbar {
    width: 4px;
}

#city-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

.city-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    border: 1px solid transparent;
    margin-bottom: 3px;
}

.city-item:hover {
    background: rgba(51, 204, 204, 0.06);
    border-color: rgba(51, 204, 204, 0.2);
}

.city-item.active {
    background: rgba(51, 204, 204, 0.1);
    border-color: var(--teal);
}

.city-left {
    min-width: 0;
}

.city-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.city-svc {
    font-size: 0.7rem;
    color: var(--muted);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.city-badge {
    flex-shrink: 0;
    background: rgba(51, 204, 204, 0.1);
    border: 1px solid rgba(51, 204, 204, 0.25);
    color: var(--teal);
    border-radius: 6px;
    padding: 2px 8px;
    font-size: 0.72rem;
    font-weight: 700;
}

.no-results {
    padding: 30px 14px;
    text-align: center;
    color: var(--muted);
    font-size: 0.85rem;
}

/* ── Leaflet map ── */
#map {
    flex: 1;
    z-index: 0;
    min-height: 100%;
}

/* ── Loading overlay ── */
#map-loading {
    position: absolute;
    inset: 0;
    background: rgba(14, 42, 58, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    gap: 14px;
    border-radius: 16px 16px 0 0;
}

#map-loading p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
}

#pw {
    width: 240px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    overflow: hidden;
    height: 6px;
}

#pb {
    height: 6px;
    background: linear-gradient(90deg, var(--teal), var(--teal-dark));
    width: 0%;
    transition: width 0.15s;
    border-radius: 20px;
}

#pt {
    font-size: 0.75rem;
    color: var(--teal);
}

/* ── Error overlay ── */
#map-error {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(14, 42, 58, 0.97);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    gap: 8px;
    text-align: center;
    padding: 30px;
    border-radius: 16px 16px 0 0;
}

#map-error h3 {
    color: #f85149;
    font-size: 1rem;
}

#map-error p {
    color: var(--muted);
    font-size: 0.82rem;
}

/* ── Leaflet popup ── */
.leaflet-popup-content-wrapper {
    background: rgba(14, 42, 58, 0.97) !important;
    border: 1px solid rgba(51, 204, 204, 0.3) !important;
    border-radius: 14px !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6) !important;
    padding: 0 !important;
    min-width: 280px;
    max-width: 320px;
}

.leaflet-popup-content {
    margin: 0 !important;
}

.leaflet-popup-tip {
    background: rgba(14, 42, 58, 0.97) !important;
}

.leaflet-popup-close-button {
    color: var(--muted) !important;
    top: 10px !important;
    right: 12px !important;
    font-size: 1.1rem !important;
}

.popup-inner {
    padding: 18px 20px;
}

.popup-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.popup-icon {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: rgba(51, 204, 204, 0.1);
    border: 1px solid rgba(51, 204, 204, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.popup-city {
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
}

.popup-state {
    font-size: 0.78rem;
    color: var(--muted);
    margin-top: 1px;
}

.popup-count {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 12px;
    padding: 10px 14px;
    background: rgba(248, 81, 73, 0.08);
    border: 1px solid rgba(248, 81, 73, 0.2);
    border-radius: 8px;
}

.popup-num {
    font-size: 1.8rem;
    font-weight: 800;
    color: #f85149;
    line-height: 1;
}

.popup-num-lbl {
    font-size: 0.8rem;
    color: var(--muted);
}

.popup-summary {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.6;
    margin-bottom: 12px;
    border-left: 2px solid rgba(51, 204, 204, 0.4);
    padding-left: 10px;
}

.popup-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.popup-tag {
    background: rgba(51, 204, 204, 0.1);
    border: 1px solid rgba(51, 204, 204, 0.25);
    color: var(--teal);
    border-radius: 5px;
    padding: 3px 9px;
    font-size: 0.7rem;
}

/* ── Responsive ── */
@media (max-width: 768px) {
    .map-embed-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .map-embed-body {
        flex-direction: column;
        height: auto;
    }

    .map-embed-sidebar {
        width: 100%;
        max-height: 200px;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }

    #map {
        flex: none;
        min-height: auto;
        height: 400px;
    }
}

@media (max-width: 480px) {
    .map-embed-section {
        padding: 2rem 3vw 0;
    }

    #map {
        flex: none;
        min-height: auto;
        height: 320px;
    }
}