/* Специфичные стили для страницы маршрутов */

.routes-section {
    padding-top: min(60px, 5vw);
    padding-bottom: min(80px, 8vw);
    background: #ffffff;
    position: relative;
    width: 100%;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 clamp(10px, 3vw, 30px); /* Резиновые отступы */
    box-sizing: border-box;
}

.routes-section .section-title {
    margin-bottom: 40px; /* Уменьшаем отступ между заголовком и блоками */
}

/* Уменьшаем отступ между сеткой маршрутов и фильтрами */
.routes-grid {
    margin-bottom: 30px;
}

.routes-card {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-height: 320px;
    background: #ffffff;
    border-radius: 15px;
    box-shadow: 0 4px 18px rgba(44,62,80,0.04);
    padding: 28px 26px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.routes-card:hover {
    box-shadow: 0 8px 25px rgba(46, 37, 112, 0.08);
    transform: translateY(-3px);
}

.routes-card-header {
    display: flex;
    align-items: flex-start;
    margin-bottom: 22px;
}

.routes-icon {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background-color: #f0eef9;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 14px;
    margin-top: 3px;
    box-shadow: 0 2px 8px rgba(46, 37, 112, 0.08);
}

.routes-icon i {
    color: #2e2570;
    font-size: 18px;
}

.routes-title {
    flex: 1;
}

.routes-card h2 {
    font-size: 1.35em;
    color: #2e2570;
    font-weight: 700;
    letter-spacing: 0.3px;
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(46, 37, 112, 0.08);
}

.routes-card ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.routes-card ul li {
    margin-bottom: 13px;
    color: #444;
    font-size: 0.98em;
    font-weight: 500;
    line-height: 1.5;
    position: relative;
    padding-left: 26px;
    display: flex;
    align-items: flex-start;
}

.routes-card ul li:before {
    content: '';
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    background-color: #f0eef9;
    border-radius: 50%;
    position: absolute;
    left: 0;
    top: 3px;
    box-shadow: 0 1px 4px rgba(46, 37, 112, 0.1);
}

.routes-card ul li:after {
    content: '\f00c';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    color: #2e2570;
    font-size: 8px;
    position: absolute;
    left: 4px;
    top: 6px;
}

/* Стили для блока дополнительных услуг */
.routes-card.additional-services {
    border-left: 4px solid #2e2570;
    background: #fff;
    box-shadow: 0 2px 15px rgba(46, 37, 112, 0.08);
    transition: all 0.3s ease;
}

.routes-card.additional-services:hover {
    box-shadow: 0 6px 22px rgba(46, 37, 112, 0.12);
    border-left-width: 6px;
    transform: translateY(-3px) translateX(0);
}

.routes-card.additional-services .routes-card-header {
    margin-bottom: 25px;
}

.routes-card.additional-services .routes-icon {
    background-color: #2e2570;
    box-shadow: 0 2px 10px rgba(46, 37, 112, 0.2);
}

.routes-card.additional-services .routes-icon i {
    color: white;
    font-size: 20px;
}

.routes-card.additional-services h2 {
    color: #2e2570;
    font-weight: 700;
    position: relative;
    font-size: 1.35em;
}

.routes-card.additional-services ul {
    padding-left: 4px;
}

.routes-card.additional-services ul li {
    transition: all 0.2s ease;
    margin-bottom: 15px;
    padding-left: 30px;
    position: relative;
    font-size: 0.96em;
    color: #444;
    line-height: 1.5;
}

.routes-card.additional-services ul li:last-child {
    margin-bottom: 0;
}

.routes-card.additional-services ul li:hover {
    transform: translateX(5px);
    color: #2e2570;
}

.routes-card.additional-services ul li:before {
    background-color: #eaeaf9;
    width: 19px;
    height: 19px;
    left: 0;
    top: 2px;
    box-shadow: 0 1px 5px rgba(46, 37, 112, 0.15);
}

.routes-card.additional-services ul li:after {
    content: '\f00c';
    color: #2e2570;
    font-size: 10px;
    left: 5px;
    top: 5px;
}

/* Фильтры */
.filters {
    margin: 10px 0 20px;
    padding: 24px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(44,62,80,0.04);
}

.filter-group {
    margin-bottom: 15px;
}

.filter-group:last-child {
    margin-bottom: 0;
}

.filter-group label {
    display: block;
    margin-bottom: 14px;
    color: #2e2570;
    font-weight: 700;
    font-size: 16px;
}

.filter-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-btn {
    padding: 8px 16px;
    border: 1px solid #2e2570;
    border-radius: 50px;
    background: #fff;
    color: #2e2570;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    min-width: 70px;
    text-align: center;
}

.filter-btn:hover {
    background: rgba(46, 37, 112, 0.05);
}

.filter-btn.active {
    background: #2e2570;
    color: white;
    box-shadow: 0 2px 4px rgba(46, 37, 112, 0.25);
}

#countrySearch {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e0e0e0;
    border-radius: 50px;
    font-size: 15px;
    transition: all 0.2s ease;
    background-color: #fff;
}

