/* ===== FINDDEALER PAGE STYLES ===== */
/* 全局样式保持不变 */
* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    width: 100%; height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

/*.header {*/
/*    background:#fff;*/
/*    height: 90px;*/
/*    line-height: 90px;*/
/*    text-align: center;*/
/*    align-items: center;*/
/*    display: flex;*/
/*}*/
/* ===== DESKTOP LAYOUT ===== */
.finddealer-page #map {
    position: fixed; inset: 0;
    width: 100%; height: 100%;
    z-index: 1;
}

.finddealer-page .left-panel {
    position: fixed;
    top: 100px; left: 80px; bottom: 50px;
    width: 560px;
    z-index: 100;
    background: #fff;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.14);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.finddealer-page .panel-header {
    padding: 40px 40px 0 40px;
    flex-shrink: 0;
}

.finddealer-page .filter-row {
    display: flex; gap: 12px; align-items: center;
}

/* ===== CUSTOM SELECT (div-based dropdown) ===== */
.finddealer-page .select-wrapper {
    position: relative;
    flex: 0 0 180px;
    border: none !important;
    outline: none !important;
}

.finddealer-page .custom-select {
    position: relative;
    width: 100%;
}

.finddealer-page .select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 17px 35px 15px 20px;
    border: none !important;
    outline: none !important;
    border-radius: 40px;
    font-size: 14px;
    color: #B3BAC4;
    background: #F8F8F8;
    cursor: pointer;
    transition: background 0.2s;
    line-height: 1.4;
}


.finddealer-page .select-trigger .select-value {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.finddealer-page .select-arrow {
    width: 11px;
    height: 6px;
    margin-left: 10px;
    background-image: url('../../icon/de_xl.png');
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    transition: transform 0.2s;
}

.finddealer-page .custom-select.open .select-arrow {
    transform: rotate(180deg);
}

.finddealer-page .select-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    overflow: hidden;
    z-index: 1000;
    list-style: none;
    margin: 0;
    padding: 0;
}

.finddealer-page .custom-select.open .select-dropdown {
    display: block;
}

.finddealer-page .select-dropdown .select-option {
    padding: 10px 20px;
    font-size: 14px;
    color: #26364D;
    cursor: pointer;
    transition: background 0.15s;
}

.finddealer-page .select-dropdown .select-option:hover,
.finddealer-page .select-dropdown .select-option.selected {
    background: #e8eef6;
}

.finddealer-page .select-dropdown .select-option.selected {
    font-weight: 500;
}

.finddealer-page .select-option:hover,
.finddealer-page .select-option.selected {
    background: #e8eef6;
}

.finddealer-page .select-option.selected {
    font-weight: 500;
}

/* Search */
.finddealer-page .search-wrapper { flex: 1; position: relative; display: flex; align-items: center; }

.finddealer-page .search-wrapper input {
    width: 100%;
    padding: 18px 34px 16px 20px;
    border: none;
    border-radius: 40px;
    font-size: 14px; color: #333; outline: none; transition: border-color 0.2s;
    background: #F8F8F8;
    line-height: 1.4;
}

