/* Estilos para o plugin Dealer Map - Frontend */

.dealer-map-container {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    max-width: 100%;
    margin: 0 auto;
}

/* Barra de pesquisa */
.dealer-map-search {
    margin-bottom: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.search-input-group {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.dealer-search-input {
    flex: 1;
    min-width: 250px;
    padding: 12px 16px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

.dealer-search-input:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.dealer-search-btn,
.dealer-location-btn {
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dealer-search-btn {
    background: #007cba;
    color: white;
}

.dealer-search-btn:hover {
    background: #005a87;
}

.dealer-location-btn {
    background: #28a745;
    color: white;
    min-width: 48px;
}

.dealer-location-btn:hover {
    background: #218838;
}

.dealer-location-btn:disabled {
    background: #6c757d;
    cursor: not-allowed;
}

/* Conteúdo principal */
.dealer-map-content {
    display: flex;
    gap: 20px;
    min-height: 600px;
}

/* Sidebar com lista */
.dealer-map-sidebar {
    flex: 0 0 350px;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
}

.dealer-list-header {
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
}

.dealer-list-header h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.dealer-sort-select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

/* Lista de concessionários */
.dealer-list {
    max-height: 500px;
    overflow-y: auto;
}

.dealer-list-loading {
    padding: 40px 20px;
    text-align: center;
    color: #666;
    font-style: italic;
}

.dealer-item {
    padding: 20px;
    border-bottom: 1px solid #e9ecef;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.dealer-item:hover {
    background: #f8f9fa;
}

.dealer-item.active {
    background: #e3f2fd;
    border-left: 4px solid #007cba;
}

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

.dealer-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

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

.dealer-distance {
    font-size: 12px;
    color: #007cba;
    font-weight: 500;
    background: #e3f2fd;
    padding: 2px 8px;
    border-radius: 12px;
    display: inline-block;
}

.dealer-contact {
    margin-top: 10px;
    font-size: 13px;
}

.dealer-contact a {
    color: #007cba;
    text-decoration: none;
}

.dealer-contact a:hover {
    text-decoration: underline;
}

/* Wrapper do mapa */
.dealer-map-wrapper {
    flex: 1;
    position: relative;
}

.dealer-map {
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e9ecef;
}

.dealer-map-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: #f8f9fa;
    color: #666;
    font-style: italic;
}

/* Info window personalizada */
.dealer-info-window {
    max-width: 300px;
    font-family: inherit;
}

.dealer-info-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

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

.dealer-info-contact {
    font-size: 13px;
    margin-bottom: 5px;
}

.dealer-info-contact strong {
    color: #333;
}

.dealer-info-contact a {
    color: #007cba;
    text-decoration: none;
}

.dealer-info-contact a:hover {
    text-decoration: underline;
}

.dealer-info-hours {
    font-size: 13px;
    color: #666;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

/* Marcador personalizado */
.dealer-marker {
    width: 32px;
    height: 32px;
    background: #007cba;
    border: 3px solid white;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 12px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.dealer-marker:hover {
    transform: scale(1.1);
}

.dealer-marker.active {
    background: #dc3545;
    transform: scale(1.2);
}

/* Estados de erro */
.dealer-map-error {
    padding: 20px;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 8px;
    color: #721c24;
    text-align: center;
}

.dealer-list-error {
    padding: 20px;
    text-align: center;
    color: #dc3545;
}

.dealer-list-empty {
    padding: 40px 20px;
    text-align: center;
    color: #666;
    font-style: italic;
}

/* Responsividade */
@media (max-width: 768px) {
    .dealer-map-content {
        flex-direction: column;
    }
    
    .dealer-map-sidebar {
        flex: none;
        order: 2;
    }
    
    .dealer-map-wrapper {
        order: 1;
    }
    
    .dealer-list {
        max-height: 300px;
    }
    
    .search-input-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .dealer-search-input {
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .dealer-map-container {
        margin: 0 -15px;
    }
    
    .dealer-map-search {
        margin: 0 15px 20px 15px;
    }
    
    .dealer-map-content {
        margin: 0 15px;
    }
    
    .dealer-item {
        padding: 15px;
    }
    
    .dealer-list-header {
        padding: 15px;
    }
}

/* Animações */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dealer-item {
    animation: fadeIn 0.3s ease;
}

/* Scrollbar personalizada */
.dealer-list::-webkit-scrollbar {
    width: 6px;
}

.dealer-list::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.dealer-list::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.dealer-list::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

