
/* Поиск в шапке и отдельная страница поиска. Остальные страницы каталога не затрагиваются. */
#rb-header-search,
#rb-search-layout {
    --rb-search-blue: #1873d7;
    --rb-search-ink: #173e68;
    --rb-search-pale: #f4f8fd;
}

/* jQuery UI управляет показом списка через display; здесь меняется только его размещение. */
#rb-header-search .rb-search-live-region {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}
#rb-header-search .ui-autocomplete {
    position: static !important;
    left: auto !important;
    top: auto !important;
    width: 100% !important;
    max-width: 100%;
    max-height: 420px;
    max-height: min(420px, 50vh);
    margin: 10px 0 0;
    padding: 6px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    list-style: none;
    border: 1px solid #d7e4f2;
    border-radius: 14px;
    background: #fff;
    color: var(--rb-search-ink);
    box-shadow: 0 8px 24px rgba(23, 62, 104, .09);
    box-sizing: border-box;
}

#rb-header-search .ui-autocomplete > li {
    margin: 0;
    padding: 0;
    border: 0;
    list-style: none;
}

#rb-header-search .ui-autocomplete > li > .mse2-ac-link {
    display: block;
    min-height: 44px;
    margin: 0;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 10px;
    background: transparent;
    color: var(--rb-search-ink);
    font: inherit;
    text-decoration: none;
    cursor: pointer;
    box-sizing: border-box;
}

#rb-header-search .ui-autocomplete > li > .mse2-ac-link:hover,
#rb-header-search .ui-autocomplete > li > .mse2-ac-link.ui-state-active,
#rb-header-search .ui-autocomplete > li.ui-state-active > .mse2-ac-link {
    margin: 0;
    border-color: var(--rb-search-blue);
    background: var(--rb-search-pale);
    color: var(--rb-search-ink);
}

#rb-header-search .ui-autocomplete > li > .mse2-ac-link.rb-search-suggestion {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
    padding: 10px 12px;
}

#rb-header-search .rb-search-suggestion__image {
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    max-width: 48px;
    margin: 0;
    padding: 3px;
    border: 1px solid #e4ecf5;
    border-radius: 8px;
    background: #fff;
    object-fit: contain;
    box-sizing: border-box;
}

#rb-header-search .rb-search-suggestion__text {
    display: block;
    flex: 1 1 auto;
    min-width: 0;
}

#rb-header-search .rb-search-suggestion__kind {
    display: block;
    margin: 0 0 3px;
    color: #647d96;
    font-size: 12px;
    line-height: 1.4;
}

#rb-header-search .rb-search-suggestion__title {
    display: block;
    color: var(--rb-search-ink);
    font-size: 15px;
    line-height: 1.45;
    white-space: normal;
    overflow-wrap: anywhere;
}

#rb-header-search .rb-search-status {
    margin: 8px 2px 0;
    color: #5b7390;
    font-size: 13px;
    line-height: 1.5;
}

#rb-header-search .rb-search-status:empty {
    display: none;
}

#rb-header-search .mse2-ac-link:focus-visible {
    outline: 2px solid var(--rb-search-blue);
    outline-offset: -2px;
}

/* Общая обёртка существует только на странице поиска ресурса 97. */
#rb-search-layout {
    padding-top: var(--rb-search-header-offset, 140px);
    background: var(--rb-search-pale);
    color: var(--rb-search-ink);
}

#rb-search-layout .first-screen.common {
    display: flex;
    align-items: center;
    height: auto;
    min-height: 180px;
    margin: 0;
    padding: 32px 0;
    background-position: center bottom;
    background-size: cover;
    box-sizing: border-box;
}

#rb-search-layout .first-screen.common > .container,
#rb-search-layout .breadcrumbs > .container,
#rb-search-layout #rb-search-page {
    width: 100%;
    max-width: 1200px;
    margin-right: auto;
    margin-left: auto;
    padding-right: 24px;
    padding-left: 24px;
    box-sizing: border-box;
}

#rb-search-layout .first-screen.common > .container {
    height: auto;
    min-height: 0;
    padding-top: 0;
    padding-bottom: 0;
}

#rb-search-layout .first-screen.common .heading-wrapper {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    width: 100%;
    max-width: none;
    height: auto;
    min-height: 0;
    margin: 0;
    padding: 0;
    text-align: left;
}

