#related-listings-shortcode-wrapper.related-listings-wrapper {
    display: block;
}
#related-listings-shortcode-wrapper.related-listings-wrapper .heading-wrapper {
    margin-bottom: 15px;
}
#related-listings-shortcode-wrapper.related-listings-wrapper .related-listing-subheading {
    font-weight: bold;
    margin: 0 0 5px 5px;
    text-align: left;
}
#related-listings-shortcode-wrapper .classified-cards-wrapper, .small-tiles .classified-cards-wrapper {
    grid-row-gap: 10px;
    overflow: hidden;
    max-width: 100%;
    margin: 0 auto 10px;
    grid-template-rows: 1fr 1fr;
    width: 100%;
    display: grid;
    max-height: 478px;
    justify-content: center;
    align-items: center;
}
#related-listings-shortcode-wrapper .classified-cards-wrapper {
    padding: 6px 3px;
}
.small-tiles .classified-cards-wrapper.classified-small-cards {
    max-height: 314px;
}
@media (min-width: 640px) {
    #related-listings-shortcode-wrapper .classified-cards-wrapper {
        max-width: 100%;
        grid-template-columns: calc(50% - 20px) calc(50% - 20px);
    }
}
@media (min-width: 1200px) {
    .jeg_main #related-listings-shortcode-wrapper .classified-cards-wrapper {
        max-width: 100%;
        grid-template-columns: 1fr 1fr 1fr;
    }
}
#related-listings-shortcode-wrapper .custom-pagination, .small-tiles .custom-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 auto !important;
}
#related-listings-shortcode-wrapper .custom-pagination .page-item, .small-tiles .custom-pagination .page-item {
    padding: 5px;
    background: transparent;
    border: 1px solid var(--classified-button-border-color);
    border-radius: 50px;
    margin: 0 5px;
}
#related-listings-shortcode-wrapper .custom-pagination .page-item.active, .small-tiles .custom-pagination .page-item.active {
    background: var(--classified-button);
    border: 1px solid var(--classified-button-border-color);
}
#related-listings-shortcode-wrapper .custom-pagination .page-item:first-child, #related-listings-shortcode-wrapper .custom-pagination .page-item:last-child, 
.small-tiles .custom-pagination .page-item:first-child, .small-tiles .custom-pagination .page-item:last-child {
    min-width: 15px;
    min-height: 10px;
    background-color: transparent;
    color: var(--classified-button);
    border: none;
    -webkit-tap-highlight-color: transparent;
}
#related-listings-shortcode-wrapper .custom-pagination .page-item:first-child, .small-tiles .custom-pagination .page-item:first-child {
    transform: rotate(90deg);
} 
#related-listings-shortcode-wrapper .custom-pagination .page-item:last-child, .small-tiles .custom-pagination .page-item:last-child {
    transform: rotate(-90deg);
}
#related-listings-shortcode-wrapper .custom-pagination .page-item:first-child::after, #related-listings-shortcode-wrapper .custom-pagination .page-item:last-child::after, 
.small-tiles .custom-pagination .page-item:first-child::after, .small-tiles .custom-pagination .page-item:last-child::after {
    font-size: 65px;
    background: currentcolor;
    content: ' ';
    white-space: pre;
    -webkit-mask: var(--svg-angle) no-repeat 50% 50%;
    mask: var(--svg-angle) no-repeat 50% 50%;
    width: 15px;
    height: 15px;
    display: inherit;
}

/* Hide 4th card and higher on mobile */
.related-listings .classified-cards-wrapper .classified-card-wrapper:nth-child(n+4), .dealer-listings .classified-cards-wrapper .classified-card-wrapper:nth-child(n+4) {
    display: none;
}

@media (min-width:640px) {
    /* Hide 7th card and higher on tablet when we are only showing related listings */
    .related-listings.related-listings-private .classified-cards-wrapper .classified-card-wrapper:nth-child(n+7) {
        display: none;
    }
    /* Show 4th card and higher on tablet */
    .related-listings .classified-cards-wrapper .classified-card-wrapper:nth-child(n+4), .dealer-listings .classified-cards-wrapper .classified-card-wrapper:nth-child(n+4) {
        display: block;
    }
    /* Hide 7th card and higher on tablet */
    .related-listings .classified-cards-wrapper .classified-card-wrapper:nth-child(n+7), .dealer-listings .classified-cards-wrapper .classified-card-wrapper:nth-child(n+7) {
        display: none;
    }
}

@media (min-width: 992px) and (max-width: 1249px) {
    /* Hide 4th card and higher between laptop and ultrawide breakpoints */
    .related-listings .classified-cards-wrapper .classified-card-wrapper:nth-child(n+4), .dealer-listings .classified-cards-wrapper:not(.dealer-only) .classified-card-wrapper:nth-child(n+4) {
        display: none;
    }
    /* Show 6th card and higher on laptop and bigger when we are only showing related listings */
    .related-listings.related-listings-private .classified-cards-wrapper .classified-card-wrapper:nth-child(n+6) {
        display: block;
    }
    /* Show 6th card and higher on laptop and bigger when we are only showing related listings */
    .related-listings .classified-cards-wrapper .classified-card-wrapper:nth-child(n+4), .dealer-listings .classified-cards-wrapper:not(.dealer-only) .classified-card-wrapper:nth-child(n+4) {
        display: none;
    }
}

@media (min-width: 1250px) {
    /* Show 4th card on desktop */
    .related-listings .classified-cards-wrapper .classified-card-wrapper:nth-child(4), .dealer-listings .classified-cards-wrapper .classified-card-wrapper:nth-child(4) {
        display: block;
    }
    /* Hide 5th card and higher at desktop breakpoint */
    .related-listings .classified-cards-wrapper .classified-card-wrapper:nth-child(n+5), .dealer-listings .classified-cards-wrapper:not(.dealer-only) .classified-card-wrapper:nth-child(n+5) {
        display: none;
    }
    /* Show 4th card and higher on desktop when we are only showing related listings */
    .related-listings.related-listings-private .classified-cards-wrapper .classified-card-wrapper:nth-child(n+4) {
        display: block;
    }
    /* Show 7th card and higher on wide in Jnews */
    .jeg_viewport .related-listings .classified-cards-wrapper .classified-card-wrapper:nth-child(n+7), .jeg_viewport .dealer-listings .classified-cards-wrapper .classified-card-wrapper:nth-child(n+7) {
        display: block;
    }
}
