/* ==========================================================================
   iFura.kz — мобильная переработка
   Подключается ПОСЛЕ app.css. Содержит только медиа-запросы для устройств.
   Брейкпойнты:
     - 991.98px : крупные планшеты / маленькие десктопы
     - 767.98px : основной мобильный (большинство правил)
     - 575.98px : узкие телефоны
     - 380px    : очень компактные
   ========================================================================== */

/* ===========================================================================
   ОБЩИЕ ТОКЕНЫ ДЛЯ МОБИЛЬНОГО (≤ 767.98px)
   =========================================================================== */
@media (max-width: 767.98px) {
    :root {
        --pro-radius:        12px;
        --pro-radius-sm:     10px;
        --pro-radius-lg:     18px;
        --m-touch-h:         46px;
        --m-touch-h-lg:      52px;
        --m-bottom-nav-h:    62px;
        --m-bottom-nav-safe: 0px;
        --m-page-pad:        14px;
    }

    html { font-size: 15.5px; }

    html,
    body.ifura-layout-body {
        height: auto !important;
        min-height: 100%;
    }

    body.ifura-layout-body {
        min-height: 100vh;
        min-height: 100dvh;
    }

    body {
        line-height: 1.5;
        /* нижний внутренний отступ для bottom-nav */
        padding-bottom: var(--m-bottom-nav-safe);
    }

    .pro-container, .container {
        padding: 0 var(--m-page-pad);
        max-width: 100%;
    }

    main#main .container {
        padding-top: 12px !important;
    }

    .pro-page { padding: 8px 0 22px; }

    /* типографика */
    h1 { font-size: 22px; line-height: 1.2; letter-spacing: -0.018em; }
    h2 { font-size: 18px; }
    h3 { font-size: 16px; }
    .pro-section__title { font-size: 16px; }
    .pro-section__text  { font-size: 13px; }
    .pro-section { margin-top: 18px; }
    .pro-section__head { gap: 6px; margin-bottom: 8px; flex-direction: column; align-items: flex-start; }

    /* breadcrumbs прячем — экономим вертикаль */
    .cf-breadcrumbs { display: none; }
}

/* ===========================================================================
   ХЕДЕР И МОБИЛЬНОЕ DRAWER-МЕНЮ
   =========================================================================== */
@media (max-width: 991.98px) {
    .ih { box-shadow: 0 1px 0 rgba(var(--cm-primary-rgb), 0.06); }
    .ih__inner {
        padding: 9px 14px;
        gap: 10px;
        justify-content: space-between;
    }
    .ih__brand img { height: 36px; }
    .ih__nav, .ih__actions, .ih__divider, .ih__cta { display: none; }
    .ih__burger {
        display: inline-flex;
        width: 42px; height: 42px;
        background: var(--pro-soft);
        border-color: var(--pro-border);
        color: var(--cm-primary);
    }
    .ih__burger i { font-size: 22px; }

    /* full-screen drawer вместо аккордеона */

    @keyframes ih-slide-down {
        from { opacity: 0; transform: translateY(-8px); }
        to   { opacity: 1; transform: translateY(0); }
    }
}

/* ===========================================================================
   НИЖНЯЯ НАВИГАЦИЯ (mobile bottom nav)
   Ожидается markup в layout: <nav class="m-bottom-nav"> ... </nav>
   =========================================================================== */
.m-bottom-nav { display: none; }

@media (max-width: 767.98px) {
    .m-bottom-nav {
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        position: fixed; left: 0; right: 0; bottom: 0;
        z-index: 1040;
        background: rgba(255, 255, 255, 0.97);
        backdrop-filter: blur(14px);
        -webkit-backdrop-filter: blur(14px);
        border-top: 1px solid var(--pro-border);
        box-shadow: 0 -8px 24px rgba(14, 39, 71, 0.08);
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }
    .m-bottom-nav__item {
        display: flex; flex-direction: column; align-items: center; justify-content: center;
        gap: 2px;
        padding: 8px 4px;
        text-decoration: none;
        color: var(--cm-muted);
        font-size: 11px; font-weight: 500;
        line-height: 1.1;
        min-height: var(--m-bottom-nav-h, 62px);
        transition: color 0.15s, background 0.15s;
    }
    .m-bottom-nav__item i {
        font-size: 22px;
        margin-bottom: 2px;
        transition: transform 0.15s;
    }
    .m-bottom-nav__item.is-active {
        color: var(--cm-primary);
    }
    .m-bottom-nav__item.is-active i {
        transform: translateY(-1px);
    }
    .m-bottom-nav__item:active { background: var(--pro-soft); }

    /* центральный «+» — выпуклая FAB-style кнопка */
    .m-bottom-nav__item.is-fab {
        position: relative;
        color: #fff;
    }
    .m-bottom-nav__item.is-fab i {
        width: 50px; height: 50px;
        display: inline-flex; align-items: center; justify-content: center;
        margin: -22px 0 4px;
        background: var(--pro-grad-primary);
        color: #fff;
        border-radius: 50%;
        font-size: 26px;
        box-shadow: 0 8px 22px rgba(var(--cm-primary-rgb), 0.42);
        border: 4px solid #fff;
    }
    .m-bottom-nav__item.is-fab span {
        color: var(--cm-primary);
        font-weight: 600;
    }
}

/* ===========================================================================
   PAGEHERO / HERO / KPI
   =========================================================================== */
