/* Мобильная кнопка "назад" */
.mobile-back-btn {
    text-align: left;
    display: flex;
    justify-content: flex-start;
}

.mobile-back-btn a {
    justify-content: flex-start !important;
    text-align: left !important;
}

.mobile-back-btn svg {
    width: 16px;
    height: 16px;
}

/* Скрытие поиска только на мобильной версии страницы объявления */
@media (max-width: 768px) {
    .listing-detail-page ~ .modern-search-wrapper,
    .listing-detail-page .modern-search-wrapper,
    body:has(.listing-detail-page) .modern-search-wrapper {
        display: none !important;
    }
    .modern-search-wrapper {
        margin-bottom: 0px;
    }
}


.listing-listing-row {
    display: grid;
    grid-template-columns: 208px 1fr 180px;
    gap: 16px;
    align-items: stretch;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    margin-bottom: 1.5rem;
    padding: 16px;
}

.listing-img-blur-wrap {
    grid-column: 1;
    width: 208px;
    height: 180px;
    min-width: 208px;
    min-height: 180px;
    border-radius: 16px;
    overflow: hidden;
    position: relative;
}

.listing-img-blur-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    filter: blur(16px) brightness(1.1);
    transform: scale(1.2);
}

.listing-img-main {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: 2;
}

.listing-img-placeholder {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

.btn-favorite {
    width: 30px;
    height: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    color: #666;
    transition: color 0.2s;
    min-width: 30px;
    font-family: monospace;
    position: relative;
    z-index: 2;
}

.btn-favorite:hover {
    color: #dc3545;
}

.btn-favorite.active {
    color: #dc3545 !important;
}

.btn-favorite.active svg {
    color: #dc3545 !important;
    fill: #dc3545 !important;
}

.listing-location-icon {
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
}

.listing-price {
    font-size: 1.1em;
}

.listing-desc-trunc {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 600px;
}

.listing-listing-content {
    grid-column: 2;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    min-width: 0;
}

.listing-listing-actions {
    grid-column: 3;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: flex-start;
    width: 180px;
    min-width: 180px;
    max-width: 180px;
}

.listing-listing-actions .btn-show-phone,
.show-phone-btn {
    width: 100%;
    min-width: 140px;
    max-width: 180px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    background: var(--main-blue, #007bff);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 18px;
    font-weight: 500;
    font-size: 1rem;
    transition: background 0.2s;
    box-sizing: border-box;
}

.listing-listing-actions .btn-show-phone:hover,
.show-phone-btn:hover {
    background: #0056b3;
    color: #fff;
}

@media (max-width: 991px) {
    .listing-listing-row {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        gap: 12px;
        padding: 12px;
    }

    .listing-img-blur-wrap {
        width: 100%;
        height: 220px;
        min-width: 0;
        min-height: 180px;
        margin-bottom: 8px;
    }

    .listing-listing-content,
    .listing-listing-actions {
        grid-column: 1;
        min-width: 0;
    }

    .listing-listing-actions {
        align-items: flex-start;
        margin-top: 8px;
        min-width: 0;
        max-width: 100%;
        width: 100%;
    }
}

@media (max-width: 767px) {
    .listing-listing-row {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        gap: 8px;
        padding: 8px;
    }

    .listing-img-blur-wrap {
        width: 100%;
        height: 180px;
        min-width: 0;
        min-height: 120px;
        margin-bottom: 6px;
    }

    .listing-listing-content {
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        min-width: 0;
    }

    .listing-desc-trunc {
        display: none;
    }
    
    .mobile-filters-overlay {
        opacity: 0;
        visibility: hidden;
    }
    
    .mobile-filters-overlay.show {
        opacity: 1;
        visibility: visible;
    }
}


.category-filters-col {
    /* для скрытия фильтров на мобиле */
}

.category-breadcrumbs .breadcrumb {
    background: none;
    padding: 0;
    margin-bottom: 0;
    font-size: 1.1em;
    align-items: center;
}

.category-breadcrumbs .breadcrumb-item {
    color: #222;
    font-weight: 400;
}

.category-breadcrumbs .breadcrumb-item a {
    color: #222;
    text-decoration: none;
    transition: color 0.2s;
}

.category-breadcrumbs .breadcrumb-item a:hover {
    color: #007bff;
    text-decoration: underline;
}

.category-breadcrumbs .breadcrumb-item.active {
    color: #007bff;
    font-weight: 500;
}

.category-breadcrumbs .breadcrumb-sep {
    margin: 0 6px;
    display: inline-flex;
    vertical-align: middle;
    color: #bbb;
}

.category-breadcrumbs .breadcrumb-sep svg {
    width: 18px;
    height: 18px;
    display: inline-block;
    vertical-align: middle;
    color: #bbb;
}

@media (max-width: 767px) {
    .category-breadcrumbs {
        display: none !important;
    }
}

.listing-slider-wrapper {
    width: 100%;
    max-width: none;
    margin: 0 0 2rem 0;
}

.listing-slider-main {
    position: relative;
    width: 100%;
    aspect-ratio: 4/3;
    background: #f5f5f5;
    border-radius: 16px;
    overflow: hidden;
    min-height: 300px;
    max-height: 480px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.listing-slider-img-block {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.listing-slider-img-block.active {
    opacity: 1;
    pointer-events: auto;
    z-index: 2;
}

.listing-slider-blur-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    filter: blur(18px) brightness(1.1);
    z-index: 1;
    background-size: cover;
    background-position: center;
}

.listing-slider-img {
    position: relative;
    z-index: 2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.listing-slider-arrow {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 48px;
    background: none;
    border: none;
    outline: none;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
    font-size: 2.2em;
    color: #222;
}

.listing-slider-arrow:hover {
    opacity: 1;
    background: rgba(0, 0, 0, 0.04);
}

.listing-slider-arrow-left {
    left: 0;
}

.listing-slider-arrow-right {
    right: 0;
}

.listing-slider-thumbs {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 10px;
}

.listing-slider-thumb {
    width: 56px;
    height: 56px;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border 0.2s;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.listing-slider-thumb.active {
    border-color: #007bff;
}

.listing-slider-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #fff;
}

@media (max-width: 767px) {
    .listing-slider-wrapper {
        max-width: 100vw;
    }

    .listing-slider-main {
        min-height: 180px;
        max-height: 320px;
    }

    .listing-slider-thumb {
        width: 40px;
        height: 40px;
    }
}

.listing-detail-row {
    display: grid;
    grid-template-columns: 50% 50%;
    gap: 32px;
    align-items: flex-start;
    margin-bottom: 1.0rem;
}

.listing-detail-slider {
    width: 100%;
}

.listing-detail-empty {
    width: 100%;
    min-width: 10px;
}

.listing-detail-info {
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.listing-detail-params {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 1.5rem;
}

.listing-detail-title {
    font-size: 2.1em;
    font-weight: 700;
    margin-bottom: 1.5rem;
    margin-top: 0.5rem;
}

.listing-detail-main {
    display: flex;
    gap: 40px;
    align-items: flex-start;
    margin-bottom: 2.5rem;
}

.listing-detail-main-left {
    flex: 1;
    min-width: 0;
}

.listing-detail-main-right {
    flex: 0 0 40%;
    min-width: 260px;
    position: sticky;
    top: 24px;
    height: auto;
    overflow: visible;
}

@media (max-width: 991px) {
    .listing-detail-row {
        grid-template-columns: 1fr;
        gap: 0;
        margin-bottom: 0;
    }

    .listing-detail-empty {
        display: none;
    }

    .listing-detail-info {
        margin-top: 2rem;
    }

    .listing-detail-main {
        flex-direction: column;
        gap: 0;
    }

    .listing-detail-main-right {
        flex: 1;
        min-width: 0;
        margin-top: 2rem;
        position: static;
    }
}