#rb-search-layout .first-screen.common .heading-wrapper h1 {
    max-width: 100%;
    margin: 0;
    color: var(--rb-search-ink);
    font-family: RobotoBold, Arial, sans-serif;
    font-size: 36px;
    font-weight: 400;
    line-height: 1.2;
    text-align: left;
    text-transform: none;
    overflow-wrap: anywhere;
}

#rb-search-layout .breadcrumbs {
    margin: 0;
    padding: 16px 0;
    background: transparent;
}

#rb-search-layout .breadcrumbs ol {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    margin: 0;
    padding: 0;
    list-style: none;
    background: transparent;
}

#rb-search-layout .breadcrumbs ol li {
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
    color: #637b94;
    font-size: 14px;
    line-height: 1.5;
}

#rb-search-layout .breadcrumbs ol li::before {
    position: static;
    display: inline-block;
    width: auto;
    height: auto;
    margin-right: 10px;
    padding: 0;
    border: 0;
    transform: none;
    background: transparent;
    color: #91a4b8;
    content: '/';
}

#rb-search-layout .breadcrumbs ol li:first-child::before {
    display: none;
}

#rb-search-layout .breadcrumbs a {
    color: var(--rb-search-blue);
    text-decoration: none;
}

#rb-search-layout .breadcrumbs a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

#rb-search-layout .search-results.section-padding {
    padding: 0;
}

#rb-search-layout #rb-search-page {
    padding-top: 16px;
    padding-bottom: 48px;
}

#rb-search-layout #rb-search-page > .container {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
}

#rb-search-layout .rb-search-toolbar {
    margin: 0 0 28px;
    padding: 24px;
    border: 1px solid #dce7f3;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 7px 24px rgba(23, 62, 104, .045);
}

#rb-search-layout .rb-search-toolbar h2,
#rb-search-layout .rb-search-models > h2,
#rb-search-layout .rb-search-models-head > h2,
#rb-search-layout .rb-search-products > h2 {
    margin: 0 0 12px;
    color: var(--rb-search-ink);
    font-family: RobotoBold, Arial, sans-serif;
    font-size: 28px;
    font-weight: 400;
    line-height: 1.3;
    text-align: left;
    text-transform: none;
    overflow-wrap: anywhere;
}

#rb-search-layout .rb-search-toolbar > p {
    margin: 0 0 18px;
    color: #5d748d;
    font-size: 15px;
    line-height: 1.6;
}

#rb-search-layout .rb-search-page-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    margin: 0;
}

#rb-search-layout .rb-search-page-form label {
    grid-column: 1 / -1;
    margin: 0;
    color: var(--rb-search-ink);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
}

#rb-search-layout .rb-search-page-form input[name="query"] {
    width: 100%;
    min-width: 0;
    min-height: 48px;
    margin: 0;
    padding: 11px 14px;
    border: 1px solid #cbdced;
    border-radius: 10px;
    background: #fff;
    color: #173e68;
    font: inherit;
    font-size: 16px;
    line-height: 1.4;
    box-sizing: border-box;
}

#rb-search-layout .rb-search-page-form button {
    min-height: 48px;
    margin: 0;
    padding: 11px 22px;
    border: 1px solid var(--rb-search-blue);
    border-radius: 10px;
    background: var(--rb-search-blue);
    color: #fff;
    font: inherit;
    font-size: 16px;
    line-height: 1.4;
    text-transform: none;
    cursor: pointer;
}

#rb-search-layout .rb-search-page-form button:hover {
    border-color: #125fb5;
    background: #125fb5;
}

/* Модели водонагревателей ведут на свои страницы, отдельно от форм добавления товаров. */
#rb-search-layout .rb-search-models {
    margin: 28px 0 34px;
}

#rb-search-layout .rb-search-model-count,
#rb-search-layout .rb-search-model-note,
#rb-search-layout .rb-search-products-note {
    margin: 0 0 17px;
    color: #607a95;
    font-size: 14px;
    line-height: 1.6;
}

#rb-search-layout .rb-search-empty,
#rb-search-layout #mse2_results:empty::after {
    grid-column: 1 / -1;
    display: block;
    padding: 24px;
    border: 1px solid #dce7f3;
    border-radius: 14px;
    background: #fff;
    color: #607a95;
}

#rb-search-layout #mse2_results:empty::after {
    content: 'Запчасти по этому запросу не найдены. Попробуйте другое название или артикул.';
}

#rb-search-layout .rb-search-model-grid,
#rb-search-layout #rb-search-page #mse2_results {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
    align-items: stretch;
    width: 100%;
    margin: 0;
    padding: 0;
}