@media (max-width: 767.98px) {
    .pro-pagehero {
        padding: 16px 14px 14px;
        margin-bottom: 12px;
        border-radius: var(--pro-radius);
    }
    .pro-pagehero::before { height: 2px; }
    .pro-pagehero__head {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        margin-bottom: 10px;
    }
    .pro-pagehero__title { font-size: 20px; }
    .pro-pagehero__sub   { font-size: 13px; }
    .pro-pagehero .pro-actions { width: 100%; }
    .pro-pagehero .pro-actions .pro-btn {
        flex: 1; justify-content: center; min-height: 44px;
    }

    /* page-hero KPI блок — горизонтальный скролл */
    .pro-pagehero .pro-kpis,
    .pro-kpis {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px;
    }
    .pro-kpi {
        padding: 10px 12px;
        border-radius: var(--pro-radius-sm);
    }
    .pro-kpi b { font-size: 16px; }
    .pro-kpi span { font-size: 11px; }

    /* hero blueprint — упрощаем, убираем визуал */
    .pro-hero { padding: 8px 0 14px; }
    .pro-hero--blueprint {
        padding: 18px 14px 16px;
        border-radius: var(--pro-radius);
    }
    .pro-hero--blueprint .pro-hero__grid {
        grid-template-columns: 1fr !important;
        gap: 14px;
    }
    .pro-hero__title { font-size: clamp(20px, 6vw, 24px); }
    .pro-hero__sub { font-size: 13.5px; }
    .pro-hero__eyebrow { padding: 4px 10px; font-size: 11px; }
    .pro-hero__actions { gap: 6px; }
    .pro-hero__actions .pro-btn { flex: 1; justify-content: center; min-height: 44px; }

    /* визуал в герое прячем — экономим экран */
    .pro-hero-visual { display: none; }
    .pro-search-wrap { margin-top: 6px; padding: 0; }

    .pro-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }
    .pro-stat { padding: 10px 12px; }
    .pro-stat b { font-size: 17px; }
    .pro-stat span { font-size: 11px; }
}

@media (max-width: 380px) {
    .pro-pagehero .pro-actions { flex-direction: column; }
    .pro-pagehero .pro-actions .pro-btn { width: 100%; }
}

/* ===========================================================================
   SECTION HEAD / SEARCH PANEL
   =========================================================================== */
