.house-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    cursor: pointer;
}

.card-image-slider.swiper {
    width: 100%;
    height: 334px;
    overflow: hidden;
    border-radius: 16px;
    position: relative;
    min-width: 0;
}

.card-favorite-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 5;

    width: 32px;
    height: 32px;
    padding: 0;
    border: 1.1px solid #0000001A;
    border-radius: 50%;
    background-color: var(--primary-inverted);
    box-shadow:
        0 4.4px 8.8px #0000001A,
        0 2.2px 6.6px #0000000A;
    backdrop-filter: blur(55px);
    -webkit-backdrop-filter: blur(55px);
    cursor: pointer;
    transition: transform .2s ease, background-color .2s ease;
}

.card-favorite-btn::before {
    content: "";
    position: absolute;
    inset: 6px;
    background: url("../../images/icons/heart.svg") center / contain no-repeat;
}

.card-favorite-btn.active::before {
    background-image: url("../../images/icons/heart-filled.svg");
}

.card-favorite-btn:hover {
    transform: scale(1.08);
}

.card-image-slider .swiper-wrapper {
    height: 100%;
    display: flex;
    will-change: transform;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.card-image-slider .swiper-slide {
    height: 100%;
    width: 100% !important;
    flex-shrink: 0;
    min-width: 0;
    position: relative;
    overflow: hidden;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.card-image-slider img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    background-repeat: no-repeat;
    display: block;
    transform: translateZ(0);

    backface-visibility: hidden;

    -webkit-backface-visibility: hidden;
}

.card-image-slider {
    width: 100%;
    height: 334px;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
    background: #eee;
}

.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;

    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-shimmer {
    position: absolute;
    inset: 0;
    background: #eee;
    z-index: 2;
}

.swiper {
    z-index: 1;
}

.swiper-button-disabled {
    opacity: 0 !important;
    pointer-events: none !important;
}

.swiper-button-next {
    right: 12px !important;
}

.swiper-button-prev {
    left: 12px !important;
}

.swiper-button-next,
.swiper-button-prev {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.2s ease;
}

.card-image-slider.is-first-slide .swiper-button-prev {
    opacity: 0 !important;
    pointer-events: none;
}

.card-image-slider.is-first-slide:hover .swiper-button-next {
    opacity: 1;
    pointer-events: auto;
}

.card-image-slider.is-first-slide:hover .swiper-button-next,
.card-image-slider.is-first-slide:hover .swiper-button-prev {
    opacity: 1;
    pointer-events: auto;
}

.card-image-slider.is-not-first .swiper-button-next,
.card-image-slider.is-not-first .swiper-button-prev {
    opacity: 1;
    pointer-events: auto;
}

.card-image-slider .swiper-button-next,
.card-image-slider .swiper-button-prev {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background-color: var(--primary-inverted);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    width: 32px !important;
    min-width: 32px;
    max-width: 32px;
    height: 32px !important;
    min-height: 32px;
    max-height: 32px;
    margin-top: -16px;
    aspect-ratio: 1;
    transition: opacity 0.2s ease, transform 0.2s ease;

    &::after {
        display: none;
    }

    &::before {
        content: "";
        width: 18px;
        height: 18px;
        background-size: contain;
        background-repeat: no-repeat;
    }

    &:hover {
        transform: scale(1.1);
    }
}

.swiper-button-next::before {
    display: block;
    mask-image: url("../cards/images/chevron_right.svg");
    mask-position: center;
    mask-size: cover;
    background-color: var(--color-primary);
}

.swiper-button-prev::before {
    display: block;
    mask-image: url("../cards/images/chevron_right.svg");
    mask-position: center;
    mask-size: cover;
    background-color: var(--color-primary);
    transform: rotate(-180deg);
}

.custom-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;

    position: absolute;
    bottom: 12px;
    left: 0;
    right: 0;

    z-index: 100;
}

.dot {

    width: 6px;
    height: 6px;

    border-radius: 999px;

    background: var(--primary-inverted);

    opacity: 0.5;

    cursor: pointer;

    flex-shrink: 0;

    transition:
        opacity 0.25s ease,
        transform 0.25s ease;

    will-change: transform;

    transform-origin: center;
}

/* активная */
.dot.active {
    opacity: 1;
}

/* уменьшенные */
.dot.small-edge {

    transform: scale(0.666);

    opacity: 0.5;
}

/* если active + small-edge */
.dot.active.small-edge {

    transform: scale(1);
}