#rb-search-layout .rb-search-model-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    margin: 0;
    overflow: hidden;
    border: 1px solid #dce7f3;
    border-radius: 16px;
    background: #fff;
    color: var(--rb-search-ink);
    text-decoration: none;
    box-shadow: 0 5px 18px rgba(23, 62, 104, .04);
}

#rb-search-layout .rb-search-model-card:hover {
    border-color: #94bce8;
    color: var(--rb-search-ink);
}

#rb-search-layout .rb-search-model-card > img {
    display: block;
    width: 100%;
    height: 160px;
    margin: 0;
    padding: 16px;
    border-bottom: 1px solid #e8eef6;
    background: #fff;
    object-fit: contain;
    box-sizing: border-box;
}

#rb-search-layout .rb-search-model-card__body {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
    padding: 18px;
}

#rb-search-layout .rb-search-model-card h3,
#rb-search-layout .rb-search-model-card .rb-search-model-title {
    display: block;
    margin: 0 0 8px;
    color: var(--rb-search-ink);
    font-family: RobotoBold, Arial, sans-serif;
    font-size: 18px;
    font-weight: 400;
    line-height: 1.4;
    text-transform: none;
    overflow-wrap: anywhere;
}

#rb-search-layout .rb-search-model-card p {
    margin: 0 0 16px;
    color: #617990;
    font-size: 14px;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

#rb-search-layout .rb-search-model-card .rb-search-model-kind {
    display: block;
    margin: 0 0 7px;
    color: #647d96;
    font-size: 12px;
    line-height: 1.4;
}

#rb-search-layout .rb-search-model-card .rb-search-model-action {
    display: block;
    margin-top: auto;
    color: var(--rb-search-blue);
    font-size: 14px;
    line-height: 1.5;
}

/* Родные miniShop2 формы и их поля остаются в карточках. */
#rb-search-layout #rb-search-page #mse2_results > .ms2_product {
    position: relative;
    width: auto;
    min-width: 0;
    max-width: none;
    margin: 0;
    padding: 20px;
    border: 1px solid #dce7f3;
    border-radius: 16px;
    background: #fff;
    color: #5d748d;
    text-align: left;
    box-shadow: 0 5px 18px rgba(23, 62, 104, .04);
    box-sizing: border-box;
}

#rb-search-layout #rb-search-page #mse2_results > .ms2_product:not([hidden]) {
    display: flex;
}

#rb-search-layout #rb-search-page #mse2_results > .ms2_product > form.ms2_form {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column !important;
    align-items: stretch !important;
    width: 100%;
    min-width: 0;
    height: 100%;
    margin: 0;
}

#rb-search-layout #rb-search-page #mse2_results .ms2_product .image-wrapper {
    display: flex;
    flex: 0 0 190px;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 190px;
    margin: 0 0 18px;
    padding: 0;
    overflow: hidden;
    border-radius: 10px;
    background: #fff;
}

#rb-search-layout #rb-search-page #mse2_results .ms2_product .image-wrapper > a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

#rb-search-layout #rb-search-page #mse2_results .ms2_product .image-wrapper img {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    margin: 0;
    object-fit: contain;
}

#rb-search-layout #rb-search-page #mse2_results .ms2_product .product-content-wrapper {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
}

#rb-search-layout #rb-search-page #mse2_results .ms2_product .product-content {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

#rb-search-layout #rb-search-page #mse2_results .ms2_product .price-title {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    height: auto;
    color: #5d748d;
    font-size: 13px;
    line-height: 1.5;
}

#rb-search-layout #rb-search-page #mse2_results .ms2_product .product-title {
    display: block;
    min-height: 0;
    max-height: none;
    margin: 0 0 12px;
    padding: 0;
    overflow: visible;
    color: var(--rb-search-ink);
    font-family: RobotoBold, Arial, sans-serif;
    font-size: 17px;
    font-weight: 400;
    line-height: 1.45;
    text-align: left;
    text-decoration: none;
    text-overflow: clip;
    white-space: normal;
    overflow-wrap: anywhere;
}

#rb-search-layout #rb-search-page #mse2_results .ms2_product .product-title:hover {
    color: var(--rb-search-blue);
}

#rb-search-layout #rb-search-page #mse2_results .ms2_product .product-title::after {
    display: none;
}

#rb-search-layout #rb-search-page #mse2_results .ms2_product .availability {
    margin-top: 2px;
    text-align: left;
    font-size: 14px;
    line-height: 1.5;
}

