/* ============================================
   CUSTOM LISTINGS - FRONTEND STYLES
   ============================================ */

/* === GRID LAYOUT === */
.custom-listings-wrapper {
    width: 100%;
    position: relative;
}

.custom-listings-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    width: 100%;
}

/* === NO RESULTS === */
.custom-listings-no-results {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    font-size: 16px;
    color: #888;
}

/* === CARD === */
.cl-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e8e8e8;
    transition: all 300ms ease;
    position: relative;
}

.cl-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

/* Linked card */
.cl-card-linked {
    cursor: pointer;
}

/* === CARD HEADER (Title area - top) === */
.cl-card-header {
    padding: 20px 20px 15px;
    order: 1;
}

/* === BADGE === */
.cl-card-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background-color: #e74c3c;
    color: #fff;
    margin-bottom: 8px;
}

.cl-badge-on-image {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
}

/* === CATEGORY === */
.cl-card-category {
    margin-bottom: 6px;
}

.cl-card-category .cl-category-tag,
.cl-card-category a {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 500;
    color: #4a90d9;
    background-color: #eaf2fb;
    text-decoration: none;
    margin-right: 4px;
    margin-bottom: 4px;
    transition: all 200ms ease;
}

.cl-card-category a:hover {
    background-color: #4a90d9;
    color: #fff;
}

/* === TITLE === */
.cl-card-title {
    margin: 0 0 6px;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
    color: #1a1a2e;
}

.cl-card-title a {
    color: inherit;
    text-decoration: none;
    transition: color 200ms ease;
}

.cl-card-title a:hover {
    color: #4a90d9;
}

/* === SUBTITLE === */
.cl-card-subtitle {
    font-size: 13px;
    color: #666;
    margin-bottom: 8px;
    line-height: 1.4;
}

/* === RATING === */
.cl-card-rating {
    display: flex;
    align-items: center;
    gap: 2px;
    margin-bottom: 8px;
}

.cl-star {
    font-size: 16px;
    color: #ddd;
    line-height: 1;
}

.cl-star.filled {
    color: #f39c12;
}

.cl-rating-number {
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-left: 6px;
}

/* === META ROW === */
.cl-card-meta-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.cl-card-price {
    font-size: 16px;
    font-weight: 700;
    color: #27ae60;
}

.cl-card-location {
    font-size: 13px;
    color: #888;
    display: flex;
    align-items: center;
    gap: 3px;
}

.cl-location-icon {
    font-size: 14px;
}

/* === IMAGE (Middle section) === */
.cl-card-image {
    order: 2;
    position: relative;
    overflow: hidden;
    height: 220px;
    background: #f5f5f5;
}

.cl-card-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    transition: background-color 300ms ease;
}

.cl-card-image a {
    display: block;
    width: 100%;
    height: 100%;
}

.cl-card-image img,
.cl-card-image .cl-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 400ms ease, filter 400ms ease;
}

.cl-card:hover .cl-card-image img {
    transform: scale(1.05);
}

.cl-placeholder-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f0f0f0;
    color: #ccc;
}

.cl-placeholder-image .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
}

