* { box-sizing: border-box; }

body.map-page {
    margin: 0;
    font-family: Inter, system-ui, -apple-system, sans-serif;
    color: #1a1a2e;
    background: #f5f6fa;
    overflow: hidden;
}

body.filter-sheet-open {
    overflow: hidden;
}

.map-layout {
    display: flex;
    height: 100vh;
    width: 100%;
}

.map-layout__scroll {
    display: contents;
}

.map-sidebar {
    width: min(400px, 100vw);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: #fff;
    border-right: 1px solid #e8eaef;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.06);
    z-index: 1000;
}

.map-sidebar__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 8px;
}

.map-sidebar__list-link {
    font-size: 13px;
    color: #0d6efd;
    text-decoration: none;
    font-weight: 500;
}

.map-sidebar__list-link:hover { text-decoration: underline; }

.map-sidebar__stats {
    margin: 0;
    padding: 0 16px 10px;
    font-size: 13px;
    font-weight: 600;
    color: #1a1a2e;
    border-bottom: 1px solid #eef0f4;
}

.map-sidebar__list-wrap {
    flex: 1;
    overflow-y: auto;
    padding: 0 12px 16px;
    scroll-behavior: smooth;
}

.map-sidebar__list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.map-main {
    flex: 1;
    position: relative;
    min-width: 0;
}

#map {
    width: 100%;
    height: 100%;
}

.leaflet-control-attribution.leaflet-control {
    display: none;
}

.leaflet-control-zoom.leaflet-bar {
    border: none;
    box-shadow: none;
    background: transparent;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0 16px 16px 0 !important;
}

.leaflet-control-zoom-in,
.leaflet-control-zoom-out {
    width: 44px !important;
    height: 44px !important;
    line-height: 1 !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    border: none !important;
    border-radius: 12px !important;
    background: #fff !important;
    color: #374151 !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12) !important;
    font-family: Inter, system-ui, sans-serif;
    font-size: 22px !important;
    font-weight: 500;
    text-decoration: none !important;
    transition: transform 0.15s, box-shadow 0.15s;
    -webkit-tap-highlight-color: transparent;
}

.leaflet-control-zoom-in span,
.leaflet-control-zoom-out span {
    line-height: 1;
}

.leaflet-control-zoom-in:hover,
.leaflet-control-zoom-out:hover {
    background: #fff !important;
    color: #374151 !important;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15) !important;
}

.leaflet-control-zoom-in.leaflet-disabled,
.leaflet-control-zoom-out.leaflet-disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12) !important;
}

.leaflet-bar a.leaflet-control-zoom-in {
    border-bottom: none !important;
}

.leaflet-touch .leaflet-control-zoom-in,
.leaflet-touch .leaflet-control-zoom-out {
    width: 44px !important;
    height: 44px !important;
    line-height: 1 !important;
}

/* Floating toolbar over map */
.map-toolbar {
    position: absolute;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1000;
    width: min(970px, calc(100% - 24px));
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(10px);
    border-radius: 14px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.8);
    padding: 10px 14px;
    pointer-events: auto;
}

.map-toolbar__row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.map-toolbar__row--secondary {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #eef0f4;
    gap: 8px;
}

.map-toolbar__filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
    flex: 1;
    min-width: 0;
}

.map-toolbar__pill {
    font-size: 13px !important;
    font-weight: 500 !important;
    color: #1a1a2e !important;
    background: #f5f6fa !important;
    border: 1px solid #e8eaef !important;
    border-radius: 8px !important;
    padding: 6px 12px !important;
    white-space: nowrap;
    min-height: 34px;
    display: inline-flex !important;
    align-items: center;
}

.map-toolbar__filters > .nav-item:nth-child(1) .map-toolbar__pill { min-width: 88px; }
.map-toolbar__filters > .nav-item:nth-child(2) .map-toolbar__pill { min-width: 84px; }
.map-toolbar__filters > .nav-item:nth-child(3) .map-toolbar__pill {
    min-width: 96px;
    max-width: 140px;
}

