@font-face {
    font-family: 'Paperlogy';
    src: url('../fonts/Paperlogy-1.000/Paperlogy-1Thin.ttf') format('truetype');
    font-weight: 100;
    font-style: normal;
}

@font-face {
    font-family: 'Paperlogy';
    src: url('../fonts/Paperlogy-1.000/Paperlogy-2ExtraLight.ttf') format('truetype');
    font-weight: 200;
    font-style: normal;
}

@font-face {
    font-family: 'Paperlogy';
    src: url('../fonts/Paperlogy-1.000/Paperlogy-3Light.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
}

@font-face {
    font-family: 'Paperlogy';
    src: url('../fonts/Paperlogy-1.000/Paperlogy-4Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'Paperlogy';
    src: url('../fonts/Paperlogy-1.000/Paperlogy-5Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
}

@font-face {
    font-family: 'Paperlogy';
    src: url('../fonts/Paperlogy-1.000/Paperlogy-6SemiBold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
}

@font-face {
    font-family: 'Paperlogy';
    src: url('../fonts/Paperlogy-1.000/Paperlogy-7Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
}

@font-face {
    font-family: 'Paperlogy';
    src: url('../fonts/Paperlogy-1.000/Paperlogy-8ExtraBold.ttf') format('truetype');
    font-weight: 800;
    font-style: normal;
}

@font-face {
    font-family: 'Paperlogy';
    src: url('../fonts/Paperlogy-1.000/Paperlogy-9Black.ttf') format('truetype');
    font-weight: 900;
    font-style: normal;
}

:root {
    /* Quali Brand Identity */
    --quali-blue: #2f6286;
    --quali-green: #72bf44;
    --quali-dark: #231f20;
    --quali-white: #ffffff;

    /* Apple-style Translucency (Derived from Brand) */
    --glass-blue: rgba(47, 98, 134, 0.1);
    --glass-green: rgba(114, 191, 68, 0.1);
    --glass-dark: rgba(35, 31, 32, 0.85);
    /* For active states */

    /* Semantic Mapping */
    --system-blue: var(--quali-blue);
    --system-green: var(--quali-green);
    --system-black: var(--quali-dark);
    --system-red: #ff3b30;

    --text-primary: var(--quali-dark);
    --text-secondary: #86868b;
    /* Keep Apple's neutral gray for secondary text */

    --bg-body: #fbfbfd;
    --bg-panel: rgba(255, 255, 255, 0.8);
    --bg-input: rgba(47, 98, 134, 0.04);
    /* Subtle tint of brand blue */
    --divider: rgba(35, 31, 32, 0.08);

    /* Layout & Spacing */
    --sidebar-width: 420px;
    --header-height: 52px;
    --radius-s: 8px;
    --radius-m: 12px;
    --radius-l: 18px;
    --radius-pill: 980px;

    /* Effects */
    --shadow-card: 0 4px 24px rgba(35, 31, 32, 0.04);
    --shadow-float: 0 12px 32px rgba(47, 98, 134, 0.12);
    /* Blue-tinted shadow */
    --backdrop-blur: saturate(180%) blur(20px);
    /* Z-Index System */
    --z-map: 1;
    --z-sidebar: 10;
    --z-control: 20;
    --z-header: 1001;
    --z-mobile-selected: 1002;
    --z-modal-overlay: 1050;
    --z-active-pin: 9999;

    /* Semantic Colors */
    --color-gold: #FFD700;
    --color-gold-dark: #B8860B;
    --color-gray-light: #f8f9fa;
    --color-gray-mid: #888;
    --color-kakao-bg: #FEE500;
    --color-kakao-text: #3C1E1E;
}

* {
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
}

/* 폼 요소 폰트 상속 이슈 해결 */
input,
button,
select,
textarea {
    font-family: inherit;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Paperlogy', -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", sans-serif;
    color: var(--text-primary);
    background-color: var(--bg-body);
    height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    letter-spacing: -0.01em;
}

/* 헤더 */
header {
    min-height: var(--header-height);
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: var(--backdrop-blur);
    -webkit-backdrop-filter: var(--backdrop-blur);
    color: var(--quali-dark);
    display: flex;
    flex-direction: column;
    padding: 0 24px;
    flex-shrink: 0;
    z-index: var(--z-header);
    border-bottom: 1px solid var(--divider);
}

.header-top-row {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.brand-title {
    font-size: 1.1rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--quali-dark);
    letter-spacing: -0.03em;
}

.brand-title img {
    height: 24px;
    width: auto;
    object-fit: contain;
}

.brand-title .logo-dark {
    display: none;
}

/* 다크모드 시 로고 전환 */
body.dark-mode .brand-title .logo-light {
    display: none;
}

body.dark-mode .brand-title .logo-dark {
    display: block;
}

/* [신규] 헤더 버튼 스타일 (데스크탑) */
.header-action-buttons {
    display: flex;
    align-items: center;
    /* 버튼들의 수직 베이스라인 일치 */
    gap: 10px;
    margin-left: 24px;
}

.header-action-buttons .btn-kakao-sm,
.header-action-buttons .btn-regist-sm {
    height: 34px;
    padding: 0 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
    box-sizing: border-box;
    white-space: nowrap;
    line-height: normal;
}

.header-action-buttons .btn-kakao-sm {
    background-color: var(--color-kakao-bg);
    color: var(--color-kakao-text);
}

.header-action-buttons .btn-kakao-sm i {
    font-size: 16px;
    color: var(--color-kakao-text);
    display: inline-block;
    margin: 0;
    line-height: inherit;
}

.header-action-buttons .btn-regist-sm {
    background-color: var(--quali-blue);
    color: var(--quali-white);
}

.header-action-buttons .btn-regist-sm i {
    font-size: 14px;
    color: var(--quali-white);
    display: inline-block;
    margin: 0;
    line-height: inherit;
}

.header-action-buttons .btn-kakao-sm:hover,
.header-action-buttons .btn-regist-sm:hover {
    transform: translateY(-1px);
    filter: brightness(0.95);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.brand-title i {
    color: var(--quali-blue);
    font-size: 1.1rem;
    filter: drop-shadow(0 0 8px rgba(47, 98, 134, 0.3));
}

.header-info {
    font-size: 0.85rem;
    color: var(--text-secondary);
    display: none;
    font-weight: 400;
    letter-spacing: -0.01em;
}

@media (min-width: 768px) {
    .header-info {
        display: block;
    }
}

/* 레이아웃 */
.main-container {
    display: flex;
    flex: 1;
    height: calc(100vh - var(--header-height));
    overflow: hidden;
}

.list-panel {
    width: var(--sidebar-width);
    background: var(--bg-panel);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--divider);
    position: relative;
    z-index: var(--z-sidebar);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.02);
}

.map-panel {
    flex: 1;
    background: var(--system-light-gray);
    position: relative;
}

/* 지도 div */
#map {
    width: 100%;
    height: 100%;
    z-index: var(--z-map);
}

/* [커스텀 핀 스타일 (FontAwesome)] */
.custom-pin {
    background: none !important;
    border: none !important;
}

.custom-pin i {
    font-size: 40px;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.4));
    display: block;
    text-align: center;
    -webkit-text-stroke: 1px white;
    transition: transform 0.2s;
}

/* 등급별 별 아이콘 스타일 */
.grade-star-pin i {
    font-size: 40px;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
    display: block;
    text-align: center;
    -webkit-text-stroke: 1px rgba(255, 255, 255, 0.5);
    transition: transform 0.2s;
}

/* S등급: 골드 + 엄청 화려한 광택(Gloss) + Pulse */
.grade-s-star i {
    color: #FFD700;
    /* 하얀 광택 효과를 위한 다중 텍스트 섀도우 */
    text-shadow:
        0 0 5px rgba(255, 215, 0, 0.5),
        -1px -1px 0 rgba(255, 255, 255, 0.9) inset,
        1px 1px 2px rgba(255, 255, 255, 0.8);
    filter: drop-shadow(0 0 15px rgba(255, 215, 0, 0.8)) drop-shadow(0 0 5px rgba(255, 255, 255, 0.5));
    -webkit-text-stroke: 1.2px #B8860B;
    animation: starPulseS 2s infinite alternate;
}

/* A등급: 블루 (가독성 강화를 위해 화이트 테두리 및 광채 추가) */
.grade-a-star i {
    color: var(--quali-blue);
    -webkit-text-stroke: 1.5px white;
    filter: drop-shadow(0 0 8px white) drop-shadow(0 0 3px rgba(0, 0, 0, 0.3));
    animation: starPulseAB 3s infinite alternate;
}

/* B등급: 그린 (가독성 강화를 위해 화이트 테두리 및 광채 추가) */
.grade-b-star i {
    color: var(--quali-green);
    -webkit-text-stroke: 1.5px white;
    filter: drop-shadow(0 0 8px white) drop-shadow(0 0 3px rgba(0, 0, 0, 0.3));
    animation: starPulseAB 3s infinite alternate;
}

@keyframes starPulseS {
    0% {
        transform: scale(1);
        filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.6)) drop-shadow(0 0 5px white);
    }

    100% {
        transform: scale(1.18);
        filter: drop-shadow(0 0 25px rgba(255, 215, 0, 1)) drop-shadow(0 0 10px white);
    }
}

