.rtm {
    /* нейтральная шкала */
    --rtm-ink: #0e1726;
    --rtm-ink-2: #5b6675;
    --rtm-ink-3: #8b95a4;
    --rtm-line: #e7ebf1;
    --rtm-soft: #f2f5f8;
    --rtm-radius: 16px;
    --rtm-gap: 16px;
    --rtm-media-ratio: 1 / 1;
    /* фикс. пропорция фото — держит CLS = 0 */
    --rtm-warranty: "гарантия 12 месяцев";
    /* текст чипа гарантии, печатается через ::before */

    /* производные от фирменного цвета */
    --rtm-b-08: color-mix(in srgb, var(--color_brand) 8%, #fff);
    --rtm-b-16: color-mix(in srgb, var(--color_brand) 16%, #fff);
    --rtm-b-30: color-mix(in srgb, var(--color_brand) 30%, #fff);
    --rtm-b-deep: color-mix(in srgb, var(--color_brand) 82%, #0b1220);
    --rtm-b-glow: color-mix(in srgb, var(--color_brand) 38%, transparent);

    display: block;
    padding: clamp(28px, 4vw, 56px) 0;
    color: var(--rtm-ink);
    font-family: inherit;
    -webkit-tap-highlight-color: transparent;
}

/* ---------- шапка ---------- */
.rtm__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin: 0 0 clamp(16px, 2.2vw, 24px);
}

.rtm__title {
    margin: 0;
    font-size: clamp(20px, 2.4vw, 30px);
    line-height: 1.2;
    font-weight: 700;
    letter-spacing: -.02em;
}

.rtm__title em {
    font-style: normal;
    color: var(--color_brand);
}

/* визуально скрытая подпись для скринридеров */
.rtm__srOnly {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

/* ---------- поиск ---------- */
.rtm__search {
    position: relative;
    flex: 0 1 320px;
    min-width: 220px;
}

.rtm__searchIco {
    position: absolute;
    left: 14px;
    top: 50%;
    width: 17px;
    height: 17px;
    margin-top: -8.5px;
    color: var(--rtm-ink-3);
    pointer-events: none;
    transition: color .2s ease;
}

.rtm__field {
    width: 100%;
    height: 46px;
    padding: 0 42px 0 40px;
    border: 1px solid var(--rtm-line);
    border-radius: 999px;
    background: #fff;
    color: var(--rtm-ink);
    font: inherit;
    font-size: 15px;
    line-height: 1;
    outline: none;
    transition: border-color .2s ease, box-shadow .2s ease;
    appearance: none;
    -webkit-appearance: none;
}

.rtm__field::placeholder {
    color: var(--rtm-ink-3);
}

/* убираем нативный крестик — у нас свой */
.rtm__field::-webkit-search-decoration,
.rtm__field::-webkit-search-cancel-button,
.rtm__field::-webkit-search-results-button {
    -webkit-appearance: none;
    display: none;
}

.rtm__field:focus {
    border-color: var(--color_brand);
    box-shadow: 0 0 0 3px var(--rtm-b-16);
}

.rtm__search:focus-within .rtm__searchIco {
    color: var(--color_brand);
}

.rtm__clear {
    position: absolute;
    right: 8px;
    top: 50%;
    width: 28px;
    height: 28px;
    margin-top: -14px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: var(--rtm-soft);
    color: var(--rtm-ink-2);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: opacity .18s ease, visibility .18s, background .18s ease, color .18s ease;
}

.rtm__clear svg {
    width: 13px;
    height: 13px;
}

.rtm__clear:hover {
    background: var(--rtm-b-16);
    color: var(--color_brand);
}

.rtm__clear:focus-visible {
    outline: 2px solid var(--color_brand);
    outline-offset: 2px;
}

.rtm.is-searching .rtm__clear {
    opacity: 1;
    visibility: visible;
}

/* счётчик результатов */
.rtm__found {
    margin: 10px 0 0;
    font-size: 13px;
    line-height: 1.3;
    color: var(--rtm-ink-2);
    min-height: 1.3em;
    /* место зарезервировано — счётчик не двигает сетку */
}

.rtm__found b {
    color: var(--rtm-ink);
    font-weight: 600;
}

/* ---------- линейки (фильтр) ---------- */
.rtm__lines {
    margin: 0 0 clamp(14px, 2vw, 20px);
}

.rtm__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.rtm__chipItem[hidden] {
    display: none;
}

.rtm__chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    border: 1px solid var(--rtm-line);
    border-radius: 999px;
    background: #fff;
    color: var(--rtm-ink);
    font: inherit;
    font-size: 14px;
    line-height: 1.15;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color .18s ease, background .18s ease, color .18s ease;
}

.rtm__chip:hover {
    border-color: var(--rtm-b-30);
    background: var(--rtm-b-08);
    color: var(--color_brand);
}

.rtm__chip:focus-visible {
    outline: 2px solid var(--color_brand);
    outline-offset: 2px;
}

.rtm__chip[aria-pressed="true"] {
    border-color: var(--color_brand);
    background: var(--color_brand);
    color: #fff;
    font-weight: 600;
}

.rtm__chip[aria-pressed="true"]:hover {
    background: var(--rtm-b-deep);
    border-color: var(--rtm-b-deep);
    color: #fff;
}

/* счётчик моделей в линейке */
.rtm__chipNum {
    display: inline-block;
    min-width: 18px;
    padding: 1px 5px;
    border-radius: 999px;
    background: var(--rtm-soft);
    color: var(--rtm-ink-2);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.45;
    text-align: center;
    transition: background .18s ease, color .18s ease;
}

.rtm__chip:hover .rtm__chipNum {
    background: #fff;
}

.rtm__chip[aria-pressed="true"] .rtm__chipNum {
    background: color-mix(in srgb, #fff 26%, transparent);
    color: #fff;
}

/* «Показать ещё» для самих линеек */
.rtm__linesMore {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 10px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--color_brand);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.rtm__linesMore[hidden] {
    display: none;
}

/* линеек мало — кнопки нет вовсе */
.rtm__linesMore:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.rtm__linesMore:focus-visible {
    outline: 2px solid var(--color_brand);
    outline-offset: 3px;
    border-radius: 4px;
}

.rtm__linesMore svg {
    width: 14px;
    height: 14px;
    transition: transform .25s ease;
}

.rtm__linesMore[aria-expanded="true"] svg {
    transform: rotate(180deg);
}

@media (max-width:520px) {
    .rtm__chips {
        gap: 6px;
    }

    .rtm__chip {
        padding: 7px 12px;
        font-size: 13px;
    }
}

/* ---------- сетка ---------- */
.rtm__grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--rtm-gap);
}

.rtm__item {
    min-width: 0;
}

.rtm__item[hidden] {
    display: none;
}

/* ---------- карточка ---------- */
.rtm__card {
    position: relative;
    display: flex;
    align-items: stretch;
    gap: 10px;
    height: 100%;
    min-height: 104px;
    padding: 15px 0 0 16px;
    /* снизу и справа 0 — фото уходит в угол, как в макете */
    border: 1px solid var(--rtm-line);
    border-radius: var(--rtm-radius);
    background: #fff;
    color: inherit;
    text-decoration: none;
    overflow: hidden;
    transition: border-color .22s ease, box-shadow .22s ease, transform .22s ease;
}

.rtm__card:hover {
    border-color: var(--rtm-b-30);
    box-shadow: 0 14px 30px -20px var(--rtm-b-glow);
    transform: translateY(-2px);
}

.rtm__card:focus-visible {
    outline: 2px solid var(--color_brand);
    outline-offset: 2px;
}

.rtm__body {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 7px;
    flex: 1 1 auto;
    min-width: 0;
    padding-bottom: 15px;
}

.rtm__name {
    margin: 0;
    font-size: 15px;
    line-height: 1.28;
    font-weight: 600;
    letter-spacing: -.01em;
    transition: color .22s ease;
}

.rtm__card:hover .rtm__name {
    color: var(--color_brand);
}

/* чипы */
.rtm__tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    background: var(--rtm-soft);
    color: var(--rtm-ink-2);
    font-size: 12px;
    line-height: 1.2;
    font-weight: 500;
    white-space: nowrap;
}

.rtm__tag--time {
    background: var(--rtm-b-08);
    color: var(--color_brand);
    font-weight: 600;
}

/* текст гарантии одинаков на всех карточках — держим его в CSS,
   меняется в одном месте (переменная --rtm-warranty на .rtm) */
.rtm__tag--warranty::before {
    content: var(--rtm-warranty);
}

.rtm__tag svg {
    width: 13px;
    height: 13px;
    flex: 0 0 auto;
}

/* фото модели */
.rtm__media {
    display: block;
    width: 36%;
    max-width: 116px;
    flex: 0 0 auto;
    align-self: flex-end;
    /* прижато к нижней грани карточки */
    pointer-events: none;
}

.rtm__media img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: var(--rtm-media-ratio);
    object-fit: contain;
    object-position: 100% 100%;
    transform-origin: 100% 100%;
    transition: transform .35s cubic-bezier(.22, .7, .3, 1);
}

