/* ==========================================================================
   Map — full-width section, controls bar, popups, legend
   ========================================================================== */

/* ── Map section ── */
.map-section {
    position: relative;
    background: var(--paper);
    border-top: 1px solid var(--concrete);
    border-bottom: 1px solid var(--concrete);
}

.map-section__canvas {
    width: 100%;
    height: 55vh;
    min-height: 400px;
    max-height: 650px;
}

/* ── Controls bar above map ── */
.map-section__bar {
    background: var(--white);
    border-bottom: 1px solid var(--concrete);
    padding: 10px 0;
}
.map-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.map-bar__filters {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

/* Filter tags on map bar */
.map-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: var(--font-ui);
    font-size: 12px;
    font-weight: 500;
    padding: 6px 12px;
    border-radius: var(--radius-pill);
    border: 1.5px solid var(--concrete);
    background: var(--white);
    color: var(--ink-2);
    cursor: pointer;
    white-space: nowrap;
    transition: all var(--dur-fast);
}
.map-tag:hover {
    border-color: var(--rust);
    color: var(--rust);
}
.map-tag.active {
    background: var(--rust);
    color: var(--white);
    border-color: var(--rust);
}
.map-tag strong { font-weight: 700; }

/* ── Legend ── */
.map-bar__legend {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    font-size: 11px;
    color: var(--ink-3);
}
.legend-dot {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 3px 6px;
    border-radius: var(--radius-pill);
    transition: all var(--dur-fast);
    white-space: nowrap;
}
.legend-dot:hover { background: var(--paper); }
.legend-dot.active { background: var(--paper-2); font-weight: 600; color: var(--ink); }
.legend-dot i {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* ── Leaflet overrides ── */
.custom-marker { background: none; border: none; }

.map-popup .leaflet-popup-content-wrapper {
    border-radius: 12px;
    padding: 0;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(28, 28, 30, .15);
}
.map-popup .leaflet-popup-content { margin: 0; }
.map-popup .leaflet-popup-tip { border-top-color: #fff; }
.map-popup__inner { padding: 14px 16px; }
.map-popup__name {
    font-weight: 800;
    font-size: 14px;
    display: block;
    margin-bottom: 2px;
}
.map-popup__company {
    font-size: 11px;
    color: #9CA3AF;
    margin: 0 0 3px;
    font-weight: 500;
}
.map-popup__addr {
    font-size: 12px;
    color: #6B7280;
    margin: 0;
}
.map-popup__nav {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #F3F4F6;
}
.map-popup__nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: #F3F4F6;
    color: #374151;
    text-decoration: none;
    transition: all .15s;
}
.map-popup__nav-btn:hover {
    background: var(--rust);
    color: #fff;
}
.map-popup__nav .map-popup__link {
    margin-left: auto;
    font-size: 12px;
    font-weight: 700;
    color: var(--rust);
    text-decoration: none;
    white-space: nowrap;
}
.map-popup__nav .map-popup__link:hover { text-decoration: underline; }

/* ── Mobile ── */
@media (max-width: 768px) {
    .map-section__canvas { height: 45vh; min-height: 300px; }
    .map-bar__legend { display: none; }
    .map-bar__filters { overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
    .map-bar__filters::-webkit-scrollbar { display: none; }
}
