/* ============================================
   DEALER LOCATOR - ELEGANT DESIGN
   Inspired by luxury brands
   ============================================ */

/* Container - 40/60 split */
.dl-container {
    display: grid;
    grid-template-columns: 40% 60%;
    gap: 0;
    height: 700px; /* Default, overridden by inline style */
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}

/* Sidebar */
.dl-sidebar {
    display: flex;
    flex-direction: column;
    background: #fafafa;
    border-right: 1px solid #eee;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
}

/* Header */
.dl-header {
    padding: 32px 28px 24px;
    border-bottom: 1px solid #eee;
    background: #fff;
}

.dl-title {
    font-size: 24px;
    font-weight: 300;
    letter-spacing: -0.5px;
    color: #111;
    margin: 0 0 8px 0;
}

.dl-subtitle {
    font-size: 13px;
    font-weight: 400;
    color: #888;
    margin: 0;
    line-height: 1.5;
}

/* Search Section - Sticky */
.dl-search-section {
    padding: 24px 28px;
    background: #fff;
    border-bottom: 1px solid #eee;
    position: sticky;
    top: 0;
    z-index: 10;
}

.dl-search-box {
    display: flex;
    position: relative;
}

#dl-search {
    width: 100%;
    padding: 16px 50px 16px 0;
    border: none;
    border-bottom: 1px solid #e0e0e0;
    border-radius: 0;
    font-size: 15px;
    font-weight: 400;
    outline: none;
    background: transparent;
    transition: border-color 0.2s;
}

#dl-search:focus {
    border-bottom-color: #111;
}

#dl-search::placeholder {
    color: #999;
    font-weight: 400;
}

.dl-search-btn {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    padding: 10px;
    background: transparent;
    border: none;
    cursor: pointer;
    opacity: 0.4;
    transition: opacity 0.2s;
}

.dl-search-btn:hover {
    opacity: 0.8;
}

.dl-search-btn svg {
    width: 20px;
    height: 20px;
    color: #333;
}

/* Action Links under search */
.dl-search-actions {
    display: flex;
    gap: 24px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
}

.dl-action-link {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    padding: 0;
    font-size: 13px;
    color: #888;
    cursor: pointer;
    transition: color 0.2s;
}

.dl-action-link:hover {
    color: #111;
}

.dl-action-link.active {
    color: #111;
    font-weight: 500;
}

.dl-action-link svg {
    width: 14px;
    height: 14px;
    opacity: 0.5;
}

.dl-action-link.active svg {
    opacity: 1;
}

/* Filters Section */
.dl-filters-section {
    padding: 20px 28px;
    background: #fff;
    border-bottom: 1px solid #eee;
}

.dl-filters-section.collapsed {
    display: none;
}

.dl-filter-group {
    margin-bottom: 16px;
}

.dl-filter-group:last-child {
    margin-bottom: 0;
}

.dl-filter-label {
    display: block;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #999;
    margin-bottom: 10px;
}

.dl-filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.dl-radius-btn,
.dl-cat-btn,
.dl-chain-btn {
    padding: 8px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    background: #fff;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    color: #555;
}

.dl-radius-btn:hover,
.dl-cat-btn:hover,
.dl-chain-btn:hover {
    border-color: #111;
    color: #111;
}

.dl-radius-btn.active,
.dl-cat-btn.active,
.dl-chain-btn.active {
    background: #111;
    border-color: #111;
    color: #fff;
}

/* Results Section */
.dl-results-section {
    flex: 0 0 auto;
}

.dl-results-header {
    padding: 16px 28px;
    background: #fafafa;
    position: sticky;
    top: 85px; /* Height of search section */
    z-index: 9;
}

.dl-results-count {
    font-size: 12px;
    font-weight: 500;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dl-results {
    padding: 0;
}

.dl-no-results {
    padding: 60px 28px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

/* ============================================
   DEALER CARDS - Elegant Design
   ============================================ */

.dl-dealer-item {
    display: block;
    padding: 24px 28px;
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background 0.2s;
    position: relative;
}

.dl-dealer-item:hover {
    background: #fafafa;
}

.dl-dealer-item:last-child {
    border-bottom: none;
}

/* Store Logo (chain logo at top) */
.dl-store-logo {
    display: block;
    max-height: 22px;
    max-width: 80px;
    object-fit: contain;
    opacity: 0.7;
    margin-bottom: 10px;
}

/* Dealer Info */
.dl-dealer-info {
    margin-bottom: 16px;
}

.dl-dealer-name {
    font-size: 16px;
    font-weight: 600;
    color: #111;
    margin-bottom: 6px;
    letter-spacing: -0.2px;
    line-height: 1.3;
}

.dl-dealer-address {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
    line-height: 1.4;
}

.dl-dealer-meta {
    margin-bottom: 0;
}

.dl-dealer-phone {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: #888;
}

.dl-dealer-phone svg {
    width: 13px;
    height: 13px;
    opacity: 0.6;
}

.dl-dealer-phone a {
    color: #888;
    text-decoration: none;
    transition: color 0.2s;
}

.dl-dealer-phone a:hover {
    color: #111;
}

/* Brand Tags */
.dl-dealer-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.dl-dealer-category,
.dl-dealer-special {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 10px;
    border-radius: 3px;
    background: #f5f5f5;
    color: #666;
}

.dl-dealer-special {
    background: #f0f7ff;
    color: #3b82f6;
}

.dl-dealer-brand-logo {
    max-height: 22px;
    max-width: 70px;
    object-fit: contain;
    opacity: 0.8;
}

/* Actions Row */
.dl-dealer-right {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 16px;
    border-top: 1px solid #f0f0f0;
}

.dl-distance-badge {
    font-size: 12px;
    font-weight: 500;
    color: #666;
}

.dl-details-btn {
    background: #111;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: background 0.2s;
}

.dl-details-btn:hover {
    background: #333;
}

.dl-directions-link {
    font-size: 12px;
    color: #888;
    text-decoration: none;
    transition: color 0.2s;
    margin-left: auto;
}

.dl-directions-link:hover {
    color: #111;
}

/* ============================================
   MAP
   ============================================ */

.dl-map-container {
    position: relative;
    background: #e8f4f8;
}

#dl-map {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #e8f4f8;
}

/* Leaflet Popup - Elegant Style */
.leaflet-popup-content-wrapper {
    border-radius: 12px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.12);
    padding: 0;
}

