.ui-carousel .gallery-image {
    position: relative;
    display: block;
    width: auto;
    height: auto;
    border-radius: var(--border-radius-l);
    overflow: hidden;
    cursor: pointer;
}

.gallery-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gallery-image-stuff {
    position: absolute;
    right: 8px;
    bottom: 8px;
    display: flex;
    gap: 8px;
}

.gallery-image-text {
    display: block;
    padding: 6px 12px;
    border-radius: 32px;
    font-size: 14px;
    font-weight: 500;
    line-height: 22px;
    color: var(--ui-text-primary);
    background: rgba(255,255,255,.3);
    backdrop-filter: blur(10px);
    transition: background .4s, visibility .4s, opacity .4s;
    position: relative;
    opacity: 1;
    z-index: 10;
    text-decoration: none;
}

.fancybox__slide.is-draggable:not(.can-zoom_in) .gallery-image-text {
    visibility: hidden;
    opacity: 0;
}

.fancybox__content .gallery-image-text {
    position: absolute;
    right: 8px;
    bottom: 8px;
    background-color: var(--ui-primary);
}

.gallery-image-tour-link {
    width: 34px;
    height: 34px;
    font-size: 20px;
}

.project-gallery-section .gallery-image {
    width: 432px;
    height: 260px;
}

@media (max-width: 575px) {
    .project-gallery-section .gallery-image {
        width: 100%;
        max-width: 432px;
        height: auto;
    }
}

.search-list-item {
    position: relative;
    display: block;
    width: 100%;
    padding: 8px 16px;
    background: none;
    outline: none;
    border: none;
    border-left: solid 1px var(--ui-background);
    text-decoration: none;
    text-align: left;
    color: var(--ui-text-primary);
    transition: color .4s, background .4s, border .4s;
}

.search-list-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 1px;
    height: 100%;
    background: var(--ui-background);
}

.search-list-item.active::before {
    width: 2px;
    background: var(--ui-secondary);
}


/* FAQ */
.page-faq__accordion-header::before {
    content: '';
    display: block;
    height: 120px;
    margin-top: -120px;
    visibility: hidden;
}

.page-faq__accordion-header:not(:first-child) {
    margin-top: 40px;
}

.page-faq mark {
    padding: 0;
    background: var(--ui-primary);
}

.search-text-result-show > :not(.search-text-found) {
    display: none;
}

.search-text-not-found > [data-search-text-header] {
    display: none;
}

.search-text-not-found-content {
    display: none;
    color: var(--ui-text-secondary);
}

.search-text-not-found > .search-text-not-found-content {
    display: block;
}


/* Галерея */
.page-gallery__content {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    grid-auto-rows: 360px;
    gap: 32px;
}

.page-gallery__content .gallery-image {
    cursor: pointer;
}

.page-gallery__content img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 24px;
}

.page-gallery__content > :nth-child(15n + 1),
.page-gallery__content > :nth-child(15n + 7),
.page-gallery__content > :nth-child(15n + 13) {
    grid-column: span 5;
}

.page-gallery__content > :nth-child(15n + 2),
.page-gallery__content > :nth-child(15n + 8),
.page-gallery__content > :nth-child(15n + 12) {
    grid-column: span 4;
}

.page-gallery__content > :nth-child(15n + 3),
.page-gallery__content > :nth-child(15n + 6),
.page-gallery__content > :nth-child(15n + 11) {
    grid-column: span 3;
}

.page-gallery__content > :nth-child(15n + 4),
.page-gallery__content > :nth-child(15n + 5),
.page-gallery__content > :nth-child(15n + 9),
.page-gallery__content > :nth-child(15n + 10),
.page-gallery__content > :nth-child(15n + 14),
.page-gallery__content > :nth-child(15n + 15) {
    grid-column: span 6;
}

.page-gallery__more {
    text-align: center;
}

.page-gallery ~ .page-bottom-block {
    margin-top: 160px;
}

