/*
 * ===========================================
 *         МАРШРУТЫ — AviaTrack
 *         Редизайн v2 (май 2026)
 * ===========================================
 */

/* ── Route card ───────────────────────────────────── */

.route-card {
    background: var(--color-surface);
    border-radius: var(--radius-xl);
    border: 1px solid var(--color-border);
    padding: 16px 18px;
    transition: box-shadow var(--transition-normal);
    animation: routeEnter 0.25s ease both;
}

.route-card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.07);
}

/* ── Card header ──────────────────────────────────── */

.route-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.route-card__route {
    flex: 1;
    min-width: 0;
}

.route-card__cities {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
    margin-bottom: 5px;
}

.route-card__city {
    font-weight: 700;
    font-size: 14px;
    color: var(--color-text);
}

.route-card__code {
    background: var(--color-bg);
    padding: 2px 5px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    font-family: var(--font-mono);
    color: var(--color-text-lt);
}

.route-card__arrow {
    color: var(--color-blue);
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.route-card__dates {
    font-size: 11px;
    color: var(--color-text-lt);
}

/* ── Price ────────────────────────────────────────── */

.route-card__price-wrap {
    text-align: right;
    flex-shrink: 0;
}

.route-card__price {
    font-family: var(--font-mono);
    font-size: 18px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 4px;
}

.route-card__price--low  { color: var(--color-green); }
.route-card__price--high { color: var(--color-red);   }

.route-card__change {
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 3px;
}

.route-card__change--low  { color: var(--color-green); }
.route-card__change--high { color: var(--color-red);   }

.route-card__change-prev {
    color: var(--color-text-lt);
    font-weight: 400;
}

/* ── Price bar ────────────────────────────────────── */

.route-card__bar {
    height: 3px;
    background: var(--color-border);
    border-radius: 2px;
    margin-bottom: 12px;
    overflow: hidden;
}

.route-card__bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.6s ease;
}

.route-card__bar-fill--low  { background: var(--color-green); }
.route-card__bar-fill--high { background: var(--color-red);   }

/* ── Actions ──────────────────────────────────────── */

.route-card__actions {
    display: flex;
    gap: 6px;
    align-items: center;
}

/* ── Buttons ──────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border-radius: var(--radius-md);
    font-family: var(--font-base);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    white-space: nowrap;
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Sizes */
.btn--sm  { font-size: 11px; padding: 5px 10px; }
.btn--md  { font-size: 13px; padding: 8px 14px; }
.btn--lg  { font-size: 14px; padding: 11px 22px; }

/* Variants */
.btn--primary {
    background: var(--color-blue);
    color: #fff;
    border: none;
}
.btn--primary:hover:not(:disabled) { background: var(--color-blue-dk); }

.btn--outline {
    background: transparent;
    color: var(--color-blue);
    border: 1px solid var(--color-border);
}
.btn--outline:hover:not(:disabled) {
    border-color: var(--color-border-md);
    color: var(--color-text);
}

.btn--ghost {
    background: transparent;
    color: var(--color-text-md);
    border: none;
}
.btn--ghost:hover:not(:disabled) { background: var(--color-bg); }

.btn--danger {
    background: var(--color-red-lt);
    color: var(--color-red);
    border: 1px solid oklch(90% 0.04 20);
}
.btn--danger:hover:not(:disabled) { background: oklch(94% 0.05 20); }

.btn--tg {
    background: oklch(97% 0.04 230);
    color: oklch(45% 0.22 230);
    border: 1px solid oklch(88% 0.07 230);
}
.btn--tg:hover:not(:disabled) { background: oklch(94% 0.06 230); }

.btn--tg-off {
    background: var(--color-bg);
    color: var(--color-text-lt);
    border: 1px solid var(--color-border);
}
.btn--tg-off:hover:not(:disabled) {
    border-color: var(--color-border-md);
    color: var(--color-text-md);
}

/* ── Stats grid ───────────────────────────────────── */

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.stat-card {
    background: var(--color-bg);
    border-radius: var(--radius-lg);
    padding: 10px 12px;
}

.stat-card__value {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--color-text);
    line-height: 1;
}

.stat-card__label {
    font-size: 11px;
    color: var(--color-text-lt);
    margin-top: 3px;
}

/* ── Section header ───────────────────────────────── */

.section-label {
    font-size: 11px;
    font-weight: 700;
    color: var(--color-text-lt);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 12px;
}

/* ── Mobile cards ─────────────────────────────────── */

@media (max-width: 767px) {
    .route-card {
        padding: 14px;
    }

    .route-card__price { font-size: 16px; }
    .route-card__city  { font-size: 13px; }

    .route-card__actions {
        flex-wrap: wrap;
        gap: 5px;
    }

    .btn--sm { padding: 6px 10px; }
}

/* ── Mobile header ────────────────────────────────── */

.mobile-header {
    height: var(--header-mobile);
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    flex-shrink: 0;
    position: relative;
    z-index: var(--z-sticky);
}

.mobile-header--dark {
    background: var(--color-navy-md);
    border-bottom-color: rgba(255, 255, 255, 0.08);
}

/* ── Mobile tab bar ───────────────────────────────── */

.mobile-tabs {
    display: flex;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0;
}

.mobile-tab {
    flex: 1;
    padding: 11px;
    border: none;
    border-bottom: 2px solid transparent;
    background: none;
    font-family: var(--font-base);
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text-lt);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.mobile-tab--active {
    color: var(--color-blue);
    border-bottom-color: var(--color-blue);
}

/* ── Mobile drawer ────────────────────────────────── */

.mobile-drawer-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: var(--z-modal-backdrop);
    backdrop-filter: blur(2px);
}

.mobile-drawer {
    position: fixed;
    top: var(--header-mobile);
    left: 0;
    bottom: 0;
    width: 280px;
    background: var(--color-surface);
    z-index: var(--z-modal);
    padding: 20px 18px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
}
