/* Listing card grid - responsive */
.catalog {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* Override old float-based grid */
.catalog .appartment_item.block {
    float: none;
    margin-right: 0;
    clear: none;
}

/* Card styling */
.catalog .appartment_item.block {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 400px;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: box-shadow 0.3s ease;
}

.catalog .appartment_item.block:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

/* Image container - fixed height */
.catalog .appartment_item .image_block {
    position: relative;
    height: 200px;
    overflow: hidden;
}

/* Description area - flex grow */
.catalog .appartment_item .mini_block_full_description {
    flex: 1;
    padding: 12px 15px 15px;
    display: flex;
    flex-direction: column;
}

/* Title */
.catalog .appartment_item .title_block {
    padding: 8px 15px;
    background: #f8f9fa;
}

.catalog .appartment_item .title_block a {
    font-size: 15px;
    font-weight: 600;
    color: #1a2a3a;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Location */
.catalog .mini_location_description {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    color: #666;
    margin-bottom: 6px;
}

/* Price */
.catalog .appartment_item .price {
    font-size: 16px;
    font-weight: 700;
    color: #0d7c3b;
}

/* Bottom bar with compare and favorite */
.catalog .compare-check-control {
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.catalog .fav-wrapper {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
}

.catalog .fav-btn {
    background: rgba(255,255,255,0.9);
    border-radius: 50%;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
}

.catalog .fav-btn:hover {
    background: #fff;
}

/* Mobile: stack single column */
@media (max-width: 767px) {
    .catalog {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .catalog .appartment_item.block {
        min-height: 350px;
    }
    
    .catalog .appartment_item .image_block {
        height: 180px;
    }
}

/* Tablet: 2 columns */
@media (min-width: 768px) and (max-width: 991px) {
    .catalog {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}

/* Desktop: 3+ columns */
@media (min-width: 992px) {
    .catalog {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}

/* Remove duplicate flexslider navigation in cards */
.catalog .appartment_item .custom-controls-container ul.flex-direction-nav {
    display: none;
}

/* Keep only one set of nav arrows */
.catalog .appartment_item .custom-navigation .flex-prev,
.catalog .appartment_item .custom-navigation .flex-next {
    display: block;
}

/* Override right_null for catalog grid */
.catalog .appartment_item.right_null {
}


/* Ensure catalog uses flex/grid and not float */
.catalog {
}

.catalog .appartment_item.block {
}


/* Override right_null for catalog grid */
.catalog .appartment_item.right_null {
    margin-right: 0;
}

/* Ensure catalog uses grid and not float */
.catalog {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.catalog .appartment_item.block {
    float: none;
    width: auto;
    margin-right: 0;
    margin-bottom: 0;
}