@keyframes starPulseAB {
    0% {
        transform: scale(1);
        opacity: 0.9;
    }

    100% {
        transform: scale(1.05);
        opacity: 1;
    }
}

.premium-pin i {
    font-size: 40px;
    color: var(--color-gold);
    /* Gold */
    filter: drop-shadow(0 0 12px rgba(255, 215, 0, 0.8));
    -webkit-text-stroke: 1px var(--color-gold-dark);
    animation: starPulse 2.5s infinite alternate;
}

@keyframes starPulse {
    0% {
        transform: scale(1);
        filter: drop-shadow(0 0 8px rgba(255, 215, 0, 0.5));
    }

    100% {
        transform: scale(1.15);
        filter: drop-shadow(0 0 16px rgba(255, 215, 0, 1));
    }
}

/* [검색 및 컨트롤 영역] */
.control-area {
    padding: 20px 24px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--divider);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: var(--z-control);
}

/* 1행: 검색창 */
.search-input-row {
    position: relative;
    width: 100%;
}

.search-input-row input {
    width: 100%;
    padding: 0 16px;
    padding-right: 48px;
    border: none;
    border-radius: 12px;
    font-size: 17px;
    background-color: var(--bg-input);
    color: var(--text-primary);
    outline: none;
    transition: all 0.2s;
    height: 48px;
    font-weight: 500;
}

.search-input-row input::placeholder {
    color: var(--text-secondary);
}

.search-input-row input:focus {
    background-color: var(--system-white);
    box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.15);
}

.search-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: var(--system-gray);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: color 0.2s;
}

.search-btn:hover {
    color: var(--system-blue);
}

.btn-clear-search {
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: #ccc;
    width: 24px;
    height: 24px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: color 0.2s;
}

.btn-clear-search:hover {
    color: var(--text-secondary);
}

.btn-clear-search.show {
    display: flex;
}

/* ==============================================
   통합 버튼 디자인 시스템 (control-btn + filter-btn 공통 베이스)
   ============================================== */

/* 지도 제어 버튼 영역 */
.map-controls-row {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
}

.map-controls-row::-webkit-scrollbar {
    display: none;
}

/* 공통 스타일 베이스 - control-btn & filter-btn 둘 다 적용 */
.control-btn,
.filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius-pill);
    cursor: pointer;
    /* 반투명 배경 */
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    /* 선명한 테두리 */
    border: 1.5px solid rgba(0, 0, 0, 0.1);
    /* 서브틀 셸도우 */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.7);
    transition: all 0.25s cubic-bezier(0.25, 0.1, 0.25, 1);
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    user-select: none;
    text-decoration: none;
}

