/* Стили для блока поиска города */
.city-search-block {
    max-width: 600px;
    margin: 20px auto 30px auto;
    position: relative;
}

.city-search-container {
    position: relative;
    width: 100%;
}

.city-search-input {
    width: 100%;
    padding: 14px 20px;
    font-size: 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    outline: none;
    transition: all 0.2s;
    background: white;
}

.city-search-input:focus {
    border-color: #0846a3;
    box-shadow: 0 0 0 3px rgba(8, 70, 163, 0.1);
}

.city-search-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    margin-top: 8px;
    max-height: 300px;
    overflow-y: auto;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.city-search-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 15px;
    color: #1e293b;
    border-bottom: 1px solid #f1f5f9;
}

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

.city-search-item:hover {
    background: #0846a3;
    color: white;
}

/* Стилизация скролла */
.city-search-dropdown::-webkit-scrollbar {
    width: 6px;
}

.city-search-dropdown::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 3px;
}

.city-search-dropdown::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.city-search-dropdown::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

@media (max-width: 768px) {
    .city-search-block {
        margin: 15px auto 25px auto;
        padding: 0 16px;
    }
}

.text-block-top {
    display: none;
}

/* Заголовок "Популярные направления" */
.popular-title {
    font-size: 22px;
    font-weight: 600;
    color: #0f172a;
    margin: 0 0 20px 0;
    text-align: center;
}

@media (max-width: 768px) {
    .popular-title {
        font-size: 20px;
        margin: 0 0 16px 0;
        text-align: left;
        padding: 0 16px;
    }
}

/* Карточки городов - 2 в ряд на мобильных */
.city-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin: 0 0 30px 0;
}

.city-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}

.city-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

.city-card a {
    text-decoration: none;
    display: block;
}

.city-card img {
    width: 100%;
    height: auto;
    display: block;
}

.city-name {
    padding: 14px 12px;
    font-size: 16px;
    font-weight: 500;
    color: #0f172a;
    text-align: center;
    background: white;
    border-top: 1px solid #e2e8f0;
}

.city-card:hover .city-name {
    color: #0846a3;
}

/* Десктоп - 3 колонки */
@media (min-width: 769px) and (max-width: 1024px) {
    .city-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}

/* Планшеты - 2 колонки */
@media (min-width: 481px) and (max-width: 768px) {
    .city-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
        padding: 0 16px;
    }
}

/* Мобильные - 2 колонки */
@media (max-width: 480px) {
    .city-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 0 12px;
    }
    
    .city-name {
        padding: 10px 8px;
        font-size: 13px;
    }
}

.routes-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 30px 0;
    justify-content: center;
}

.routes-links a {
    background: #f1f5f9;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 14px;
    text-decoration: none;
    color: #0f172a;
    transition: all 0.2s;
}

.routes-links a:hover {
    background: #0846a3;
    color: white;
}

@media (max-width: 480px) {
    .routes-links {
        padding: 0 12px;
        gap: 6px;
    }
    .routes-links a {
        padding: 5px 12px;
        font-size: 12px;
    }
}

.stops-list {
    margin: 20px 0;
}

.source-info {
    margin: 20px 0;
    font-size: 12px;
    color: #94a3b8;
    text-align: center;
}

/* Информационный блок */
.info-block {
    margin: 40px 0 30px 0;
    padding: 0;
}

.info-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #ffffff; /* изменено на белый */
    border: 2px solid #1e2a5e; /* добавлена рамка тёмно-синего цвета */
    border-radius: 16px;
}

.info-section h3 {
    font-size: 20px;
    font-weight: 600;
    color: #0f172a;
    margin-bottom: 12px;
}

.info-section p {
    font-size: 15px;
    line-height: 1.6;
    color: #334155;
    margin-bottom: 12px;
}

.info-section p:last-child {
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .info-block {
        margin: 30px 0 20px 0;
    }
    
    .info-section {
        padding: 16px;
        margin-bottom: 20px;
        border-width: 2px; /* рамка сохраняется на мобильных */
    }
    
    .info-section h3 {
        font-size: 18px;
    }
    
    .info-section p {
        font-size: 14px;
    }
}

/* ========== БЛОК ПОИСКА ПО ГОРОДАМ (МИНИМАЛИСТИЧНЫЙ) ========== */
.search-city-block {
    width: 100%;
    margin: 0;
    padding: 0;
}

.search-input-wrapper {
    position: relative;
    width: 100%;
}

.search-input {
    width: 100%;
    padding: 12px 40px 12px 16px;
    font-size: 0.95rem;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: white;
    outline: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
    font-family: inherit;
}

.search-input:focus {
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59,130,246,0.1);
}

.clear-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #94a3b8;
    padding: 4px 8px;
    border-radius: 50%;
    transition: all 0.2s;
    display: none;
}

.clear-btn.visible {
    display: block;
}

.clear-btn:hover {
    color: #ef4444;
}

.search-results {
    margin-top: 8px;
    max-height: 500px;
    overflow-y: auto;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.search-results:empty {
    display: none;
}

.result-item {
    display: block;
    padding: 10px 16px;
    border-bottom: 1px solid #f1f5f9;
    transition: background 0.15s;
    text-decoration: none;
    color: #1e293b;
    font-size: 0.9rem;
}

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

.result-item:hover {
    background: #f8fafc;
}

.no-results {
    padding: 20px;
    text-align: center;
    color: #64748b;
    font-size: 0.85rem;
}

.search-results::-webkit-scrollbar {
    width: 6px;
}

.search-results::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 10px;
}

.search-results::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}