/* Дополнительный UI публичной карты: переключатель карты, список участков и фильтры. */

.land-map-title-switch {
    position: relative;
    min-width: 0;
}

.land-map-title-switch summary {
    min-width: 0;
    max-width: 360px;
    display: flex;
    align-items: center;
    gap: 7px;
    list-style: none;
    cursor: pointer;
    color: #17231b;
    font-family: var(--zf-font-display);
    font-size: clamp(17px, 2vw, 24px);
    font-weight: 700;
    line-height: 1.12;
    letter-spacing: -.025em;
}

.land-map-title-switch summary::-webkit-details-marker {
    display: none;
}

.land-map-title-switch summary span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.land-map-title-switch summary svg {
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    transition: transform .16s ease;
}

.land-map-title-switch[open] summary svg {
    transform: rotate(180deg);
}

.land-map-title-menu {
    position: absolute;
    z-index: 950;
    top: calc(100% + 14px);
    left: -14px;
    width: min(320px, calc(100vw - 32px));
    max-height: min(420px, calc(100dvh - 110px));
    overflow-y: auto;
    padding: 8px;
    border: 1px solid rgba(255,255,255,.78);
    border-radius: 15px;
    background: rgba(255,255,255,.94);
    box-shadow: 0 18px 48px rgba(16,59,45,.20);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
}

.land-map-title-menu a {
    display: block;
    padding: 10px 11px;
    border-radius: 10px;
    color: #17231b;
    font: 700 13px/1.3 var(--zf-font);
    text-decoration: none;
}

.land-map-title-menu a:hover,
.land-map-title-menu a.is-current {
    background: rgba(16,59,45,.09);
    color: var(--zf-forest);
}

.land-map-toolbar {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-left: 3px;
}

.land-map-toolbar button {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(16,59,45,.12);
    border-radius: 11px;
    background: rgba(255,255,255,.58);
    color: var(--zf-forest);
    cursor: pointer;
}

.land-map-toolbar button:hover,
.land-map-toolbar button.is-active {
    background: var(--zf-forest);
    color: #fff;
}

.land-map-toolbar svg {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
}

.map-side-panel {
    position: absolute;
    z-index: 810;
    top: 84px;
    left: 16px;
    width: min(360px, calc(100% - 32px));
    max-height: calc(100dvh - 102px);
    overflow: hidden;
    border: 1px solid rgba(255,255,255,.74);
    border-radius: 18px;
    background: rgba(255,255,255,.92);
    box-shadow: 0 20px 54px rgba(16,59,45,.20);
    -webkit-backdrop-filter: blur(18px) saturate(115%);
    backdrop-filter: blur(18px) saturate(115%);
}

.map-side-panel[hidden] {
    display: none;
}

.map-side-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 54px;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(16,59,45,.10);
}

.map-side-panel-head strong {
    font-family: var(--zf-font-display);
    font-size: 19px;
}

.map-side-panel-head button {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 9px;
    background: rgba(16,59,45,.07);
    color: var(--zf-forest);
    font-size: 24px;
    cursor: pointer;
}

.map-side-list {
    max-height: calc(100dvh - 158px);
    overflow-y: auto;
    padding: 8px;
    overscroll-behavior: contain;
}

.map-side-list-item {
    width: 100%;
    padding: 10px 11px;
    display: grid;
    gap: 7px;
    border: 0;
    border-bottom: 1px solid rgba(16,59,45,.08);
    border-radius: 11px;
    background: transparent;
    color: #17231b;
    text-align: left;
    cursor: pointer;
}

.map-side-list-item:hover,
.map-side-list-item:focus-visible {
    background: rgba(16,59,45,.07);
    outline: none;
}

.map-side-list-top {
    display: flex;
    align-items: center;
    gap: 9px;
}

.map-side-list-top strong {
    margin-left: auto;
    font-size: 13px;
}

.map-side-list-meta {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    color: rgba(23,35,27,.63);
    font-size: 11px;
    line-height: 1.35;
}

.map-side-list-area {
    min-width: 0;
}

.map-side-list-price {
    flex: 0 0 auto;
    color: var(--zf-price-red);
    font-size: 12px;
    font-weight: 850;
    text-align: right;
}

.map-side-list-item.is-filter-muted {
    opacity: .42;
}

.map-side-list-item.is-static {
    cursor: default;
}

.map-side-filters {
    max-height: calc(100dvh - 158px);
    overflow-y: auto;
    padding: 14px;
    display: grid;
    gap: 14px;
}

.map-side-filters[hidden] {
    display: none;
}

.map-side-filters > label,
.map-side-filters fieldset {
    display: grid;
    gap: 7px;
    margin: 0;
}

.map-side-filters > label > span,
.map-side-filters legend {
    color: rgba(23,35,27,.67);
    font-size: 11px;
    font-weight: 800;
}

.map-filter-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.map-side-filters input[type="number"] {
    width: 100%;
    min-height: 40px;
    padding: 0 10px;
    border: 1px solid rgba(16,59,45,.14);
    border-radius: 10px;
    background: rgba(255,255,255,.82);
    font: inherit;
}

.map-side-filters fieldset {
    grid-template-columns: 1fr 1fr;
    padding: 12px;
    border: 1px solid rgba(16,59,45,.11);
    border-radius: 12px;
}

.map-side-filters fieldset legend {
    grid-column: 1 / -1;
    padding: 0 5px;
}

.map-side-filters fieldset label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
}

.map-side-filter-actions button {
    width: 100%;
    min-height: 40px;
    border: 1px solid rgba(16,59,45,.16);
    border-radius: 11px;
    background: rgba(16,59,45,.08);
    color: var(--zf-forest);
    font-weight: 800;
    cursor: pointer;
}

/* Imported SVG/Leaflet marker styles can be inline; interaction states must win. */
.zf-map-plot.is-filter-muted polygon,
.zf-map-plot.is-filter-muted path,
.zf-map-plot.is-filter-muted polyline {
    fill: #b7b9b7 !important;
    fill-opacity: .22 !important;
    stroke: #8c8f8c !important;
    stroke-opacity: .35 !important;
    filter: none !important;
}

.zf-map-number-marker.is-filter-muted {
    opacity: .20 !important;
}

.zf-map-plot.is-list-highlight polygon,
.zf-map-plot.is-list-highlight path,
.zf-map-plot.is-list-highlight polyline {
    fill-opacity: 1 !important;
    stroke: #f0b429 !important;
    stroke-width: 3 !important;
    filter: drop-shadow(0 0 8px rgba(240,180,41,.95)) !important;
}

.zf-map-number-marker.is-list-highlight {
    opacity: 1 !important;
    transform: scale(1.12);
    transform-origin: center;
}

.map-info-price strong {
    color: var(--zf-price-red);
}

.public-map-embed .land-map-title-switch,
.public-map-embed .land-map-toolbar,
.public-map-embed .map-side-panel {
    display: none;
}

@media (max-width: 720px) {
    .land-map-brand-home span,
    .land-map-brand-divider {
        display: none;
    }
    .land-map-title-switch {
        flex: 1 1 auto;
        min-width: 0;
    }
    .land-map-title-switch summary {
        width: 100%;
        max-width: none;
        font-size: 15px;
    }
    .land-map-toolbar {
        flex: 0 0 auto;
    }
    .land-map-toolbar button {
        width: 34px;
        height: 34px;
    }
    .map-side-panel {
        top: 66px;
        left: 8px;
        width: min(360px, calc(100% - 16px));
        max-height: calc(100dvh - 74px);
    }
    .map-side-list,
    .map-side-filters {
        max-height: calc(100dvh - 130px);
    }
}
