/* Шапка torgi25.ru: адаптивный бренд и кнопка меню в одну строку */
.navbar-ag .container-fluid {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    gap: 8px;
}
.navbar-ag .navbar-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 auto;
    min-width: 0;
    margin-right: 0;
    padding: 0;
    white-space: normal;
}
.navbar-ag .brand-logo {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
}
.navbar-ag .brand-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.navbar-ag .brand-name {
    font-weight: 800;
    color: #1f4e79;
    letter-spacing: .01em;
    line-height: 1.12;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.navbar-ag .brand-sub {
    font-size: .74rem;
    color: #6b7789;
    letter-spacing: .04em;
    line-height: 1.25;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.navbar-ag .brand-agency {
    font-size: 10.5px;
    line-height: 1.2;
    letter-spacing: .02em;
    color: #6b7789;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.navbar-ag .navbar-toggler {
    flex: 0 0 auto;
}

/* Десктоп: одна строка с длинным названием + подпись домена */
@media (min-width: 769px) {
    .navbar-ag .navbar-brand { flex: 0 0 auto; }
    .navbar-ag .brand-name { font-size: .92rem; letter-spacing: 0; }
    .navbar-ag .brand-sub { font-size: .72rem; }
    .navbar-ag .navbar-nav { gap: .25rem; }
    .navbar-ag .nav-link { padding-left: .5rem !important; padding-right: .5rem !important; }
}

/* Мобильные: компактный двухстрочный бренд, кнопка меню всегда справа */
@media (max-width: 768px) {
    .navbar-ag .brand-logo { width: 32px; height: 32px; }
    .navbar-ag .navbar-brand { gap: 6px; }
    .navbar-ag .brand-name { font-size: 1rem; line-height: 1.1; }
    .navbar-ag .brand-agency {
        font-size: 10px;
        line-height: 1.2;
        white-space: normal;
        overflow: visible;
        text-overflow: clip;
    }
    .navbar-ag .navbar-toggler { padding: .3rem .45rem; }
}

@media (max-width: 360px) {
    .navbar-ag .brand-agency { font-size: 9px; }
    .navbar-ag .brand-name { font-size: .95rem; }
    .navbar-ag .brand-logo { width: 28px; height: 28px; }
}

/* Граница ровно 768px: на ней уже мобильный вариант, на 769px — десктопный */
@media (max-width: 768px) {
    .navbar-ag .brand-desktop { display: none !important; }
    .navbar-ag .brand-mobile { display: flex !important; }
}
@media (min-width: 769px) {
    .navbar-ag .brand-desktop { display: flex !important; }
    .navbar-ag .brand-mobile { display: none !important; }
}

/* Кнопки первого экрана: строгая сетка, обе кнопки одинаковой геометрии */
.hero-actions {
    display: inline-grid;
    grid-template-columns: repeat(2, minmax(260px, 1fr));
    gap: 12px;
    align-items: stretch;
    margin-top: 1rem;
}
.hero-actions .hero-btn {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: auto;
    min-height: 52px;
    padding: 13px 20px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    text-align: center;
    border-radius: .5rem;
    text-decoration: none;
}
.hero-actions .hero-btn i {
    font-size: 1.05em;
    line-height: 1;
    flex: 0 0 auto;
}
@media (max-width: 640px) {
    .hero-actions {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
        gap: 10px;
    }
    .hero-actions .hero-btn {
        width: 100%;
        white-space: normal;
    }
}

settings-manager> —
   на некоторых машинах он рисуется синим кружком у правого края. Скрываем. */
settings-manager,
#settings-manager,
.page-settings-manager {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
}

/* Парные CTA-блоки: одинаковая ширина и высота обеих кнопок */
.cta-pair {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-items: stretch;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
.cta-pair .btn {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    height: 100%;
    min-height: 46px;
    padding: 11px 14px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
    white-space: normal;
    overflow-wrap: anywhere;
    border-radius: .5rem;
}
@media (max-width: 767.98px) {
    .cta-pair {
        display: grid;
        grid-template-columns: 1fr;
        grid-auto-rows: 1fr;   /* обе кнопки в паре — одной высоты */
        width: 100%;
        max-width: 100%;
        gap: 10px;
    }
    .cta-pair .btn { white-space: normal; }
    /* декоративный кружок/иконка в синем баннере на мобильных не нужны */
    .tg-banner .tg-icon { display: none !important; }
}

/* Три формата работы: сетка, одинаковая высота, никаких обрезаний */
.packages-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    align-items: stretch;
}

/* ячейка — flex-контейнер, чтобы карточка тянулась на всю высоту строки */
.package-cell {
    display: flex;
}

.package-card {
    flex: 1 1 auto;
    width: 100%;
    height: auto;
    max-height: none;
    overflow: visible;
}

/* на карточках форматов работы нет декоративных элементов/кружков */
.package-card::before,
.package-card::after {
    content: none !important;
    display: none !important;
}

.packages-head {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: flex-end;
    gap: 4px 16px;
    margin-bottom: 12px;
}

.packages-head h2 {
    margin-bottom: 4px;
}

.packages-head p {
    margin-bottom: 0;
}

@media (max-width: 767.98px) {
    .packages-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .package-card {
        height: auto !important;
        max-height: none !important;
        overflow: visible !important;
    }

    .packages-head {
        display: block;
        margin-bottom: 10px;
    }

    .packages-head h2 {
        margin-bottom: 2px;
    }

    .packages-head .packages-all-link {
        display: inline-block;
        margin-top: 4px;
    }
}

/* Блок «Не хотите самостоятельно разбираться с ЭТП?» — единый левый край */
.cta-etp .cta-etp-text {
    margin-left: 0;
    padding-left: 0;
    text-align: left;
    max-width: 100%;
}

.cta-etp .cta-etp-text h3 {
    margin-left: 0;
    padding-left: 0;
    text-align: left;
}

.cta-etp .cta-etp-text p {
    margin-left: 0;
    padding-left: 0;
    text-align: left;
    max-width: 100%;
}

/* декоративные псевдоэлементы в блоке не используем (никаких «кружков») */
.cta-etp::before,
.cta-etp::after {
    content: none !important;
    display: none !important;
}

@media (max-width: 991.98px) {
    /* колонки складываются — убираем гаттеры, чтобы кнопка встала по линии текста */
    .cta-etp .row {
        margin-left: 0;
        margin-right: 0;
    }

    .cta-etp .cta-etp-text,
    .cta-etp .cta-etp-action {
        padding-left: 0;
        padding-right: 0;
    }

    .cta-etp .cta-etp-action {
        margin-top: .85rem;
        text-align: left !important;
    }
}

@media (max-width: 768px) {
    .cta-etp {
        padding: 1rem !important;
    }

    .cta-etp .cta-etp-btn {
        display: flex;
        width: 100%;
        justify-content: center;
        align-items: center;
        box-sizing: border-box;
        margin-left: 0;
    }
}

/* Пагинация: контрастная активная страница и компактные кнопки на узких экранах */
.nav-pagination .page-item.active .page-link {
    background: #1f4e79 !important;
    border-color: #1f4e79 !important;
    color: #ffffff !important;
}

.nav-pagination .page-link {
    white-space: nowrap;
}

@media (max-width: 480px) {
    .nav-pagination {
        gap: 2px !important;
    }

    .nav-pagination .page-link {
        padding: .25rem .4rem;
        font-size: .8rem;
        line-height: 1.2;
        min-width: 28px;
        text-align: center;
    }

    .nav-pagination .page-link i {
        font-size: .72rem;
        display: inline-block;
    }

    .nav-pagination .page-item {
        flex: 0 0 auto;
    }
}

/* ------------------------------------------------------------------ */
/*  Типографика карточек: естественные переносы, единое выравнивание  */
/* ------------------------------------------------------------------ */
.card,
.metric-card,
.package-card,
.package-cell,
.lead-form-card,
.accordion-item,
.tg-banner {
    box-sizing: border-box;
    max-width: 100%;
}

.card p,
.card li,
.card dd,
.card dt,
.card .small,
.metric-card p,
.metric-card .metric-title,
.package-card p,
.package-card li,
.accordion-body,
.tg-banner p,
.tg-banner .small {
    text-align: left;
    line-height: 1.5;
    max-width: 100%;
    overflow-wrap: break-word;
    word-break: normal;
    hyphens: auto;
}

.card h1, .card h2, .card h3, .card h4, .card h5, .card h6,
.metric-card h3, .metric-card .metric-title,
.package-card h3,
.accordion-button {
    text-align: left;
    overflow-wrap: break-word;
    hyphens: auto;
}

.card td:not(.text-end):not(.text-center),
.card th:not(.text-end):not(.text-center) {
    text-align: left;
}

.card img,
.card svg,
.card table {
    max-width: 100%;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Длинные идентификаторы лотов/номеров не должны расширять карточку */
.card {
    overflow-wrap: anywhere;
}
.filter-card form,
.filter-card .row,
.filter-card [class^="col-"],
.filter-card [class*=" col-"] {
    min-width: 0;
}
.filter-card .btn,
.filter-card .form-control,
.filter-card .form-select {
    max-width: 100%;
}

/* Кнопки уведомлений в «Радаре»: одна строка на десктопе, колонка на мобильных */
.notify-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    column-gap: 8px;
    align-items: center;
    margin-bottom: 1rem;
}

.notify-buttons .btn {
    flex: 1 1 calc((100% - 16px) / 3);
    min-width: 0;
    white-space: normal;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 768px) {
    .notify-buttons {
        flex-direction: column;
        align-items: stretch;
    }

    .notify-buttons .btn {
        width: 100%;
        white-space: normal;
        text-align: center;
    }
}

/* «Радар уведомлений»: правая карточка-пример равна по высоте левому контенту (десктоп) */
@media (min-width: 769px) {
    .radar-row {
        align-items: stretch;
    }

    .radar-row > [class^="col-"],
    .radar-row > [class*=" col-"] {
        display: flex;
        flex-direction: column;
    }

    .radar-card {
        height: 100%;
        width: 100%;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        box-sizing: border-box;
    }
}

@media (max-width: 768px) {
    .radar-card {
        height: auto;
    }
}

/* Мобильные кнопки действий в карточках: одна ширина на всю карточку */
@media (max-width: 767.98px) {
    .card .btn,
    .package-card .btn,
    .metric-card .btn {
        display: flex;
        width: 100%;
        justify-content: center;
        text-align: center;
        box-sizing: border-box;
        margin-left: 0;
        margin-right: 0;
    }

    /* декоративные «кружки» и псевдоэлементы в карточках на мобильных не нужны */
    .card [class*="rounded-circle"].position-absolute,
    .card [class*="rounded-circle"].deco-circle,
    .card .deco-circle,
    .package-card::before,
    .package-card::after,
    .cta-etp::before,
    .cta-etp::after {
        display: none !important;
        content: none !important;
    }
}

/* Пакеты на мобильных: та же ширина карточек, что у остальных блоков страницы */
@media (max-width: 767.98px) {
    #packages {
        padding-left: 0;
        padding-right: 0;
    }

    #packages .packages-grid {
        width: auto;
        margin-left: -16px;
        margin-right: -16px;
    }
}