@media (max-width: 1199px) {
    .page-gallery__content {
        gap: 24px;
    }

    .page-gallery__content > :nth-child(4n + 1),
    .page-gallery__content > :nth-child(4n + 4) {
        grid-column: span 7;
    }

    .page-gallery__content > :nth-child(4n + 2),
    .page-gallery__content > :nth-child(4n + 3) {
        grid-column: span 5;
    }

    .page-gallery ~ .page-bottom-block {
        margin-top: 112px;
    }
}

@media (max-width: 767px) {
    .page-gallery__more {
        display: none;
    }

    .page-gallery__content {
        display: initial;
    }

    .page-gallery__content img {
        max-height: 216px;
        object-fit: cover;
    }

    .page-gallery .f-carousel__viewport {
        border-radius: 24px;
        overflow: hidden;
    }

    .page-gallery .f-thumbs__slide,
    .page-tours .f-thumbs__slide {
        --f-thumb-width: 102px;
        --f-thumb-height: 60px;
        --f-thumb-outline: 2px;
        --f-thumb-outline-color: var(--ui-primary);
        --f-thumb-opacity: 1;
        --f-thumb-border-radius: 8px;
    }

    .gallery-carousel-nav .ui-arrow-left-transp,
    .gallery-carousel-nav .ui-arrow-right-transp {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
    }

    .gallery-carousel-nav .ui-arrow-left-transp {
        left: 24px;
    }
    .gallery-carousel-nav .ui-arrow-right-transp {
        right: 24px;
    }

    .page-gallery ~ .page-bottom-block {
        margin-top: 40px;
    }
}

.tag-filter-form {
    display: flex;
    flex-wrap: wrap;
    align-items: start;
    gap: 8px;
    /* min-height: 84px; */
}

.tag-filter-reset {
    display: none;
    background: var(--ui-primary);
}

.btn-more {
    padding: 10px 10px 10px 20px;
    background: white;
}


/* Блог */
.telegram-promo {
    min-height: 400px;
    grid-column-start: 10;
    grid-column-end: span 3;
    grid-row-start: 2;
    grid-row-end: 3;
    display: flex;
    flex-direction: column;
    padding: 24px 16px 16px;
    border-radius: var(--border-radius-m);
    background: url('/local/assets/v3/images/tg_promo_bg.png') no-repeat right 90%;
    background-color: var(--ui-secondary);
    color: var(--ui-text-white);
}

.page-blog {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 32px;
    margin-bottom: 16px;
}


.page-blog > .preview-card:nth-child(8n + 2),
.page-blog > .preview-card:nth-child(8n + 3),
.page-blog > .preview-card:nth-child(8n + 4),
.page-blog > .preview-card:nth-child(8n + 5),
.page-blog > .preview-card:nth-child(8n + 9) {
    grid-column: span 4;
}

.page-blog > .preview-card:nth-child(8n + 6) {
    grid-column: span 5;
}

.page-blog > .preview-card:nth-child(8n + 14) {
    grid-column: span 4;
}

.page-blog > .preview-card:nth-child(8n + 7),
.page-blog > .preview-card:nth-child(8n + 8) {
    grid-column: span 6;
}

.page-blog .preview-card {
    height: auto;
    margin-bottom: 0;
}

