/* Мобильная адаптация страниц городов /city/* */

@media (max-width: 768px) {
    /* Контейнер страницы города */
    .city-page {
        padding: 0;
    }

    /* Hero секция города */
    .city-hero {
        padding: 2rem 1rem;
        background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
        color: white;
        text-align: center;
        margin-bottom: 1.5rem;
    }

    .city-hero-title {
        font-size: 1.75rem !important;
        font-weight: 700;
        margin-bottom: 0.75rem;
        line-height: 1.2;
    }

    .city-hero-subtitle {
        font-size: 1rem;
        opacity: 0.9;
    }

    /* Основной контент */
    .city-content {
        padding: 0 1rem 2rem;
    }

    /* Направления из города */
    .city-directions {
        margin: 2rem 0;
    }

    .city-directions-title {
        font-size: 1.3rem;
        margin-bottom: 1rem;
        color: #0f172a;
        font-weight: 700;
    }

    .directions-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .direction-card {
        background: white;
        border-radius: 12px;
        padding: 1rem;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
        border: 1px solid #e5e7eb;
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-decoration: none;
        color: inherit;
        transition: all 0.2s ease;
    }

    .direction-card:active {
        transform: scale(0.98);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    }

    .direction-info {
        flex: 1;
    }

    .direction-name {
        font-size: 1.05rem;
        font-weight: 600;
        color: #0f172a;
        margin-bottom: 0.25rem;
    }

    .direction-distance {
        font-size: 0.85rem;
        color: #64748b;
    }

    .direction-price {
        font-size: 1.1rem;
        font-weight: 700;
        color: #2563eb;
    }

    /* Популярные маршруты */
    .popular-routes {
        background: #f8fafc;
        border-radius: 16px;
        padding: 1.5rem 1rem;
        margin: 1.5rem 0;
    }

    .popular-routes-title {
        font-size: 1.2rem;
        margin-bottom: 1rem;
        color: #0f172a;
        font-weight: 700;
    }

    .popular-routes-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .popular-route-item {
        background: white;
        padding: 0.875rem 1rem;
        border-radius: 10px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-decoration: none;
        color: inherit;
        border: 1px solid #e5e7eb;
        transition: transform 0.2s ease;
    }

    .popular-route-item:active {
        transform: scale(0.98);
    }

    .popular-route-name {
        font-weight: 600;
        color: #1e293b;
        font-size: 0.95rem;
    }

    .popular-route-price {
        font-weight: 700;
        color: #2563eb;
        font-size: 1rem;
    }

    /* Информация о городе */
    .city-info {
        background: white;
        border-radius: 16px;
        padding: 1.5rem 1rem;
        margin: 1.5rem 0;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    }

    .city-info h2 {
        font-size: 1.3rem;
        margin-bottom: 1rem;
        color: #0f172a;
    }

    .city-info p {
        font-size: 1rem;
        line-height: 1.7;
        color: #475569;
        margin-bottom: 1rem;
    }

    .city-info ul {
        padding-left: 1.5rem;
        margin-bottom: 1rem;
    }

    .city-info li {
        margin-bottom: 0.5rem;
        line-height: 1.6;
        color: #475569;
    }

    /* Статистика города */
    .city-stats {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
        margin: 1.5rem 0;
    }

    .city-stat-card {
        background: white;
        border-radius: 12px;
        padding: 1rem;
        text-align: center;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
        border: 1px solid #e5e7eb;
    }

    .city-stat-value {
        font-size: 1.75rem;
        font-weight: 700;
        color: #2563eb;
        margin-bottom: 0.25rem;
    }

    .city-stat-label {
        font-size: 0.85rem;
        color: #64748b;
    }

    /* Контактная информация */
    .city-contact {
        background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
        border-radius: 16px;
        padding: 1.5rem;
        color: white;
        margin: 1.5rem 0;
        text-align: center;
    }

    .city-contact h3 {
        font-size: 1.2rem;
        margin-bottom: 1rem;
    }

    .city-contact-button {
        background: white;
        color: #2563eb;
        border: none;
        border-radius: 10px;
        padding: 12px 24px;
        font-size: 1rem;
        font-weight: 600;
        width: 100%;
        cursor: pointer;
        transition: transform 0.2s ease;
    }

    .city-contact-button:active {
        transform: scale(0.98);
    }

    /* Фильтр направлений */
    .directions-filter {
        margin-bottom: 1rem;
    }

    .filter-tabs {
        display: flex;
        gap: 0.5rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0.5rem;
    }

    .filter-tab {
        background: #f8fafc;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
        white-space: nowrap;
        cursor: pointer;
        transition: all 0.2s ease;
    }

    .filter-tab.active {
        background: #2563eb;
        color: white;
        border-color: #2563eb;
    }

    /* Пагинация */
    .directions-pagination {
        display: flex;
        justify-content: center;
        gap: 0.5rem;
        margin-top: 2rem;
    }

    .pagination-button {
        width: 40px;
        height: 40px;
        border-radius: 8px;
        border: 1px solid #e5e7eb;
        background: white;
        color: #475569;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.2s ease;
    }

    .pagination-button.active {
        background: #2563eb;
        color: white;
        border-color: #2563eb;
    }

    .pagination-button:active {
        transform: scale(0.95);
    }

    /* Sticky CTA кнопка */
    .city-sticky-cta {
        position: sticky;
        bottom: 16px;
        left: 0;
        right: 0;
        padding: 0 1rem;
        z-index: 100;
    }

    .city-cta-button {
        width: 100%;
        padding: 16px 24px;
        background: linear-gradient(135deg, #2563eb, #1d4ed8);
        color: white;
        border: none;
        border-radius: 12px;
        font-size: 1.1rem;
        font-weight: 600;
        box-shadow: 0 8px 24px rgba(37, 99, 235, 0.3);
        cursor: pointer;
        transition: transform 0.2s ease;
    }

    .city-cta-button:active {
        transform: scale(0.98);
    }

    /* Safe area для iPhone X+ */
    @supports (padding: env(safe-area-inset-bottom)) {
        .city-sticky-cta {
            bottom: max(16px, env(safe-area-inset-bottom));
        }

        .city-cta-button {
            padding-bottom: max(16px, calc(16px + env(safe-area-inset-bottom)));
        }
    }
}

/* Для очень маленьких экранов */
@media (max-width: 375px) {
    .city-hero-title {
        font-size: 1.5rem !important;
    }

    .direction-name {
        font-size: 0.95rem;
    }

    .direction-price {
        font-size: 1rem;
    }

    .city-stats {
        gap: 0.5rem;
    }

    .city-stat-card {
        padding: 0.875rem;
    }

    .city-stat-value {
        font-size: 1.5rem;
    }
}