/* Кнопки уведомлений в подвале: равная ширина на десктопе, 100% на мобильных */
.footer-notify-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: stretch;
}

.footer-notify-buttons .btn {
    flex: 1 1 0;
    min-width: 0;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

@media (max-width: 768px) {
    .footer-notify-buttons {
        flex-direction: column;
        align-items: stretch;
    }

    .footer-notify-buttons .btn {
        display: flex;
        width: 100%;
        min-width: 0;
        justify-content: center;
        white-space: normal;
    }
}

/* «С чего начать»: кнопки MAX/Telegram не перестраиваются после загрузки шрифтов */
@media (min-width: 769px) {
    .start-notify-buttons {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap;
        gap: 10px;
        align-items: stretch;
        width: 100%;
    }

    .start-notify-buttons .btn {
        flex: 1 1 0;
        width: auto;
        min-width: 0;
        justify-content: center;
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        padding-left: 8px;
        padding-right: 8px;
        font-size: .8rem;
    }
}

@media (max-width: 768px) {
    .start-notify-buttons {
        display: flex;
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .start-notify-buttons .btn {
        width: 100%;
        justify-content: center;
        text-align: center;
        white-space: normal;
    }
}

/* 769–1199 px: кнопки в один ряд, но текст переносится, чтобы не обрезался */
@media (min-width: 769px) and (max-width: 1439.98px) {
    .start-notify-buttons .btn {
        white-space: normal;
        font-size: .78rem;
        line-height: 1.25;
    }
}

/* «Быстрая заявка»: левая колонка равна по высоте правой форме, кнопки уведомлений — по нижней линии */
@media (min-width: 769px) {
    .quicklead-row {
        align-items: stretch;
    }

    .quicklead-row > [class^="col-"],
    .quicklead-row > [class*=" col-"] {
        display: flex;
        flex-direction: column;
    }

    .quicklead-left {
        display: flex;
        flex-direction: column;
        align-self: stretch;
        height: auto;
        min-height: 100%;
        box-sizing: border-box;
    }

    .quicklead-left .start-notify-buttons {
        margin-top: auto;
        padding-top: 16px;
        /* компенсация блока согласия под кнопкой «Отправить заявку» */
        padding-bottom: 62px;
    }
}

@media (max-width: 768px) {
    .quicklead-left {
        height: auto;
    }

    .quicklead-left .start-notify-buttons {
        margin-top: 0;
        padding-top: 0;
    }
}

/* ≥992px: согласие под кнопкой занимает одну строку — компенсация 41px */
@media (min-width: 992px) {
    .quicklead-left .start-notify-buttons {
        padding-bottom: 41px;
    }
}

/* 769–991.98px: согласие под кнопкой занимает две строки — компенсация 66px */
@media (min-width: 769px) and (max-width: 991.98px) {
    .quicklead-left .start-notify-buttons {
        padding-bottom: 63px;
    }
}

/* «Быстрая заявка»: компактный бейдж, кнопка на всю форму, единая высота кнопок */
@media (min-width: 769px) {
    .quicklead-left .quicklead-badge {
        align-self: flex-start;
        width: fit-content;
        max-width: 100%;
    }

    .quicklead-row .quicklead-submit,
    .quicklead-left .start-notify-buttons .btn {
        height: 44px;
        min-height: 44px;
        box-sizing: border-box;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        text-align: center;
    }

    .quicklead-row .quicklead-submit {
        width: 100%;
        grid-column: 1 / -1;
    }
}
