﻿/* ============================================================
   Mobile Horizontal Listing Card
   Layout: image left, content right (flex row)
   Hierarchy: Price → Title → Meta → Footer
   ============================================================ */

/* ---- Card wrapper ---- */
.listing-card-horizontal {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #f1f5f9;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    margin-bottom: 10px;
    overflow: hidden;
    transition: box-shadow 0.25s ease, transform 0.2s ease, border-color 0.2s ease;
}

.listing-card-horizontal:hover {
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.09);
    transform: translateY(-2px);
    border-color: rgba(53, 146, 252, 0.15);
}

/* ---- Inner link: horizontal row ---- */
.listing-card-link {
    display: flex;
    flex-direction: row;
    text-decoration: none;
    color: inherit;
    flex: 1;
    min-height: 0;
}

/* ---- Image: fixed square, left side ---- */
.listing-image {
    position: relative;
    width: 100px;
    min-width: 100px;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    flex-shrink: 0;
    background: #f8fafc;
    align-self: stretch;
}

.listing-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transition: transform 0.3s ease;
}

.listing-card-horizontal:hover .listing-image img {
    transform: scale(1.05);
}

/* ---- Badges ---- */
.listing-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    padding: 3px 7px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    color: #ffffff;
    z-index: 2;
    line-height: 1.3;
    letter-spacing: 0.2px;
}

.badge-featured { background: rgba(217, 119, 6, 0.88); }
.badge-new      { background: rgba(22, 163, 74, 0.88); top: 26px; }

/* ---- Content: flex column, fills the row ---- */
.listing-content {
    flex: 1;
    padding: 10px 12px 10px 10px;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* ---- 1. PRICE — dominant, first element ---- */
.listing-price {
    margin-bottom: 4px;
    flex-shrink: 0;
}

.price-amount {
    font-size: 19px;
    font-weight: 700;
    color: var(--tz-primary, #1E3A8A);
    line-height: 1.2;
    white-space: nowrap;
    letter-spacing: -0.2px;
}

.price-negotiable-text {
    font-size: 17px;
    font-weight: 700;
    color: var(--tz-primary, #1E3A8A);
    line-height: 1.2;
}

/* ---- 2. TITLE — secondary, 2-line clamp ---- */
.listing-title {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.45;
    min-height: calc(1.45em * 2);
    margin: 0 0 4px 0;
    color: var(--tz-text, #0F172A);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color 0.2s ease;
}

.listing-card-link:hover .listing-title {
    color: var(--tz-primary-soft, #3B82F6);
}

/* ---- 3. META — location • time, single line, low emphasis ---- */
.listing-meta-combined {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 3px;
    font-size: 11px;
    color: #9ca3af;
    overflow: hidden;
    white-space: nowrap;
    flex: 1;
    min-width: 0;
}

.listing-meta-combined > span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.listing-meta-combined i {
    font-size: 12px;
    flex-shrink: 0;
    opacity: 0.75;
}

.listing-meta-combined .meta-sep {
    flex-shrink: 0;
    color: #d1d5db;
    overflow: visible;
}

/* ---- 4. FOOTER — views left, CTA right ---- */
.listing-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    flex-shrink: 0;
}

.listing-views {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    color: #9ca3af;
}

.listing-views i {
    font-size: 13px;
    opacity: 0.75;
}

/* ---- CTA Button — compact ---- */
.btn-call-cta {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    border-radius: 8px;
    background: #3592fc;
    color: #ffffff;
    font-size: 12px;
    font-weight: 500;
    line-height: 1;
    border: none;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
    box-shadow: 0 2px 6px rgba(53, 146, 252, 0.22);
    transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
}

.btn-call-cta:hover {
    background: #1e74e8;
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(53, 146, 252, 0.30);
}

.btn-call-cta:active {
    transform: translateY(0);
    box-shadow: none;
}

.btn-call-cta i {
    font-size: 12px;
}

/* ---- 480px+: slightly larger image ---- */
@media (min-width: 480px) {
    .listing-image {
        width: 115px;
        min-width: 115px;
    }

    .price-amount          { font-size: 20px; }
    .price-negotiable-text { font-size: 18px; }
    .listing-title         { font-size: 14px; }
    .listing-meta-combined { font-size: 12px; }
}

/* ---- 768px+: tablet ---- */
@media (min-width: 768px) {
    .listing-image {
        width: 130px;
        min-width: 130px;
    }

    .listing-content       { padding: 12px 14px 12px 12px; }
    .price-amount          { font-size: 21px; }
    .price-negotiable-text { font-size: 19px; }
    .listing-title         { font-size: 14px; }
    .listing-meta-combined { font-size: 12px; }
}

/* ---- Loading / empty states ---- */
.listing-card-horizontal.loading {
    opacity: 0.5;
    pointer-events: none;
}

.listing-empty-state {
    text-align: center;
    padding: 48px 20px;
    color: #9ca3af;
}

.listing-empty-state i {
    font-size: 56px;
    margin-bottom: 14px;
    opacity: 0.45;
}

.listing-empty-state h3 {
    font-size: 17px;
    font-weight: 600;
    color: #4b5563;
    margin-bottom: 6px;
}

.listing-empty-state p {
    font-size: 13px;
    color: #9ca3af;
}
