/* ═══════════════════════════════════════════════════════
   Search Result Cards (sr-card) — Premium design
   ═══════════════════════════════════════════════════════ */

.sr-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 4px 12px rgba(0, 0, 0, 0.04);
    transition: transform 0.25s cubic-bezier(.4, 0, .2, 1),
        box-shadow 0.25s cubic-bezier(.4, 0, .2, 1);
    position: relative;
}

.sr-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
}

/* ── Image area ── */
.sr-card__image-wrap {
    position: relative;
    width: 100%;
    padding-top: 62%;
    /* ~16:10 aspect ratio */
    overflow: hidden;
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
}

.sr-card__image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.sr-card:hover .sr-card__image {
    transform: scale(1.05);
}

/* Section badge (top-left) */
.sr-card__section-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 10px;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 20px;
    letter-spacing: 0.02em;
    z-index: 2;
}

/* Text badge (top-right) */
.sr-card__badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 10px;
    background: linear-gradient(135deg, #f59e0b, #d97706);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    z-index: 2;
}

/* Price tag (bottom-right on image) */
.sr-card__price-tag {
    position: absolute;
    bottom: 10px;
    right: 10px;
    padding: 6px 14px;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    border-radius: 10px;
    z-index: 2;
    letter-spacing: 0.01em;
}

.sr-card__price-tag--request {
    background: rgba(100, 116, 139, 0.65);
    font-weight: 500;
    font-size: 0.8rem;
}

/* ── Body ── */
.sr-card__body {
    padding: 14px 16px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.sr-card__title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
    color: #1e293b;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sr-card__desc {
    font-size: 0.825rem;
    line-height: 1.45;
    color: #64748b;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Location */
.sr-card__location {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8125rem;
    color: #94a3b8;
    font-weight: 500;
}

.sr-card__location svg {
    flex-shrink: 0;
    color: #3b82f6;
}

/* Feature tags */
.sr-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.sr-card__tag {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    color: #1d4ed8;
    font-size: 0.7rem;
    font-weight: 600;
    border-radius: 6px;
    white-space: nowrap;
    letter-spacing: 0.01em;
}

/* Footer */
.sr-card__footer {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.sr-card__rating {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #334155;
}

/* ═══════════ Dark mode ═══════════ */
@media (prefers-color-scheme: dark) {
    .sr-card {
        background: #1e293b;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2), 0 4px 12px rgba(0, 0, 0, 0.15);
    }

    .sr-card:hover {
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
    }

    .sr-card__title {
        color: #f1f5f9;
    }

    .sr-card__desc {
        color: #94a3b8;
    }

    .sr-card__tag {
        background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(59, 130, 246, 0.1));
        color: #93c5fd;
    }

    .sr-card__rating {
        color: #e2e8f0;
    }

    .sr-card__footer {
        border-top-color: rgba(255, 255, 255, 0.06);
    }
}

/* Also handle .dark class */
.dark .sr-card {
    background: #1e293b;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2), 0 4px 12px rgba(0, 0, 0, 0.15);
}

.dark .sr-card:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

.dark .sr-card__title {
    color: #f1f5f9;
}

.dark .sr-card__desc {
    color: #94a3b8;
}

.dark .sr-card__tag {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(59, 130, 246, 0.1));
    color: #93c5fd;
}

.dark .sr-card__rating {
    color: #e2e8f0;
}

.dark .sr-card__footer {
    border-top-color: rgba(255, 255, 255, 0.06);
}

/* ═══════════ Mobile ═══════════ */
@media (max-width: 560px) {
    .sr-card__body {
        padding: 12px 14px 14px;
        gap: 6px;
    }

    .sr-card__title {
        font-size: 0.9375rem;
    }

    .sr-card__desc {
        font-size: 0.8rem;
        -webkit-line-clamp: 1;
    }

    .sr-card__tags {
        gap: 4px;
    }

    .sr-card__tag {
        font-size: 0.65rem;
        padding: 2px 6px;
    }

    .sr-card__price-tag {
        font-size: 0.8rem;
        padding: 4px 10px;
    }
}

/* ═══════════ Избранное (сердечко на карточках) ═══════════ */
.sr-card-wrapper {
    position: relative;
    display: block;
}

.sr-card-wrapper>.listing-favorite-btn,
.sr-card-wrapper>a.listing-favorite-btn {
    position: absolute;
    top: 4px;
    right: 6px;
    margin: 0;
    z-index: 5;
}