.rtm__card:hover .rtm__media img {
    transform: scale(1.06);
}

/* подсветка совпадений */
.rtm__hit {
    background: var(--rtm-b-16);
    border-radius: 3px;
    color: inherit;
    font-weight: 700;
    padding: 0 1px;
}

/* ---------- пустой результат ---------- */
.rtm__empty {
    margin: 0;
    padding: 34px 16px;
    border: 1px dashed var(--rtm-line);
    border-radius: var(--rtm-radius);
    text-align: center;
    color: var(--rtm-ink-2);
    font-size: 15px;
    line-height: 1.5;
}

.rtm__empty[hidden] {
    display: none;
}

.rtm__empty b {
    color: var(--rtm-ink);
}

.rtm__emptyBtn {
    display: inline-block;
    margin-top: 10px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--color_brand);
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.rtm__emptyBtn:focus-visible {
    outline: 2px solid var(--color_brand);
    outline-offset: 3px;
    border-radius: 4px;
}

/* ---------- кнопка «показать все» ---------- */
.rtm__more {
    display: flex;
    justify-content: center;
    margin-top: clamp(16px, 2.2vw, 24px);
}

.rtm__more[hidden] {
    display: none;
}

.rtm__moreBtn {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 13px 26px;
    border: 0;
    border-radius: 999px;
    background: var(--color_brand);
    color: #fff;
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: background .2s ease, transform .2s ease, box-shadow .2s ease;
}