.leaflet-popup-content {
    margin: 0;
    font-size: 13px;
    line-height: 1.5;
}

.leaflet-popup-tip {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.dl-popup-title {
    font-weight: 600;
    font-size: 14px;
    color: #111;
    padding: 16px 18px 8px;
    border-bottom: none;
}

.dl-popup-distance {
    font-size: 11px;
    color: #888;
    padding: 0 18px 8px;
    font-weight: 500;
}

.dl-popup-address {
    color: #666;
    padding: 0 18px 8px;
    font-size: 13px;
}

.dl-popup-phone {
    padding: 0 18px 8px;
}

.dl-popup-phone a {
    color: #666;
    text-decoration: none;
}

.dl-popup-directions {
    padding: 12px 18px;
    border-top: 1px solid #f0f0f0;
    background: #fafafa;
    border-radius: 0 0 12px 12px;
}

.dl-popup-directions a {
    color: #111;
    text-decoration: none;
    font-weight: 600;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* User Marker */
.dl-user-marker {
    background: #111;
    border: 3px solid #fff;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* Leaflet Controls - Minimal Style */
.leaflet-control-zoom {
    border: none !important;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1) !important;
    border-radius: 8px !important;
    overflow: hidden;
}

.leaflet-control-zoom a {
    background: #fff !important;
    color: #333 !important;
    border: none !important;
    width: 36px !important;
    height: 36px !important;
    line-height: 36px !important;
    font-size: 16px !important;
}

.leaflet-control-zoom a:hover {
    background: #f5f5f5 !important;
}

.leaflet-control-layers {
    border: none !important;
    box-shadow: 0 2px 12px rgba(0,0,0,0.1) !important;
    border-radius: 8px !important;
}

/* Map Scroll Message */
.dl-map-scroll-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    z-index: 1000;
    pointer-events: none;
    display: none;
}

/* Loading State */
.dl-results.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1100px) {
    .dl-container {
        grid-template-columns: 1fr;
        grid-template-rows: auto 450px;
    }
    
    .dl-sidebar {
        border-right: none;
        border-bottom: 1px solid #eee;
    }
    
    .dl-results {
        max-height: 350px;
    }
}

@media (max-width: 600px) {
    .dl-container {
        border-radius: 0;
        box-shadow: none;
    }
    
    .dl-header {
        padding: 24px 20px 20px;
    }
    
    .dl-title {
        font-size: 20px;
    }
    
    .dl-search-section {
        padding: 16px 20px;
    }
    
    .dl-search-actions {
        flex-direction: column;
        gap: 12px;
    }
    
    .dl-filters-section {
        padding-left: 20px;
        padding-right: 20px;
    }
    
    .dl-results-header {
        padding: 12px 20px;
    }
    
    .dl-dealer-item {
        padding: 20px;
    }
    
    .dl-dealer-right {
        flex-wrap: wrap;
    }
}

/* ============================================
   SCROLLBAR - Minimal
   ============================================ */

.dl-sidebar::-webkit-scrollbar {
    width: 6px;
}

.dl-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.dl-sidebar::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 3px;
}

.dl-sidebar::-webkit-scrollbar-thumb:hover {
    background: #ccc;
}

/* ============================================
   WIDGET - Compact search box
   ============================================ */

.dl-widget {
    background: #fff;
    border-radius: 12px;
    padding: 24px 28px;
    box-shadow: 0 2px 16px rgba(0,0,0,0.08);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.dl-widget-title {
    margin-bottom: 16px;
}

.dl-widget-label {
    font-size: 18px;
    font-weight: 500;
    color: #111;
}

.dl-widget-location {
    font-size: 18px;
    font-weight: 300;
    color: #666;
}

.dl-widget-search {
    display: flex;
    gap: 12px;
}

#dl-widget-input {
    flex: 1;
    padding: 14px 18px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

#dl-widget-input:focus {
    border-color: #111;
}

#dl-widget-input::placeholder {
    color: #aaa;
}

.dl-widget-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 24px;
    background: #111;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.dl-widget-btn:hover {
    background: #333;
    color: #fff;
}

.dl-widget-btn svg {
    width: 16px;
    height: 16px;
}

@media (max-width: 500px) {
    .dl-widget-search {
        flex-direction: column;
    }
    
    .dl-widget-btn {
        justify-content: center;
    }
}