.map-toolbar__pill .filter-rent_type,
.map-toolbar__pill .filter-rooms,
.map-toolbar__pill .filter-city {
    color: #0d6efd;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 72px;
    display: inline-block;
    vertical-align: bottom;
}

.map-toolbar__pill:hover,
.map-toolbar__pill:focus {
    background: #eef2ff !important;
    border-color: #c5d9f8 !important;
    color: #0d6efd !important;
}

.map-toolbar__owner {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px;
    background: #f5f6fa;
    border: 1px solid #e8eaef;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
}

.map-toolbar__owner .form-check-input {
    width: 2em;
    height: 1.1em;
    margin: 0;
    cursor: pointer;
}

.map-toolbar__price {
    display: flex;
    align-items: center;
    gap: 6px;
}

.map-toolbar__price input {
    width: 88px;
    font-size: 12px;
    border-radius: 8px;
    border: 1px solid #e8eaef;
}

.map-toolbar__price-sep {
    color: #9ca3af;
    font-size: 12px;
}

.map-toolbar__city-menu {
    max-height: 280px;
    overflow-y: auto;
    min-width: 200px;
}

.map-toolbar__city-search {
    position: sticky;
    top: 0;
    background: #fff;
    padding: 8px 28px 6px 12px;
    z-index: 1;
}

.map-toolbar__clear-search {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #9ca3af;
    font-size: 18px;
    line-height: 1;
}

.map-toolbar__actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.map-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 14px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s, transform 0.1s;
}

.map-btn:active { transform: scale(0.97); }