.rtm__moreBtn:hover {
    background: var(--rtm-b-deep);
    transform: translateY(-2px);
    box-shadow: 0 12px 24px -14px var(--rtm-b-glow);
}

.rtm__moreBtn:active {
    transform: translateY(0);
}

.rtm__moreBtn:focus-visible {
    outline: 2px solid var(--color_brand);
    outline-offset: 3px;
}

.rtm__moreBtn b {
    font-weight: 700;
}

.rtm__moreIco {
    width: 16px;
    height: 16px;
    flex: 0 0 auto;
    transition: transform .28s cubic-bezier(.22, .7, .3, 1);
}

.rtm__moreBtn[aria-expanded="true"] .rtm__moreIco {
    transform: rotate(180deg);
}

/* ---------- анимация раскрытия ---------- */
.rtm__item--extra {
    opacity: 0;
    transform: translateY(10px);
}

.rtm__item--extra.is-in {
    opacity: 1;
    transform: none;
    transition: opacity .35s ease, transform .35s cubic-bezier(.22, .7, .3, 1);
}

/* ---------- адаптив ---------- */
@media (max-width:1000px) {
    .rtm__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width:680px) {
    .rtm__head {
        gap: 12px;
    }

    .rtm__title {
        flex: 1 1 100%;
    }

    .rtm__search {
        flex: 1 1 100%;
    }
}

@media (max-width:520px) {
    .rtm {
        --rtm-gap: 12px;
    }

    .rtm__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .rtm__card {
        flex-direction: column;
        padding: 13px 0 0 13px;
        min-height: auto;
    }

    .rtm__name {
        font-size: 13.5px;
    }

    /* карточка узкая, а текст времени приходит из CMS целой фразой — переносим */
    .rtm__tag {
        font-size: 11px;
        padding: 4px 8px;
        white-space: normal;
        align-items: flex-start;
        text-align: left;
    }

    .rtm__tag svg {
        margin-top: 1px;
    }

    .rtm__body {
        padding-right: 13px;
        padding-bottom: 8px;
        gap: 6px;
    }

    .rtm__media {
        width: 46%;
        max-width: 64px;
        align-self: flex-end;
    }

    .rtm__moreBtn {
        width: 100%;
        justify-content: center;
    }
}

@media (prefers-reduced-motion:reduce) {
    .rtm * {
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
    }

    .rtm__card:hover {
        transform: none;
    }

    .rtm__item--extra {
        opacity: 1;
        transform: none;
    }
}