.image-shimmer::after {
    content: "";
    position: absolute;
    top: 0;
    left: -150%;
    width: 150%;
    height: 100%;

    background: linear-gradient(
        90deg,
        rgba(238,238,238,0) 0%,
        rgba(255,255,255,0.6) 50%,
        rgba(238,238,238,0) 100%
    );

    animation: shimmer 1.5s infinite;
}

.card-image-slider.loaded .image-shimmer {
    opacity: 0;
    visibility: hidden;
    transition: 0.3s ease;
}

@keyframes shimmer {
    100% {
        left: 150%;
    }
}

.card-content {
    display: flex;
    justify-content: space-between;
    position: relative;
}

.main-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
    z-index: 2;
    pointer-events: none;
}

.card-content-link {
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: 8px;
}

.card-content-link:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 4px;
}

.card-title {
    color: var(--color-primary);
    font-weight: 600;
    font-size: 14px;
    line-height: 18px;
}

.card-km {
    font-weight: 400;
    line-height: 18px;
    font-size: 14px;
}

.card-map {
    width: fit-content;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--color-secondary);
    font: inherit;
    font-weight: 400;
    text-decoration: underline;
    text-align: left;
    cursor: pointer;
    position: relative;
    z-index: 3;
    pointer-events: auto;
    transition: all 0.2s linear;

    &:hover {
        color: var(--color-primary);
    }
}

.card-date {
    font-weight: 400;
    color: var(--color-primary);
    line-height: 18px;
    position: relative;
    z-index: 2;
    pointer-events: none;
}

.card-price-dropdown {
    position: relative;
}

.card-price-dropdown::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 12px;
}

.card-price {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0;
    border: none;
    background: transparent;
    font: inherit;
    text-align: left;
}

.price-min {
    font-weight: 600;
    color: var(--color-primary);
    text-decoration: underline;
    line-height: 18px;
}

.price-average {
    font-weight: 400;
    color: var(--color-secondary);
    line-height: 18px;
    transition: color .2s linear;
}

.card-price-dropdown:hover .price-average,
.card-price-dropdown:focus-within .price-average {
    color: var(--color-primary);
}

.card-price-arrow {
    width: 8px;
    height: 8px;
    margin-left: 4px;
    border-right: 2px solid var(--color-primary);
    border-bottom: 2px solid var(--color-primary);
    transform: translateY(-2px) rotate(45deg);
    transition: transform .2s linear;
}

.card-price-dropdown:hover .card-price-arrow,
.card-price-dropdown:focus-within .card-price-arrow {
    transform: translateY(2px) rotate(225deg);
}

.card-price-menu {
    position: absolute;
    left: 0;
    top: calc(100% + 12px);
    z-index: 20;
    width: max-content;
    min-width: 360px;
    padding: 24px 28px;
    border-radius: 16px;
    background: var(--color-bg);
    box-shadow: 0 12px 32px rgba(0, 0, 0, .18);

    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity .2s linear, visibility .2s linear, transform .2s linear;
}

.card-price-dropdown:hover .card-price-menu,
.card-price-dropdown:focus-within .card-price-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.house-card:nth-child(4n) .card-price-menu {
    right: 0;
    left: auto;
}

.card-price-menu-title {
    color: var(--color-primary);
    font-size: 18px;
    font-weight: 600;
    line-height: 24px;
}

.card-price-menu-subtitle {
    margin-top: 4px;
    color: var(--color-secondary);
    font-size: 14px;
    line-height: 18px;
}

.card-price-rows {
    display: grid;
    gap: 12px;
    margin-top: 20px;
}

.card-price-row,
.card-price-average-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 28px;
    color: var(--color-secondary);
    font-size: 14px;
    line-height: 18px;
}

.card-price-row > span:last-child,
.card-price-average-row > strong {
    margin-left: auto;
    text-align: right;
    white-space: nowrap;
}

.card-price-row strong,
.card-price-average-row strong {
    color: var(--color-primary);
    font-weight: 600;
}

.card-price-average-row {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--color-border);
    color: var(--color-primary);
    font-weight: 600;
}

.empty-value {
    display: inline-block;
    width: 28px;
    height: 1px;
    margin-bottom: 4px;
    background: var(--color-border);
}

.card-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 3;
    background-color: var(--primary-inverted);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 999px;
    color: var(--color-primary);
    font-size: 14px;
    font-weight: 600;
    line-height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 7px 12px;

    box-shadow:
        0 4px 8px rgba(0, 0, 0, 0.10),
        0 2px 6px rgba(0, 0, 0, 0.04);

    backdrop-filter: blur(50px);
    -webkit-backdrop-filter: blur(50px);
}