/* === CONTENT AREA (Bottom - list + button) === */
.cl-card-content {
    order: 3;
    padding: 15px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* === EXCERPT === */
.cl-card-excerpt {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
    margin-bottom: 12px;
}

/* ============================================
   LIST STYLES
   ============================================ */

/* ── Icon mode (default) ── */
.cl-card-list.cl-icon-list {
    list-style: none !important;
    padding-left: 0 !important;
    margin: 0;
}

.cl-card-list.cl-icon-list li {
    display: flex;
    align-items: flex-start;
    font-size: 14px;
    color: #444;
    line-height: 1.5;
}

.cl-list-icon {
    flex-shrink: 0;
    margin-right: 8px;
    font-size: 14px;
    width: 14px;
    min-width: 14px;
    text-align: center;
    color: #4a90d9;
    margin-top: 2px;
    line-height: 1.5;
}

.cl-default-bullet {
    font-weight: 700;
    font-style: normal;
}

.cl-list-text {
    flex: 1;
}

/* ── Native list mode (disc, circle, square, decimal) ── */
.cl-card-list.cl-native-list {
    padding-left: 20px;
    margin: 0;
}

.cl-card-list.cl-native-list li {
    display: list-item !important;
    font-size: 14px;
    color: #444;
    line-height: 1.5;
}

.cl-card-list.cl-native-list li::marker {
    color: #4a90d9;
}

.cl-card-list.cl-native-list li .cl-list-text {
    flex: unset;
}

/* ── No bullet mode ── */
.cl-card-list.cl-no-bullets {
    list-style: none !important;
    padding-left: 0 !important;
    margin: 0;
}

.cl-card-list.cl-no-bullets li {
    display: block;
    font-size: 14px;
    color: #444;
    line-height: 1.5;
}

/* ── Common list item spacing ── */
.cl-card-list li:not(:last-child) {
    margin-bottom: 8px;
}

.cl-card-list li:last-child {
    margin-bottom: 0;
}

/* ============================================
   BUTTON STYLES
   ============================================ */

.cl-card-button-wrap {
    display: flex;
    justify-content: flex-start;
    margin-top: 12px;
}

.cl-card-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 24px;
    background-color: #4a90d9;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    border: 2px solid transparent;
    border-radius: 4px;
    text-decoration: none;
    cursor: pointer;
    transition: all 300ms ease;
    box-sizing: border-box;
}

.cl-card-button:hover {
    text-decoration: none;
    color: #ffffff;
    opacity: 0.9;
}

.cl-card-button:focus {
    outline: none;
}

/* Button text */
.cl-btn-text {
    display: inline;
}

/* Button icon */
.cl-btn-icon {
    display: inline-flex;
    align-items: center;
    font-size: 14px;
    line-height: 1;
    font-style: normal;
}

.cl-btn-icon-after {
    margin-left: 6px;
}

.cl-btn-icon-before {
    margin-right: 6px;
}

/* ── Button Hover Animations ── */
.cl-btn-hover-lift:hover {
    transform: translateY(-3px);
}

.cl-btn-hover-sink:hover {
    transform: translateY(3px);
}

.cl-btn-hover-grow:hover {
    transform: scale(1.05);
}

.cl-btn-hover-shrink:hover {
    transform: scale(0.95);
}

/* ============================================
   PAGINATION
   ============================================ */

.custom-listings-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.cl-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 6px 12px;
    border: 1px solid #ddd;
    background: #f5f5f5;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    transition: all 200ms ease;
    line-height: 1;
}

.cl-page-btn:hover:not(.active):not(:disabled) {
    background: #e0e0e0;
    border-color: #ccc;
}

.cl-page-btn.active {
    background: #4a90d9;
    color: #fff;
    border-color: #4a90d9;
}

.cl-page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.cl-page-dots {
    padding: 0 6px;
    color: #999;
    font-size: 16px;
}

/* === LOAD MORE === */
.custom-listings-load-more-wrap {
    display: flex;
    justify-content: center;
    margin-top: 30px;
}

.cl-load-more-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 30px;
    background: #4a90d9;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 200ms ease;
    min-width: 160px;
}

.cl-load-more-btn:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.cl-load-more-btn.loading {
    opacity: 0.7;
    cursor: wait;
}

/* === LOADING STATE === */
.custom-listings-wrapper.cl-loading .custom-listings-grid {
    opacity: 0.5;
    pointer-events: none;
    transition: opacity 200ms ease;
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
    .custom-listings-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .custom-listings-grid {
        grid-template-columns: 1fr;
    }

    .cl-card-header {
        padding: 15px 15px 10px;
    }

    .cl-card-content {
        padding: 10px 15px;
    }
}