.map-btn--primary {
    background: linear-gradient(135deg, #0d6efd, #0b5ed7);
    color: #fff;
    box-shadow: 0 2px 8px rgba(13, 110, 253, 0.35);
}

.map-btn--primary:hover { background: linear-gradient(135deg, #0b5ed7, #0a58ca); color: #fff; }

.map-btn--light {
    background: #f5f6fa;
    color: #374151;
    border: 1px solid #e8eaef;
}

.map-btn--light:hover { background: #eef0f4; color: #1a1a2e; }

.map-toolbar__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

.map-chip {
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 500;
    border-radius: 20px;
    border: 1px solid #e8eaef;
    background: #fff;
    color: #4b5563;
    cursor: pointer;
    transition: all 0.15s;
}

.map-chip:hover {
    border-color: #0d6efd;
    color: #0d6efd;
    background: #eef4ff;
}

.map-chip.is-active {
    background: #0d6efd;
    border-color: #0d6efd;
    color: #fff;
}

.map-toolbar__toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #6b7280;
    cursor: pointer;
    margin: 0;
    white-space: nowrap;
}

.map-toolbar__toggle input { cursor: pointer; }

.map-toolbar__status {
    flex-shrink: 0;
    min-width: 148px;
    font-size: 12px;
    color: #6b7280;
    white-space: nowrap;
    text-align: right;
    margin-left: auto;
}

/* Map progress bar */
.map-progress {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    z-index: 1001;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.map-progress.is-active {
    opacity: 1;
}

.map-progress__bar {
    height: 100%;
    width: 35%;
    border-radius: 0 2px 2px 0;
    background: linear-gradient(90deg, transparent, #0d6efd 40%, #d63384 70%, transparent);
    animation: mapProgressSlide 1.1s ease-in-out infinite;
}

@keyframes mapProgressSlide {
    0% { transform: translateX(-120%); }
    100% { transform: translateX(420%); }
}

/* Sidebar loading state */
.map-sidebar__list-wrap.is-loading {
    opacity: 0.55;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.map-sidebar__stats-text.is-loading::after {
    content: '';
    display: inline-block;
    width: 10px;
    height: 10px;
    margin-left: 8px;
    border: 2px solid #e8eaef;
    border-top-color: #0d6efd;
    border-radius: 50%;
    vertical-align: -1px;
    animation: mapSpin 0.65s linear infinite;
}

@keyframes mapSpin {
    to { transform: rotate(360deg); }
}

/* Loader (infinite scroll only) */
.map-loader {
    display: none;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
}

.map-loader.is-visible { display: flex; }

.map-loader--inline {
    justify-content: center;
    padding: 12px;
    opacity: 0;
    height: 36px;
    transition: opacity 0.2s ease;
}

.map-loader--inline.is-visible {
    display: flex;
    opacity: 1;
}

.map-loader__spinner {
    display: flex;
    gap: 5px;
    align-items: center;
}

.map-loader__spinner span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, #0d6efd, #d63384);
    animation: mapBounce 1.2s infinite ease-in-out;
}

.map-loader__spinner span:nth-child(2) { animation-delay: 0.15s; }
.map-loader__spinner span:nth-child(3) { animation-delay: 0.3s; }

.map-loader__spinner--sm span {
    width: 6px;
    height: 6px;
}

.map-loader__text {
    font-size: 13px;
    color: #0d6efd;
    font-weight: 500;
}

@keyframes mapBounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* Skeleton */
.skeleton {
    background: linear-gradient(90deg, #f0f0f5 25%, #e8e8f0 50%, #f0f0f5 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
    border-radius: 6px;
}

.skeleton--line { height: 12px; margin-bottom: 8px; }
.skeleton--line.short { width: 60%; }
.skeleton--price { height: 16px; width: 45%; margin-top: 8px; }

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.apt-card--skeleton .apt-card__img {
    background: #f0f0f5;
    animation: shimmer 1.4s infinite;
    background-size: 200% 100%;
}

/* Apartment cards */
.apt-card {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #eef0f4;
    background: #fff;
    transition: box-shadow 0.2s, border-color 0.2s, transform 0.15s;
}

.apt-card:hover {
    box-shadow: 0 6px 20px rgba(13, 110, 253, 0.12);
    border-color: #c5d9f8;
}

.apt-card.is-active {
    border-color: #0d6efd;
    box-shadow: 0 0 0 2px rgba(13, 110, 253, 0.25);
}

.apt-card.is-hover {
    border-color: #0d6efd;
    box-shadow: 0 4px 16px rgba(13, 110, 253, 0.2);
    transform: translateX(2px);
}

.apt-card__trigger {
    display: flex;
    gap: 12px;
    width: 100%;
    padding: 10px;
    border: none;
    background: transparent;
    text-align: left;
    cursor: pointer;
    color: inherit;
    font: inherit;
}

.apt-card__trigger:focus-visible {
    outline: 2px solid #0d6efd;
    outline-offset: -2px;
    border-radius: 12px;
}

.apt-card__link {
    display: flex;
    gap: 12px;
    padding: 10px;
    text-decoration: none;
    color: inherit;
}

.apt-card__img {
    width: 88px;
    height: 72px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
    background: #f0f0f5;
}

.apt-card__body {
    flex: 1;
    min-width: 0;
}

.apt-card__type {
    font-size: 11px;
    font-weight: 600;
    color: #0d6efd;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    margin-bottom: 2px;
}

.apt-card__address {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.35;
    color: #1a1a2e;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.apt-card__price {
    font-size: 13px;
    font-weight: 700;
    color: #d63384;
    margin-top: 6px;
}

.apt-empty {
    text-align: center;
    padding: 32px 16px;
    color: #6b7280;
    font-size: 14px;
    line-height: 1.5;
}

.map-mobile-topbar {
    display: none;
}

.map-sheet-handle {
    display: none;
}

.list-sentinel {
    height: 1px;
}

/* Map markers */
.price-marker-icon { font-family: Inter, Arial, sans-serif; }

.price-marker-icon.is-selected-marker {
    z-index: 10000 !important;
}

.marker-pin {
    background: #d63384;
    color: white;
    font-weight: 700;
    font-size: 11px;
    text-align: center;
    border-radius: 8px;
    padding: 4px 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

.marker-pin.is-highlighted {
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 4px 14px rgba(13, 110, 253, 0.35);
    z-index: 5000 !important;
    outline: 2px solid #fff;
}

.marker-pin.is-selected {
    transform: scale(1.22) translateY(-5px);
    background: #0d6efd !important;
    color: #fff;
    z-index: 10000 !important;
    outline: 3px solid #fff;
    box-shadow: 0 0 0 3px #0d6efd, 0 8px 28px rgba(13, 110, 253, 0.55);
    animation: markerSelectedPulse 1.6s ease-in-out infinite;
}

@keyframes markerSelectedPulse {
    0%, 100% { box-shadow: 0 0 0 3px #0d6efd, 0 8px 24px rgba(13, 110, 253, 0.45); }
    50% { box-shadow: 0 0 0 6px rgba(13, 110, 253, 0.35), 0 10px 32px rgba(13, 110, 253, 0.6); }
}

.marker-selection-ring {
    animation: ringPulse 1.6s ease-in-out infinite;
    pointer-events: none;
}

@keyframes ringPulse {
    0%, 100% { opacity: 0.7; stroke-width: 3; }
    50% { opacity: 1; stroke-width: 4; }
}

.marker-pin::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid #d63384;
}

.popup-content h3 { margin: 0 0 8px; font-size: 14px; }
.popup-content a {
    color: #0d6efd;
    font-size: 13px;
}

/* Bottom preview sheet */
.map-preview {
    position: absolute;
    right: 16px;
    bottom: 16px;
    z-index: 10100;
    width: 270px;
    pointer-events: none;
}

.map-preview.is-map-anchored {
    right: auto;
    bottom: auto;
}

.map-preview[hidden] { display: block; }
.map-preview[hidden]:not(.is-visible) { visibility: hidden; }

.map-preview__backdrop {
    display: none;
}

.map-preview__grab {
    display: none;
}

.map-preview__panel {
    position: relative;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    transform: translateY(calc(100% + 24px));
    opacity: 0;
    transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1), opacity 0.2s ease;
}

.map-preview.is-visible {
    pointer-events: auto;
}

.map-preview.is-visible .map-preview__panel {
    transform: translateY(0);
    opacity: 1;
}

.map-preview__close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: #374151;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.map-preview__link {
    display: block;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.9);
}

.map-preview__img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
    background: #f0f0f5;
}

.map-preview__body {
    padding: 14px 16px 16px;
}

.map-preview__type {
    font-size: 11px;
    font-weight: 600;
    color: #0d6efd;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin-bottom: 4px;
}

.map-preview__address {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    color: #1a1a2e;
    margin-bottom: 8px;
}

.map-preview__price {
    font-size: 16px;
    font-weight: 700;
    color: #d63384;
    margin-bottom: 10px;
}

.map-preview__cta {
    font-size: 13px;
    font-weight: 600;
    color: #0d6efd;
}

/* Map FAB + history panel */
.map-fab {
    position: absolute;
    z-index: 1000;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 12px;
    background: #fff;
    color: #374151;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}

.map-fab:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
}

.map-fab--history {
    right: 16px;
    bottom: 128px;
}

.map-fab__badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    font-size: 10px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    color: #fff;
    background: #0d6efd;
    border-radius: 9px;
}

.map-history {
    position: absolute;
    inset: 0;
    z-index: 1002;
    pointer-events: none;
}

.map-history.is-open {
    pointer-events: auto;
}

.map-history[hidden] { display: block; visibility: hidden; }
.map-history.is-open { visibility: visible; }

.map-history__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.35);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.map-history.is-open .map-history__backdrop {
    opacity: 1;
}

.map-history__panel {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(340px, 92%);
    background: #fff;
    box-shadow: -8px 0 32px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.38s cubic-bezier(0.32, 0.72, 0, 1);
}

.map-history__grab {
    display: none;
}

.map-history.is-open .map-history__panel {
    transform: translateX(0);
}

.map-history__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 16px 12px;
    border-bottom: 1px solid #eef0f4;
}