.control-btn:hover,
.filter-btn:hover {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(0, 0, 0, 0.15);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

/* 아이콘 기본 색 */
.control-btn i,
.filter-btn i {
    color: var(--text-secondary);
    transition: color 0.2s;
    font-size: 0.88rem;
}

/* === 콘트롤 버튼 활성화 상태 === */

/* 핀 묶어보기 - 브랜드 다크 */
.control-btn#btnCluster.active {
    background: var(--quali-dark);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 12px rgba(35, 31, 32, 0.3);
}

.control-btn#btnCluster.active i {
    color: #fff;
}

/* 내 위치 - 브랜드 블루 */
.control-btn#btnMyLocation.active {
    background: var(--quali-blue);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 12px rgba(47, 98, 134, 0.35);
}

.control-btn#btnMyLocation.active i {
    color: #fff;
}

/* 다크모드 - 진한 네이비 */
.control-btn#btnDarkMode.active {
    background: #1a1a2e;
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 12px rgba(26, 26, 46, 0.4);
}

.control-btn#btnDarkMode.active i {
    color: #f0c040;
}

/* 2행: 필터 버튼들 */
.filter-buttons-row {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scrollbar-width: none;
}

.filter-buttons-row::-webkit-scrollbar {
    display: none;
}

/* filter-btn - control-btn의 공통 베이스를 활용하므로 별도 기본 선언 불필요 (filter-btn 독자 추가 속성만) */
.filter-btn input {
    display: none;
}

/* === 필터 버튼 활성화 상태 === */

/* S등급 - 골드 */
.filter-btn.premium-filter.active {
    background: linear-gradient(135deg, var(--color-gold), #FFB800);
    border-color: rgba(184, 134, 11, 0.4);
    color: #000;
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.4);
}

.filter-btn.premium-filter.active i {
    color: #000;
}

/* A등급 - 브랜드 블루 */
.filter-btn.a-grade-filter.active {
    background: var(--quali-blue);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 12px rgba(47, 98, 134, 0.4);
}

.filter-btn.a-grade-filter.active i {
    color: #fff;
}

/* B등급 - 브랜드 그린 */
.filter-btn.b-grade-filter.active {
    background: var(--quali-green);
    border-color: transparent;
    color: #1a1a1a;
    box-shadow: 0 4px 12px rgba(114, 191, 68, 0.4);
}

.filter-btn.b-grade-filter.active i {
    color: #1a1a1a;
}

/* 원케어 - 브랜드 블루 */
.filter-btn.onecare-filter.active {
    background: var(--quali-blue);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 4px 12px rgba(47, 98, 134, 0.35);
}

.filter-btn.onecare-filter.active i {
    color: #fff;
}

/* 시승 - 브랜드 그린 */
.filter-btn.testride-filter.active {
    background: var(--quali-green);
    border-color: transparent;
    color: #1a1a1a;
    box-shadow: 0 4px 12px rgba(114, 191, 68, 0.35);
}

.filter-btn.testride-filter.active i {
    color: #1a1a1a;
}


/* [선택된 매장 표시줄 - 전역/데스크탑 기본] */
.selected-info-bar {
    background-color: var(--color-gray-light);
    color: var(--quali-blue);
    padding: 12px 16px;
    border-radius: var(--radius-m);
    font-size: 0.95rem;
    display: none;
    align-items: center;
    justify-content: space-between;
    border: 1px solid var(--divider);
    animation: fadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 10px;
    box-shadow: var(--shadow-card);
}

.selected-info-bar strong {
    margin-left: 5px;
    font-weight: 700;
}

.selected-info-bar i.fa-check-circle {
    margin-right: 8px;
    color: var(--quali-green);
}

