/* Modern Route Cards - Airbnb/Booking Premium Style */

/* Основные стили карточек */
.route-card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 1px 3px rgba(0, 0, 0, 0.08);
    border: 1px solid #E5E7EB;
    height: 100%;
}

.route-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
    border-color: #D1D5DB;
}

/* Контейнер изображения */
.route-card__image {
    position: relative;
    width: 100%;
    height: 240px; /* Фиксированная высота */
    overflow: hidden;
    background: #f7f7f7;
    /* Убираем любые возможные отступы */
    margin: 0;
    padding: 0;
    line-height: 0; /* Убираем возможный отступ от inline элементов */
}

.route-card__image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    transition: transform 0.4s ease;
    display: block !important; /* Убираем отступ снизу у inline изображений */
    margin: 0 !important;
    padding: 0 !important;
}

.route-card:hover .route-card__image img {
    transform: scale(1.08);
}

/* Переопределяем стили кнопки избранного */
/* Кнопка находится в content, но нужно позиционировать её поверх изображения */
.route-card .favorite-btn {
    position: absolute !important;
    /* Смещаем вверх на высоту изображения минус нужный отступ */
    top: -228px !important;
    right: 12px !important;
    width: 40px !important;
    height: 40px !important;
    background-color: white !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    z-index: 10 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
    /* Убираем старый background-image из style.css */
    background-image: none !important;
}

/* Добавляем иконку сердца через псевдоэлемент */
.route-card .favorite-btn::before {
    content: '' !important;
    display: block !important;
    width: 24px !important;
    height: 24px !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23222' stroke-width='2'%3E%3Cpath d='M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z'%3E%3C/path%3E%3C/svg%3E") !important;
    background-size: contain !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
}

/* При наведении */
.route-card .favorite-btn:hover {
    transform: scale(1.1) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2) !important;
}

/* Активное состояние (лайкнуто) */
.route-card .favorite-btn.active::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='%23FF385C' stroke='%23FF385C' stroke-width='2'%3E%3Cpath d='M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z'%3E%3C/path%3E%3C/svg%3E") !important;
}

/* Бейдж с рейтингом */
.route-card__rating {
    position: absolute;
    bottom: 12px;
    left: 12px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    padding: 4px 8px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    font-weight: 600;
    z-index: 2;
}

.route-card__rating svg {
    width: 14px;
    height: 14px;
}

/* Контент карточки */
.route-card__content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    position: relative;
}

/* Заголовок */
.route-card__title {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.4;
    color: #111827;
    margin: 0 0 10px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Рейтинг и просмотры */
.route-card__marks {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
    font-size: 13px;
    color: #6B7280;
}

.route-card__marks svg {
    width: 15px;
    height: 15px;
}

.route-card__marks p {
    margin: 0;
    display: flex;
    align-items: center;
    gap: 4px;
}

.route-card__marks b {
    color: #111827;
    font-weight: 600;
}

/* Описание */
.route-card__description {
    font-size: 14px;
    color: #717171;
    line-height: 1.4;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Цены */
.route-card__price {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    margin-right: 8px;
}

.route-card__old-price {
    font-size: 15px;
    color: #9CA3AF;
    text-decoration: line-through;
    font-weight: 400;
}

/* Кнопка "Подробнее" - современный легкий стиль Airbnb/Booking */
.route-card .btn-2 {
    margin-top: auto;
    padding-top: 16px;
    width: 100%;
    padding: 13px 24px;
    background: white;
    color: #222;
    border: 1.5px solid #DDDDDD;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.route-card .btn-2:hover {
    border-color: #222;
    background: #F7F7F7;
    transform: scale(1.01);
}

/* Промо-бейдж */
.route-card__price span[style*="background-color:red"] {
    background: linear-gradient(135deg, #FF385C 0%, #E91E63 100%) !important;
    color: white !important;
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-block;
}

/* Убираем лишние элементы */
.route-card__routes-link {
    display: none;
}

/* Сетка карточек - переопределяем старые flex стили */
.routes-cards {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    gap: 24px !important;
    margin-bottom: 40px;
    padding: 0;
    flex-wrap: nowrap !important;
}

/* Убираем старую фиксированную ширину карточек */
.routes-cards .route-card {
    width: 100% !important;
}

/* Для популярных маршрутов на главной */
.popular-routes .routes-cards {
    grid-template-columns: repeat(3, 1fr) !important;
}

/* Убираем Swiper стили для routes-cards */
.routes-cards.swiper-wrapper {
    display: grid !important;
    transform: none !important;
}

/* Модернизация карточек-категорий */
.routes-item {
    position: relative;
    border-radius: 20px !important;
    overflow: hidden;
    background: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #f0f0f0;
}

.routes-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.12);
    border-color: transparent;
}

.routes-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.routes-item:hover img {
    transform: scale(1.05);
}

.routes-item__content {
    padding: 24px !important;
}

.routes-item__title {
    font-size: 24px !important;
    font-weight: 700;
    color: #222;
    margin-bottom: 8px;
}

.routes-item__text {
    font-size: 14px;
    color: #717171;
    margin-bottom: 20px;
}

.routes-item .btn-3 {
    background: white;
    color: #222;
    border: 1.5px solid #DDDDDD;
    padding: 12px 24px;
    border-radius: 24px;
    font-weight: 500;
    font-size: 15px;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-block;
    text-decoration: none;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.routes-item .btn-3:hover {
    background: #F7F7F7;
    color: #222;
    border-color: #222;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Адаптивность */
@media (max-width: 1200px) {
    .popular-routes .routes-cards {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    .routes-cards {
        gap: 20px;
    }
}

@media (max-width: 991px) {
    .popular-routes .routes-cards {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .route-card__title {
        font-size: 16px;
    }

    .routes-item__title {
        font-size: 20px !important;
    }
}

@media (max-width: 768px) {
    .routes-cards {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 16px;
    }

    .route-card__content {
        padding: 12px;
    }

    .route-card__price {
        font-size: 16px;
    }
}

@media (max-width: 576px) {
    .routes-cards {
        grid-template-columns: 1fr !important;
    }

    .popular-routes .routes-cards {
        grid-template-columns: 1fr !important;
    }

    .routes-item {
        margin-bottom: 16px;
    }

    .route-card__content {
        padding: 16px;
    }

    .route-card__image {
        height: 200px;
    }
}

/* Анимации загрузки */
@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.route-card--loading .route-card__image {
    background: linear-gradient(
        90deg,
        #f0f0f0 0%,
        #f8f8f8 50%,
        #f0f0f0 100%
    );
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
}

/* Исправляем Swiper слайды */
.swiper-slide.route-card {
    height: auto !important;
}

/* Убираем margin у карточек в свайпере */
.routes-slider .route-card,
.swiper-wrapper .route-card {
    margin-bottom: 0 !important;
}

/* Удаление старых стилей Swiper для карточек */
.routes-slider .swiper-slide {
    height: auto;
}

.routes-page .route-card.hidden-card {
    display: none;
}

/* Фиксим flex контейнеры */
.route-card > div:first-child {
    flex-shrink: 0;
}

/* Убираем лишние отступы */
.route-card .d-flex.gap-3.mb-4 {
    margin-bottom: 16px !important;
}

/* Кнопка "Смотреть все" - современный нежный стиль */
.view-all-routes {
    display: block;
    margin: 32px auto 0;
    padding: 14px 40px;
    background: white;
    border: 1.5px solid #DDDDDD;
    border-radius: 24px;
    color: #222;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    width: fit-content;
    text-align: center;
}

.view-all-routes:hover {
    background: #F7F7F7;
    border-color: #222;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    color: #222;
}