/* Titan Dealers Plugin Styles */
.titan-dealers-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Header */
.dealers-header {
    text-align: center;
    margin-bottom: 30px;
}

.dealers-header h2 {
    color: #1a1a1a;
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.dealers-description {
    color: #666;
    font-size: 1.1rem;
    margin: 0;
}

/* Search Form */
.dealers-search-form {
    background: #F9F9F9;
    padding: 30px;
    border-radius: 10px;
}

.search-input-group {
    display: flex;
    gap: 10px;
}

#location-input {
    flex: 1;
    padding: 15px 20px;
    border: 1px solid #aaa;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease;
}

#location-input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

.search-btn {
    background: #01466D;
    color: white;
    border: none;
    padding: 15px 25px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    text-transform: uppercase;
}

.search-btn:hover {
    background: #01466D;
}

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

/* Location Options */
.location-options {
    text-align: center;
}

.location-btn {
    background: transparent;
    color: #e00034;
    border: 2px solid #e00034;
    padding: 15px 25px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.location-btn:hover {
    background: #e00034;
    color: white;
}

/* Filters */
.dealers-filters {
    background: #F9F9F9;
    padding: 20px;
    border-radius: 8px;
    margin-top: 10px;
    display: none; /* Inicia escondido */
    flex-wrap: wrap;
    gap: 20px;
    align-items: center;
}

.dealers-filters.show {
    display: flex !important;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
}

.filter-group label {
    font-weight: 600;
    font-size: 14px;
    color: #000;
    text-transform: uppercase;
    white-space: nowrap;
}

.filter-group select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    min-width: 150px;
}


/* Results */
.dealers-results {
    min-height: 200px;
}

.loading {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

/* Garante que o loading seja escondido quando necessário */
#dealers-loading.hidden {
    display: none !important;
}

.loading i {
    font-size: 28px;
}

.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 15px 30px;
    border-radius: 8px;
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Dealers List */
.dealers-list {
    display: flex !important;
    flex-direction: column;
    gap: 15px;
    max-height: 600px;
    overflow-y: auto;
    padding-right: 10px;
    visibility: visible !important;
    opacity: 1 !important;
}

.dealer-item {
    background: white;
    border: 1px solid #aaa;
    border-radius: 6px;
    padding: 15px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.dealer-item:hover,
.dealer-item.active {
    background: #F9F9F9;
}

.dealer-info h3 {
    color: #000;
    font-size: 16px;
    font-weight: 600;
    margin: 0;
}

.dealer-address,
.dealer-phone,
.dealer-distance,
.dealer-hours,
.dealer-email {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: #666;
    font-size: 13px;
    line-height: 1.4;
}

.dealer-phone a,
.dealer-whatsapp a,
.dealer-email a {
    color: #007bff;
    text-decoration: none;
}

.dealer-phone a:hover,
.dealer-whatsapp a:hover,
.dealer-email a:hover {
    text-decoration: underline;
}

.dealer-whatsapp {
    color: #25d366;
}

.dealer-info .icon {
    background: #EEEEEE;
    padding: 2px;
    border-radius: 4px;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: none;
}

.dealer-actions {
    margin-top: 15px;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn {
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    border: none;
}

.btn-primary {
    background: #01466D;
    color: white;
}

.btn-primary:hover {
    background: #01466D;
}

.btn-secondary {
    background: #e00034;
    color: white;
}

.btn-secondary:hover {
    background: #e00034;
}

.btn-whatsapp {
    background-color: #25d366;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 5px;
    text-decoration: none;
    transition: background-color 0.3s;
}

.btn-whatsapp:hover {
    background-color: #128c7e;
    color: white;
}

/* Results Container - Layout de duas colunas */
.dealers-results-container {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 30px;
    margin-top: 30px;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Estado inicial - sem resultados */
.dealers-results-container:not(.has-results) {
    opacity: 0.3;
}

.dealers-results-container.has-results {
    opacity: 1;
}

/* Lista de distribuidores - Coluna esquerda */
.dealers-list-container {
    min-height: 500px;
}

.dealers-list-header,
.dealers-map-header {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.dealers-list-header h3,
.dealers-map-header h3,
.dealers-count {
    margin: 0;
    color: #000000;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Mapa - Coluna direita */
.dealers-map-container {
    position: sticky;
    top: 20px;
    margin-top: 31px;
}

/* Map */
.dealers-map {
    height: 500px;
    border-radius: 0px;
    overflow: hidden;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .dealers-results-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .dealers-map-container {
        position: static;
        order: -1;
    }
    
    .dealers-map {
        height: 300px;
    }
}

@media (max-width: 768px) {
    .titan-dealers-container {
        padding: 15px;
    }
    
    .dealers-header h2 {
        font-size: 1.5rem;
    }
    
    .dealers-search-form {
        padding: 20px;
    }
    
    .search-input-group {
        flex-direction: column;
    }
    
    .dealers-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    
    .dealers-results-container {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .map-fallback {
        text-align: center;
        padding: 40px 20px;
        background: #f8f9fa;
        border-radius: 8px;
        border: 2px dashed #dee2e6;
    }
    
    .map-fallback i {
        font-size: 48px;
        color: #6c757d;
        margin-bottom: 20px;
    }
    
    .map-fallback h4 {
        color: #495057;
        margin-bottom: 10px;
    }
    
    .map-fallback p {
        color: #6c757d;
        margin-bottom: 20px;
    }
    
    .fallback-list {
        text-align: left;
        max-height: 300px;
        overflow-y: auto;
    }
    
    .fallback-item {
        background: white;
        padding: 15px;
        margin-bottom: 10px;
        border-radius: 6px;
        box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    }
    
    .fallback-item h5 {
        color: #007bff;
        margin-bottom: 8px;
        font-size: 16px;
    }
    
    .fallback-item p {
        margin: 5px 0;
        font-size: 14px;
        color: #495057;
    }
    
    .fallback-item i {
        color: #007bff;
        margin-right: 8px;
        width: 16px;
    }
}

/* Azure Maps Markers */
.azure-marker {
    transition: all 0.3s ease !important;
}

.azure-marker:hover {
    transform: scale(1.1) !important;
    background: #0056b3 !important;
}

/* Popup do Azure Maps */
.atlas-popup {
    border-radius: 8px !important;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15) !important;
}

.atlas-popup-content {
    border-radius: 8px !important;
}

/* Botões no popup */
.map-info-window button {
    transition: all 0.3s ease;
}

.map-info-window button:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
    
    .dealers-map {
        height: 600px;
    }
    
    .dealer-actions {
        flex-direction: column;
    }
    
    .btn {
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .dealers-header h2 {
        font-size: 1.3rem;
    }
    
    .dealers-description {
        font-size: 1rem;
    }
    
    .dealers-search-form {
        padding: 15px;
    }
    
    #location-input,
    .search-btn {
        padding: 12px 15px;
        font-size: 14px;
    }
}

/* Animation for loading states */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Estados iniciais e vazios */
.initial-state,
.map-placeholder,
.no-results {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.initial-state i,
.map-placeholder i,
.no-results i {
    font-size: 48px;
    color: #ddd;
    margin-bottom: 20px;
}

.initial-state h4,
.map-placeholder h4,
.no-results h3 {
    color: #333;
    margin-bottom: 10px;
}

.initial-state p,
.map-placeholder p,
.no-results p {
    color: #666;
    margin: 0;
}

/* Custom scrollbar for results */
.dealers-list::-webkit-scrollbar {
    width: 8px;
}

.dealers-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

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

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