.btn-clear-select {
    background: rgba(0, 0, 0, 0.05);
    border: none;
    cursor: pointer;
    color: #999;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.btn-clear-select:hover {
    background: rgba(255, 59, 48, 0.1);
    color: var(--system-red);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 모바일 전용 플로팅 바 디자인 (하단 고정) */
@media (max-width: 900px) {
    .selected-info-bar {
        position: fixed;
        bottom: 30px;
        left: 20px;
        right: 20px;
        z-index: var(--z-mobile-selected);
        /* 지도 컨트롤보다 위에 */
        margin-bottom: 0;
        padding: 16px 20px;
        background: var(--quali-dark);
        color: white;
        border-radius: 20px;
        border: none;
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
        display: none;
        /* JS로 제어 */
        animation: slideUp 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .selected-info-bar i.fa-check-circle {
        color: var(--quali-green);
    }

    .selected-info-bar strong {
        color: var(--quali-green);
    }

    .btn-clear-select {
        background: rgba(255, 255, 255, 0.1);
        color: white;
    }

    /* 하단 이동 버튼 위치 조정 (바와 겹치지 않게) */
    .btn-top.show {
        bottom: 100px;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(100%) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}


/* 3행: 탭 영역 마스크 추가 */
.tabs-container {
    display: flex;
    align-items: center;
    position: relative;
    width: 100%;
    margin-top: 4px;
    padding-bottom: 4px;
}

.tabs-container::before,
.tabs-container::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 32px;
    pointer-events: none;
    z-index: 5;
}

.tabs-container::before {
    left: 24px;
    /* scroll-btn width */
    background: linear-gradient(to right, var(--bg-body, #fff), transparent);
}

.tabs-container::after {
    right: 24px;
    background: linear-gradient(to left, var(--bg-body, #fff), transparent);
}

.scroll-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    /* Above mask */
    flex-shrink: 0;
    transition: all 0.2s;
}

.scroll-btn:hover {
    color: var(--system-blue);
    background: rgba(0, 0, 0, 0.05);
}

.category-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 4px 10px;
    margin: 0 5px;
    flex: 1;
    scroll-behavior: smooth;
    -ms-overflow-style: none;
    scrollbar-width: none;
    align-items: center;
    padding-left: 16px;
    /* Space for mask */
    padding-right: 16px;
}

.category-tabs::-webkit-scrollbar {
    display: none;
}

.tab-btn {
    padding: 8px 16px;
    font-size: 15px;
    cursor: pointer;
    white-space: nowrap;
    background: transparent;
    color: var(--text-secondary);
    border-radius: 20px;
    transition: all 0.3s ease;
    flex-shrink: 0;
    position: relative;
    z-index: 1;
    font-weight: 500;
}

.tab-btn:hover {
    color: var(--quali-blue);
    background: var(--glass-blue);
}

.tab-btn.active {
    color: white;
    font-weight: 600;
    background-color: var(--quali-blue);
    box-shadow: 0 4px 16px rgba(47, 98, 134, 0.3);
    /* Soft blue shadow */
}

/* 리스트 아이템 */
.list-content {
    flex: 1;
    overflow-y: auto;
    background: var(--bg-panel);
    padding: 20px 24px;
}

.list-content::-webkit-scrollbar {
    width: 8px;
}

.list-content::-webkit-scrollbar-thumb {
    background: #d2d2d7;
    border-radius: 4px;
    border: 2px solid transparent;
    background-clip: content-box;
}

.store-card {
    background: white;
    border-radius: 18px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: var(--shadow-card);
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.store-card:hover {
    transform: scale(1.01);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.06);
    border-color: rgba(0, 0, 0, 0.08);
}

.store-card.active-card {
    transform: scale(1.02);
    box-shadow: 0 0 0 2px var(--system-blue), 0 12px 32px var(--glass-blue);
    border-color: transparent;
    background-color: #f8fbff;
}

.store-card::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background-color: var(--system-blue);
    transition: width 0.2s;
}

.store-card.active-card::before {
    width: 6px;
    box-shadow: 2px 0 8px rgba(47, 98, 134, 0.4);
}

.store-card.premium-card {
    background: linear-gradient(135deg, white, #fdfbf7);
    border: 1px solid rgba(255, 215, 0, 0.3);
}

.store-card.premium-card::before {
    background-color: #FFD700;
    width: 0;
}

.store-card.premium-card:hover::before {
    width: 6px;
}

.store-card.premium-card.active-card {
    box-shadow: 0 0 0 2px #FFD700, 0 12px 32px rgba(255, 215, 0, 0.15);
    background-color: #fffefa;
}

.store-card.premium-card.active-card::before {
    width: 6px;
    box-shadow: 2px 0 8px rgba(255, 215, 0, 0.5);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.store-name {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.04em;
    line-height: 1.2;
}

/* 지점명(D열) 스타일 */
.store-branch {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 14px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.card-body {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.info-row {
    display: flex;
    align-items: flex-start;
    margin-bottom: 8px;
}

.info-row i {
    width: 24px;
    color: var(--system-blue);
    margin-top: 3px;
    font-size: 14px;
}

/* 전화번호 링크 스타일 */
.phone-link {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.phone-link:hover {
    color: var(--system-blue);
    text-decoration: underline;
}

.badge-group {
    display: flex;
    gap: 8px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.badge.test-ride {
    background-color: rgba(52, 199, 89, 0.1);
    color: var(--system-green);
    border: none;
}

.badge.one-care {
    background-color: rgba(0, 113, 227, 0.1);
    color: var(--system-blue);
    border: none;
}

.badge i {
    margin-right: 4px;
}

.closed-day {
    display: inline-block;
    font-size: 13px;
    color: var(--system-red);
    margin-top: 6px;
    background: rgba(255, 59, 48, 0.05);
    padding: 4px 8px;
    border-radius: 6px;
    vertical-align: middle;
    font-weight: 500;
}

/* Leaflet Popup Customization */
.leaflet-popup-content-wrapper {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(16px);
    border-radius: 18px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    padding: 0;
    border: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
}

.leaflet-popup-content {
    margin: 0 !important;
    width: 280px !important;
}

/* 모바일 지도 내 팝업 크기 조정 및 버그 수정 */
@media (max-width: 900px) {
    .leaflet-popup-content {
        width: 200px !important;
        /* 다시 축소하여 콤팩트하게 */
        max-height: 280px;
        overflow: hidden !important;
        /* 스크롤바 제거 */
    }

    /* 모바일에서 좁을 경우 정보 숨김 */
    .popup-mobile-hide {
        display: none !important;
    }

    /* 모바일 팝업 내 버튼 및 폰트 크기 축소 */
    .map-popup-title {
        font-size: 15px !important;
    }

    .map-popup-branch {
        font-size: 12px !important;
    }

    .map-popup-btn,
    .btn-map-link {
        padding: 6px 10px !important;
        /* 다시 축소 */
        font-size: 12px !important;
        min-height: auto !important;
        margin-top: 2px !important;
    }

    .map-popup-inner {
        padding: 10px 15px !important;
        /* 패딩 축소 */
        gap: 4px !important;
        /* 간격 축소 */
    }

    .leaflet-popup-inner {
        padding: 8px;
        /* 패딩 더 축소 */
    }

    .map-popup-header {
        margin-bottom: 4px;
        padding-bottom: 6px;
    }

    .map-popup-body {
        margin-bottom: 6px;
    }

    .map-popup-title {
        font-size: 14px;
        /* 폰트 크기 축소 */
    }

    .map-popup-branch {
        font-size: 12px;
    }

    .map-popup-row {
        font-size: 12px;
        margin-bottom: 3px;
    }

    .map-popup-buttons {
        gap: 4px;
    }

    /* 모바일 화면에서는 지도 진입 팝업 자체가 안 뜨므로 해당 스타일 필요 없음 */
    /* 모바일 바텀시트 내 버튼만 멋지게 키워주기 */
    .mobile-modal-container .map-popup-btn,
    .mobile-modal-container .btn-map-link {
        padding: 12px 0 !important;
        font-size: 15px !important;
        min-height: 48px !important;
        margin-top: 4px !important;
    }
}



.leaflet-popup-tip {
    background: rgba(255, 255, 255, 0.95);
}

/* 지도 중앙 팝업 - 꼬리 없는 클린 스타일 */
.center-map-popup .leaflet-popup-tip-container {
    display: none;
}

.center-map-popup .leaflet-popup-content-wrapper {
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18);
    border-radius: 18px;
}

body.dark-mode .center-map-popup .leaflet-popup-content-wrapper {
    background: rgba(30, 30, 30, 0.97);
}

/* [신규] 모바일 커스텀 모달 스타일 */
.mobile-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
    display: none;
    align-items: flex-end;
    /* 하단에서 올라오는 느낌 */
    justify-content: center;
}

.mobile-modal-container {
    width: 100%;
    max-width: 500px;
    background: var(--bg-body);
    border-radius: 24px 24px 0 0;
    padding: 20px;
    position: relative;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.2);
    transform: translateY(100%);
    transition: transform 0.3s ease-out;
    max-height: 90vh;
    overflow-y: auto;
    overflow-x: hidden;
    /* 가로 스크롤 방지 */
}

/* 모바일 모달 내 미니 지도 */
#mobileMiniMap {
    width: 100%;
    height: 180px;
    border-radius: 12px;
    margin-bottom: 8px;
    background: #ccc;
    z-index: 1;
}

/* 다크모드: 모바일 바텀시트 전체 스타일 */
body.dark-mode .mobile-modal-overlay {
    background: rgba(0, 0, 0, 0.75);
}

body.dark-mode .mobile-modal-container {
    background: #1e1e1e;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.5);
}

body.dark-mode .mobile-modal-container .map-popup-title {
    color: #e0e0e0;
}

body.dark-mode .mobile-modal-container .map-popup-branch {
    color: #aaa;
}

body.dark-mode .mobile-modal-container .map-popup-row {
    color: #c0c0c0;
}

body.dark-mode .btn-close-modal {
    background: #333;
    color: #aaa;
}

body.dark-mode .mobile-modal-container .map-popup-btn {
    background: #333;
    color: #e0e0e0;
    border-color: #555;
}

body.dark-mode .mobile-modal-container .map-popup-btn:hover {
    background: #444;
}



.mobile-modal-overlay.show {
    display: flex;
}

.mobile-modal-overlay.show .mobile-modal-container {
    transform: translateY(0);
}

.btn-close-modal {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-input);
    border: none;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
}

.leaflet-container a.leaflet-popup-close-button {
    color: var(--system-gray);
    top: 8px;
    right: 8px;
    font-size: 18px;
    padding: 4px;
    width: 24px;
    height: 24px;
    background: rgba(0, 0, 0, 0.05);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.leaflet-container a.leaflet-popup-close-button:hover {
    color: var(--system-black);
    background: rgba(0, 0, 0, 0.1);
}

/* Custom Popup Content */
.map-popup-inner {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    text-align: center;
    /* 중앙 정렬로 통일 */
    overflow: hidden !important;
    /* 내부 스크롤 방지 */
}

.map-popup-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.map-popup-phone {
    font-size: 14px;
    color: var(--text-secondary);
    margin: 0;
    font-weight: 500;
}

.map-popup-phone-link {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.map-popup-phone-link:hover {
    color: var(--quali-blue);
    text-decoration: underline;
}

/* [신규] 팝업 상세 스타일 */
.map-popup-inner {
    text-align: center;
    /* 중앙 정렬로 변경 */
    min-width: 200px;
}

.map-popup-header {
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
    margin-bottom: 10px;
}

.map-popup-title {
    font-size: 16px;
    font-weight: bold;
    margin: 0;
    color: #333;
    line-height: 1.3;
}

.map-popup-branch {
    font-size: 13px;
    color: #666;
    margin-top: 4px;
}

.map-popup-body {
    margin-bottom: 12px;
}

.map-popup-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    color: #555;
    margin-bottom: 5px;
    line-height: 1.4;
}

.map-popup-row i {
    width: 16px;
    text-align: center;
    color: #888;
    margin-top: 2px;
}

.map-popup-buttons {
    display: flex;
    flex-direction: row;
    /* 가로 배열로 변경 */
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
    flex-wrap: wrap;
    /* 공간 부족 시 줄바꿈 */
}

.map-popup-row a {
    color: inherit;
    text-decoration: none;
}

.map-popup-row a:hover {
    text-decoration: underline;
    color: #2f6286;
}

/* 네이버 지도로 보기 (Secondary) - 데스크탑 팝업 전용 슬림 버튼 */
.map-popup-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    width: auto;
    /* 너비 자동 */
    min-width: 110px;
    background: rgba(0, 0, 0, 0.04);
    color: var(--quali-blue);
    text-decoration: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s;
    border: 1px solid rgba(0, 0, 0, 0.07);
    min-height: 34px;
    letter-spacing: -0.2px;
}

.map-popup-btn:hover {
    background: rgba(47, 98, 134, 0.06);
    border-color: rgba(47, 98, 134, 0.2);
    color: var(--quali-blue);
}

/* S등급 프리미엄 전용 팝업 헤더 스타일 (light mode) */
.premium-popup-header {
    background: linear-gradient(135deg, #fffef9, #fff7d6);
    padding: 16px;
    border-radius: 12px;
    border: 1px solid rgba(255, 215, 0, 0.4);
    margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.15);
}

.premium-popup-title {
    color: #B8860B;
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.4px;
}

/* 등급별 뱃지 스타일 */
.premium-badge.badge-s {
    background: linear-gradient(135deg, #FFD700, #FFB800);
    color: #000;
    border: 1px solid rgba(255, 215, 0, 0.5);
}

.premium-badge.badge-a {
    background: linear-gradient(135deg, #2f6286, #1a4a6d);
    color: #fff;
    border: 1px solid rgba(47, 98, 134, 0.3);
}

.premium-badge.badge-b {
    background: linear-gradient(135deg, #72bf44, #5a9e36);
    color: #fff;
    border: 1px solid rgba(114, 191, 68, 0.3);
}

/* S등급 뱃지 공통 스타일 (light mode) */
.premium-badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    margin-bottom: 8px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 700;
    letter-spacing: -0.01em;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* 길찾기 버튼 (Primary) - 네이버 그린 */
.btn-map-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    width: auto;
    /* 너비 자동 */
    min-width: 110px;
    background: #03C75A;
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(3, 199, 90, 0.25);
    cursor: pointer;
    min-height: 34px;
    gap: 6px;
    letter-spacing: -0.2px;
}

.btn-map-link:hover {
    background: #02b351;
    box-shadow: 0 4px 8px rgba(3, 199, 90, 0.3);
    transform: translateY(-1px);
}

/* 프리미엄 팝업 전용 타이틀 조절 (줄바꿈 방지) */
.premium-popup-title {
    font-size: 20px !important;
    word-break: keep-all;
    letter-spacing: -0.02em;
}

/* 다크모드 대응: S등급 프리미엄 헤더 */
body.dark-mode .premium-popup-header {
    background: linear-gradient(135deg, #2a2a20, #332e18);
    border-color: rgba(255, 215, 0, 0.35);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

body.dark-mode .premium-popup-title {
    color: #FFD166;
}

body.dark-mode .premium-badge {
    background: rgba(255, 215, 0, 0.2);
    color: #FFD166;
    border: 1px solid rgba(255, 215, 0, 0.4);
}

/* 다크모드 대응 */
body.dark-mode .map-popup-title {
    color: #e0e0e0;
}

body.dark-mode .map-popup-branch {
    color: #aaa;
}

body.dark-mode .map-popup-row {
    color: #ccc;
}

body.dark-mode .map-popup-row a {
    color: #ccc;
}

body.dark-mode .map-popup-header {
    border-bottom-color: #444;
}

.message-box {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
    font-size: 15px;
}

.btn-top {
    position: absolute;
    bottom: 24px;
    right: 24px;
    width: 52px;
    height: 52px;
    background: var(--system-black);
    color: white;
    border-radius: 50%;
    border: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s, opacity 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.btn-top.show {
    opacity: 1;
    pointer-events: auto;
}

.btn-top:hover {
    transform: translateY(-4px);
}

/* [신규] 시승 안내 문구 스타일 */
.test-ride-guide {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px dashed var(--divider);
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
    font-weight: 500;
}

.test-ride-guide i {
    color: var(--quali-blue);
    font-size: 14px;
}

/* [신규] 카카오톡 & 제품등록센터 버튼 스타일 */
.btn-kakao,
.btn-regist {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.2s;
    flex: 1;
    min-width: 140px;
}

.btn-kakao {
    background-color: #FEE500;
    color: #191919;
}

.btn-kakao:hover {
    background-color: #fada0a;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(254, 229, 0, 0.3);
}

.btn-regist {
    background-color: var(--quali-blue);
    color: white;
}

.btn-regist:hover {
    background-color: #3b78a3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(47, 98, 134, 0.3);
}

/* 사이드바 전용 고정 버튼 컨테이너 */
.sidebar-action-buttons {
    display: flex;
    gap: 10px;
    margin-top: 4px;
}

/* 모바일 바텀시트에서의 버튼 크기 조정 */
@media (max-width: 900px) {
    .sidebar-action-buttons {
        margin-top: 10px;
    }

    .btn-kakao,
    .btn-regist {
        height: 48px;
        border-radius: 12px;
    }
}

/* [신규] 모바일 플로팅 액션 버튼 (FAB) */
.mobile-fab-container {
    position: fixed;
    bottom: 160px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 2100;
}

.fab-btn {
    width: auto;
    height: 48px;
    padding: 0 20px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 800;
    color: white;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    text-decoration: none;
    transition: all 0.2s ease-in-out;
    letter-spacing: -0.02em;
}

.fab-btn.kakao {
    background-color: #FEE500 !important;
    color: #3C1E1E !important;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

/* [신규] 모달 오픈 시 플로팅 버튼 숨김 */
body.modal-open .mobile-fab-container {
    display: none !important;
}

.fab-btn.regist {
    background-color: var(--quali-blue);
}

.fab-btn:active {
    transform: scale(0.95);
    filter: brightness(0.9);
}

/* [신규] FAB 전용 애니메이션 제거됨 (정적 디자인 유지) */


/* 유틸리티: 기기별 노출 */
.desktop-only {
    display: flex !important;
}

.mobile-only {
    display: none !important;
}

@media (max-width: 900px) {
    .desktop-only {
        display: none !important;
    }

    .mobile-only {
        display: flex !important;
    }
}

@media (max-width: 900px) {
    body {
        display: block;
        height: auto;
        overflow-y: auto;
    }

    .main-container {
        flex-direction: column-reverse;
        height: auto;
    }

    .map-panel {
        height: 300px;
        flex: none;
        position: relative;
        top: 0;
        z-index: 5;
    }

    .list-panel {
        width: 100%;
        height: auto;
        flex: none;
        border-right: none;
    }

    .list-content {
        max-height: none;
        overflow: visible;
        padding: 16px;
    }

    header {
        position: sticky;
        top: 0;
        z-index: 1100;
        /* 컨트롤 영역보다 높게 */
        padding: 12px;
        padding-bottom: 16px;
        /* 하단 여백 추가 */
    }

    .mobile-only-header-controls .control-area {
        padding: 0;
        background: transparent;
        backdrop-filter: none;
        border-bottom: none;
        gap: 10px;
        position: static;
    }

    .mobile-only-header-controls {
        display: block;
        margin-top: 8px;
    }

    /* 모바일 헤더 내 검색창 스타일 */
    .mobile-only-header-controls .search-input-row {
        margin-bottom: 0;
    }

    /* 모바일 헤더 내 지도 제어 버튼 */
    .mobile-only-header-controls .map-controls-row {
        padding: 0;
        background: transparent;
        border-bottom: none;
        margin-top: 0;
    }

    /* 모바일 헤더 내 필터 버튼 */
    .mobile-only-header-controls .filter-buttons-row {
        padding-bottom: 0;
    }

    /* 모바일 헤더 내 탭 */
    .mobile-only-header-controls .tabs-container {
        margin-top: 0;
        padding-bottom: 0;
    }

    /* 다크모드 헤더 대응 */
    body.dark-mode header {
        background-color: rgba(30, 30, 30, 0.95);
    }

    /* 모바일에서 body 스크롤 시 헤더 고정 보장 */
    body {
        display: block;
        height: auto;
        overflow-y: auto;
    }

    .btn-top {
        position: fixed;
        bottom: 24px;
        right: 24px;
        z-index: 999;
    }
}

/* [신규] 내 위치 마커 (레이더 효과) */
.my-location-marker {
    background: transparent;
    border: none;
    overflow: visible;
}

.my-location-icon-wrapper {
    position: relative;
    width: 90px;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.my-location-icon-wrapper i {
    font-size: 60px;
    color: var(--system-blue);
    z-index: 3;
    position: relative;
    /* 흰색 발광 효과 추가 (Drop-shadow) */
    filter: drop-shadow(0 0 15px rgba(255, 255, 255, 1)) drop-shadow(0 0 5px rgba(0, 122, 255, 0.5));
    text-shadow: 0 0 10px rgba(255,255,255,0.9);
}

.my-location-pulse {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    background: rgba(0, 122, 255, 0.2);
    border-radius: 50%;
    z-index: 1;
}

.my-location-pulse::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    background: rgba(0, 122, 255, 0.4);
    border-radius: 50%;
    animation: radar-wave 2.5s infinite ease-out;
}

@keyframes radar-wave {
    0% {
        width: 20px;
        height: 20px;
        opacity: 1;
        background: rgba(0, 122, 255, 0.6);
        box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.8);
    }

    50% {
        opacity: 0.5;
        background: rgba(0, 122, 255, 0.3);
    }

    100% {
        width: 120px;
        height: 120px;
        opacity: 0;
        background: rgba(0, 122, 255, 0);
        box-shadow: 0 0 20px 10px rgba(255, 255, 255, 0);
    }
}

/* [원복] 프리미엄 핀 스타일: 별 모양만 강조 */
.premium-star-only i {
    color: #FFD700;
    /* 금색 */
    font-size: 38px;
    filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.6));
    animation: premium-star-pulse 2s infinite ease-in-out;
}

@keyframes premium-star-pulse {
    0% {
        transform: scale(1);
        filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.6));
    }

    50% {
        transform: scale(1.1);
        filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.8));
    }

    100% {
        transform: scale(1);
        filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.6));
    }
}

/* [신규] 선택된 핀 스타일 (더 세련된 강조) */
.custom-pin.active-pin i,
.custom-pin.active-pin img {
    color: #ff3b30 !important;
    /* 강제 빨간색 (아이콘용) */
    transform: scale(1.15) translateY(-5px);
    /* 적당히 커지고 살짝 위로 */
    filter: drop-shadow(0 4px 12px rgba(255, 59, 48, 0.6)) !important;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    z-index: 9999;
}

/* [신규] 팝업 꼬리(Tail) 강화 - 시각적 연결 */
.leaflet-popup-tip {
    width: 16px;
    height: 16px;
    padding: 0;
    margin: -8px auto 0;
    /* 위로 더 올림 */
    pointer-events: auto;
    background: white;
    box-shadow: 0 3px 14px rgba(0, 0, 0, 0.4);
    transform: rotate(45deg);
    /* 마름모꼴 유지 */
}

/* [신규] 내 위치 팝업 커스텀 (텍스트 맞춤, X버튼 수정) */
.custom-location-popup .leaflet-popup-content-wrapper {
    background: rgba(47, 98, 134, 0.9);
    /* 말풍선 배경색 변경 (구분됨) */
    color: white;
    padding: 0;
    border-radius: 4px;
    text-align: center;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
}

.custom-location-popup .leaflet-popup-content {
    margin: 6px 10px;
    /* 여백 축소 */
    line-height: 1.4;
    min-width: max-content !important;
    font-size: 13px;
    font-weight: bold;
}

.custom-location-popup .leaflet-popup-tip {
    background: rgba(47, 98, 134, 0.9);
}

/* 내 위치 팝업 X 버튼 숨기기 (요청사항) */
.custom-location-popup .leaflet-popup-close-button {
    display: none;
}

/* [다크 모드] */
body.dark-mode {
    --bg-body: #121212;
    --bg-panel: #1e1e1e;
    --text-primary: #e0e0e0;
    --text-secondary: #aaaaaa;
    --bg-input: #333333;
    --divider: #444444;
    --system-white: #2c2c2c;
    --bg-popup: rgba(30, 30, 30, 0.95);
    background-color: var(--bg-body);
    color: var(--text-primary);
}

body.dark-mode header {
    background-color: rgba(30, 30, 30, 0.85);
    color: #e0e0e0;
    border-bottom: 1px solid var(--divider);
}

body.dark-mode .brand-title {
    color: #e0e0e0;
}

body.dark-mode .control-area {
    background: rgba(30, 30, 30, 0.85);
}

body.dark-mode .list-panel {
    background: var(--bg-panel);
    border-right: 1px solid var(--divider);
}

body.dark-mode .list-content {
    background: var(--bg-panel);
}

body.dark-mode .store-card {
    background: #2c2c2c;
    border: 1px solid #444;
    box-shadow: none;
}

body.dark-mode .store-card:hover,
body.dark-mode .store-card.active-card {
    background: #3a3a3a;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

body.dark-mode .store-card.premium-card {
    background: linear-gradient(135deg, #2c2c2c, #3a3a3a);
    border: 1px solid rgba(255, 215, 0, 0.3);
}

body.dark-mode .store-name {
    color: #fff;
}

body.dark-mode .search-input-row input {
    color: #fff;
    background-color: #333;
}

body.dark-mode .search-input-row input:focus {
    background-color: #444;
}

body.dark-mode .filter-btn {
    background: #333;
    color: #e0e0e0;
}

body.dark-mode .filter-btn:hover {
    background: #444;
}

/* 다크모드 필터 버튼 활성화 상태 (다크모드에서도 브랜드켇러 유지) */
body.dark-mode .filter-btn.onecare-filter.active {
    background: var(--quali-blue);
    color: white;
    border-color: transparent;
}

body.dark-mode .filter-btn.onecare-filter.active i {
    color: white;
}

body.dark-mode .filter-btn.testride-filter.active {
    background: #4dbf2a;
    color: #111;
    border-color: transparent;
}

body.dark-mode .filter-btn.testride-filter.active i {
    color: #111;
}

/* 다크모드 하이퍼링크 색상 최적화 */
body.dark-mode a:not(.control-btn):not(.tab-btn):not(.btn-kakao-sm):not(.btn-regist-sm):not(.fab-btn),
body.dark-mode .phone-link,
body.dark-mode .map-popup-row a {
    color: #85e05d;
    /* 브랜드 그린 계열로 변경하여 눈의 피로도 감소 */
}

body.dark-mode a:hover {
    color: #a2f07d;
    text-decoration: underline;
}

body.dark-mode .leaflet-popup-content-wrapper,
body.dark-mode .leaflet-popup-tip {
    background: rgba(30, 30, 30, 0.95);
    color: #e0e0e0;
}

body.dark-mode .map-popup-title {
    color: #fff;
}

body.dark-mode .map-popup-phone {
    color: #aaa;
}

/* 다크 모드 토글 버튼 */
.dark-mode-toggle {
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background 0.3s;
    margin-right: 16px;
}

.dark-mode-toggle:hover {
    background: rgba(0, 0, 0, 0.1);
}

body.dark-mode .dark-mode-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* 다크모드: 통합 버튼 시스템 (control-btn + filter-btn) */
body.dark-mode .control-btn,
body.dark-mode .filter-btn {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.15);
    color: #e0e0e0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

body.dark-mode .control-btn:hover,
body.dark-mode .filter-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

body.dark-mode .control-btn i,
body.dark-mode .filter-btn i {
    color: rgba(255, 255, 255, 0.5);
}

/* 다크모드 활성화 상태는 라이트모드와 동일하게 브랜드컬러 유지 */

/* 마커 클러스터 커스텀 스타일 */
.marker-cluster-custom {
    background-color: rgba(47, 98, 134, 0.6);
    border-radius: 50%;
}

.marker-cluster-custom div {
    background-color: rgba(47, 98, 134, 0.9);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    margin: 5px;
}

/* 애니메이션 마커 (Pulse) */
.marker-pulse {
    animation: pulse-animation 1.5s infinite;
}

@keyframes pulse-animation {
    0% {
        transform: scale(1);
        filter: drop-shadow(0 0 0 rgba(255, 69, 58, 0.7));
    }

    50% {
        transform: scale(1.1);
        filter: drop-shadow(0 0 10px rgba(255, 69, 58, 0));
    }

    100% {
        transform: scale(1);
        filter: drop-shadow(0 0 0 rgba(255, 69, 58, 0));
    }
}

/* [신규] 모바일 상세 모달 스타일 */
.mobile-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    align-items: flex-end;
    /* Bottom sheet */
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-modal-overlay.show {
    visibility: visible;
    opacity: 1;
}

.mobile-modal-container {
    background: #fff;
    width: 100%;
    max-height: 90vh;
    border-radius: 28px 28px 0 0;
    /* 더 둥글게 */
    padding: 28px 24px 24px;
    padding-bottom: env(safe-area-inset-bottom, 24px);
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.15);
    transform: translateY(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow-y: auto;
}

/* 상단 핸들바 효과 추가 */
.mobile-modal-container::before {
    content: '';
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 36px;
    height: 4px;
    background: #e5e5ea;
    border-radius: 2px;
}

.mobile-modal-overlay.show .mobile-modal-container {
    transform: translateY(0);
}

.btn-close-modal {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 32px;
    height: 32px;
    border-radius: 16px;
    background: #f2f2f7;
    border: none;
    color: #8e8e93;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: background 0.2s;
}

.btn-close-modal:active {
    background: #e5e5ea;
}

#mobileMiniMap {
    width: 100%;
    height: 180px;
    border-radius: 14px;
    margin-bottom: 20px;
    background: #e5e5ea;
    z-index: 1;
    overflow: hidden;
}

/* Add scrolling support to mobile modal body */
#mobileModalBody {
    margin-top: 10px;
    padding-bottom: 20px;
}

/* Leaflet Tooltip 커스텀 */
.leaflet-tooltip {
    background: rgba(0, 0, 0, 0.75) !important;
    border: none !important;
    border-radius: 6px !important;
    color: white !important;
    font-family: 'Paperlogy', sans-serif !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    padding: 4px 10px !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3) !important;
}

.leaflet-tooltip-top:before {
    border-top-color: rgba(0, 0, 0, 0.75) !important;
}

/* 모바일 모달 내 버튼은 다시 가득 채우기 (터치 편의) */
@media (max-width: 900px) {
    .mobile-modal-container .map-popup-buttons {
        flex-direction: column;
    }

    .mobile-modal-container .map-popup-btn,
    .mobile-modal-container .btn-map-link {
        width: 100%;
        min-height: 48px;
        font-size: 15px;
    }
}