.map-mode-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100vw; height: 100vh;
    background: var(--bg-main);
    z-index: 99999;
    display: none;
    flex-direction: row;
}
.map-mode-sidebar {
    width: 420px;
    height: 100%;
    background: var(--surface-800);
    border-right: 1px solid var(--surface-600);
    display: flex;
    flex-direction: column;
    box-shadow: 4px 0 24px rgba(0,0,0,0.5);
    z-index: 2;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.map-mode-map-container {
    flex: 1;
    height: 100%;
    position: relative;
    z-index: 1;
}
.map-mode-header {
    padding: 20px;
    border-bottom: 1px solid var(--surface-600);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--surface-900);
}
.map-mode-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text-main);
}
.map-mode-close {
    background: rgba(255,255,255,0.1);
    border: none;
    color: white;
    padding: 8px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}
.map-mode-close:hover {
    background: rgba(255,255,255,0.2);
}
.map-mode-filters {
    padding: 12px 20px 8px;
    border-bottom: 1px solid var(--surface-600);
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.28) transparent;
}
.map-mode-filters::-webkit-scrollbar { height: 6px; }
.map-mode-filters::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.28); border-radius: 100px; }
.map-mode-filters::-webkit-scrollbar-track { background: transparent; }
.map-mode-filter-btn {
    padding: 6px 12px;
    border-radius: 100px;
    background: var(--surface-700);
    color: var(--text-muted);
    border: 1px solid var(--surface-600);
    font-size: 13px;
    white-space: nowrap;
    cursor: pointer;
}
.map-mode-filter-btn.active {
    background: var(--accent-500);
    color: white;
    border-color: var(--accent-400);
}
.map-mode-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 20px 12px;
    border-bottom: 1px solid var(--surface-600);
    overflow-x: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.28) transparent;
}
.map-mode-toolbar::-webkit-scrollbar { height: 6px; }
.map-mode-toolbar::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.28); border-radius: 100px; }
.map-mode-toolbar::-webkit-scrollbar-track { background: transparent; }
.mm-seg {
    display: inline-flex;
    gap: 2px;
    padding: 3px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
}
.mm-seg-btn {
    border: 0;
    background: transparent;
    color: var(--surface-400, #94a3b8);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: -0.2px;
    padding: 6px 12px;
    border-radius: 999px;
    white-space: nowrap;
    cursor: pointer;
    transition: color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}
.mm-seg-btn:hover { color: var(--surface-50); }
.mm-seg-btn.active {
    color: #0b1220;
    background: linear-gradient(135deg, var(--accent-400), var(--accent-500));
    box-shadow: 0 2px 10px rgba(var(--rgb-accent-500), 0.35);
}
.map-mode-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.map-compact-card {
    background: var(--surface-700);
    border: 1px solid var(--surface-600);
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
}
.map-compact-card:hover {
    border-color: var(--accent-400);
    background: var(--surface-600);
}
.map-compact-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 4px;
}
.map-compact-price {
    font-size: 18px;
    font-weight: 800;
    color: var(--accent-400);
    margin-bottom: 8px;
}
.map-compact-desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.map-mode-mobile-toggle {
    display: none;
    position: absolute;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--accent-500), var(--accent-400));
    color: var(--primary-900);
    padding: 12px 24px;
    border-radius: 100px;
    font-weight: 700;
    font-size: 15px;
    z-index: 10000;
    border: none;
    box-shadow: 0 8px 24px rgba(var(--rgb-accent-400), 0.3);
    transition: all 0.2s ease;
}
.map-mode-mobile-toggle:active {
    transform: translateX(-50%) scale(0.95);
}

.custom-map-marker {
    transform: translate(-50%, -50%);
    transform-origin: center center;
    background: var(--accent-500);
    color: white;
    padding: 8px 16px;
    border-radius: 100px;
    font-weight: 700;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.4);
    border: 2px solid white;
    cursor: pointer;
    transition: transform 0.2s;
    white-space: nowrap;
}
.custom-map-marker:hover, .custom-map-marker.active {
    transform: translate(-50%, -50%) scale(1.1);
    background: var(--accent-400);
    z-index: 10 !important;
}
.custom-map-marker .marker-count {
    background: white;
    color: var(--accent-500);
    padding: 2px 6px;
    border-radius: 100px;
    font-size: 12px;
    margin-left: 6px;
}


.mobile-floating-map-btn {
    display: flex;
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--accent-500);
    color: #fff;
    border: none;
    padding: 14px 28px;
    border-radius: 100px;
    font-weight: 700;
    font-size: 15px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    z-index: 9990;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    animation: floatPulse 2s ease-in-out infinite;
}

@keyframes floatPulse {
    0%, 100% {
        transform: translateX(-50%) translateY(0);
        box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    }
    50% {
        transform: translateX(-50%) translateY(-4px);
        box-shadow: 0 8px 28px rgba(0,0,0,0.6);
    }
}

.mobile-floating-map-btn:hover {
    transform: translateX(-50%) translateY(-2px) scale(1.05) !important;
    box-shadow: 0 8px 32px rgba(var(--rgb-accent-400),0.5) !important;
    background: var(--accent-600);
}




@media (max-width: 480px) {
    .fab-group { bottom: 16px; right: 12px; gap: 8px; }
    .fab-btn { padding: 10px 14px; }
    .fab-label { font-size: 11px; }
}

@media (min-width: 768px) {
    .mapview-body { flex-direction: row; }
    .mapview-list {
        width: 380px;
        border-right: 1px solid var(--surface-200);
        box-shadow: 4px 0 15px rgba(0,0,0,0.1);
        z-index: 5;
    }
}

@media (max-width: 767px) {
    .mapview-body { flex-direction: column; }
    .mapview-map-container {
        height: 100%;
        position: absolute;
        top: 0; left: 0; right: 0; bottom: 0;
    }
    .mapview-list {
        position: absolute;
        bottom: 0; left: 0; right: 0;
        height: 55vh; /* 기본 바텀시트 높이 */
        border-top-left-radius: 20px;
        border-top-right-radius: 20px;
        box-shadow: 0 -4px 20px rgba(0,0,0,0.3);
        z-index: 5;
        border-right: none;
        border-top: 1px solid var(--surface-200);
        transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
        transform: translateY(calc(100% - 60px)); /* 기본적으로 헤더+핸들만 보이게 내림 */
    }
    .mapview-list.expanded {
        transform: translateY(0);
    }
    .mapview-drag-handle {
        display: block;
        width: 40px;
        height: 4px;
        background: var(--surface-300);
        border-radius: 2px;
        margin: 12px auto;
        cursor: pointer;
    }
    .mapview-list-header {
        padding-top: 4px; /* 핸들이 있으므로 패딩 축소 */
    }
}

@media (max-width: 768px) {
    .map-mode-overlay {
        flex-direction: column;
    }
    .map-mode-sidebar {
        position: absolute;
        bottom: 0; left: 0;
        width: 100%;
        height: 60%;
        border-right: none;
        border-top: 1px solid var(--surface-600);
        transform: translateY(100%);
        border-radius: 20px 20px 0 0;
    }
    .map-mode-sidebar.show-on-mobile {
        transform: translateY(0);
    }
    .map-mode-mobile-toggle {
        display: block;
    }

    .mobile-floating-map-btn {
        display: flex !important;
    }
}