#countrySearch:focus {
    border-color: #2e2570;
    outline: none;
    box-shadow: 0 0 0 2px rgba(46, 37, 112, 0.1);
}

/* Обертка таблицы для горизонтальной прокрутки */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
    max-width: 100%;
    margin-bottom: min(40px, 5vw);
    -webkit-overflow-scrolling: touch; /* Плавная прокрутка на iOS */
    scrollbar-width: thin; /* Тонкий скроллбар для Firefox */
    border-radius: 12px;
    box-shadow: 0 4px 18px rgba(44,62,80,0.04);
}

.table-wrapper::-webkit-scrollbar {
    height: 8px; /* Высота полосы прокрутки */
}

.table-wrapper::-webkit-scrollbar-track {
    background: #f1f1f1; /* Цвет фона */
    border-radius: 4px;
}

.table-wrapper::-webkit-scrollbar-thumb {
    background: #bbb; /* Цвет полосы */
    border-radius: 4px;
}

.table-wrapper::-webkit-scrollbar-thumb:hover {
    background: #888; /* Цвет при наведении */
}

/* Таблица цен для маршрутов */
.pricing-table {
    width: max-content; /* Автоматическая подстройка под содержимое */
    min-width: min(100%, 800px); /* Минимальная ширина не больше контейнера */
    border-collapse: separate;
    border-spacing: 0;
    margin-top: min(25px, 3vw);
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: none;
    table-layout: auto;
}

