/**
 * Dealer Page Styles
 */

/* Основной контейнер */
.dealers-page-container {
    max-width: 1600px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.dealers-page-container h1 {
    margin-bottom: 25px;
    color: #1a1a2e;
    font-size: 32px;
    border-left: 5px solid #ff6b00;
    padding-left: 20px;
}

/* Фильтр над картой */
.dealers-top-filter {
    background: white;
    padding: 20px;
    border-radius: 16px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
}

.dealers-filter-group {
    flex: 1;
    min-width: 180px;
}

.dealers-filter-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 13px;
}

.dealers-filter-group input,
.dealers-filter-group select {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s;
}

.dealers-filter-group input:focus,
.dealers-filter-group select:focus {
    outline: none;
    border-color: #ff6b00;
}

/* Вкладки */
.dealers-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.dealers-tab-btn {
    padding: 12px 30px;
    background: #e9ecef;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    color: #555;
}

.dealers-tab-btn.active {
    background: #ff6b00;
    color: white;
    box-shadow: 0 4px 12px rgba(255,107,0,0.3);
}

.dealers-tab-content {
    display: none;
}

.dealers-tab-content.active {
    display: block;
}

/* Макет карта + сайдбар */
.dealers-map-sidebar-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
}

.dealers-map-wrapper {
    flex: 2;
    min-width: 400px;
    height: 550px;
    background: #e9ecef;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.dealers-sidebar {
    flex: 1;
    min-width: 280px;
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.dealers-sidebar-header {
    padding: 18px 20px;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    color: white;
}

.dealers-sidebar-header h3 {
    margin: 0;
    font-size: 18px;
}

.dealers-sidebar-header p {
    margin: 5px 0 0;
    font-size: 12px;
    opacity: 0.8;
}

.dealers-regions-tree {
    flex: 1;
    overflow-y: auto;
    max-height: 480px;
    padding: 15px;
}

.dealers-region-group {
    margin-bottom: 20px;
    border-left: 3px solid #ff6b00;
    padding-left: 12px;
}

.dealers-region-title {
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 10px;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.dealers-region-title .count {
    background: #ff6b00;
    color: white;
    border-radius: 20px;
    padding: 2px 8px;
    font-size: 11px;
}

.dealers-cities-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-left: 15px;
}

.dealers-city-radio-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.2s;
    font-size: 14px;
}

.dealers-city-radio-label:hover {
    background: #fff3e0;
}

.dealers-city-radio-label input[type="radio"] {
    accent-color: #ff6b00;
    width: 16px;
    height: 16px;
}

.dealers-city-name {
    flex: 1;
}

.dealers-city-count {
    background: #e9ecef;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    color: #666;
}

/* Карточка выбранного дилера */
.dealers-selected-card {
    background: white;
    border-radius: 16px;
    margin-top: 20px;
    padding: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    display: none;
}

.dealers-selected-card.active {
    display: block;
}

.dealers-card-header {
    background: linear-gradient(135deg, #ff6b00 0%, #ff8c42 100%);
    padding: 15px 20px;
    color: white;
    border-radius: 16px 16px 0 0;
    font-weight: 600;
}

.dealers-detail-content {
    padding: 20px;
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.dealers-detail-logo {
    flex: 0 0 120px;
    text-align: center;
}

.dealers-detail-logo img {
    max-width: 100%;
    border-radius: 12px;
}

.dealers-detail-info {
    flex: 1;
}

.dealers-detail-info h3 {
    color: #ff6b00;
    margin-bottom: 12px;
}

.dealers-detail-info p {
    margin: 8px 0;
    font-size: 14px;
}

.dealers-detail-info a {
    color: #ff6b00;
    text-decoration: none;
}

/* Адаптив */
@media (max-width: 900px) {
    .dealers-map-sidebar-layout {
        flex-direction: column;
    }
    
    .dealers-map-wrapper {
        min-width: auto;
        height: 400px;
    }
    
    .dealers-sidebar {
        max-height: 400px;
    }
    
    .dealers-top-filter {
        flex-direction: column;
    }
    
    .dealers-filter-group {
        width: 100%;
    }
}

@media (max-width: 600px) {
    .dealers-page-container {
        padding: 10px;
    }
    
    .dealers-page-container h1 {
        font-size: 24px;
    }
    
    .dealers-tab-btn {
        padding: 8px 16px;
        font-size: 14px;
    }
    
    .dealers-detail-content {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
}

/* Стили для кластеров карты */
.dealers-cluster-icon {
    background: #ff6b00;
    color: white;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    border: 2px solid white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* Загрузчик */
.dealers-loader {
    text-align: center;
    padding: 50px;
}

.dealers-loader::after {
    content: '';
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #ff6b00;
    border-radius: 50%;
    animation: dealers-spin 1s linear infinite;
}

@keyframes dealers-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}