.page-blog .preview-card__body {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.page-blog .preview-card__body .article__props {
    margin-top: auto;
}

.page-blog__preview-tags > * {
    margin-bottom: 4px;
}

.page-blog__preview-item {
    cursor:default;
}

.page-blog .preview-card__image {
    padding: 0;
    height: 160px;
}

.page-blog__preview-name {
    color: var(--ui-text-primary);
    text-decoration: none;
}

.page-blog__preview-text {
    max-height: 78px;
    overflow: hidden;
    position: relative;
}

.page-blog__preview-text::after {
    /* content: '\2026'; */
    position: absolute;
    bottom: 6px;
    right: 0;
    width: 10%;
    background: linear-gradient(to right, transparent, white 80%);
    text-align: right;
    color: var(--ui-text-tetriary);
}

.page-blog__search {
    position: relative;
    min-width: 320px;
}

.page-blog__search-result-count {
    position: absolute;
    top: -32px;
    right: 0;
    font-size: 16px;
    font-weight: 400;
    line-height: 24px;
    color: var(--ui-text-secondary);
}

.page-blog__search .ui-search-results-grp > a > .icon {
	margin-right: 4px;
    font-size: 18px;
	color: var(--ui-text-tetriary);
}



/* Услуги */
.page-services {
    row-gap: 32px;
    margin-bottom: 128px;
}

.page-services__block {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: start;
    height: 100%;
    padding: 32px;
    border-radius: var(--border-radius-m);
    background: white;
}

.page-services__block li:not(:last-child) {
    margin-bottom: 8px;
}

.page-services__block-btn {
    margin-top: auto;
    align-self: end;
}

.page-services__block--houses .page-services__block-btn {
    position: absolute;
    top: 36px;
    right: 32px;
}

.page-services__link-grp {
    margin-top: auto;
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 16px;
}

.page-services__link-w-img {
    text-align: center;
    text-decoration: none;
    color: var(--ui-text-primary);
    transition: color .4s;
    word-break: break-word;
    hyphens: auto;
}

.page-services__link-w-img:hover {
    color: var(--ui-text-secondary);
}

.page-services__img-wrap {
    height: 100px;
    display: flex;
    max-width: 170px;
    margin: 0 auto 0 auto;
    justify-content: flex-end;
    flex-direction: column;
}

.page-services__link-w-img img {
    object-fit:cover;
    display: block;
}

.page-services__block .mortgage__bank-param-block {
    margin-top: 40px;
    margin-bottom: 72px;
}

.page-services__block .mortgage__logo-grp {
    margin-top: auto;
    margin-right: 160px;
}

.page-services__block--mortgage .page-services__block-btn {
    position: absolute;
    bottom: 32px;
}


/* Контакты */
.page-contacts {
    margin-bottom: 128px;
    color: var(--ui-text-white);
}

.page-contacts .socials-block > a {
    background-color: var(--ui-background);
}

.page-contacts .socials-block > a:hover {
    background-color: var(--ui-state-hover);
}

.page-contacts.content-container {
    padding: 0 calc(0.5 * var(--bs-gutter-x));
}

.page-contacts__content {
    padding: 32px 0;
    background-color: var(--ui-secondary);
}

.page-contacts__btn-grp {
    margin-bottom: 40px;
    display: flex;
}

.page-contacts__contacts-grp {
    margin-bottom: 24px;
    color: var(--ui-text-white);
}

.page-contacts__contacts-grp > div:not(:last-child) {
    margin-bottom: 12px;
    display: flex;
}

.page-contacts__contacts-grp .icon {
    margin-right: 8px;
    font-size: 20px;
    color: var(--ui-primary);
}

.page-contacts__map {
    margin-left: 16px;
    border-radius: var(--border-radius-l);
    overflow: hidden;
}

.page-contacts__map .bx-yandex-view-map {
    height: 464px;
}

.page-contacts ~ .page-bottom-block .page-bottom-block__image {
    /*background-image: url('/local/assets/v3/images/page_contacts_bottom_bg.jpg');*/
}


/* Блок с формой в конце страницы */
.page-bottom-block {
    margin-bottom: 80px;
}

.page-bottom-block__content {
    padding: 24px 32px;
    border-radius: var(--border-radius-l);
    background: white;
}

.page-bottom-block__image {
    width: 100%;
    height: 100%;
    border-radius: var(--border-radius-l);
    overflow: hidden;
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    /*background-image: url('/local/assets/v3/images/page_services_bottom_bg.jpg');*/
}

.page-bottom-block #contact-form-modal {
    margin: 0;
}