@media (max-width: 599px) {
    .card-price-menu {
        width: min(360px, calc(100vw - (var(--container-padding) * 2)));
        min-width: 0;
        box-sizing: border-box;
        padding: 20px;
    }

    .card-price-row,
    .card-price-average-row {
        gap: 16px;
    }
}

.building-map-popup-open,
.building-map-popup-open body {
    overflow: hidden;
}

.building-map-popup {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    background: #e9eef6;
}

.building-map-popup.is-open {
    display: block;
}

.building-map-popup__frame {
    position: relative;
    width: 100%;
    height: 100%;
    padding: 10px;
    border-radius: 0;
    background: #fff;
}

.building-map-popup__canvas {
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 8px;
    background: #f4f4f1;
}

.building-map-popup .ymaps-2-1-79-gotoymaps,
.building-map-popup .ymaps-2-1-79-gototaxi,
.building-map-popup .ymaps-2-1-79-gototech,
.building-map-popup .ymaps-2-1-79-copyright__wrap {
    display: none !important;
}

.building-map-marker {
    position: relative;
    width: 40px;
    height: 40px;
    border: 3px solid #fff;
    border-radius: 50%;
    background: #000;
    box-shadow:
        0 4px 8px 0 #0000001A,
        0 2px 6px 0 #0000000A;
}

.building-map-marker__dot {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fff;
    transform: translate(-50%, -50%);
}

.building-map-marker__label {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 10px);
    max-width: 260px;
    padding: 7px 10px;
    border-radius: 8px;
    background: #fff;
    box-shadow:
        0 4px 8px 0 #0000001A,
        0 2px 6px 0 #0000000A;
    color: var(--color-primary);
    font-size: 14px;
    font-weight: 500;
    line-height: 18px;
    opacity: 0;
    pointer-events: none;
    text-align: center;
    transform: translate(-50%, 4px);
    transition: opacity .18s linear, transform .18s linear;
    white-space: nowrap;
}

.building-map-marker:hover .building-map-marker__label,
.building-map-marker:focus-within .building-map-marker__label {
    opacity: 1;
    transform: translate(-50%, 0);
}

.building-map-popup__controls {
    position: absolute;
    top: 24px;
    right: 24px;
    z-index: 5;
    display: grid;
    gap: 10px;
    justify-items: center;
}

.building-map-popup__zoom {
    display: grid;
    width: 48px;
    height: 97px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, .1);
    border-radius: 24px;
    background: rgba(255, 255, 255, .9);
    box-shadow:
        0 4px 8px 0 #0000001A,
        0 2px 6px 0 #0000000A;
    backdrop-filter: blur(50px);
    -webkit-backdrop-filter: blur(50px);
}

.building-map-popup__button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    background: #fff;
    color: #000;
    font: inherit;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.building-map-popup__button::before {
    content: "";
    display: block;
    background-position: center;
    background-repeat: no-repeat;
    background-size: contain;
}

.building-map-popup__button:hover {
    background: #f5f5f5;
}

.building-map-popup__button:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.building-map-popup__close {
    width: 48px;
    height: 48px;
    border: 1px solid rgba(0, 0, 0, .1);
    border-radius: 50%;
    background: rgba(255, 255, 255, .9);
    box-shadow:
        0 4px 8px 0 #0000001A,
        0 2px 6px 0 #0000000A;
    backdrop-filter: blur(50px);
    -webkit-backdrop-filter: blur(50px);
}

.building-map-popup__close::before {
    content: "";
    display: block;
    width: 16px;
    height: 16px;
    background: url("../../images/icons/close-map.svg") center / contain no-repeat;
}

.building-map-popup__close:hover {
    background: rgba(255, 255, 255, .9);
}

.building-map-popup__zoom-in {
    width: 48px;
    height: 48px;
    border-bottom: 1px solid rgba(0, 0, 0, .1);
    background: transparent;
}

.building-map-popup__zoom-out {
    width: 48px;
    height: 48px;
    background: transparent;
}

.building-map-popup__zoom-in:hover,
.building-map-popup__zoom-out:hover {
    background: rgba(255, 255, 255, .5);
}

.building-map-popup__zoom-in::before {
    width: 20px;
    height: 20px;
    background-image: url("../../images/icons/plus.svg");
}

.building-map-popup__zoom-out::before {
    width: 20px;
    height: 3px;
    background-image: url("../../images/icons/minus.svg");
}

@media (max-width: 768px) {
    .building-map-popup {
        padding: 0;
    }

    .building-map-popup__controls {
        top: 20px;
        right: 20px;
    }
}
