.hidden {
    display: none;
}
a.title-page {
    line-height: 120%;
    font-size: 18px;
    color: #000;
    font-weight: 400;
}
.line-price {
    margin-bottom: 5px;
}
.line-price__count,
.offered-prices__title {
    min-width: 120px;
}
.offered-prices {
    margin-top: 10px;
    margin-bottom: 10px;
}
.title-small {
    margin-bottom: 10px;
}
.card .offered-price {
    margin-bottom: 10px;
    margin-top: 10px;
    gap: 17px;
}
.card .btn-main {
    margin-top: 10px;
}
.total-card {
    padding-top: 0px;
}
.offered-price::before {
    content: "⚠️";
    font-size: 18px;
    background: none;
    width: 18px;
    height: 18px;
}
.quanity-action input {
    font-size: 16px;
    font-weight: 600;
}
.btn-main.disabled {
    pointer-events: none;
    background-color: #F6F6F6;
    color: #222222;
}
/** Кнопки форм "в процессе" */
.btn-main {
    transition: background-color 0.3s;
}
.btn-main.active {
    transition: unset;
    background: #F6F6F6 url(../img/loader.svg?v2) center center no-repeat !important;
    background-size: 36px !important;
    text-indent: -99999px;
    pointer-events: none;
}
.btn-main.active:after {
    content: unset;
}
.btn-main.active > svg {
    display: none;
}

/** Form error toopltip */
input:invalid:not(:placeholder-shown),
input.error {
    border-color: #A1131B;
    color: #A1131B;
}
input.error[type="checkbox"]:before {
    border-color: #A1131B;
}
.tippy-box {
  color: #1E1F22;
}

.tippy-arrow {
  color: #F6F6F6;
}
.tippy-content {
  cursor: initial;
  background-color: #F6F6F6;
  padding: 22px 24px;
  box-shadow: 0px 4px 32px 0px #00000029, 0px 0px 4px 0px #0000000A;
  z-index: initial;
}
.tippy-content p {
  color: #1E1F22;
  font-size: 16px;
  line-height: 19px;
  letter-spacing: 0.03em;
}
.tippy-content a {
  margin-top: 10px;
  font-weight: 500;
  color: #A1131B;
  display: inline-block;
}
.mainform .tippy-content {
  padding: 10px 15px;
  color: #A1131B;
  font-size: 14px;
  font-weight: 400;
  line-height: 18px;
  text-align: left;
}
.popup-notifications {
    width: 100%;
    max-width: 440px;
    /* выравниваем по центру/правому краю — на десктопе плашка не растягивается
     * на всю ширину, на мобиле .popup-notifications в main.css даёт боковые
     * padding'и 16px, max-width 440 их перекрывает естественно. */
    left: 50%;
    transform: translateX(-50%);
    position: fixed;
    top: 12px;
    z-index: 501;
    pointer-events: none;
}
.popup-notifications .notifications {
    pointer-events: auto;
}
.item-notification__text {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: 30px;
}
.ic-info--success {
    background-image: url(../img/is_success.svg);
}
.ic-info--error {
    background-image: url(../img/ic_alert.svg);
}

/* --- Toast-уведомления: выразительный вид + прогресс-бар автоскрытия --- */
/* Базовая плашка из main.css — белая со слабой тенью и серой рамкой.
 * Здесь подмешиваем: более насыщенную тень, slide-in анимацию и нижний
 * прогресс-бар, который синхронно с setTimeout(5000) уезжает в ноль.
 * Раньше тут был цветной border-left 4px по типу, но он визуально
 * сливался с логотипом в шапке — снят, тип теперь читается через цвет
 * иконки и прогресс-бара. */
.item-notification {
    padding: 14px 18px 16px;
    border-radius: 14px;
    border: 1px solid rgba(20, 30, 60, 0.08);
    box-shadow:
        0 18px 36px -12px rgba(20, 30, 60, 0.22),
        0 6px 14px rgba(20, 30, 60, 0.08);
    overflow: hidden;
    position: relative;
    animation: notif-slide-in 0.35s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}
.popup-notifications .item-notification {
    /* `popup-notifications` в custom.css фиксирована top:12px, поэтому
     * исходный override (top:100%, background:#fbfbfb) уже не нужен. */
    background: #fff;
}

