/* ==================== */
/* CITY POPUP STYLES */
/* ==================== */

/* Полноэкранный фон попапа */
.city-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.98);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 999999;
    opacity: 0;
    transition: opacity 0.4s ease;
    backdrop-filter: blur(5px);
}

.city-popup-overlay.active {
    display: flex;
    opacity: 1;
}

/* Контейнер попапа */
.city-popup-container {
    background: white;
    padding: 30px;
    border-radius: 16px;
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 115, 170, 0.2);
    border: 1px solid #e9ecef;
    animation: cityPopupAppear 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes cityPopupAppear {
    from {
        transform: scale(0.95) translateY(20px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* Кнопка закрытия */
.city-popup-close {
    position: absolute;
    top: 25px;
    right: 25px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 50%;
    cursor: pointer;
    padding: 10px;
    color: #495057;
    transition: all 0.3s;
    z-index: 10;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
}

.city-popup-close:hover {
    background: #2c7a3e;
    color: white;
    border-color: #2c7a3e;
    transform: rotate(90deg);
}

.city-popup-close svg {
    fill: currentColor;
    width: 20px;
    height: 20px;
}

/* Заголовок */
.city-popup-header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

.city-popup-header h2 {
    color: #2c7a3e;
    font-size: 32px;
    margin-bottom: 10px;
    font-weight: 700;
}

.city-popup-subtitle {
    color: #6c757d;
    font-size: 16px;
    max-width: 600px;
    margin: 0 auto;
}

/* Поиск городов */
.city-popup-search {
    margin-bottom: 30px;
    position: sticky;
    top: 0;
    background: white;
    padding-top: 10px;
    z-index: 1;
}

.city-search-input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.3s;
    background: #f8f9fa;
    font-family: inherit;
}

.city-search-input:focus {
    outline: none;
    border-color: #2c7a3e;
    background: white;
    box-shadow: 0 0 0 3px rgba(44, 122, 62, 0.1);
}

.city-search-input::placeholder {
    color: #adb5bd;
}

/* Сетка городов */
.cities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    margin-bottom: 40px;
}

.city-item {
    background: #f8f9fa;
    padding: 18px 15px;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid #e9ecef;
    font-weight: 500;
    color: #495057;
    position: relative;
    overflow: hidden;
}

.city-item:hover {
    background: #2c7a3e;
    color: white;
    transform: translateY(-3px);
    border-color: #2c7a3e;
    box-shadow: 0 8px 20px rgba(44, 122, 62, 0.2);
}

.city-item.highlight {
    background: #e8f5e9;
    border-color: #2c7a3e;
    color: #2c7a3e;
    font-weight: 600;
}

/* Информация о выбранном городе */
.selected-city-info {
    background: linear-gradient(135deg, #e8f5e9 0%, #f0f7f2 100%);
    border-radius: 12px;
    padding: 25px;
    margin-top: 30px;
    border-left: 5px solid #2c7a3e;
    display: none;
}

.selected-city-info.active {
    display: block;
    animation: citySlideIn 0.4s ease;
}

@keyframes citySlideIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.city-info-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.city-info-header h3 {
    color: #2c7a3e;
    font-size: 24px;
    margin: 0;
}

.city-order-btn {
    background: #2c7a3e;
    color: white;
    border: none;
    padding: 12px 28px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s;
    font-family: inherit;
}

.city-order-btn:hover {
    background: #246935;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(44, 122, 62, 0.3);
}

.city-info-text {
    color: #495057;
    font-size: 16px;
    line-height: 1.6;
}

.city-info-text strong {
    color: #2c7a3e;
}

/* Форма заказа */
.city-form-title {
    text-align: center;
    color: #2c7a3e;
    margin-bottom: 25px;
    font-size: 28px;
}

.city-feedback-form {
    max-width: 600px;
    margin: 0 auto;
    padding: 30px;
    background: white;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.city-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.city-form-group {
    margin-bottom: 20px;
}

.city-form-group label {
    display: block;
    margin-bottom: 8px;
    color: #495057;
    font-weight: 500;
    font-size: 15px;
}

.city-form-group input,
.city-form-group textarea,
.city-form-group select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s;
    background: #f8f9fa;
    font-family: inherit;
}

.city-form-group input:focus,
.city-form-group textarea:focus,
.city-form-group select:focus {
    outline: none;
    border-color: #2c7a3e;
    background: white;
    box-shadow: 0 0 0 3px rgba(44, 122, 62, 0.1);
}

.city-submit-btn {
    background: linear-gradient(135deg, #2c7a3e 0%, #3a9e55 100%);
    color: white;
    border: none;
    padding: 18px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 17px;
    font-weight: 600;
    width: 100%;
    transition: all 0.3s;
    margin-top: 10px;
    letter-spacing: 0.5px;
    font-family: inherit;
}

.city-submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(44, 122, 62, 0.3);
}

/* Сообщение об успехе */
.city-success-message {
    text-align: center;
    padding: 40px;
    display: none;
}

.city-success-message.active {
    display: block;
    animation: cityFadeIn 0.5s ease;
}

@keyframes cityFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.success-icon {
    font-size: 60px;
    color: #2c7a3e;
    margin-bottom: 20px;
}

.city-success-message h3 {
    color: #2c7a3e;
    font-size: 28px;
    margin-bottom: 15px;
}

.city-success-message p {
    color: #6c757d;
    font-size: 16px;
    line-height: 1.6;
    max-width: 500px;
    margin: 0 auto 25px;
}

/* Анимация загрузки */
.city-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #2c7a3e;
    border-radius: 50%;
    animation: citySpin 1s linear infinite;
    margin-right: 10px;
    vertical-align: middle;
}

@keyframes citySpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Стили для скроллбара */
.city-popup-container::-webkit-scrollbar {
    width: 8px;
}

.city-popup-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.city-popup-container::-webkit-scrollbar-thumb {
    background: #2c7a3e;
    border-radius: 10px;
}

.city-popup-container::-webkit-scrollbar-thumb:hover {
    background: #246935;
}

/* Адаптивность */
@media (max-width: 992px) {
    .cities-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 10px;
    }
    
    .city-popup-container {
        padding: 25px 20px;
        width: 95%;
    }
    
    .city-popup-header h2 {
        font-size: 28px;
    }
}