.pricing-table thead {
    background: linear-gradient(90deg, #2e2570, #3a2f8a);
    position: sticky;
    top: clamp(60px, 8vw, 80px); /* Резиновое прилипание */
    z-index: 10;
}

/* Предотвращение переноса строк в заголовках */
.pricing-table th {
    color: white;
    padding: 16px 20px;
    text-align: left;
    font-weight: 600;
    font-size: 0.9em;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    min-width: 80px; /* Минимальная ширина ячеек */
}

/* Для ячеек с содержимым можно добавить перенос, чтобы не растягивались */
.pricing-table td {
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
    color: #444;
    font-size: 0.95em;
    transition: all 0.2s ease;
    word-break: break-word;
}

.pricing-table tbody tr:first-child td {
    padding-top: 25px;
}

.pricing-table tbody tr {
    transition: all 0.2s ease;
    cursor: pointer;
}

.pricing-table tbody tr:hover {
    background: #f8f9fa;
    transform: translateX(5px);
}

.pricing-table td:first-child {
    font-weight: 600;
    color: #2e2570;
}

.pricing-table td:nth-child(2) {
    font-family: monospace;
    font-size: 0.95em;
    color: #666;
}

.pricing-table td:nth-child(3) {
    font-weight: 600;
    color: #2d9cdb;
}

.pricing-table td:last-child {
    color: #666;
    font-style: italic;
}

.pricing-table tr:hover td {
    color: #2e2570;
}

/* Стили для разных тиров маршрутов */
.pricing-table tr.tier-1 {
    background-color: rgba(46, 37, 112, 0.03);
}

.pricing-table tr.tier-2 {
    background-color: rgba(59, 130, 246, 0.03);
}

.pricing-table tr.tier-3 {
    background-color: rgba(5, 150, 105, 0.03);
}

.pricing-table tr.tier-1:hover {
    background-color: rgba(46, 37, 112, 0.07);
}

.pricing-table tr.tier-2:hover {
    background-color: rgba(59, 130, 246, 0.07);
}

.pricing-table tr.tier-3:hover {
    background-color: rgba(5, 150, 105, 0.07);
}

/* Настройка сообщений о загрузке/ошибке */
.loading-spinner {
    text-align: center;
    padding: clamp(20px, 5vw, 40px);
    width: 100%;
}

.loading-spinner i {
    font-size: clamp(18px, 5vw, 24px);
    color: #2e2570;
}

.loading-spinner p {
    margin-top: 10px;
    font-size: clamp(14px, 3vw, 16px);
}

/* Стиль для сообщений об ошибке */
.pricing-table tr td[colspan="5"] {
    padding: clamp(15px, 3vw, 25px);
    text-align: center;
}

.pricing-table tr td[colspan="5"][style*="color: red"] {
    color: #d32f2f !important;
    font-weight: 600;
}

.pricing-table tr td[colspan="5"] small {
    display: block;
    margin-top: 8px;
    opacity: 0.8;
    font-size: clamp(11px, 2.5vw, 14px);
}

/* Адаптивность для маршрутов */
@media (max-width: 820px) {
    .routes-grid {
        grid-template-columns: 1fr;
    }
    
    .filters {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .filter-group {
        width: 100%;
    }
    
    #countrySearch {
        width: 100%;
    }
    
    .pricing-table {
        font-size: 14px;
    }
    
    .pricing-table th,
    .pricing-table td {
        padding: 10px 15px;
    }
}

@media (max-width: 768px) {
    .routes-grid {
        grid-template-columns: 1fr;
        gap: 22px;
        padding: 0 10px;
    }

    .routes-card {
        padding: 22px 20px;
        min-height: auto;
    }

    .routes-icon {
        width: 38px;
        height: 38px;
        margin-right: 12px;
    }

    .routes-icon i {
        font-size: 16px;
    }

    .routes-card h2 {
        font-size: 1.2em;
        margin-bottom: 12px;
        padding-bottom: 12px;
    }

    .routes-card ul li {
        font-size: 0.94em;
        margin-bottom: 10px;
        padding-left: 24px;
    }

    .routes-card ul li:before {
        width: 14px;
        height: 14px;
        top: 3px;
    }

    .routes-card ul li:after {
        font-size: 7px;
        left: 4px;
        top: 5px;
    }

    .filters {
        margin: 30px 0;
        padding: 18px 15px;
    }

    .filter-group label {
        font-size: 15px;
        margin-bottom: 10px;
    }

    .filter-buttons {
        gap: 8px;
    }

    .filter-btn {
        padding: 7px 12px;
        font-size: 13px;
        min-width: 60px;
    }

    .pricing-table thead {
        top: 70px;
    }

    .pricing-table th {
        padding: 14px 15px;
        font-size: 0.8em;
    }

    .pricing-table td {
        padding: 12px 15px;
        font-size: 0.9em;
    }

    .pricing-table tbody tr:hover {
        transform: none;
    }

    .routes-card.additional-services {
        border-left-width: 3px;
    }

    .routes-card.additional-services:hover {
        border-left-width: 5px;
    }

    .routes-card.additional-services ul li {
        margin-bottom: 12px;
        padding-left: 28px;
    }

    .routes-card.additional-services ul li:before {
        width: 17px;
        height: 17px;
    }

    .routes-card.additional-services ul li:after {
        font-size: 9px;
        left: 4px;
        top: 4px;
    }
}

@media (max-width: 480px) {
    .routes-card {
        padding: 18px 16px;
    }

    .routes-card-header {
        margin-bottom: 16px;
    }

    .routes-icon {
        width: 34px;
        height: 34px;
        margin-right: 10px;
    }

    .routes-icon i {
        font-size: 14px;
    }

    .routes-card h2 {
        font-size: 1.1em;
        margin-bottom: 10px;
        padding-bottom: 10px;
    }

    .routes-card ul li {
        font-size: 0.9em;
        margin-bottom: 8px;
        padding-left: 22px;
    }

    .routes-card ul li:before {
        width: 12px;
        height: 12px;
        top: 3px;
    }

    .routes-card ul li:after {
        font-size: 6px;
        left: 3px;
        top: 5px;
    }

    .filter-buttons {
        gap: 6px;
    }

    .filter-btn {
        padding: 6px 10px;
        font-size: 12px;
        min-width: 50px;
    }

    #countrySearch {
        padding: 10px 14px;
        font-size: 14px;
        border-radius: 30px;
    }
    
    /* Улучшенная обертка таблицы для мобильной версии */
    .table-wrapper {
        padding: 0;
        margin: 15px 0 25px;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .table-wrapper::-webkit-scrollbar {
        height: 4px; /* Меньшая высота полосы прокрутки на мобильных */
    }
    
    /* Изменяем настройки таблицы для мобильных устройств */
    .pricing-table {
        width: max-content; /* Подстраивается под содержимое */
        min-width: auto; /* Убираем минимальную ширину */
        margin-top: 10px;
        border-radius: 8px;
    }
    
    /* Настройки ячеек */
    .pricing-table th, 
    .pricing-table td {
        padding: 10px 8px;
        font-size: 0.85em;
        white-space: nowrap; /* Предотвращаем перенос текста в ячейках */
    }
    
    /* Настройки для содержимого в последней колонке (Примечание) */
    .pricing-table th:last-child,
    .pricing-table td:last-child {
        white-space: normal; /* Примечание может переноситься */
        max-width: 150px; /* Ограничиваем ширину */
    }
    
    /* Стили для карточек с дополнительными услугами */
    .routes-card.additional-services ul li {
        margin-bottom: 10px;
        padding-left: 26px;
    }

    .routes-card.additional-services ul li:before {
        width: 15px;
        height: 15px;
    }

    .routes-card.additional-services ul li:after {
        font-size: 8px;
        left: 4px;
        top: 4px;
    }
} 