/* Unified map page: filter panel + large map, filling the screen height inside the site width. */
.mp {
    padding-top: 1rem;
    padding-bottom: 1rem;
}
.mp-wrap {
    display: grid;
    grid-template-columns: 400px minmax(0, 1fr);
    gap: 0.85rem;
    height: max(600px, calc(100vh - 250px));
}

/* Panel */
.mp-panel {
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: #fff;
    border: 1px solid var(--ek-border);
    border-radius: 6px;
    box-shadow: none;
    padding: 0.935rem;
    z-index: 2;
}
.mp-head {
    display: flex;
    align-items: center;
    gap: 0.68rem;
    margin-bottom: 1rem;
}
.mp-head-icon {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    background: #2563eb;
    color: #fff;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.mp-head h1 {
    font-size: 1.25rem;
    font-weight: 800;
    margin: 0;
}
.mp-head p {
    font-size: .8rem;
    color: var(--ek-muted);
    margin: 0;
}
.mp-toggle {
    display: none;
    margin-left: auto;
    border: 1px solid var(--ek-border);
    background: #fff;
    border-radius: 6px;
    width: 38px;
    height: 38px;
}
.mp-body {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1;
}
.mp-search {
    display: flex;
    align-items: center;
    gap: .6rem;
    border: 1px solid var(--ek-border);
    border-radius: 6px;
    padding: 0 0.765rem;
    margin-bottom: .7rem;
}
.mp-search i {
    color: var(--ek-muted);
}
.mp-search input {
    border: 0;
    outline: 0;
    height: 42px;
    flex: 1;
    min-width: 0;
    font-size: .88rem;
}
.mp-selects {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .6rem;
    margin-bottom: .9rem;
}
.mp-select {
    display: flex;
    align-items: center;
    gap: .5rem;
    border: 1px solid var(--ek-border);
    border-radius: 6px;
    padding: 0 .7rem;
    min-width: 0;
}
.mp-select i {
    color: #303038;
}
.mp-select select {
    border: 0;
    outline: 0;
    background: transparent;
    height: 42px;
    flex: 1;
    min-width: 0;
    font-size: .86rem;
    font-weight: 500;
}