.finddealer-page .search-wrapper input::placeholder { color: #bbb; }
.finddealer-page .search-wrapper input:focus { border-color: #7b9e6b; }

.finddealer-page .search-btn {
    position: absolute; right: 20px;
    background: none; border: none; cursor: pointer; color: #888;
    display: flex; align-items: center; padding: 0;
}

.finddealer-page .search-btn svg, .finddealer-page .search-btn img { width: 15px; height: 15px; color: #26364D}

/* Result row: result-bar (80%) + reset (right) in one line */
.finddealer-page .result-row {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 40px 0;
    flex-shrink: 0;
}

/* Result bar — takes 80% width, bg #CDEE9A */
.finddealer-page .result-bar {
    flex: 0 0 80%;
    display: flex; align-items: center;
    padding: 15px 14px;
    background: rgba(205,238,154,0.2);
    border-radius: 40px;
    font-size: 14px; color: #26364D;
}

.finddealer-page .result-bar span { font-weight: 500; }

/* Reset — no bg, right side */
.finddealer-page .reset-btn {
    background: none; border: none; color: #26364D;
    font-size: 12px; cursor: pointer;
    display: flex; align-items: center; gap: 4px;
    font-weight: 400; padding:2px 28px 2px 0;
    border-radius: 5px; transition: background 0.15s;
}

/* PC: Hide mobile reset button, show PC reset button */
.finddealer-page .reset-btn.mobile-reset {
    display: none;
}

.finddealer-page .reset-btn.pc-reset {
    display: flex;
}

.finddealer-page .reset-btn:hover { background: rgba(38,54,77,0.08); }
.finddealer-page .reset-btn svg, .finddealer-page .reset-btn img { width: 12px; height: 12px;position: relative;bottom: 1px; }

/* Dealer list */
.finddealer-page .dealer-list {
    flex: 1; overflow-y: auto;
    padding: 30px 40px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.finddealer-page .dealer-list::-webkit-scrollbar { width: 4px; }
.finddealer-page .dealer-list::-webkit-scrollbar-track { background: transparent; }
.finddealer-page .dealer-list::-webkit-scrollbar-thumb { background: #ddd; border-radius: 4px; }

/* Dealer card */
.finddealer-page .dealer-card {
    background: #fff;
    border: 1px solid #E3E7ED;
    border-radius: 24px;
    padding: 30px 40px;
    margin-bottom: 20px;
    cursor: pointer; transition: all 0.2s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    position: relative;
}

.finddealer-page .dealer-card:hover {
    border-color: rgba(255,255,255,0);
    box-shadow: -5px -5px 10px rgba(148,169,196,0.1);
}

.finddealer-page .dealer-card.active {
    background: #94A9C4;
    border-color: #94A9C4;
}

.finddealer-page .dealer-name {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 20px; font-weight: 600;
    color: #26364d; margin-bottom: 3px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    letter-spacing: -0.02em;
}

.finddealer-page .dealer-card.active .dealer-name {
    color: #fff;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.finddealer-page .dealer-addr {
    font-size: 14px; color: #26364d; margin-bottom: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    letter-spacing: -0.01em;
}

.finddealer-page .dealer-card.active .dealer-addr {
    color: #e0e8f0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

.finddealer-page .view-location {
    display: flex; align-items: center; gap: 5px;
    font-size: 14px; color: #26364d; margin-bottom: 20px;
    font-weight: 500; cursor: pointer;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    letter-spacing: -0.01em;
    opacity: 0.5;
}

.finddealer-page .dealer-card.active .view-location { color: #fff; }
.finddealer-page .view-location svg, .finddealer-page .view-location img { width: 16px; height: 16px; }

/* Card footer: email fixed width, detail right-aligned, 10px gap */
.finddealer-page .card-footer {
    display: flex; align-items: center; justify-content: space-between;
    gap: 10px;
}

.finddealer-page .email-link {
    display: flex; align-items: center; gap: 4px;
    font-size: 12px; color: #26364D; text-decoration: none;
    background: #F8F8F8;
    border-radius: 10px;
    padding: 15px 16px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
    min-width: 140px; max-width: 250px;
    transition: background 0.2s, color 0.2s;
    flex-shrink: 0;
    width: 250px;
    font-weight: 260;
    /*font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;*/
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    letter-spacing: 0.01em;
}

.finddealer-page .email-link:hover { background: #eee; }

.finddealer-page .email-link svg, .finddealer-page .email-link img {
    width: 12px; height: 12px; flex-shrink: 0;
    color: #26364D; transition: color 0.2s;
}

.finddealer-page .dealer-card.active .email-link {
    background: rgba(240, 240, 241, 0.2); color: #fff;
}


.finddealer-page .dealer-card.active .email-link svg,
.finddealer-page .dealer-card.active .email-link img { color: #fff; }

.finddealer-page .detail-btn {
    display: flex; align-items: center; gap:10px;
    padding: 17px 22px;
    border-radius: 10px;
    font-size: 12px; font-weight: 260; cursor: pointer;

    border: none; background: #F8F8F8; color: #26364D;
    white-space: nowrap; transition: all 0.2s;
    flex-shrink: 0;
}

.finddealer-page .detail-btn:hover { background: #eee; }

.finddealer-page .detail-btn svg, .finddealer-page .detail-btn img {
    width: 12px; height: 12px; color: #26364D; transition: color 0.2s;
}

.finddealer-page .dealer-card.active .detail-btn {
    background: #CDEE9A; border: none;
}


/*.finddealer-page .dealer-card.active .detail-btn:hover { background: #b8e08a; }*/
.finddealer-page .dealer-card.active .detail-btn svg,
/*.finddealer-page .dealer-card.active .detail-btn img { color: #4a7a35; }*/

/* 右侧装饰椭圆 */
.finddealer-page .dealer-card.active::before{
    content: '';
    position: absolute;
    border-radius: 45%;
    background: rgba(255, 255, 255, 0.03);
    pointer-events: none;
}
.finddealer-page .dealer-card.active::after {
    content: '';
    position: absolute;
    border-radius: 45%;
    background: rgba(255, 255, 255, 0.08);
    pointer-events: none;
}


/* 上椭圆：大圆，右侧居中偏上，左边缘约在卡片右侧 55% 处 */
.finddealer-page .dealer-card.active::before {
    width: 120px;
    height: 160px;
    right: 68px;
    top: -34px;
}

/* 下椭圆：稍小，向左偏移与上圆交错 */
.finddealer-page .dealer-card.active::after {
    width: 143px;
    height: 189px;
    right: -22px;
    bottom: -31px;
}


.finddealer-page .no-result {
    text-align: center; color: #bbb;
    font-size: 13px; padding: 30px 0;
}

/* ===== LEAFLET ===== */
.finddealer-page .leaflet-control-zoom {
    display: none !important;
}

.finddealer-page .leaflet-popup-close-button { display: none !important; }

/* 缩小 Leaflet 底部和右侧控件 */
.finddealer-page .leaflet-bottom,
.finddealer-page .leaflet-right {
    display: flex;
}

.finddealer-page .leaflet-control-attribution {
    font-size: 10px !important;
    padding: 2px 5px !important;
    margin: 0 !important;
    background: rgba(255, 255, 255, 0.7) !important;
}

.finddealer-page .leaflet-bottom .leaflet-control {
    margin: 0 !important;
}

.finddealer-page .leaflet-right .leaflet-control {
    margin: 0 !important;
}

/* 隐藏所有不必要的 Leaflet 控件，只保留必要元素 */
.finddealer-page .leaflet-bottom .leaflet-control:not(.leaflet-control-attribution) {
    display: none !important;
}

.finddealer-page .leaflet-right .leaflet-control:not(.leaflet-control-attribution) {
    display: none !important;
}

/* Custom marker style */
.finddealer-page .custom-marker {
    background: transparent !important;
    border: none !important;
}

.finddealer-page .leaflet-popup-content-wrapper {
    border-radius: 24px !important; padding: 0 !important;
    box-shadow: 0 10px 10px rgba(38,54,77,0.10) !important;
    border: none !important; overflow: hidden; min-width: 310px;
    margin-left: 15px !important;
}

.finddealer-page .leaflet-popup-content { margin: 0 !important;font-size: 12px; width: auto !important; }
.finddealer-page .leaflet-popup-tip-container { display: none; }

.finddealer-page .popup-card {
    background: #fff; min-width: 270px; max-width: 320px;
}

.finddealer-page .popup-card * {
    box-sizing: border-box !important;
}

.finddealer-page .popup-header {
    background: #94A9C4;
    border-radius: 24px;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 20px;
    margin: 4px 4px 0 4px;
}

.finddealer-page .popup-header * {
    box-sizing: border-box !important;
}

.finddealer-page .popup-title {
    font-size: 16px !important;
    font-weight: bold !important;
    color: #fff !important;
}

.finddealer-page .popup-close {
    width: 18px; height: 18px;
    background: rgba(255,255,255,0);
    border: none; border-radius: 50%; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    color: #fff; transition: background 0.2s; flex-shrink: 0;
}

/*.finddealer-page .popup-close:hover { background: rgba(255,255,255,0.5); }*/
.finddealer-page .popup-close svg, .finddealer-page .popup-close img { width: 10px; height: 10px; }

.finddealer-page .popup-body {
    padding: 24px 25px 24px;
    background: #fff;
    border-radius: 0 0 12px 12px;
    margin: 0 2px 2px 2px;
}

.finddealer-page .popup-body * {
    box-sizing: border-box !important;
}

.finddealer-page .popup-row {
    display: flex !important;
    align-items: flex-start !important;
    gap: 15px !important;
    margin-bottom: 0px !important;
    align-items: center !important;
}

.finddealer-page .popup-row:last-child { margin-bottom: 0; }

.finddealer-page .popup-divider {
    height: 1px;
    background: #929AA6;
    margin: 20px 0;
    opacity: 0.16;
}

.finddealer-page .popup-row svg, .finddealer-page .popup-row img {
    width: 16px; flex-shrink: 0; margin-top: 2px; color: #94A9C4;
}

.finddealer-page .popup-row-content label {
    display: block !important;
    font-size: 12px !important;
    color: #aab !important;
    margin-bottom: 2px !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    font-weight: normal !important;
}

.finddealer-page .popup-row-content span {
    font-size: 12px !important;
    color: #26364D !important;
    font-weight: 500 !important;
}

.finddealer-page .popup-row-content a {
    font-size: 12px !important;
    color: #26364D !important;
    text-decoration: none !important;
}

.finddealer-page .popup-row-content a:hover {
    text-decoration: underline !important;
}

/* ===== MOBILE RESPONSIVE (<=768px) ===== */
@media (max-width: 768px) {
    html, body { overflow: auto; }

    /* Map on top */
    .finddealer-page #map {
        position: relative;
        width: 100%;
        height: 50vh;
        min-height: 250px;
        z-index: 1;
    }

    /* Panel below map */
    .finddealer-page .left-panel {
        position: relative;
        top: auto; left: auto; bottom: auto;
        width: 100%;
        border-radius: 0;
        z-index: 2;
        box-shadow: none;
        background: #f5f5f5;
    }

    /* Panel header: no top padding since filter-row is absolutely positioned */
    .finddealer-page .panel-header {
        padding: 0;
        min-height: 0;
    }

    /* Filter row: reset, select, search horizontal layout - positioned over map */
    .finddealer-page .filter-row {
        position: fixed;
        top: 70px;
        left: 15px;
        right: 15px;
        z-index: 1000;
        display: flex;
        gap: 8px;
        align-items: center;
        width: auto;
    }

    /* Reset button - first item, circular icon only */
    .finddealer-page .reset-btn {
        flex: 0 0 auto;
        width: 44px;
        height: 44px;
        padding: 0;
        border-radius: 50%;
        background: #fff;
        /*box-shadow: 0 2px 8px rgba(0,0,0,0.15);*/
        display: flex;
        align-items: center;
        justify-content: center;
        border: none;
        cursor: pointer;
        transition: transform 0.2s, box-shadow 0.2s;
    }

    .finddealer-page .reset-btn:hover {
        transform: scale(1.05);
        box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    }

    .finddealer-page .reset-btn img {
        width: 14px;
        height: 14px;
    }

    .finddealer-page .reset-btn .text {
        display: none;
    }

    /* Select wrapper - second item */
    .finddealer-page .select-wrapper {
        flex: 2;
        background: #fff;
        border-radius: 22px;
        border: none !important;
        outline: none !important;
        overflow: visible;
        position: relative;
        z-index: 1001;
    }

    /* Custom select - mobile */
    .finddealer-page .select-trigger {
        width: 100%;
        padding: 18px 30px 17px 15px;
        font-size: 12px;
        border-radius: 22px;
        background: #fff;
        color: #B3BAC4;
    }

    .finddealer-page .select-arrow {
        width: 10px;
        height: 5px;
        background-image: url('../../icon/de_xl.png');
        background-size: contain;
    }

    .finddealer-page .select-dropdown {
        position: absolute;
        max-height: 50vh;
        overflow-y: auto;
        border-radius: 16px;
    }

    .finddealer-page .select-dropdown .select-option {
        padding: 10px 15px;
        font-size: 12px;
    }

    /* Search wrapper - third item */
    .finddealer-page .search-wrapper {
        flex: 3;
        background: #fff;
        border-radius: 22px;
        /*box-shadow: 0 2px 8px rgba(0,0,0,0.15);*/
        overflow: hidden;
        display: flex;
        align-items: center;
    }

    .finddealer-page .search-wrapper input {
        width: 100%;
        padding: 18px 40px 17px 15px;
        font-size: 12px;
        border: none;
        border-radius: 22px;
        line-height: 1.4;
        background: #fff;
    }

    /* Result row: show result count in mobile, hide reset button */
    .finddealer-page .result-row {
        background: #fff;
        z-index: 1000;
        padding:15px;
    }

    /* Result bar - styled for mobile */
    .finddealer-page .result-bar {
        flex: 1;
        display: flex;
        align-items: center;
        padding: 10px 16px;
        background: rgba(205,238,154,0.1);
        backdrop-filter: blur(8px);
        border-radius: 20px;
        font-size: 12px;
        color: #26364D;
        /*box-shadow: 0 2px 8px rgba(0,0,0,0.1);*/
    }

    /* Mobile: show mobile reset button, hide PC reset button */
    .finddealer-page .reset-btn.mobile-reset {
        display: flex;
        background: #cdee9a;
        border-radius: 50%;
    }

    .finddealer-page .reset-btn.pc-reset {
        display: none;
    }

    /* Dealer list */
    .finddealer-page .dealer-list {
        padding: 15px;
        padding-top: 10px;
        background: #fff;
        overflow-y: auto;
        max-height: calc(55vh - 60px);
    }

    /* Adjust card styles for mobile */
    .finddealer-page .dealer-card {
        padding: 20px;
        margin-bottom: 15px;
        border-radius: 16px;
    }

    .finddealer-page .dealer-name {
        font-size: 18px;
    }

    .finddealer-page .dealer-addr {
        font-size: 13px;
    }

    /* Card footer adjustments */
    .finddealer-page .card-footer {
        gap: 8px;
    }

    .finddealer-page .email-link {
        min-width: 100px;
        max-width: 200px;
        padding: 12px 14px;
        font-size: 11px;
    }

    .finddealer-page .detail-btn {
        padding: 12px 16px;
        font-size: 11px;
        gap: 8px;
    }

    /* Adjust popup for mobile */
    .finddealer-page .leaflet-popup-content-wrapper {
        margin-left: 0 !important;
        max-width: 85vw !important;
        transform: scale(0.85) !important;
        transform-origin: center bottom !important;
    }

    .finddealer-page .popup-card {
        min-width: auto;
        max-width: none;
    }

    .finddealer-page .popup-header {
        padding: 15px !important;
        border-radius: 18px !important;
    }

    .finddealer-page .popup-title {
        font-size: 14px !important;
    }

    .finddealer-page .popup-close {
        width: 16px;
        height: 16px;
    }

    .finddealer-page .popup-body {
        padding: 18px 18px 18px !important;
    }

    .finddealer-page .popup-row {
        gap: 12px !important;
    }

    .finddealer-page .popup-row svg,
    .finddealer-page .popup-row img {
        width: 14px !important;
        margin-top: 1px !important;
    }

    .finddealer-page .popup-row-content label {
        font-size: 11px !important;
        margin-bottom: 1px !important;
    }

    .finddealer-page .popup-row-content span,
    .finddealer-page .popup-row-content a {
        font-size: 11px !important;
    }

    .finddealer-page .popup-divider {
        margin: 15px 0 !important;
    }
}