.listing-favorite-btn,
a.listing-favorite-btn {
    -webkit-appearance: none;
    appearance: none;
    border: none;
    width: 23px;
    height: 23px;
    min-width: 23px;
    min-height: 23px;
    padding: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: rgba(255, 255, 255, 0.94);
    color: #64748b;
    box-shadow: 0 1px 8px rgba(15, 23, 42, 0.12);
    transition: transform 0.15s ease, color 0.15s ease, background 0.15s ease;
    text-decoration: none;
    line-height: 0;
}

.listing-favorite-btn .listing-favorite-btn__icon,
a.listing-favorite-btn .listing-favorite-btn__icon {
    width: 12px;
    height: 12px;
    max-width: 12px;
    max-height: 12px;
    flex-shrink: 0;
    display: block;
}

.listing-favorite-btn:hover,
a.listing-favorite-btn:hover {
    transform: scale(1.07);
    color: #e11d48;
}

.listing-favorite-btn.is-active,
a.listing-favorite-btn.is-active {
    color: #e11d48;
}

.listing-favorite-btn.is-active .listing-favorite-btn__icon,
a.listing-favorite-btn.is-active .listing-favorite-btn__icon {
    fill: #e11d48;
    stroke: #e11d48;
}

.listing-favorite-btn--featured {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 5;
}

.listing-favorite-btn--svc {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 6;
}

.services-grid .svc-card-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.services-grid .svc-card-wrapper>.svc-card {
    flex: 1;
    min-height: 0;
}

.hero-search-card-wrap {
    position: relative;
    display: block;
}

.listing-favorite-btn--hero {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 8;
}

.dark .listing-favorite-btn,
.dark a.listing-favorite-btn {
    background: rgba(30, 41, 59, 0.92);
    color: #94a3b8;
}

/* ── Детальная страница объявления: сердечко на большом фото (правый верх) ── */
.rental-main-photo-wrap {
    position: relative;
    display: block;
    width: 100%;
    min-width: 0;
}

.rental-main-photo-wrap .main-photo {
    display: block;
}

.listing-favorite-btn--detail {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 6;
    width: 26px;
    height: 26px;
    min-width: 26px;
    min-height: 26px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.18);
}

.listing-favorite-btn--detail .listing-favorite-btn__icon {
    width: 13px;
    height: 13px;
    max-width: 13px;
    max-height: 13px;
}

@media (max-width: 768px) {
    .listing-favorite-btn--detail {
        top: 10px;
        right: 10px;
        width: 24px;
        height: 24px;
        min-width: 24px;
        min-height: 24px;
    }

    .listing-favorite-btn--detail .listing-favorite-btn__icon {
        width: 12px;
        height: 12px;
        max-width: 12px;
        max-height: 12px;
    }
}

/* Поиск: прижатие к углу карточки */
.sr-card-wrapper>.listing-favorite-btn--sr,
.sr-card-wrapper>a.listing-favorite-btn--sr {
    top: 3px !important;
    right: 5px !important;
    margin: 0 !important;
}

/* Компас / главная: избранное на материалах news_articles */
.compass-main-card-wrap,
.compass-side-card-wrap,
.compass-card-wrap {
    position: relative;
    display: block;
}

.compass-main-card-wrap>.listing-favorite-btn--compass,
.compass-main-card-wrap>a.listing-favorite-btn--compass {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 5;
}

.compass-side-card-wrap>.listing-favorite-btn--compass,
.compass-side-card-wrap>a.listing-favorite-btn--compass {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 5;
}

.compass-card-wrap>.listing-favorite-btn--compass,
.compass-card-wrap>a.listing-favorite-btn--compass {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 5;
}

.homepage-news-card-wrap {
    position: relative;
    display: block;
    min-width: 0;
}

.homepage-news-card-wrap .homepage-news-card {
    height: 100%;
}

.homepage-news-card-wrap>.listing-favorite-btn--home-news,
.homepage-news-card-wrap>a.listing-favorite-btn--home-news {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 4;
}

.news-detail-fav-wrap {
    position: relative;
}

.news-detail-fav-wrap>.listing-favorite-btn--news-detail,
.news-detail-fav-wrap>a.listing-favorite-btn--news-detail {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 12;
}

/* Редакционный обзор на карточке листинга (.lux-rev) */
.lux-rev-fav-outer {
    position: relative;
    display: block;
}

.lux-rev-fav-outer>.listing-favorite-btn--promo-lux,
.lux-rev-fav-outer>a.listing-favorite-btn--promo-lux {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 6;
}