@media (max-width: 768px) {
    .cities-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .city-popup-header h2 {
        font-size: 24px;
    }
    
    .city-popup-subtitle {
        font-size: 14px;
    }
    
    .city-popup-search {
        margin-bottom: 20px;
    }
    
    .city-form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .city-info-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .city-order-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .cities-grid {
        grid-template-columns: 1fr;
    }
    
    .city-popup-container {
        padding: 20px 15px;
        width: 98%;
        max-height: 95vh;
    }
    
    .city-popup-close {
        top: 15px;
        right: 15px;
        width: 38px;
        height: 38px;
    }
}

/* Стили для кликабельного текста */
.city-popup-clickable {
    cursor: pointer;
    text-decoration: none;
    transition: color 0.3s;
}

.city-popup-clickable:hover {
    color: #246935;
}

/* Стиль для кнопки "Назад к городам" */
.city-back-to-cities {
    color: #2c7a3e;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
    display: inline-block;
    margin-top: 15px;
}

.city-back-to-cities:hover {
    color: #246935;
    text-decoration: underline;
}

/* Убираем нижний блок с информацией о городе */
.selected-city-info {
    display: none !important;
}

/* Улучшаем отображение сетки городов */
.cities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.city-item {
    background: #f8f9fa;
    padding: 20px 15px;
    border-radius: 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid #e9ecef;
    font-weight: 500;
    color: #495057;
    position: relative;
    overflow: hidden;
    font-size: 16px;
}

.city-item:hover {
    background: #2c7a3e;
    color: white;
    transform: translateY(-3px);
    border-color: #2c7a3e;
    box-shadow: 0 8px 20px rgba(44, 122, 62, 0.2);
}

.city-item.highlight {
    background: #e8f5e9;
    border-color: #2c7a3e;
    color: #2c7a3e;
    font-weight: 600;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(44, 122, 62, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(44, 122, 62, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(44, 122, 62, 0);
    }
}

/* Анимация при выборе города */
.city-item.selected {
    animation: citySelected 0.5s ease;
}

@keyframes citySelected {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.95);
    }
    100% {
        transform: scale(1);
    }
}