.map-history__header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
}

.map-history__close {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 10px;
    background: #f5f6fa;
    color: #6b7280;
    cursor: pointer;
}

.map-history__list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 12px;
}

.map-history__item {
    display: flex;
    gap: 10px;
    width: 100%;
    padding: 10px;
    margin-bottom: 6px;
    border: 1px solid #eef0f4;
    border-radius: 12px;
    background: #fff;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
    font: inherit;
    color: inherit;
}

.map-history__item:hover {
    border-color: #c5d9f8;
    box-shadow: 0 4px 12px rgba(13, 110, 253, 0.1);
}

.map-history__item img {
    width: 64px;
    height: 52px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
    background: #f0f0f5;
}

.map-history__item-body {
    flex: 1;
    min-width: 0;
}

.map-history__item-type {
    font-size: 10px;
    font-weight: 600;
    color: #0d6efd;
    text-transform: uppercase;
}

.map-history__item-address {
    font-size: 12px;
    font-weight: 500;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.map-history__item-price {
    font-size: 12px;
    font-weight: 700;
    color: #d63384;
    margin-top: 4px;
}

.map-history__empty {
    text-align: center;
    padding: 32px 16px;
    color: #9ca3af;
    font-size: 13px;
    line-height: 1.5;
}

.map-history__footer {
    padding: 12px 16px 16px;
    border-top: 1px solid #eef0f4;
}

.map-history__clear {
    width: 100%;
    padding: 10px;
    font-size: 13px;
    font-weight: 600;
    color: #6b7280;
    background: #f5f6fa;
    border: 1px solid #e8eaef;
    border-radius: 10px;
    cursor: pointer;
    margin-bottom: 8px;
}

.map-history__hint {
    display: block;
    font-size: 11px;
    color: #9ca3af;
    text-align: center;
}

@media (max-width: 900px) {
    .map-layout {
        --map-panel-height: 44dvh;
        flex-direction: column;
        height: 100vh;
        height: 100dvh;
        overflow: hidden;
    }

    .map-layout__scroll {
        display: block;
        flex: 1;
        min-height: 0;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior-y: contain;
    }

    .map-main {
        flex-shrink: 0;
        height: var(--map-panel-height);
        overflow: hidden;
        transition: height 0.38s cubic-bezier(0.32, 0.72, 0, 1);
    }

    .map-sheet-handle {
        display: none;
        align-items: center;
        justify-content: center;
        gap: 8px;
        width: 100%;
        flex-shrink: 0;
        height: 44px;
        padding: 10px 16px 12px;
        background: #fff;
        border: none;
        border-bottom: 1px solid #eef0f4;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
        cursor: pointer;
        position: sticky;
        top: 0;
        z-index: 1002;
        pointer-events: auto;
        -webkit-tap-highlight-color: transparent;
    }

    .map-layout.is-map-collapsed .map-sheet-handle {
        display: flex;
        box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    }

    .map-layout.is-map-collapsed .map-sheet-handle__pill {
        display: none;
    }

    .map-sheet-handle:active {
        background: #f8faff;
    }

    .map-sidebar {
        flex: none;
        width: 100%;
        min-height: calc(100dvh - 44px);
        display: flex;
        flex-direction: column;
        border-right: none;
        box-shadow: none;
    }

    .map-sidebar__list-wrap {
        flex: none;
        overflow: visible;
        min-height: 0;
        padding: 0 10px 24px;
    }

    #map {
        height: calc(100% - 48px);
    }

    .map-mobile-topbar {
        display: flex;
        align-items: center;
        gap: 10px;
        height: 48px;
        padding: 0 12px;
        background: #fff;
        border-bottom: 1px solid #eef0f4;
        position: relative;
        z-index: 1001;
    }

    .map-mobile-topbar__logo {
        flex-shrink: 0;
    }

    .map-mobile-topbar__filter {
        display: inline-flex;
        align-items: center;
        gap: 6px;
        padding: 8px 14px;
        font-size: 13px;
        font-weight: 600;
        color: #1a1a2e;
        background: #f5f6fa;
        border: 1px solid #e8eaef;
        border-radius: 20px;
        cursor: pointer;
        transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
        -webkit-tap-highlight-color: transparent;
    }

    .map-mobile-topbar__filter:active {
        transform: scale(0.96);
        background: #eef2ff;
        box-shadow: 0 2px 8px rgba(13, 110, 253, 0.15);
    }

    .map-mobile-topbar__stats {
        margin-left: auto;
        font-size: 11px;
        font-weight: 600;
        color: #6b7280;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 40%;
    }

    .map-toolbar--desktop {
        display: none !important;
    }

    .map-sheet-handle__pill {
        position: absolute;
        top: 6px;
        left: 50%;
        transform: translateX(-50%);
        width: 36px;
        height: 4px;
        border-radius: 2px;
        background: #d1d5db;
    }

    .map-sheet-handle__label {
        font-size: 13px;
        font-weight: 600;
        color: #0d6efd;
        margin-top: 4px;
    }

    .map-sheet-handle__chevron {
        margin-top: 4px;
        color: #0d6efd;
        transition: transform 0.35s cubic-bezier(0.32, 0.72, 0, 1);
    }

    .map-layout.is-history-open .map-sidebar {
        flex: 0 0 0 !important;
        max-height: 0 !important;
        width: 100% !important;
        opacity: 0;
        overflow: hidden;
        pointer-events: none;
        transition:
            max-height 0.38s cubic-bezier(0.32, 0.72, 0, 1),
            opacity 0.28s ease;
    }

    .map-layout.is-history-open .map-sheet-handle {
        max-height: 0 !important;
        opacity: 0;
        padding: 0 !important;
        pointer-events: none;
        overflow: hidden;
    }

    /* History bottom sheet on mobile */
    .map-history {
        position: fixed;
        inset: 0;
        z-index: 1500;
    }

    .map-history__panel {
        left: 0;
        right: 0;
        top: auto;
        bottom: 0;
        width: 100%;
        max-height: 88dvh;
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.15);
        transform: translateY(100%);
        padding-bottom: env(safe-area-inset-bottom, 0);
    }

    .map-history.is-open .map-history__panel {
        transform: translateY(0);
    }

    .map-history__grab {
        display: block;
        width: 36px;
        height: 4px;
        border-radius: 2px;
        background: #d1d5db;
        margin: 10px auto 0;
        flex-shrink: 0;
    }

    .map-sidebar__header--desktop {
        display: none;
    }

    .map-sidebar__stats {
        padding: 10px 14px;
        font-size: 12px;
    }

    .map-fab--history {
        bottom: auto;
        top: 58px;
        right: 10px;
    }

    .leaflet-control-zoom.leaflet-bar {
        margin: 0 10px 12px 0 !important;
    }

    /* Preview bottom sheet on mobile */
    .map-preview {
        position: fixed;
        inset: auto 0 0 0;
        top: auto;
        width: 100%;
        z-index: 1400;
        pointer-events: none;
    }

    .map-preview.is-visible {
        pointer-events: auto;
    }

    .map-preview__backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: transparent;
        opacity: 1;
    }

    .map-scroll-spacer {
        flex-shrink: 0;
        width: 100%;
        pointer-events: none;
    }

    .map-layout.is-preview-open .map-main {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        height: var(--map-panel-height);
        z-index: 1300;
        opacity: 1;
        transform: translateY(0);
        box-shadow: 0 4px 24px rgba(0, 0, 0, 0.14);
        transition:
            transform 0.38s cubic-bezier(0.32, 0.72, 0, 1),
            opacity 0.28s ease;
        transition-property: transform, opacity;
    }

    .map-layout.is-preview-opening .map-main {
        transform: translateY(-100%);
        opacity: 0;
    }

    .map-layout.is-preview-closing .map-main {
        transform: translateY(-100%);
        opacity: 0;
    }

    .map-layout.is-preview-open.is-map-collapsed .map-sheet-handle {
        display: none !important;
    }

    .map-layout.is-preview-open .map-preview__backdrop {
        top: var(--map-panel-height);
    }

    .map-layout.is-preview-open .map-sidebar__list-wrap {
        position: relative;
    }

    .map-layout.is-preview-open .map-sidebar__list-wrap::after {
        content: '';
        position: absolute;
        inset: 0;
        background: rgba(15, 23, 42, 0.16);
        pointer-events: none;
        z-index: 2;
    }

    .map-preview__panel {
        position: relative;
        transform: translateY(100%);
        opacity: 1;
        background: #fff;
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.15);
        padding-bottom: env(safe-area-inset-bottom, 0);
        transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
    }

    .map-preview.is-visible .map-preview__panel {
        transform: translateY(0);
    }

    .map-preview__grab {
        display: block;
        width: 36px;
        height: 4px;
        margin: 10px auto 0;
        border-radius: 2px;
        background: #d1d5db;
    }

    .map-preview__close {
        top: 14px;
        right: 14px;
    }

    .map-preview__link {
        display: flex;
        gap: 12px;
        align-items: stretch;
        border-radius: 0;
        box-shadow: none;
        border: none;
        background: transparent;
        padding: 8px 14px 16px;
    }

    .map-preview__img {
        width: 112px;
        height: 88px;
        flex-shrink: 0;
        border-radius: 12px;
    }

    .map-preview__body {
        flex: 1;
        min-width: 0;
        padding: 4px 36px 0 0;
    }

    .map-preview__address {
        font-size: 14px;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .map-preview__price {
        font-size: 15px;
        margin-bottom: 6px;
    }

    .map-preview__cta {
        font-size: 12px;
    }

    /* Filter bottom sheet */
    .map-filter-sheet {
        position: fixed;
        inset: 0;
        z-index: 2000;
        pointer-events: none;
    }

    .map-filter-sheet.is-open {
        pointer-events: auto;
    }

    .map-filter-sheet[aria-hidden="true"] {
        visibility: hidden;
    }

    .map-filter-sheet.is-open {
        visibility: visible;
    }

    .map-filter-sheet__backdrop {
        position: absolute;
        inset: 0;
        background: rgba(15, 23, 42, 0.45);
        opacity: 0;
        transition: opacity 0.32s ease;
    }

    .map-filter-sheet.is-open .map-filter-sheet__backdrop {
        opacity: 1;
    }

    .map-filter-sheet__panel {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 0;
        max-height: 88vh;
        max-height: 88dvh;
        background: #fff;
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.15);
        display: flex;
        flex-direction: column;
        transform: translateY(100%);
        transition: transform 0.38s cubic-bezier(0.32, 0.72, 0, 1);
        padding-bottom: env(safe-area-inset-bottom, 0);
    }

    .map-filter-sheet.is-open .map-filter-sheet__panel {
        transform: translateY(0);
    }

    .map-filter-sheet__grab {
        width: 36px;
        height: 4px;
        border-radius: 2px;
        background: #d1d5db;
        margin: 10px auto 0;
        flex-shrink: 0;
    }

    .map-filter-sheet__header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 12px 16px 8px;
        flex-shrink: 0;
    }

    .map-filter-sheet__header h3 {
        margin: 0;
        font-size: 17px;
        font-weight: 700;
    }

    .map-filter-sheet__close {
        width: 36px;
        height: 36px;
        display: flex;
        align-items: center;
        justify-content: center;
        border: none;
        border-radius: 50%;
        background: #f5f6fa;
        color: #6b7280;
        cursor: pointer;
    }

    .map-filter-sheet__body {
        flex: 1;
        overflow-y: auto;
        padding: 0 16px 8px;
        -webkit-overflow-scrolling: touch;
    }

    .map-filter-acc {
        border-bottom: 1px solid #eef0f4;
    }

    .map-filter-acc summary {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 14px 0;
        font-size: 15px;
        font-weight: 600;
        cursor: pointer;
        list-style: none;
        -webkit-tap-highlight-color: transparent;
    }

    .map-filter-acc summary::-webkit-details-marker { display: none; }

    .map-filter-acc summary::after {
        content: '';
        width: 8px;
        height: 8px;
        border-right: 2px solid #9ca3af;
        border-bottom: 2px solid #9ca3af;
        transform: rotate(45deg);
        transition: transform 0.25s ease;
        flex-shrink: 0;
        margin-left: 12px;
    }

    .map-filter-acc[open] summary::after {
        transform: rotate(-135deg);
    }

    .map-filter-acc summary span {
        color: #0d6efd;
        font-weight: 600;
        font-size: 13px;
    }

    .map-filter-acc__content {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        padding-bottom: 14px;
    }

    .map-filter-acc__content--grid {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
    }

    .map-filter-acc__content--price {
        align-items: center;
    }

    .map-filter-acc__content--price input {
        flex: 1;
        border-radius: 10px;
    }

    .map-filter-opt {
        padding: 10px 14px;
        font-size: 14px;
        font-weight: 500;
        color: #374151;
        background: #f5f6fa;
        border: 1px solid #e8eaef;
        border-radius: 10px;
        cursor: pointer;
        transition: background 0.18s, border-color 0.18s, color 0.18s, transform 0.12s;
        -webkit-tap-highlight-color: transparent;
    }

    .map-filter-opt:active {
        transform: scale(0.96);
    }

    .map-filter-opt.is-active {
        background: #eef4ff;
        border-color: #0d6efd;
        color: #0d6efd;
        font-weight: 600;
    }

    .map-filter-sheet__city-search {
        width: 100%;
        margin-bottom: 8px;
    }

    .map-filter-sheet__city-list {
        display: flex;
        flex-direction: column;
        gap: 4px;
        width: 100%;
        max-height: 180px;
        overflow-y: auto;
    }

    .map-filter-sheet__city-list .map-filter-opt {
        width: 100%;
        text-align: left;
    }

    .map-filter-sheet__row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 14px 0;
        border-bottom: 1px solid #eef0f4;
        font-size: 15px;
        font-weight: 500;
    }

    .map-filter-sheet__toggle {
        cursor: pointer;
    }

    .map-filter-sheet__chips {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
        padding: 14px 0;
    }

    .map-filter-sheet__footer {
        display: flex;
        gap: 10px;
        padding: 12px 16px 16px;
        border-top: 1px solid #eef0f4;
        flex-shrink: 0;
        background: #fff;
    }

    .map-filter-sheet__footer .map-btn {
        flex: 1;
        padding: 14px;
        font-size: 15px;
    }
}

@media (min-width: 901px) {
    .map-mobile-topbar,
    .map-sheet-handle,
    .map-filter-sheet {
        display: none !important;
    }

    .map-layout {
        position: relative;
    }

    .map-sidebar {
        order: -1;
    }

    .map-main {
        order: 0;
    }

    .map-preview {
        position: absolute;
        z-index: 10100;
    }

    .map-preview__panel {
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    }

    .map-preview__link {
        box-shadow: none;
        border: none;
    }

    .map-preview__backdrop,
    .map-preview__grab {
        display: none !important;
    }

    .map-layout.is-preview-open .map-sidebar__list-wrap::after {
        display: none;
    }
}

@media (max-width: 480px) {
    .map-layout {
        --map-panel-height: 40vh;
    }
}