/* Category tiles */
.mp-tiles {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: .55rem;
    overflow-y: auto;
    min-height: 0;
    flex: 1;
    align-content: start;
    padding: 2px;
}
.mp-tile {
    --c: #2563eb;
    display: flex;
    align-items: center;
    gap: .65rem;
    text-align: left;
    background: #fff;
    border: 1px solid var(--ek-border);
    border-radius: 6px;
    padding: .55rem .65rem;
    transition: border-color .15s, background .15s;
}
.mp-tile:hover {
    border-color: color-mix(in srgb, var(--c) 45%, #fff);
}
.mp-tile.active {
    background: color-mix(in srgb, #2563eb 10%, #fff);
    border-color: #93b4f8;
}
.mp-tile strong {
    display: block;
    font-size: .8rem;
    font-weight: 600;
    line-height: 1.2;
    color: var(--ek-text);
}
.mp-tile.active strong {
    color: #1d4ed8;
}
.mp-tile small {
    font-size: .74rem;
    color: var(--ek-muted);
}
.mp-ticon {
    --c: #2563eb;
    width: 36px;
    height: 36px;
    border-radius: 6px;
    background: color-mix(in srgb, var(--c) 12%, #fff);
    color: var(--c);
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.mp-tile.active .mp-ticon {
    background: var(--c);
    color: #fff;
}
.mp-ticon.sm {
    width: 52px;
    height: 52px;
    border-radius: 6px;
}
.mp-register {
    margin-top: .9rem;
    height: 46px;
    border-radius: 6px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
}

/* Map side */
.mp-main {
    position: relative;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--ek-border);
    background: #fff;
}
.mp-map {
    position: absolute;
    inset: 0;
    z-index: 0;
}
.mp-views {
    position: absolute;
    top: 1rem;
    left: 1rem;
    z-index: 500;
    display: flex;
    background: #fff;
    border-radius: 6px;
    padding: .25rem;
    box-shadow: none;
}
.mp-views button {
    border: 0;
    background: transparent;
    border-radius: 6px;
    padding: .5rem 0.85rem;
    font-size: .86rem;
    font-weight: 600;
    color: #303038;
}
.mp-views button.active {
    background: #2563eb;
    color: #fff;
}
.mp-near {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 500;
    border: 0;
    background: #fff;
    border-radius: 6px;
    padding: .65rem 0.85rem;
    font-weight: 600;
    font-size: .88rem;
    box-shadow: none;
}
.mp-near i {
    color: #2563eb;
    margin-right: .25rem;
}
.mp-ctrl {
    position: absolute;
    right: 1rem;
    bottom: 1.5rem;
    z-index: 500;
    display: flex;
    flex-direction: column;
    gap: .6rem;
}
.mp-ctrl button {
    width: 46px;
    height: 46px;
    border: 0;
    background: #fff;
    font-size: 1.2rem;
    box-shadow: none;
}
.mp-ctrl button:first-child {
    border-radius: 6px 6px 0 0;
    border-bottom: 1px solid var(--ek-border);
}
.mp-ctrl button:nth-child(2) {
    border-radius: 0 0 6px 6px;
    margin-top: -.6rem;
}
.mp-ctrl .single {
    border-radius: 6px;
    color: #2563eb;
}
.mp-main.listing .mp-ctrl,
.mp-main.listing .mp-near {
    display: none;
}

/* List view (replaces the map) */
.mp-listview {
    position: absolute;
    inset: 0;
    z-index: 400;
    background: #f5f7f8;
    padding: 3.825rem 0.85rem 0.85rem;
    overflow-y: auto;
}
.mp-listhead {
    font-size: .82rem;
    color: var(--ek-muted);
    margin-bottom: .6rem;
}
.mp-listhead #shown {
    font-weight: 700;
    color: var(--ek-text);
}
.mp-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: .7rem;
}
.mp-list li {
    display: flex;
    align-items: center;
    gap: 0.68rem;
    background: #fff;
    border: 1px solid var(--ek-border);
    border-radius: 6px;
    padding: .6rem;
    cursor: pointer;
}
.mp-list li:hover {
    border-color: #93b4f8;
}
.mp-list li img {
    width: 52px;
    height: 52px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}
.mp-item {
    min-width: 0;
    flex: 1;
}
.mp-item strong,
.mp-item small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mp-item strong {
    font-size: .88rem;
    margin-top: .1rem;
}
.mp-item small {
    font-size: .74rem;
    color: var(--ek-muted);
}
.mp-dist {
    font-size: .74rem;
    font-weight: 700;
    color: #2563eb;
    white-space: nowrap;
}
.mp-open {
    color: var(--ek-muted);
    padding: .3rem;
}
.mp-empty {
    justify-content: center;
    color: var(--ek-muted);
    cursor: default !important;
}

/* Markers, labels and popups */
.mp-pin span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 50% 50% 50% 0;
    transform: rotate(-45deg);
    background: var(--c);
    border: 3px solid #fff;
    box-shadow: none;
}
.mp-pin i {
    transform: rotate(45deg);
    color: #fff;
    font-size: .9rem;
}
.leaflet-tooltip.mp-label {
    display: none;
    background: transparent;
    border: 0;
    box-shadow: none;
    padding: 0;
    font-family: inherit;
    font-size: .8rem;
    font-weight: 600;
    color: #101010;
    text-shadow: 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff, 0 0 3px #fff;
    white-space: nowrap;
    line-height: 1.2;
}
.leaflet-tooltip.mp-label::before {
    display: none;
}
.mp-labels .leaflet-tooltip.mp-label {
    display: block;
}
.mp-pop {
    display: flex;
    flex-direction: column;
    gap: .2rem;
    font-family: inherit;
    min-width: 200px;
}
.mp-pop img {
    width: 100%;
    height: 110px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: .3rem;
}
.mp-pop-type {
    --c: #2563eb;
    display: inline-block;
    align-self: flex-start;
    font-size: .66rem;
    font-weight: 700;
    color: var(--c);
    background: color-mix(in srgb, var(--c) 12%, #fff);
    border-radius: 5px;
    padding: .05rem .45rem;
}
.mp-pop strong {
    font-size: .9rem;
}
.mp-pop small {
    color: #606060;
    font-size: .74rem;
}
.mp-pop a {
    margin-top: .3rem;
    font-weight: 600;
    font-size: .8rem;
}
.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
    background: rgba(37, 99, 235, .25);
}
.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
    background: #2563eb;
    color: #fff;
    font-weight: 700;
}

@media (max-width: 1199.98px) {
    .mp-wrap {
        grid-template-columns: 340px minmax(0, 1fr);
    }
}
@media (max-width: 991.98px) {
    .mp-wrap {
        position: relative;
        grid-template-columns: minmax(0, 1fr);
        height: calc(100vh - 210px);
        min-height: 520px;
    }
    .mp-panel {
        position: absolute;
        top: 4.2rem;
        left: .6rem;
        right: .6rem;
        max-height: calc(100% - 5rem);
        padding: 0.68rem;
    }
    .mp-panel:not(.open) {
        bottom: auto;
    }
    .mp-panel:not(.open) .mp-body {
        display: none;
    }
    .mp-panel:not(.open) .mp-head {
        margin-bottom: 0;
    }
    .mp-toggle {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    .mp-head-icon {
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }
    .mp-near span {
        display: none;
    }
}
@media (max-width: 575.98px) {
    .mp-near {
        padding: .65rem 0.68rem;
        font-size: 0;
    }
    .mp-near i {
        font-size: 1rem;
        margin: 0;
    }
    .mp-list {
        grid-template-columns: minmax(0, 1fr);
    }
}
