/* Dealer Locator - filter bar */
.dealers-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 20px;
    margin-bottom: 25px;
}

.dealers-filter-field {
    display: flex;
    flex-direction: column;
}

.dealers-filter-field label {
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 14px;
}

.dealers-filter-field input,
.dealers-filter-field select {
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    min-width: 180px;
    font-size: 14px;
}

.dealers-filter-location {
    flex: 1 1 280px;
}

#dealers-search-button {
    height: 42px;
    padding: 0 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

/* Error / status messages */
.dealers-error-message {
    background: #fdecea;
    color: #611a15;
    padding: 10px 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

/* Results layout: sidebar list + map */
.dealers-results-wrap {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.dealers-list {
    flex: 0 0 20%;
    max-width: 20%;
    max-height: 600px;
    overflow-y: auto;
    order: 1;
    border: 1px solid #eee;
    border-radius: 4px;
    padding: 10px;
}

.dealers-map-wrap {
    flex: 0 0 80%;
    max-width: 80%;
    order: 2;
}

#dealers-map {
    width: 100%;
    height: 600px;
    border-radius: 4px;
}

.dealers-empty-state,
.dealers-no-results {
    color: #888;
    text-align: center;
    padding: 20px 10px;
}

/* Dealer result card (sidebar list) */
.dealer-card {
    border-bottom: 1px solid #eee;
    padding: 12px 4px;
    cursor: pointer;
}

.dealer-card:last-child {
    border-bottom: none;
}

.dealer-card h4 {
    margin: 0 0 5px;
    font-size: 15px;
}

.dealer-card p {
    margin: 2px 0;
    font-size: 13px;
    color: #555;
}

.dealer-card .dealer-distance {
    color: #888;
    font-weight: 600;
    margin: 6px 0;
}

.dealer-card a.dealers-directions-link {
    font-size: 13px;
    text-decoration: underline;
}

/* Dealer popup (Leaflet marker popup) */
.dealer-popup {
    max-width: 250px;
}

.dealer-popup img.dealer-cover {
    width: 100%;
    height: 110px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 8px;
}

.dealer-popup h4 {
    margin: 0 0 6px;
}

.dealer-popup p {
    margin: 2px 0;
    font-size: 13px;
}

.dealer-popup .dealer-popup-links {
    margin-top: 8px;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* User location marker (highlighted pin) */
.dealers-user-marker span {
    display: block;
    width: 16px;
    height: 16px;
    background: #e53e3e;
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
}

/* Collapsed dealer card while a route is drawn: only the name, next to the pin */
.dealer-name-tooltip {
    font-weight: 600;
    font-size: 13px;
    padding: 4px 10px;
    white-space: nowrap;
}

/* Directions: keep the route line on the map, hide the turn-by-turn itinerary panel */
.leaflet-routing-container {
    display: none !important;
}

/* Responsive: stack filters, map, then list on mobile */
@media (max-width: 991px) {
    .dealers-filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .dealers-filter-field input,
    .dealers-filter-field select {
        min-width: 0;
        width: 100%;
    }

    .dealers-results-wrap {
        flex-direction: column;
    }

    .dealers-list,
    .dealers-map-wrap {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .dealers-map-wrap {
        order: 1;
    }

    .dealers-list {
        order: 2;
        margin-top: 20px;
        max-height: none;
    }

    #dealers-map {
        height: 400px;
    }
}
