/* ===== ОБНОВЛЕННЫЙ СТИЛЬ ДЛЯ РЕГИОНА ===== */

.region-selector-compact {
    display: flex;
    align-items: center;
    gap: 20px;
    background: rgba(255,255,255,0.1);
    padding: 6px 16px 6px 20px;
    border-radius: 40px;
    transition: all 0.2s ease;
}

.region-selector-compact:hover {
    background: rgba(255,255,255,0.15);
}

.region-info {
    display: flex;
    align-items: center;
    gap: 10px;
    color: white;
}

.region-info i {
    font-size: 16px;
    opacity: 0.9;
}

.region-label {
    font-size: 13px;
    opacity: 0.8;
}

.region-code-badge {
    background: #e5c13b;
    color: #0a3143;
    padding: 4px 10px;
    border-radius: 30px;
    font-weight: 700;
    font-size: 13px;
    line-height: 1;
}

.region-name {
    font-weight: 500;
    font-size: 14px;
}

.region-change-btn {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    padding: 6px 16px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.region-change-btn:hover {
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.3);
}

.region-change-btn i {
    font-size: 14px;
}

/* ===== МОДАЛЬНОЕ ОКНО ВЫБОРА РЕГИОНА ===== */

.region-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0.2s, opacity 0.2s;
}

.region-modal.active {
    visibility: visible;
    opacity: 1;
}

.region-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 20, 30, 0.7);
    backdrop-filter: blur(4px);
}

.region-modal-content {
    position: relative;
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    background: white;
    border-radius: 8px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    transform: translateY(20px);
    transition: transform 0.3s ease;
    z-index: 10000;
}

.region-modal.active .region-modal-content {
    transform: translateY(0);
}

.region-modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid #d3e0e5;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(90deg, #f8fcfd 0%, #ffffff 100%);
    border-radius: 8px 8px 0 0;
}

.region-modal-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: #0a3143;
    display: flex;
    align-items: center;
    gap: 12px;
}

.region-modal-header h2 i {
    color: #2c5f2d;
}

.region-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #6c8a9a;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.region-modal-close:hover {
    background: #f0f7fa;
    color: #0a3143;
}

.region-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

/* Поиск */
.region-search-section {
    margin-bottom: 20px;
}

.region-search-wrapper {
    position: relative;
    margin-bottom: 8px;
}

.search-icon {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #8ba3ad;
    font-size: 16px;
}

.region-search-input {
    width: 100%;
    padding: 14px 20px 14px 48px;
    font-size: 16px;
    border: 2px solid #d3e0e5;
    border-radius: 8px;
    transition: all 0.2s;
    background: white;
}

.region-search-input:focus {
    outline: none;
    border-color: #2c5f2d;
    box-shadow: 0 0 0 3px rgba(44, 95, 45, 0.1);
}

.region-search-clear {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #8ba3ad;
    font-size: 18px;
    cursor: pointer;
    display: none;
    padding: 4px;
}

.region-search-clear:hover {
    color: #b22222;
}

.search-hint {
    font-size: 12px;
    color: #6c8a9a;
    padding-left: 16px;
    transition: opacity 0.2s;
}

/* Фильтры */
.region-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e3edf0;
}

.filter-btn {
    padding: 6px 16px;
    border: 1px solid #cbd8df;
    background: white;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 500;
    color: #1e4a5f;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-btn:hover {
    background: #f0f7fa;
    border-color: #8ba3ad;
}

.filter-btn.active {
    background: #0a3143;
    color: white;
    border-color: #0a3143;
}

/* Список регионов */
.regions-container {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e3edf0;
    border-radius: 6px;
    background: #fafefd;
}

.region-group {
    border-bottom: 1px solid #e3edf0;
}

.region-group:last-child {
    border-bottom: none;
}

.region-group-title {
    padding: 12px 16px;
    background: #e3edf0;
    font-weight: 600;
    color: #0a3143;
    font-size: 14px;
    position: sticky;
    top: 0;
    z-index: 1;
}

.region-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1px;
    background: #e3edf0;
}

.region-item {
    padding: 10px 16px;
    background: white;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
    border: 1px solid transparent;
}

.region-item:hover {
    background: #f0f7fa;
    border-color: #8ba3ad;
    z-index: 2;
}

.region-item.selected {
    background: #e8f3e9;
    border-left: 4px solid #2c5f2d;
}

.region-code {
    font-family: 'Roboto Mono', monospace;
    font-weight: 700;
    color: #0a3143;
    min-width: 40px;
    background: #eef5f7;
    padding: 2px 6px;
    border-radius: 4px;
    text-align: center;
    font-size: 12px;
}

.region-full-name {
    flex: 1;
    font-size: 13px;
    color: #0a3143;
}

.region-type {
    font-size: 11px;
    color: #6c8a9a;
    background: #f0f7fa;
    padding: 2px 8px;
    border-radius: 12px;
    white-space: nowrap;
}

.selected-icon {
    color: #2c5f2d;
    font-size: 16px;
    margin-left: auto;
}

/* Нет результатов */
.no-results {
    padding: 60px 20px;
    text-align: center;
    color: #8ba3ad;
}

.no-results i {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.no-results p {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 8px;
    color: #4f6f7f;
}

.no-results span {
    font-size: 14px;
}

/* Футер модалки */
.region-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #d3e0e5;
    background: #f8fcfd;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 0 0 8px 8px;
}

.selected-info {
    font-size: 14px;
    color: #1e4a5f;
}

.selected-info strong {
    color: #0a3143;
    background: #e8f3e9;
    padding: 4px 12px;
    border-radius: 30px;
    margin-left: 8px;
}

.modal-actions {
    display: flex;
    gap: 12px;
}

/* Адаптивность */
@media (max-width: 768px) {
    .region-selector-compact {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        background: none;
        padding: 10px 0;
    }
    
    .region-info {
        flex-wrap: wrap;
    }
    
    .region-change-btn {
        width: 100%;
        justify-content: center;
    }
    
    .region-modal-content {
        width: 95%;
        max-height: 90vh;
    }
    
    .region-items {
        grid-template-columns: 1fr;
    }
    
    .region-modal-footer {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }
    
    .modal-actions {
        justify-content: stretch;
    }
    
    .modal-actions .btn {
        flex: 1;
    }
}

/* Анимации */
@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(44, 95, 45, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(44, 95, 45, 0); }
    100% { box-shadow: 0 0 0 0 rgba(44, 95, 45, 0); }
}

.region-change-btn:focus {
    animation: pulse 1.5s infinite;
}

/* Скроллбар для контейнера регионов */
.regions-container::-webkit-scrollbar {
    width: 8px;
}

.regions-container::-webkit-scrollbar-track {
    background: #eef5f7;
}

.regions-container::-webkit-scrollbar-thumb {
    background: #8ba3ad;
    border-radius: 4px;
}

.regions-container::-webkit-scrollbar-thumb:hover {
    background: #4f6f7f;
}