#rb-search-layout #rb-search-page #mse2_results .ms2_product .price-wrapper {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 5px 8px;
    width: 100%;
    margin: auto 0 0;
    padding-top: 18px;
    color: #5d748d;
    font-size: 14px;
    line-height: 1.4;
}

#rb-search-layout #rb-search-page #mse2_results .ms2_product .price-wrapper .price {
    display: inline-block;
    width: auto;
    height: auto;
    margin: 0;
    padding: 0;
    color: var(--rb-search-ink);
    font-family: RobotoBold, Arial, sans-serif;
    font-size: 23px;
    font-weight: 400;
    line-height: 1.35;
}

#rb-search-layout #rb-search-page #mse2_results .ms2_product .price-wrapper.akciya .old_price {
    position: static;
    display: inline-block;
    margin: 0;
    padding: 0;
    transform: none;
    color: #76899e;
    font-size: 14px;
    text-decoration: line-through;
}

#rb-search-layout #rb-search-page #mse2_results .ms2_product .price-wrapper.akciya .price {
    color: #b12626;
}

#rb-search-layout #rb-search-page #mse2_results .ms2_product .button-wrapper {
    width: 100%;
    margin-top: 18px;
}

#rb-search-layout #rb-search-page #mse2_results .ms2_product .button-wrapper > button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    min-height: 46px;
    margin: 0;
    padding: 12px 14px;
    border-radius: 11px;
    font-family: RobotoRegular, Arial, sans-serif;
    font-size: 15px;
    line-height: 1.4;
    text-align: center;
    text-transform: none;
    white-space: normal;
}

#rb-search-layout #rb-search-page #mse2_results .ms2_product .button-wrapper > button:disabled {
    opacity: .55;
    cursor: not-allowed;
}

#rb-search-layout #rb-search-page #mse2_results > p,
#rb-search-layout #rb-search-page #mse2_results > .alert {
    grid-column: 1 / -1;
    margin: 0;
    padding: 20px;
    border: 1px solid #dce7f3;
    border-radius: 14px;
    background: #fff;
    color: var(--rb-search-ink);
    font-size: 16px;
    line-height: 1.6;
}

#rb-search-layout .mse2_pagination ul {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin: 28px 0 0;
    padding: 0;
    list-style: none;
    border: 0;
}

#rb-search-layout .mse2_pagination ul > li {
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 15px;
    line-height: 1.4;
    text-decoration: none;
}

#rb-search-layout .mse2_pagination ul > li > a,
#rb-search-layout .mse2_pagination ul > li > span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    padding: 8px 12px;
    border: 1px solid #d4e2f0;
    border-radius: 10px;
    background: #fff;
    color: var(--rb-search-ink);
    text-decoration: none;
    box-sizing: border-box;
}

#rb-search-layout .mse2_pagination ul > li.active > a,
#rb-search-layout .mse2_pagination ul > li.active > span {
    border-color: var(--rb-search-blue);
    background: var(--rb-search-blue);
    color: #fff;
}

#rb-search-layout a:focus-visible,
#rb-search-layout button:focus-visible,
#rb-search-layout input[name="query"]:focus-visible {
    outline: 3px solid var(--rb-search-blue);
    outline-offset: 3px;
}

@media (max-width: 1199px) {
    #rb-search-layout {
        padding-top: var(--rb-search-header-offset, 45px);
    }
}

@media (max-width: 991px) {
    #rb-search-layout .rb-search-model-grid,
    #rb-search-layout #rb-search-page #mse2_results {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 18px;
    }
}

@media (max-width: 600px) {
    #rb-search-layout .first-screen.common {
        min-height: 160px;
        padding: 28px 0;
    }

    #rb-search-layout .first-screen.common > .container,
    #rb-search-layout .breadcrumbs > .container,
    #rb-search-layout #rb-search-page {
        padding-right: 16px;
        padding-left: 16px;
    }

    #rb-search-layout .first-screen.common .heading-wrapper h1 {
        font-size: 28px;
    }

    #rb-search-layout .rb-search-toolbar {
        padding: 18px;
    }

    #rb-search-layout .rb-search-toolbar h2,
    #rb-search-layout .rb-search-models > h2 {
        font-size: 24px;
    }

    #rb-search-layout .rb-search-page-form,
    #rb-search-layout .rb-search-model-grid,
    #rb-search-layout #rb-search-page #mse2_results {
        grid-template-columns: minmax(0, 1fr);
    }

    #rb-search-layout .rb-search-page-form button {
        width: 100%;
    }

    #rb-search-layout #rb-search-page #mse2_results > .ms2_product {
        padding: 18px;
    }
}