.item-notification__text {
    font-size: 14px;
    line-height: 143%;
    color: #1E1F22;
}

.item-notification__progress {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 3px;
    width: 100%;
    background: rgba(20, 30, 60, 0.06);
    overflow: hidden;
}
.item-notification__progress::after {
    content: "";
    display: block;
    height: 100%;
    width: 100%;
    background: #325BFF;
    transform-origin: left center;
    /* 4s ровно соответствует setTimeout в showNotification — синхронизация
     * вручную: при правках одного не забыть второе. */
    animation: notif-progress 4s linear forwards;
}
.item-notification--success .item-notification__progress::after { background: #1E7F38; }
.item-notification--warning .item-notification__progress::after { background: #D89600; }
.item-notification--error .item-notification__progress::after,
.item-notification--critical .item-notification__progress::after { background: #B5343A; }

/* Когда плашку закрывают вручную (`.removing` от JS) — прогресс-бар
 * замираем, чтобы не дёргался во время fade-out. */
.item-notification.removing .item-notification__progress::after {
    animation-play-state: paused;
}
/* Сам прогресс-бар при свёртке тоже гасим — иначе тонкая 3px полоска
 * мелькает на дне коллапсирующей плашки. */
.item-notification.removing .item-notification__progress {
    opacity: 0;
}

@keyframes notif-slide-in {
    from { opacity: 0; transform: translateY(-16px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes notif-progress {
    from { transform: scaleX(1); }
    to   { transform: scaleX(0); }
}
input[type="number"] {
    text-align: center;
    font-weight: 600;
}
.loading::before {
    content: "";
    pointer-events: none;
    position: absolute;
    display: block;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: rgba(250, 250, 250, 0.6) url(../img/loader.svg?v2) center center no-repeat !important;
    background-size: 48px !important;
}
.loading * {
    pointer-events: none;
}
@media screen and (max-width: 768px) {
    .list-categories {
        /*display: grid;*/
        grid-template-columns: repeat(1, 1fr);
    }
}

/* --- Web-auth: шапка + баннер «Запомнить устройство» --- */
.header__user {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-left: auto;
    margin-right: 12px;
    font-size: 14px;
}
.header__user-name {
    font-weight: 600;
}
.header__user-link {
    color: #325BFF;
    text-decoration: none;
}
.header__user-link:hover {
    text-decoration: underline;
}
.header__logout {
    display: inline;
    margin: 0;
}
.header__logout-btn {
    background: none;
    border: none;
    color: #A1131B;
    cursor: pointer;
    padding: 0;
    font: inherit;
}
.header__logout-btn:hover {
    text-decoration: underline;
}

/* Старые гpey-баннеры (trust-banner / push-banner) теперь идут через
 * общий `.attn-banner` — мягкий blue accent, иконка слева, кнопки
 * с SVG'шками и одинаковой шириной. Старые селекторы оставлены пустыми,
 * чтобы шаблоны без обновления HTML не теряли визуала. */
.trust-banner,
.push-banner {
    /* visual теперь в .attn-banner, здесь — только семантический хук */
}

.attn-banner {
    background: linear-gradient(180deg, #F0F4FF 0%, #E5ECFF 100%);
    border-bottom: 1px solid #C4D2FF;
    border-left: 4px solid #325BFF;
    padding: 14px 0;
    box-shadow: 0 6px 16px -8px rgba(50, 91, 255, 0.18);
    color: #1E1F22;
}
.attn-banner__inner {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}
.attn-banner__icon {
    width: 36px;
    height: 36px;
    flex: none;
    border-radius: 50%;
    background: #325BFF;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}
.attn-banner__text {
    flex: 1 1 200px;
    font-size: 14px;
    line-height: 140%;
    color: #1E1F22;
    font-weight: 500;
}
.attn-banner__actions {
    display: flex;
    gap: 8px;
    flex: 0 0 auto;
}
.attn-banner__form {
    margin: 0;
    /* form-обёртка не должна ломать flex-выравнивание кнопок */
    display: flex;
}
.attn-banner__btn {
    /* Одинаковый размер для primary/skip + место под иконку. width:100% от
     * .btn-main больше не нужен — мы внутри inline-actions, не fullwidth. */
    height: 40px;
    min-width: 132px;
    padding: 0 16px;
    font-size: 14px;
    border-radius: 8px;
    gap: 6px;
    width: auto;
}
.attn-banner__btn--primary {
    background: #325BFF;
    color: #fff;
}
.attn-banner__btn--primary:hover {
    background: #2547D6;
}
.attn-banner__btn.btn-main--skip {
    background: #fff;
    color: #1E1F22;
    border: 1px solid #C4D2FF;
}
.attn-banner__btn.btn-main--skip:hover {
    background: #F0F4FF;
}
.attn-banner__btn svg {
    flex: none;
}
@media (max-width: 520px) {
    /* На узких экранах кнопки расползаются в полную ширину строкой */
    .attn-banner__actions {
        width: 100%;
    }
    .attn-banner__form { flex: 1; }
    .attn-banner__btn { min-width: 0; width: 100%; }
}
/* Старые trust-banner правила удалены — visual теперь от .attn-banner.
 * `.btn-main--skip` оставлен как generic skip-button класс: его юзают
 * не только баннеры (где он переопределяется .attn-banner__btn.btn-main--skip),
 * но и другие места. */
.btn-main--skip {
    background: #fff;
    color: #222;
    border: 1px solid #d0d0d0;
}

/* --- Личный кабинет: список пунктов --- */
.personal-actions {
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.personal-action,
.personal-action__btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid #e3e3e3;
    border-radius: 12px;
    text-decoration: none;
    color: inherit;
    font: inherit;
    width: 100%;
    cursor: pointer;
    text-align: left;
}
.personal-action--logout {
    padding: 0;
    border: none;
    background: none;
}
.personal-action__icon {
    font-size: 22px;
    line-height: 1;
    width: 28px;
    text-align: center;
}
.personal-action__text {
    flex: 1;
    font-size: 16px;
    font-weight: 500;
}
.personal-action__arrow {
    color: #a0a0a0;
    font-size: 22px;
    line-height: 1;
}
.personal-action:hover,
.personal-action__btn:hover {
    border-color: #325BFF;
}
.personal-action--logout .personal-action__btn {
    color: #A1131B;
}
/* .info-page в main.css имеет опечатку `position: 0 18px;` (должно было быть
   `padding`) — без этого override контент прижимается к краям экрана. */
.info-page {
    padding: 0 18px;
    box-sizing: border-box;
}
.info-page__content {
    width: 100%;
    max-width: 480px;
}
.info-page__action {
    margin-top: 12px;
}
.info-page__action .btn-main {
    display: block;
    width: 100%;
}

/* --- Кабинет: тоггл push-уведомлений ---
 * Базовый .personal-action — flex {icon, text, arrow}. У toggle-варианта
 * вместо стрелки — нативный checkbox c iOS-style switch, и текст может
 * быть в две строки (label + hint). Расширяем разметку через
 * .personal-action__content + .switch без ломки соседних строк. */
.personal-action--toggle {
    cursor: default;
}
.personal-action--toggle:hover {
    border-color: #e3e3e3;
}
.personal-action__content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.personal-action__hint {
    font-size: 12px;
    color: #878A92;
    line-height: 130%;
}

.switch {
    position: relative;
    width: 44px;
    height: 26px;
    display: inline-block;
    flex: none;
}
.switch input {
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}
.switch__slider {
    position: absolute;
    inset: 0;
    cursor: pointer;
    background: #d6d8e0;
    border-radius: 13px;
    transition: background 0.2s ease;
}
.switch__slider::before {
    content: "";
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}
.switch input:checked + .switch__slider {
    background: #325BFF;
}
.switch input:checked + .switch__slider::before {
    transform: translateX(18px);
}
.switch input:disabled + .switch__slider {
    opacity: 0.5;
    cursor: not-allowed;
}

/* --- Кабинет: страница «Важная информация» --- */
.personal-info {
    margin-top: 16px;
    color: #1E1F22;
    font-size: 15px;
    line-height: 160%;
}
.personal-info p {
    margin: 0 0 14px;
}
.personal-info p:last-child {
    margin-bottom: 0;
}
.personal-info__back {
    margin-top: 24px;
}
.personal-info__back .btn-main {
    display: block;
    width: 100%;
}

/* --- Доверенные устройства --- */
.devices-list {
    list-style: none;
    padding: 0;
    margin: 16px 0;
}
.devices-list__item {
    border: 1px solid #e3e3e3;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 10px;
}
.devices-list__head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}
.devices-list__current {
    background: #325BFF;
    color: #fff;
    border-radius: 10px;
    padding: 1px 8px;
    font-size: 11px;
    text-transform: uppercase;
}
.devices-list__meta {
    color: #555;
    font-size: 13px;
    margin-bottom: 8px;
}

/* Корзина — пустое состояние и строки предложений */
.cart-empty {
    padding: 24px 16px;
    color: #878A92;
    text-align: center;
    font-size: 14px;
}

.proposal {
    margin-top: 6px;
    padding: 6px 8px;
    border-radius: 6px;
    background: #F5F6FA;
}

.proposal--approved {
    background: #E8F6EC;
}

.proposal--new {
    background: #FFF7E0;
}

.proposal__heading {
    margin-bottom: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #555;
}

/* Заказы — карточка, раскрытие, бейдж статуса, фильтр, пагинация */
.orders-filter {
    display: flex;
    align-items: center;
    gap: 8px;
}

.orders-filter input[type="date"] {
    padding: 4px 8px;
    border: 1px solid #D6D8E0;
    border-radius: 6px;
    font: inherit;
    color: #2B2D33;
    background: #fff;
}

.orders-filter__reset {
    font-size: 12px;
    color: #325BFF;
    text-decoration: underline;
}

.orders-empty {
    padding: 24px 16px;
    color: #878A92;
    text-align: center;
    font-size: 14px;
}

/* Раскрытие — через .item-order.active из common.js. Своих border-стрелок
   и checkbox-tricks не вводим: main.css уже даёт SVG-стрелку и
   max-height transition. Снимаем верхний кэп, чтобы крупные заказы (до
   ~50 позиций) показывались полностью без внутреннего скролла. */
.item-order.active .content-order {
    max-height: none;
}

.head-order__number {
    font-weight: 600;
    color: #2B2D33;
}

.head-order__bottom {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
}

/* main.css даёт .head-order { display:flex; gap:16px }. По умолчанию
   flex-item не сжимается ниже intrinsic-ширины своего контента — поэтому
   длинный статус ("Принят в обработку") + контент + стрелка не помещались
   на мобиле и стрелка вылезала за правую кромку плашки. */
.head-order__content {
    min-width: 0;
}

.order-status {
    padding: 2px 6px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 600;
    color: #2B2D33;
    background: #EEF0F5;
    white-space: nowrap;
    flex-shrink: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
}

.status--2 { background: #E8F6EC; color: #1E7F38; }
.status--3 { background: #FFF7E0; color: #8A6A12; }
.status--4 { background: #FCE4E4; color: #B5343A; }
.status--5 { background: #FFE6D0; color: #A6520F; }

.orders-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 16px 0;
}

.orders-pagination__btn {
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid #D6D8E0;
    color: #325BFF;
    font-size: 14px;
    text-decoration: none;
}

.orders-pagination__current {
    font-size: 14px;
    color: #2B2D33;
}

/* Кнопка «Прайс-лист» в каталоге — первым элементом списка категорий/товаров.
   Визуально вписана как тот же item-category/item-catalog, но с акцентной
   иконкой и заметным выделением — чтобы пользователь видел, что это
   actionable (скачивание XLSX), а не навигация в подраздел. */
.item-category--price-list,
.item-catalog--price-list {
    background: #F4F7FF;
    border: 1px solid #C4D2FF;
}
.item-category--price-list:hover,
.item-catalog--price-list:hover {
    background: #E8EEFF;
}
.item-category--price-list .item-category__title,
.item-catalog--price-list .item-catalog__title {
    color: #325BFF;
    font-weight: 600;
}
.item-category__icon {
    font-size: 22px;
    margin-right: 10px;
}
.item-catalog--price-list .item-catalog__image {
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Статусные страницы — «магазин закрыт», «доступ запрещён» */
.status-page {
    padding: 24px 0;
}

.status-page__card {
    background: #fff;
    border: 1px solid #EEF0F5;
    border-radius: 12px;
    padding: 32px 24px;
    text-align: center;
    margin: 0 16px;
    box-shadow: 0 2px 8px rgba(43, 45, 51, 0.04);
}

.status-page__icon {
    font-size: 48px;
    line-height: 1;
    margin-bottom: 12px;
}

.status-page__message {
    font-size: 14px;
    line-height: 1.5;
    color: #2B2D33;
}

/* Плавность fade'а toast-уведомлений — переопределяем main.css.
 * Главное отличие: вместо height (anim из `auto` в `0` ломается в
 * браузерах) используем max-height. Иначе после `.removing` остаётся
 * «остаточная полоска» — height снапает в 0, но border/padding ещё
 * пытаются доехать. */
.item-notification {
    max-height: 500px;
    transition:
        opacity 0.4s linear,
        transform 0.4s linear,
        max-height 0.4s linear,
        margin 0.4s linear,
        padding 0.4s linear,
        border-width 0.4s linear;
}
.item-notification.removing {
    /* перекрываем main.css `height: 0`, чтобы свёртка ехала через max-height */
    height: auto;
    max-height: 0;
    border-top-width: 0;
    border-bottom-width: 0;
}

/* --- Колокольчик уведомлений: выпадающая панель с историей --- */
/* main.css задаёт .btn-notifications с расчётом на <a>, поэтому browser-
 * дефолты у <button> (рамка, серый фон, паддинг, шрифт) пробивались
 * наружу и колокольчик выглядел «вычурной» кнопкой. Сбрасываем то, что
 * .btn-notifications не покрывает явно. */
button.btn-notifications {
    border: none;
    background: transparent;
    padding: 0;
    margin: 0;
    font: inherit;
    color: inherit;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}


/* Панель анкерится к шапке (header.position нормальный, .container —
 * relative по умолчанию у нас не задан, поэтому здесь position:absolute
 * привязывается к нему через manual top/right через header__wrapper).
 * Чтобы не зависеть от иерархии, используем position:fixed — панель
 * рендерится в правом верхнем углу под шапкой. На мобилках 100% ширины
 * с боковыми отступами выглядит органично.
 */
.notifications-panel {
    /* header = padding 15+15 + content ~33 + border 1 ≈ 64px */
    position: fixed;
    top: 68px;
    right: 12px;
    left: 12px;
    max-width: 380px;
    margin-left: auto;
    z-index: 500;
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 12px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
    overflow: hidden;
}
.notifications-panel[hidden] {
    display: none;
}
.notifications-panel__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #eef0f5;
}
.notifications-panel__title {
    font-weight: 600;
    font-size: 15px;
    color: #1E1F22;
}
.notifications-panel__clear {
    background: none;
    border: none;
    color: #325BFF;
    font-size: 13px;
    cursor: pointer;
    padding: 0;
}
.notifications-panel__clear:hover {
    text-decoration: underline;
}
.notifications-panel__list {
    max-height: 60vh;
    overflow-y: auto;
}
.notifications-panel__empty {
    padding: 24px 16px;
    text-align: center;
    color: #878A92;
    font-size: 13px;
}
.notifications-panel__item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid #f3f4f7;
}
.notifications-panel__item:last-child {
    border-bottom: none;
}
.notifications-panel__item .ic-info {
    margin-top: 2px;
    flex: none;
}
.notifications-panel__item-body {
    flex: 1;
    min-width: 0;
}
.notifications-panel__item-title {
    font-weight: 600;
    font-size: 14px;
    color: #1E1F22;
    margin-bottom: 2px;
}
.notifications-panel__item-text {
    font-size: 13px;
    line-height: 143%;
    color: #2B2D33;
    word-break: break-word;
}
.notifications-panel__item-time {
    margin-top: 4px;
    font-size: 11px;
    color: #878A92;
}

/* Запросы — кнопки «Принять/Отклонить» во встречном предложении.
 * `.item-catalog__buttons` — это flex-контейнер с `gap:16px`, а его CSS
 * правило `.item-catalog__buttons .btn-main { flex:1 }` рассчитано на
 * случай, когда кнопка — прямой ребёнок (как в макете). У нас же между
 * `.item-catalog__buttons` и `.btn-main` живёт `<form>` (нужна для CSRF
 * и POST на разные URL'ы) — без вмешательства она съедает flex-grow и
 * кнопки лежат по ширине контента. `display:contents` снимает форму с
 * layout, и кнопки внутри становятся прямыми flex-детьми контейнера. */
.item-catalog__buttons form[name="proposal_action"] {
    display: contents;
}