/* Блок с текстом и формой */
.desc-text-block__content {
    position: relative;
    padding: 24px 32px;
    min-height: 100%;
    overflow: hidden;
}

.desc-text-block .contact-form {
    height: auto;
}

 .desc-text-block__image {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    background-image: url('/local/assets/v3/images/page_services_bottom_bg.jpg');
}

.is-empty + .desc-text-block__image {
    display: block;
}


/* Ссылки на странице каталога проектов */
.tag-list {
    padding: 32px 0;
}

.tag-list__content {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-list__link {
    font-weight: 600;
}

.tag-list__link.active {
    color: var(--ui-primary);
    background: var(--ui-secondary);
}


/* Карточка превью проекта */
:root {
    --project-card-margin-bottom: 32px;
}

.project-preview-card {
    margin-bottom: var(--project-card-margin-bottom);
    height: calc(100% - var(--project-card-margin-bottom));
}

.project-preview-card .preview-card__footer {
    display: flex;
    align-items: center;
}


/* Страница 3D туров */
.page-tours {
    margin-bottom: var(--ui-section-padding);
}

.page-tours__content {
    margin-bottom: var(--ui-section-padding);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
}

.page-tours__content .page-tours__tour {
    height: 360px;
    border-radius: var(--border-radius-l);
    overflow: hidden;
}


/* Страница 3D тура */
.page-tour {
    margin-bottom: var(--ui-section-padding);
    position: relative;
    padding-top: 16px;
}

.page-tour__nav {
    position: absolute;
    top: -50px;
    right: 0;
    display: flex;
}

.page-tour__nav .icon {
    font-size: 14px;
}

.page-tour__nav > :first-child {
    margin-right: 16px;
    padding-left: 10px;
    background-color: white;
}

.page-tour__nav > :first-child .icon {
    margin: 0 8px 0 0;
}

.page-tour__nav > :last-child {
    padding-right: 10px;
}

.page-tour__content {
    height: 760px;
    max-height: 90vh;
    border-radius: var(--border-radius-l);
    overflow: hidden;
}


.page-catalog__link-list {
    list-style: none;
    column-count: 2;
}

.page-catalog__link-list li {
    margin-bottom: 16px;
    font-size: 18px;
    font-weight: 600;
    line-height: 26px;
    color: var(--ui-state-link);
}

.page-catalog__link-list li::before {
    content: '\22c5';
    margin-right: 4px;
    font-size: 24px;
    line-height: 20px;
}

.page-catalog__link-list li a {
    text-decoration: none;
    color: var(--ui-state-link);
}

@media (hover:hover) {
    .gallery-image:hover .gallery-image-text {
        background: var(--ui-primary);
    }

    .gallery-image-text:hover {
        background-color: var(--ui-state-hover);
    }

    .search-list-item:hover {
        background: var(--ui-text-white);
    }
}

@media (max-width: 1399px) {
    .page-tour__content {
        height: 640px;
    }
}

@media (max-width: 1199px) {
    .page-blog {
        gap: 24px;
    }

    .page-blog > .preview-card:nth-child(2),
    .page-blog > .preview-card:nth-child(4n + 5),
    .page-blog > .preview-card:nth-child(4n + 8) {
        grid-column: span 5;
    }

    .page-blog > .preview-card:nth-child(3),
    .page-blog > .preview-card:nth-child(4),
    .page-blog > .preview-card:nth-child(4n + 6),
    .page-blog > .preview-card:nth-child(4n + 7) {
        grid-column: span 7;
    }

    .telegram-promo {
        grid-column-start: 8;
        grid-column-end: span 5;
    }

    .page-services__bottom .page-bottom-block__image {
        display: none;
    }

    .page-services {
        --bs-gutter-x: 24px;

        row-gap: 24px;
    }

    .page-services__block .ui-h3 {
        font-size: 30px;
        line-height: 40px;
    }

    .page-services__block--mortgage {
        order: 1;
    }

    .page-contacts {
        margin-bottom: 106px;
    }

    .page-contacts__map .bx-yandex-view-map {
        height: 436px;
    }

    .page-bottom-block__image {
        width: calc(100% + 56px);
        height: calc(100% - 24px);
        margin-top: 12px;
    }

    .page-bottom-block {
        margin-bottom: 56px;
    }

    :root {
        --project-card-margin-bottom: 24px;
    }

    .page-tours__content {
        gap: 24px;
    }

    .page-tours__content .page-tours__tour {
        height: 288px;
    }

    .page-tour {
        --page-tour-nav-height: calc(24px + 42px);
    }

    .page-tour__content {
        height: 480px;
        margin-bottom: calc(var(--ui-section-padding) + var(--page-tour-nav-height));
    }

    .page-tour__nav {
        top: initial;
        left: 0;
        bottom: calc(-1 * var(--page-tour-nav-height));
        justify-content: center;
    }
}

@media (max-width: 991px) {
    .project-preview-card .preview-card__footer {
        flex-direction: column;
        align-items: start;
    }

    .project-preview-card .preview-card__footer a {
        margin-top: 16px;
        width: 100%;
    }

    .project-preview-card .preview-card__body,
    .project-preview-card .preview-card__footer {
        padding-left: 16px;
        padding-right: 16px;
    }

    .desc-text-block__content {
        min-height: 320px;
        margin-bottom: 48px;
    }
}

@media (max-width: 767px) {
    .page-blog {
        grid-template-columns: 1fr;
    }

    .page-blog > .preview-card:nth-child(n) {
        grid-column: span 1;
    }

    .telegram-promo {
        grid-column: span 1;
        grid-row-start: 3;
        grid-row-end: span 1;
    }

    .page-services__block {
        padding: 24px 16px;
    }

    .page-services__block-btn {
        margin-top: 32px;
        align-self: stretch;
    }

    .page-services__block .page-services__block-btn {
        position: static;
    }

    .page-bottom-block__content {
        padding: 16px;
    }

    .page-services__block .mortgage__logo-grp {
        margin-right: 0;
    }

    .page-services__block .mortgage__logo-grp {
        margin-top: 32px;
    }

    .page-services__block .mortgage__bank-param-block {
        margin-top: 40px;
        margin-bottom: 0px;
    }

    .mortgage__bank-param-block, .page-services__block--mortgage .page-services__block-btn {
        order: 1;
    }

    .page-contacts {
        margin-bottom: 88px;
    }

    .page-contacts__content {
        padding-top: 16px;
    }

    .page-contacts__map {
        margin-left: 0;
    }

    .page-contacts__btn-grp {
        margin-top: 16px;
        margin-bottom: 24px;
    }

    .page-bottom-block {
        margin-bottom: 48px;
    }

    .desc-text-block__content {
        padding: 16px;
    }

    .page-tours__content {
        display: block;
        margin-bottom: 8px;
    }
}

@media (max-width: 575px) {
    .page-services__link-grp {
        width: 100%;
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .page-services__link-w-img img {
        font-size: 16px;
        line-height: 22px;
    }
    .page-services__link-w-img img {
        height: 84px;
    }

    .page-contacts__map .bx-yandex-view-map {
        height: 172px;
    }

    .project-preview-card .preview-card__image {
        padding-left: 0;
        padding-right: 0;
    }

    .page-tour__content {
        height: 320px;
    }

    .page-tour__nav > a:nth-child(n) {
        padding: 8px;
        width: 44px;
        height: 44px;
        font-size: 0;
    }

    .page-tour__nav > a:nth-child(n) .icon {
        margin: 0;
        font-size: 24px;
    }

    .page-catalog__link-list {
        column-count: 1;
    }
}