/* Listings container using Flexbox for a responsive grid */
.listings-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Card styling */
.card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    width: 320px;
    overflow: hidden;
    transition: transform 0.2s;
    display: flex;
    flex-direction: column;
}

.card:hover {
    transform: translateY(-5px);
}

.listing-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Image container with badges */
.image-container {
    position: relative;
    width: 100%;
    height: 220px;
}

.image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.badges {
    position: absolute;
    top: 10px;
    left: 10px;
    display: flex;
    gap: 8px;
}

.badge {
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

/* Specific badge colors */
.badge.featured {
    background-color: #ffc107;
}

.badge.new-listing {
    background-color: #dc3545;
}

.badge.for-sale {
    background-color: #dc3545;
}

.badge.price-reduced {
    background-color: #007bff;
}

/* Text details section */
.details {
    padding: 15px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.details h2 {
    margin: 0 0 5px;
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.details .price {
    font-size: 24px;
    font-weight: bold;
    color: #000;
    margin: 0 0 10px;
}

.details .location {
    font-size: 14px;
    color: #666;
    margin: 0 0 5px;
}

.details .address {
    font-size: 14px;
    color: #666;
    margin: 0 0 15px;
}

/* Tags at the bottom of the card */
.tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
}

.tag {
    background-color: #e9ecef;
    border-radius: 20px;
    padding: 5px 10px;
    font-size: 12px;
    color: #495057;
}

.tag:first-child {
    font-weight: bold;
}

/* Single listing styles */
.single-listing-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.single-listing-thumbnail img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-bottom: 20px;
}

.listing-details {
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.key-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 8px;
}

.key-detail-item {
    display: flex;
    align-items: center;
    font-size: 16px;
    color: #333;
}

.key-detail-item .dashicons {
    margin-right: 10px;
    color: #007bff;
}

.key-detail-item strong {
    margin-right: 5px;
}

.description {
    margin-bottom: 20px;
    font-size: 16px;
    line-height: 1.6;
    color: #555;
}

.read-more, .read-less {
    color: #007bff;
    text-decoration: none;
    font-weight: bold;
    font-size: 14px;
}

.read-more:hover, .read-less:hover {
    text-decoration: underline;
}

.accordion-header {
    background: #f1f1f1;
    padding: 15px;
    font-size: 18px;
    font-weight: bold;
    color: #333;
    cursor: pointer;
    border-radius: 5px;
    margin-bottom: 5px;
    display: flex;
    align-items: center;
}

.accordion-header.active {
    background: #007bff;
    color: #fff;
}

.accordion-header.active .dashicons {
    color: #fff;
}

.accordion-header:hover {
    background: #e9ecef;
}

.accordion-content {
    display: none;
    padding: 15px;
    border-left: 3px solid #007bff;
    margin-bottom: 10px;
}

.accordion-content.active {
    display: block;
}

.accordion-content p {
    margin: 10px 0;
    font-size: 16px;
    color: #555;
}

.accordion-content p strong {
    color: #333;
}

.photo-gallery img {
    border-radius: 5px;
    object-fit: cover;
}

/* Agent card styles */
.agent-card {
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 20px;
    max-width: 300px;
}

.agent-card h2 {
    font-size: 18px;
    color: #333;
    margin: 0 0 15px;
}

.agent-card .agent-photo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 15px;
}

.agent-card p {
    font-size: 16px;
    color: #555;
    margin: 10px 0;
}

.agent-card p strong {
    color: #333;
}

.agent-card a {
    color: #007bff;
    text-decoration: none;
}

.agent-card a:hover {
    text-decoration: underline;
}

/* Related listings styles */
.related-listings {
    margin-top: 40px;
}

.related-listings h2 {
    font-size: 24px;
    color: #333;
    margin-bottom: 20px;
}

/* Pagination styles */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
    font-size: 16px;
}

.pagination a, .pagination span {
    padding: 8px 12px;
    border: 1px solid #007bff;
    border-radius: 5px;
    text-decoration: none;
    color: #007bff;
    transition: background-color 0.2s;
}

.pagination a:hover {
    background-color: #007bff;
    color: #fff;
}

.pagination .current {
    background-color: #007bff;
    color: #fff;
    border-color: #007bff;
}

/* Responsive layout for single listing */
@media (min-width: 769px) {
    .single-listing-container {
        display: flex;
        flex-wrap: wrap;
        gap: 20px;
    }

    .single-listing-container .single-listing-thumbnail,
    .single-listing-container .key-details,
    .single-listing-container .description,
    .single-listing-container .listing-details {
        flex: 1 1 70%;
        max-width: 70%;
    }

    .agent-card-sidebar {
        flex: 1 1 25%;
        max-width: 300px;
    }

    .agent-card-mobile {
        display: none;
    }
}

@media (max-width: 768px) {
    .single-listing-container .single-listing-thumbnail,
    .single-listing-container .key-details,
    .single-listing-container .description,
    .single-listing-container .listing-details,
    .single-listing-container .agent-card-mobile {
        max-width: 100%;
    }

    .agent-card-sidebar {
        display: none;
    }

    .agent-card-mobile {
        display: block;
        margin: 20px auto;
    }
}