@media (max-width: 767.98px) {
    .pro-search {
        padding: 14px 12px;
        border-radius: var(--pro-radius);
    }
    .pro-search::before { height: 2px; }
    .pro-search__top {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .pro-search__tabs {
        width: 100%;
        justify-content: stretch;
    }
    .pro-search__tabs label {
        flex: 1; justify-content: center;
        padding: 10px 12px;
        font-size: 13px;
        min-height: 40px;
    }
    .pro-search__caption { font-size: 11.5px; }
    .pro-search__submit { height: 48px; font-size: 14px; font-weight: 600; }
}

/* ===========================================================================
   ROLES / AUDIENCE / ACCESS / FLOW / CTA
   =========================================================================== */
@media (max-width: 767.98px) {
    .pro-roles {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .pro-role-card {
        min-height: 0;
        padding: 16px;
    }
    .pro-role-card__icon { width: 42px; height: 42px; border-radius: 12px; }
    .pro-role-card__icon i { font-size: 22px; }
    .pro-role-card__title { font-size: 16px; }
    .pro-role-card__text { font-size: 13px; }
    .pro-role-card__actions .pro-btn {
        flex: 1; justify-content: center; min-height: 40px;
    }

    .pro-audience { grid-template-columns: 1fr; gap: 10px; }
    .pro-aud-card { padding: 14px; }

    .pro-access { grid-template-columns: 1fr; gap: 10px; }
    .pro-access-card { padding: 16px; }

    .pro-flow {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 14px;
        border-radius: var(--pro-radius);
    }
    .pro-flow-step { padding: 12px 14px; }
    .pro-flow-step__title { font-size: 14px; }
    .pro-flow-step__text { font-size: 12.5px; }

    .pro-cta {
        grid-template-columns: 1fr;
        padding: 18px 16px;
        gap: 12px;
        text-align: center;
        border-radius: var(--pro-radius);
    }
    .pro-cta__actions { justify-content: center; }
    .pro-cta__actions .pro-btn { flex: 1; justify-content: center; min-height: 44px; }
    .pro-cta::after { width: 140px; height: 140px; right: -40px; top: -50px; }
}

/* ===========================================================================
   MARKETPLACE / 2-КОЛОНКИ
   =========================================================================== */
@media (max-width: 767.98px) {
    .pro-market {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .pro-market__col { padding: 12px; }
    .pro-market__title { font-size: 14px; }
    .pro-market-board {
        padding: 12px;
        border-radius: var(--pro-radius);
    }
}

/* ===========================================================================
   SIDEBAR LAYOUT — фильтры в bottom-sheet (CSS-only через :has)
   =========================================================================== */
@media (max-width: 991.98px) {
    .pro-grid--sidebar,
    .pro-grid--detail {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .pro-grid--two { grid-template-columns: 1fr; }
    .pro-sticky { position: static; }
}

@media (max-width: 767.98px) {
    /* Sidebar (фильтры) превращается в выезжающий снизу sheet.
       Активируется через любой <input type="checkbox" id="m-filters"> на странице
       и label с классом m-filter-toggle. Если HTML hooks нет — aside просто стек. */
    .pro-grid--sidebar > aside { order: -1; }

    /* Если есть hidden checkbox с id="m-filters" — превращаем aside в sheet */
    body:has(#m-filters) .pro-grid--sidebar > aside {
        position: fixed;
        left: 0; right: 0; bottom: 0;
        max-height: 80vh;
        overflow-y: auto;
        background: #fff;
        z-index: 1050;
        border-top-left-radius: 22px;
        border-top-right-radius: 22px;
        box-shadow: 0 -16px 40px rgba(14, 39, 71, 0.18);
        padding: 10px var(--m-page-pad, 14px) calc(18px + env(safe-area-inset-bottom, 0px));
        transform: translateY(100%);
        transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
    }
    body:has(#m-filters) .pro-grid--sidebar > aside::before {
        content: ""; display: block;
        width: 44px; height: 4px;
        background: var(--pro-border-strong);
        border-radius: 999px;
        margin: 6px auto 12px;
    }
    body:has(#m-filters:checked) .pro-grid--sidebar > aside {
        transform: translateY(0);
    }
    body:has(#m-filters:checked)::after {
        content: ""; position: fixed; inset: 0;
        background: rgba(14, 39, 71, 0.45);
        z-index: 1049;
    }
    body:has(#m-filters) .m-filter-toggle {
        position: fixed;
        right: 14px;
        bottom: calc(var(--m-bottom-nav-h, 62px) + env(safe-area-inset-bottom, 0px) + 12px);
        z-index: 1041;
        width: 56px; height: 56px;
        border-radius: 50%;
        background: var(--pro-grad-primary);
        color: #fff;
        display: inline-flex; align-items: center; justify-content: center;
        box-shadow: 0 12px 28px rgba(var(--cm-primary-rgb), 0.36);
        cursor: pointer;
        border: 0;
        font-size: 22px;
    }
    body:has(#m-filters:checked) .m-filter-toggle i::before {
        content: "\ea76"; /* ti-x */
    }
}

/* ===========================================================================
   TOOLBAR / РЕЗУЛЬТАТЫ / КАРТОЧКИ ГРУЗОВ И ТРАНСПОРТА
   =========================================================================== */
@media (max-width: 767.98px) {
    .pro-toolbar-strip {
        padding: 10px 12px;
        margin-bottom: 10px;
        gap: 8px;
        flex-wrap: nowrap;
        font-size: 12.5px;
    }
    .pro-toolbar-strip__count { flex: 1; min-width: 0; font-size: 12px; line-height: 1.3; }
    .pro-toolbar-strip__sort {
        margin-left: 0;
        flex-shrink: 0;
    }
    .pro-toolbar-strip__sort .pro-label { display: none; }
    .pro-toolbar-strip__sort .form-select {
        min-width: 130px;
        height: 38px;
        font-size: 12.5px;
    }

    .pro-results,
    .pro-results.is-narrow {
        grid-template-columns: 1fr !important;
        gap: 10px;
    }

    /* — карточки грузов/транспорта: компактнее, тач-удобные — */
    .pro-item-card {
        padding: 14px 14px 14px 16px;
        gap: 8px;
        border-radius: var(--pro-radius);
    }
    .pro-item-card::before { width: 4px; }
    .pro-item-card__top {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }
    .pro-item-card__route {
        font-size: 16px;
        gap: 5px;
        line-height: 1.3;
    }
    .pro-item-card__route i { font-size: 17px; }
    .pro-item-card__price {
        align-self: flex-start;
        font-size: 13.5px;
        padding: 4px 10px;
    }
    .pro-item-card__meta {
        gap: 6px 10px;
        font-size: 12.5px;
    }
    .pro-item-card__meta i { font-size: 14px; }
    .pro-item-card__foot {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 6px;
        padding-top: 8px;
        font-size: 11.5px;
    }
    .pro-item-card__foot .pro-actions { gap: 4px; flex-wrap: wrap; }

    /* — pro-row: вертикальная компактная плитка — */
    .pro-row {
        grid-template-columns: 1fr;
        gap: 6px;
        padding: 12px 12px 12px 14px;
    }
    .pro-row__route { font-size: 14.5px; }
    .pro-row__right {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        text-align: left;
        min-width: 0;
        gap: 8px;
        margin-top: 2px;
        padding-top: 6px;
        border-top: 1px dashed var(--pro-border);
        width: 100%;
    }
    .pro-row__price { font-size: 14px; }
}

/* ===========================================================================
   ФОРМЫ — крупные тач-цели, всегда 1 колонка
   =========================================================================== */
@media (max-width: 767.98px) {
    .pro-form { gap: 16px; }
    .pro-form__grid--2,
    .pro-form__grid--3,
    .pro-form__grid--4 {
        grid-template-columns: 1fr !important;
        gap: 12px;
    }
    .pro-field--col-2 { grid-column: span 1; }

    .pro-input, .pro-select, .pro-textarea,
    .pro-form .form-control, .pro-form .form-select,
    .form-control, .form-select {
        height: 46px;
        padding: 10px 12px;
        font-size: 15px; /* iOS не зумит при ≥16px, но 15px — компромисс */
        border-radius: var(--pro-radius-sm);
    }
    .pro-textarea, textarea.form-control {
        min-height: 120px;
        font-size: 15px;
        padding: 12px;
    }
    .pro-label, .form-label, .pro-form .form-label {
        font-size: 12px;
        margin-bottom: 6px;
    }

    .pro-input-group { gap: 6px; }
    .input-group { flex-wrap: nowrap; }
    .input-group-text { font-size: 12.5px; padding: 8px 12px; }

    .pro-check { font-size: 14px; gap: 9px; min-height: 24px; }
    .pro-check input[type="checkbox"], .pro-check input[type="radio"],
    .form-check-input { width: 20px; height: 20px; }

    /* кнопки в формах */
    .pro-btn {
        min-height: 46px;
        padding: 10px 14px;
        font-size: 14px;
        border-radius: var(--pro-radius-sm);
    }
    .pro-btn.is-lg { min-height: 52px; font-size: 15px; padding: 12px 18px; }
    .pro-btn.is-sm { min-height: 36px; font-size: 12.5px; padding: 7px 11px; }
    .pro-btn.is-block, .pro-actions .pro-btn {
        flex: 1; justify-content: center;
    }
    .pro-actions { gap: 8px; }
}

/* ===========================================================================
   FORM BUILDER (3-колоночный мастер) → 1 колонка с табами
   =========================================================================== */
@media (max-width: 991.98px) {
    .pro-builder {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .pro-builder__nav {
        position: sticky;
        top: 60px;
        z-index: 100;
        flex-direction: row;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        padding: 6px;
        background: rgba(255, 255, 255, 0.96);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }
    .pro-builder__nav-head { display: none; }
    .pro-builder__nav-item {
        grid-template-columns: 24px 1fr;
        flex-shrink: 0;
        min-width: 140px;
        scroll-snap-align: start;
        padding: 9px 11px;
        font-size: 13px;
    }
    .pro-builder__nav-tick { display: none; }
    .pro-builder__nav-num { width: 24px; height: 24px; font-size: 11px; border-radius: 7px; }

    .pro-builder__preview {
        position: static;
        order: 99;
        padding: 14px;
    }
}

@media (max-width: 767.98px) {
    .pro-builder__panel {
        padding: 14px 12px;
        border-radius: var(--pro-radius);
    }
    .pro-builder__panel-head {
        margin-bottom: 12px;
        padding-bottom: 10px;
    }
    .pro-builder__panel-eyebrow { font-size: 10.5px; }
    .pro-builder__panel-title { font-size: 17px; }
    .pro-builder__panel-sub { font-size: 12.5px; }

    .pro-builder__bar {
        position: sticky;
        bottom: var(--m-bottom-nav-safe);
        z-index: 50;
        padding: 10px 12px;
        margin: 14px -14px 0;
        border-radius: var(--pro-radius) var(--pro-radius) 0 0;
        background: rgba(255, 255, 255, 0.97);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        box-shadow: 0 -8px 24px rgba(14, 39, 71, 0.10);
    }
    .pro-builder__bar-progress { font-size: 11.5px; min-width: 0; flex: 1 1 100%; }
    .pro-builder__bar-actions { width: 100%; }
    .pro-builder__bar-actions .pro-btn { flex: 1; }

    .pro-builder__quick-tip { font-size: 12px; padding: 10px 12px; }
}

/* ===========================================================================
   AUTH (логин / регистрация)
   =========================================================================== */
@media (max-width: 767.98px) {
    .pro-auth {
        margin: 12px 0;
        border-radius: var(--pro-radius);
        box-shadow: var(--pro-shadow-sm);
    }
    .pro-auth__grid { grid-template-columns: 1fr; }
    .pro-auth__aside {
        padding: 18px 16px 14px;
        border-right: 0;
        border-bottom: 1px solid var(--pro-border);
    }
    .pro-auth__title { font-size: 19px; }
    .pro-auth__sub { font-size: 13px; }
    .pro-auth__bullets li { font-size: 12.5px; }
    .pro-auth__content {
        padding: 18px 16px 22px;
        gap: 14px;
    }
    .pro-auth__steps { gap: 4px; }
    .pro-auth__step { padding: 4px 9px; font-size: 11px; }
    .pro-auth__foot {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        text-align: center;
    }
}

/* ===========================================================================
   ТАБЛИЦЫ → КАРТОЧКИ
   На мобиле строки скрывают THEAD и показывают каждую TD как key/value-карточку.
   Работает для .pro-table и обычных .table при наличии data-label на TD.
   =========================================================================== */
@media (max-width: 767.98px) {
    .pro-table-wrap {
        background: transparent;
        border: 0;
        box-shadow: none;
        overflow: visible;
    }
    .pro-table, table.table { display: block; }
    .pro-table thead, table.table thead { display: none; }
    .pro-table tbody, table.table tbody { display: block; }
    .pro-table tr, table.table tr {
        display: flex; flex-direction: column;
        background: #fff;
        border: 1px solid var(--pro-border);
        border-radius: var(--pro-radius);
        margin-bottom: 8px;
        padding: 10px 12px;
        box-shadow: var(--pro-shadow-sm);
    }
    .pro-table td, table.table td {
        display: flex; align-items: center; justify-content: space-between;
        padding: 7px 0;
        border-bottom: 1px dashed var(--pro-border);
        font-size: 13px;
        text-align: right;
    }
    .pro-table td:last-child, table.table td:last-child {
        border-bottom: 0; padding-bottom: 0;
    }
    .pro-table td::before, table.table td::before {
        content: attr(data-label);
        flex: 0 0 auto;
        margin-right: 12px;
        font-size: 11px; font-weight: 600;
        text-transform: uppercase; letter-spacing: 0.04em;
        color: var(--cm-muted);
        text-align: left;
    }
    .pro-table .actions, table.table .actions { justify-content: flex-end; }

    /* DL (key-value) */
    .pro-dl {
        grid-template-columns: 1fr;
        gap: 0;
    }
    .pro-dl dt {
        margin-top: 8px;
        padding-top: 0;
    }
    .pro-dl dt:first-child { margin-top: 0; }
    .pro-dl dd { margin: 0 0 4px; }
}

/* ===========================================================================
   КАРТОЧКИ / ПАНЕЛИ / EMPTY-STATE / ROUTES
   =========================================================================== */
@media (max-width: 767.98px) {
    .pro-card, .pro-panel { padding: 14px; border-radius: var(--pro-radius); }
    .pro-card__head { padding-bottom: 8px; margin-bottom: 10px; }
    .pro-card__title { font-size: 14.5px; }

    .pro-routes-wrap { padding: 12px; border-radius: var(--pro-radius); }
    .pro-routes { gap: 5px; }
    .pro-route {
        padding: 8px 12px;
        font-size: 12.5px;
        min-height: 36px;
    }

    .pro-empty {
        padding: 22px 14px;
        border-radius: var(--pro-radius);
    }
    .pro-empty__icon { width: 44px; height: 44px; font-size: 22px; }
    .pro-empty__title { font-size: 14.5px; }
    .pro-empty__text { font-size: 12.5px; }
    .pro-empty .pro-actions { flex-direction: column; gap: 8px; }
    .pro-empty .pro-actions .pro-btn { width: 100%; }

    .pro-error {
        margin: 18px 0;
        padding: 22px 16px;
        border-radius: var(--pro-radius);
    }
    .pro-error__code { font-size: 44px; }
    .pro-error__title { font-size: 18px; }
    .pro-error__text { font-size: 13px; }
}

/* ===========================================================================
   PAGINATION / ALERTS / MODAL / BADGES
   =========================================================================== */
@media (max-width: 767.98px) {
    .pro-pagination, .pagination {
        gap: 4px;
        margin-top: 12px;
    }
    .pro-pagination a, .pro-pagination span,
    .pagination li a, .pagination li span {
        min-width: 40px; height: 40px;
        font-size: 13.5px;
        padding: 0 10px;
    }
    /* скрываем дальние страницы — оставляем только prev/active/next */
    .pagination li:not(.active):not(.prev):not(.next):not(.first):not(.last) a {
        /* keep visible — иначе ломается логика */
    }

    .alert {
        padding: 10px 12px;
        font-size: 13px;
        border-radius: var(--pro-radius-sm);
    }

    .modal-dialog {
        margin: 0;
        max-width: 100%;
        min-height: 100vh;
        display: flex; align-items: flex-end;
    }
    .modal-content {
        border-radius: 22px 22px 0 0;
        border: 0;
        width: 100%;
        max-height: 92vh;
        overflow-y: auto;
    }
    .modal-header { padding: 14px 16px; }
    .modal-body   { padding: 16px; }
    .modal-footer { padding: 12px 16px calc(14px + env(safe-area-inset-bottom, 0px)); }

    .pro-badge { font-size: 11px; padding: 3px 8px; }
    .pro-pill  { font-size: 12px; padding: 5px 10px; }
}

/* ===========================================================================
   ФУТЕР — мобильная версия (более крупная, выразительная, app-like)
   =========================================================================== */
@media (max-width: 767.98px) {
    .pro-footer {
        position: relative;
        overflow: hidden;
        margin-top: 28px;
        padding: 26px 0 calc(20px + var(--m-bottom-nav-safe) + env(safe-area-inset-bottom, 0px));
        background:
            radial-gradient(circle at 12% 0%, rgba(30, 99, 214, 0.12), transparent 42%),
            radial-gradient(circle at 92% 100%, rgba(14, 165, 233, 0.10), transparent 46%),
            linear-gradient(180deg, #ffffff 0%, #f3f8ff 60%, #ebf3fc 100%);
        border-top: 1px solid #cfe0fa;
    }
    .pro-footer::before {
        content: "";
        position: absolute;
        inset: 0;
        background-image:
            linear-gradient(rgba(30, 99, 214, 0.05) 1px, transparent 1px),
            linear-gradient(90deg, rgba(30, 99, 214, 0.05) 1px, transparent 1px);
        background-size: 28px 28px;
        opacity: 0.5;
        mask-image: linear-gradient(180deg, rgba(0,0,0,0.6), transparent 70%);
        -webkit-mask-image: linear-gradient(180deg, rgba(0,0,0,0.6), transparent 70%);
        pointer-events: none;
    }
    .pro-footer__inner {
        position: relative; z-index: 1;
        padding: 0 14px;
    }

    /* TOP — все секции в одну колонку */
    .pro-footer__top {
        grid-template-columns: 1fr;
        gap: 14px;
        padding-bottom: 18px;
        border-bottom: 1px dashed rgba(30, 99, 214, 0.22);
    }

    /* Brand-блок становится hero-карточкой */
    .pro-footer__top > div:first-child {
        position: relative;
        padding: 22px 18px;
        text-align: center;
        background: linear-gradient(150deg, #ffffff 0%, #f0f7ff 100%);
        border: 1px solid #cfe0fa;
        border-radius: 22px;
        box-shadow: 0 12px 28px rgba(20, 38, 80, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.9);
    }
    .pro-footer__top > div:first-child::after {
        content: "";
        position: absolute;
        right: -28px; top: -28px;
        width: 100px; height: 100px; border-radius: 50%;
        background: radial-gradient(circle, rgba(30, 99, 214, 0.18), transparent 70%);
    }
    .pro-footer__brand {
        position: relative;
        margin: 0 auto 12px;
        justify-content: center;
        display: inline-flex;
    }
    .pro-footer__brand img {
        height: 44px;
        filter: drop-shadow(0 8px 18px rgba(30, 99, 214, 0.18));
    }
    .pro-footer__copy {
        position: relative;
        margin: 0 auto;
        max-width: 320px;
        font-size: 14.5px;
        font-weight: 500;
        line-height: 1.55;
        color: var(--cm-text);
    }
    .pro-footer__chips {
        position: relative;
        justify-content: center;
        gap: 6px;
        margin-top: 14px;
    }
    .pro-footer__chips span {
        padding: 7px 12px;
        font-size: 12px;
        font-weight: 600;
        background: #ffffff;
        border-color: #cfe0fa;
        box-shadow: 0 4px 12px rgba(30, 99, 214, 0.06);
    }
    .pro-footer__chips i { font-size: 14px; }

    /* Каждая nav-секция — карточка */
    .pro-footer__top > div:not(:first-child) {
        padding: 14px;
        background: rgba(255, 255, 255, 0.85);
        border: 1px solid var(--pro-border);
        border-radius: 18px;
        box-shadow: 0 6px 18px rgba(20, 38, 80, 0.04);
    }

    /* Заголовок секции — крупнее, с акцентной чертой */
    .pro-footer__title {
        position: relative;
        display: inline-flex;
        align-items: center;
        gap: 8px;
        margin-bottom: 12px;
        padding-left: 12px;
        font-size: 13px;
        font-weight: 700;
        letter-spacing: 0.05em;
    }
    .pro-footer__title::before {
        content: "";
        position: absolute;
        left: 0; top: 2px; bottom: 2px;
        width: 3px;
        border-radius: 999px;
        background: linear-gradient(180deg, var(--cm-primary), var(--cm-accent));
    }

    /* Ссылки секции — плитки 2 в ряд с иконкой-кругом */
    .pro-footer__nav {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }
    .pro-footer__nav a {
        display: flex;
        align-items: center;
        gap: 10px;
        min-height: 48px;
        padding: 10px 12px;
        background: var(--pro-soft);
        border: 1px solid var(--pro-border);
        border-radius: 14px;
        color: var(--cm-text);
        font-size: 13.5px;
        font-weight: 600;
        line-height: 1.2;
        transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.1s;
    }
    .pro-footer__nav a:hover,
    .pro-footer__nav a:active {
        background: #ffffff;
        color: var(--cm-primary);
        border-color: #cfe0fa;
        transform: translateY(-1px);
    }
    .pro-footer__nav a i {
        flex-shrink: 0;
        width: 30px; height: 30px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        font-size: 16px;
        background: #ffffff;
        color: var(--cm-primary);
        border-radius: 10px;
        border: 1px solid #cfe0fa;
        opacity: 1;
    }
    .pro-footer__nav a:hover i,
    .pro-footer__nav a:active i {
        background: var(--cm-primary);
        color: #ffffff;
        border-color: var(--cm-primary);
    }

    /* BOTTOM — копирайт + auth-кнопки */
    .pro-footer__bottom {
        flex-direction: column;
        align-items: stretch;
        gap: 14px;
        padding-top: 16px;
    }
    .pro-footer__copyright {
        text-align: center;
        font-size: 12.5px;
        font-weight: 500;
        color: var(--cm-muted);
        letter-spacing: 0.01em;
    }
    .pro-footer__bottom-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        width: 100%;
    }
    .pro-footer__bottom-actions a {
        flex: 1;
        justify-content: center;
        min-height: 48px;
        padding: 10px 12px;
        font-size: 14px;
        font-weight: 600;
        border-radius: 14px;
        background: #ffffff;
        border: 1px solid var(--pro-border);
        box-shadow: 0 4px 10px rgba(20, 38, 80, 0.04);
        transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.1s, box-shadow 0.15s;
    }
    .pro-footer__bottom-actions a i {
        font-size: 17px;
    }
    .pro-footer__bottom-actions a:active {
        transform: translateY(1px);
    }
    .pro-footer__bottom-actions a.is-register {
        color: #ffffff;
        background: linear-gradient(135deg, var(--cm-primary) 0%, var(--cm-primary-dark) 100%);
        border-color: var(--cm-primary);
        box-shadow: 0 8px 20px rgba(30, 99, 214, 0.28);
    }
    .pro-footer__bottom-actions a.is-register i { color: #ffffff; }
    .pro-footer__bottom-actions a.is-register:hover,
    .pro-footer__bottom-actions a.is-register:active {
        color: #ffffff;
        background: linear-gradient(135deg, var(--cm-primary-dark) 0%, var(--cm-primary) 100%);
    }
}

/* ===========================================================================
   ФУТЕР — очень узкие экраны (≤ 380px)
   =========================================================================== */
@media (max-width: 380px) {
    .pro-footer__top > div:first-child { padding: 18px 14px; }
    .pro-footer__brand img { height: 38px; }
    .pro-footer__copy { font-size: 13.5px; }
    .pro-footer__chips span { padding: 6px 10px; font-size: 11.5px; }
    .pro-footer__nav { grid-template-columns: 1fr; }
    .pro-footer__nav a { min-height: 46px; }
    .pro-footer__bottom-actions { grid-template-columns: 1fr; }
}

/* ===========================================================================
   ОЧЕНЬ УЗКИЕ ЭКРАНЫ (≤ 380px)
   =========================================================================== */
@media (max-width: 380px) {
    :root {
        --m-page-pad: 5px;
    }
    html { font-size: 15px; }

    .ih__brand img { height: 32px; }
    .ih__burger { width: 38px; height: 38px; }

    .pro-pagehero { padding: 14px 12px 12px; }
    .pro-pagehero__title { font-size: 18px; }

    .pro-item-card { padding: 12px 12px 12px 14px; }
    .pro-item-card__route { font-size: 15px; }
    .pro-item-card__price { font-size: 13px; padding: 3px 8px; }
    .pro-item-card__meta { gap: 5px 8px; font-size: 12px; }

    .m-bottom-nav__item { font-size: 10.5px; }
    .m-bottom-nav__item i { font-size: 20px; }
    .m-bottom-nav__item.is-fab i { width: 46px; height: 46px; font-size: 24px; }

    .pro-kpis { grid-template-columns: 1fr !important; }
}

/* ===========================================================================
   LANDSCAPE на маленькой высоте — экономим вертикаль
   =========================================================================== */
@media (max-width: 991.98px) and (max-height: 480px) {
    .ih { position: static; }
    body { padding-bottom: 0; }
    .m-bottom-nav { position: static; }
}

/* ===========================================================================
   CARGO/INDEX: компактный мобильный поиск + аккордеон + плавающий счётчик
   =========================================================================== */

/* Десктоп: мобильную форму прячем, страничный hero показываем */
.m-search-wrap { display: none; }
.m-results-count { display: none; }
.m-hide-sm { /* на десктопе видно */ }

@media (max-width: 767.98px) {
    /* Скрываем десктопный sidebar, hero и старую FAB-кнопку фильтров */
    .pro-grid--sidebar > aside.m-hide,
    .m-filter-toggle,
    body:has(#m-filters) .m-filter-toggle { display: none !important; }
    body:has(#m-filters) .pro-grid--sidebar > aside { all: unset; display: block; }
    .pro-page > .m-hide-sm,
    .pro-page > .pro-pagehero.m-hide-sm { display: none; }

    .pro-grid--sidebar { gap: 0; }

    /* Обёртка мобильного поиска — sticky сверху, под хедером */
    .m-search-wrap {
        display: block;
        top: 60px;
        z-index: 30;
        margin: 0 calc(-1 * var(--m-page-pad)) 12px;
        padding: 8px var(--m-page-pad) 0;
        background: linear-gradient(180deg, var(--pro-bg) 0%, var(--pro-bg) 70%, transparent 100%);
    }

    /* compact-форма */
    .m-search {
        position: relative;
        display: flex; flex-direction: column; gap: 10px;
        padding: 12px 12px 14px;
        background: #fff;
        border: 1px solid var(--pro-border);
        border-radius: var(--pro-radius);
        box-shadow: var(--pro-shadow-sm);
        overflow: hidden;
    }
    .m-search::before {
        content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px;
        background: var(--pro-grad-accent);
        opacity: 0.9;
    }
    .m-search.is-loading {
        pointer-events: none;
    }
    .m-search.is-loading::after {
        content: ""; position: absolute; left: 0; right: 0; top: 3px; height: 2px;
        background: linear-gradient(90deg, transparent, var(--cm-primary), transparent);
        animation: m-search-loader 1s linear infinite;
    }
    @keyframes m-search-loader {
        0%   { transform: translateX(-100%); }
        100% { transform: translateX(100%); }
    }

    .m-search__head {
        display: flex; align-items: center; justify-content: space-between;
        gap: 8px;
    }
    .m-search__title {
        display: inline-flex; align-items: center; gap: 6px;
        font-size: 13px; font-weight: 600;
        color: var(--cm-text);
    }
    .m-search__title i {
        color: var(--cm-primary);
        font-size: 16px;
    }
    .m-search__reset {
        width: 36px; height: 36px;
        display: inline-flex; align-items: center; justify-content: center;
        border-radius: var(--pro-radius-sm);
        background: var(--pro-soft);
        border: 1px solid var(--pro-border);
        color: var(--cm-muted);
        cursor: pointer;
        transition: background 0.15s, color 0.15s;
    }
    .m-search__reset:hover { background: var(--pro-soft-2); color: var(--cm-primary); }
    .m-search__reset i { font-size: 16px; }

    .m-search__row {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .m-search__row--2 {
        grid-template-columns: 1fr 1fr;
    }

    .m-search__field {
        position: relative;
        display: flex; flex-direction: column; gap: 4px;
        margin: 0;
    }
    .m-search__label {
        display: inline-flex; align-items: center; gap: 4px;
        font-size: 10.5px; font-weight: 600;
        text-transform: uppercase; letter-spacing: 0.04em;
        color: var(--cm-muted);
    }
    .m-search__label i { font-size: 12px; color: var(--cm-primary); opacity: 0.85; }

    .m-search .form-control,
    .m-search .form-select {
        height: 42px;
        padding: 8px 11px;
        font-size: 14px;
        border-radius: var(--pro-radius-sm);
        border-color: var(--pro-border);
        background: #fff;
    }
    .m-search .form-control:focus,
    .m-search .form-select:focus {
        border-color: var(--cm-primary);
        background: #fff;
    }

    .m-search__field--check {
        justify-content: center;
        padding-top: 16px;
    }
    .m-search__field--check .pro-check {
        background: var(--pro-soft);
        border: 1px solid var(--pro-border);
        border-radius: var(--pro-radius-sm);
        padding: 9px 11px;
        height: 42px;
        font-size: 13px;
        font-weight: 500;
        width: 100%;
    }

    /* Аккордеон расширенных */
    .m-search__more {
        margin-top: 4px;
        border-top: 1px dashed var(--pro-border);
        padding-top: 10px;
    }
    .m-search__more-toggle {
        display: flex; align-items: center; justify-content: space-between;
        gap: 8px;
        padding: 8px 4px;
        margin: 0 -4px;
        font-size: 13px;
        font-weight: 600;
        color: var(--cm-text);
        cursor: pointer;
        list-style: none;
        border-radius: var(--pro-radius-sm);
        transition: background 0.15s;
    }
    .m-search__more-toggle::-webkit-details-marker { display: none; }
    .m-search__more-toggle:hover { background: var(--pro-soft); }
    .m-search__more-toggle > span {
        display: inline-flex; align-items: center; gap: 6px;
    }
    .m-search__more-toggle i { font-size: 16px; color: var(--cm-primary); }
    .m-search__more-chevron {
        transition: transform 0.2s ease;
    }
    .m-search__more[open] .m-search__more-chevron {
        transform: rotate(180deg);
    }
    .m-search__more-body {
        display: flex; flex-direction: column; gap: 10px;
        margin-top: 10px;
        padding-top: 10px;
        border-top: 1px dashed var(--pro-border);
        animation: m-search-more-in 0.18s ease;
    }
    @keyframes m-search-more-in {
        from { opacity: 0; transform: translateY(-4px); }
        to   { opacity: 1; transform: translateY(0); }
    }

    /* Pjax loading state для results */
    #cargo-results-pjax.is-loading {
        opacity: 0.55;
        transition: opacity 0.15s;
    }

    /* Плавающий счётчик найденных заявок (заменяет FAB-фильтры) */
    .m-results-count {
        display: inline-flex;
        align-items: center;
        gap: 4px;
        position: fixed;
        right: 14px;
        bottom: calc(var(--m-bottom-nav-h, 62px) + env(safe-area-inset-bottom, 0px) + 14px);
        z-index: 1041;
        min-width: 64px;
        padding: 6px 14px;
        border-radius: 28px;
        background: var(--pro-grad-primary);
        color: #fff;
        text-decoration: none;
        box-shadow: 0 12px 28px rgba(var(--cm-primary-rgb), 0.36);
        flex-direction: column;
        line-height: 1.05;
        transition: transform 0.15s, box-shadow 0.15s;
    }
    .m-results-count:hover,
    .m-results-count:active {
        color: #fff;
        transform: translateY(-1px);
        box-shadow: 0 14px 32px rgba(var(--cm-primary-rgb), 0.45);
    }
    .m-results-count__num {
        font-size: 18px; font-weight: 700;
        letter-spacing: -0.01em;
    }
    .m-results-count__label {
        font-size: 10px; font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        opacity: 0.92;
    }

    /* Empty-state — арт-картинка */
    .pro-empty-art img { max-width: 240px !important; }
    .pro-empty-art h3 { font-size: 17px; }
}

@media (max-width: 380px) {
    .m-search__row--2 { grid-template-columns: 1fr; }
    .m-results-count { right: 10px; min-width: 28px; height: 28px; padding: 5px 12px; bottom:4px;}
    .m-results-count__num { font-size: 16px; }
}

/* ===========================================================================
   SELECT2 — мобильная адаптация
   =========================================================================== */
@media (max-width: 767.98px) {
    .select2-container--krajee-bs5 .select2-selection,
    .select2-container--default .select2-selection--single {
        height: 46px;
        min-height: 46px;
    }
    .select2-container--krajee-bs5 .select2-selection--single .select2-selection__rendered,
    .select2-container--default .select2-selection--single .select2-selection__rendered {
        line-height: 44px;
        padding: 0 36px 0 12px;
        font-size: 14.5px;
    }
    .select2-container--krajee-bs5 .select2-selection--single .select2-selection__arrow,
    .select2-container--default .select2-selection--single .select2-selection__arrow {
        height: 44px;
        width: 32px;
    }

    /* Внутри compact-формы поиска — поле потоньше */
    .m-search .select2-container--krajee-bs5 .select2-selection,
    .m-search .select2-container--default .select2-selection--single {
        height: 42px;
        min-height: 42px;
        background: #fff;
        border-color: var(--pro-border);
    }
    .m-search .select2-container--krajee-bs5 .select2-selection--single .select2-selection__rendered,
    .m-search .select2-container--default .select2-selection--single .select2-selection__rendered {
        line-height: 40px;
        font-size: 14px;
    }
    .m-search .select2-container--krajee-bs5 .select2-selection--single .select2-selection__arrow,
    .m-search .select2-container--default .select2-selection--single .select2-selection__arrow {
        height: 40px;
    }

    /* Dropdown — занимает почти всю ширину, увеличенные тач-цели */
    .select2-container--default .select2-results__option,
    .select2-container--krajee-bs5 .select2-results__option {
        padding: 11px 12px;
        font-size: 14.5px;
        min-height: 46px;
    }
    .select2-container--default .select2-results__options,
    .select2-container--krajee-bs5 .select2-results__options {
        max-height: 60vh;
    }
    .select2-container--default .select2-search--dropdown .select2-search__field,
    .select2-container--krajee-bs5 .select2-search--dropdown .select2-search__field {
        height: 42px;
        font-size: 15px;
    }
    .city-s2__sub { font-size: 12px; }
}
