﻿:root {
    --card-bg: #fff;
    --text-strong: #222;
    --text-muted: #6b7280;
    --ring: rgba(0,0,0,.08);
    --shadow: 0 8px 24px rgba(0,0,0,0.12);
    --radius: 16px;
}

.listing-card {
    font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    background: var(--card-bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: transform .25s ease, box-shadow .25s ease;
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
    will-change: transform;
}

    .listing-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 12px 30px rgba(0,0,0,.18);
    }



/* Imagen */
.listing-thumb img {
    display: block;
    width: 100%;
    height: 230px;
    object-fit: cover;
}

/* Cuerpo */
.listing-body {
    padding: 16px 16px 8px 16px;
}

.listing-title {
    margin: 0 0 4px 0;
}

.listing-title-link {
    color: #222;
    font-size: 20px;
    font-weight: 700;
    line-height: 160%;
    letter-spacing: 0.2px;
    text-transform: capitalize;
    text-decoration: none;
}

    .listing-title-link:hover {
        text-decoration: underline;
    }

.listing-subtitle {
    margin: 0;
    color: var(--text-muted);
    font-weight: 400;
    font-size: 14px;
    line-height: 1.4;
}

    .listing-subtitle .listing-agency {
        color: #3586BB;
        text-decoration: none;
    }

        .listing-subtitle .listing-agency:hover {
            text-decoration: underline;
        }

/* Footer */
.listing-footer {
    padding: 8px 16px 16px 16px; /* ajustado para reducir espacio arriba de Bids */
    /*margin-top: auto;*/
}

.listing-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.listing-row--meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.meta-left,
.meta-right {
    display: flex;
    gap: 24px;
    align-items: baseline;
}

.meta-block {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.meta-label {
    color: var(--text-muted);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: .6px;
}

.meta-value {
    color: var(--text-strong);
    font-weight: 700;
    font-size: 16px;
}

/* Acciones */
.listing-row--actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-start;
    border-top: 1px solid rgba(0,0,0,0.06);
    margin-top: 8px;
    padding-top: 12px;
}

.time-left {
    margin: 0;
    color: var(--text-strong);
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    flex: 1 1 auto;
    min-width: 0;
}

    .time-left span {
        color: inherit;
        font-weight: 700;
    }

.icon-clock {
    width: 16px;
    height: 16px;
    display: inline-block;
}

/* Botón */
.btn-more {
    padding: 10px 16px;
    border-radius: 999px;
    background: #3586BB;
    color: #fff !important;
    text-decoration: none !important;
    display: inline-flex;
    align-items: center;
    line-height: 1;
    box-shadow: 0 2px 6px rgba(53,134,187,.3);
    transition: transform .2s ease;
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
    flex: 0 0 auto;
    margin-left: auto;
}

    .btn-more:hover,
    .btn-more:focus,
    .btn-more:active,
    .btn-more:visited {
        background: #3586BB;
        color: #fff !important;
        text-decoration: none !important;
        transform: none;
        outline: none;
    }

/* Utilidad */
.text-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Grid */
.home-body-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    max-width: 1140px;
    margin-left: 0;
    margin-right: auto;
    padding: 0 16px;
    box-sizing: border-box;
}

    .home-body-row > [class*="col-"] {
        padding-left: 0 !important;
        padding-right: 0 !important;
        max-width: none !important;
    }

.home-body-card .listing-card {
    width: 100%;

}

.home-body-row .card-viewmore {
    grid-column: 1 / -1;
}


/* === Acciones: tiempo + botón siempre en una sola línea === */
.listing-row--actions {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap !important; /* no permitir salto de línea */
    gap: .5rem;
    min-width: 0; /* importante para que pueda recortar */
}

    /* El párrafo de tiempo no debe meter márgenes extras */
    .listing-row--actions .time-left {
        margin: 0 !important;
        display: flex; /* alinear icono + texto */
        align-items: center;
        gap: .4rem;
        flex: 1 1 auto; /* ocupa el espacio disponible */
        min-width: 0; /* habilita el ellipsis */
        white-space: nowrap; /* no romper líneas */
        font-size: clamp(12px, 1.5vw, 14px); /* se ajusta sutilmente */
    }

        /* El texto del tiempo puede recortarse con … si no cabe */
        .listing-row--actions .time-left span {
            display: inline-block;
            min-width: 0;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        /* El icono nunca se deforma */
        .listing-row--actions .time-left .icon-clock {
            flex: 0 0 auto;
            width: 16px;
            height: 16px;
        }

    /* El botón tampoco salta de línea; se encoge un poco si hace falta */
    .listing-row--actions .btn-more {
        flex: 0 1 auto; /* permite encogerse antes de saltar */
        white-space: nowrap; /* no dividir "More Info" */
        font-size: clamp(12px, 1.5vw, 14px);
        padding: clamp(6px, 1.2vw, 10px) clamp(10px, 1.6vw, 16px);
        line-height: 1;
    }

/* Ajuste extra para tarjetas muy angostas (por si colapsa a 1 columna) */
@media (max-width: 420px) {
    .listing-row--actions {
        gap: .35rem;
    }

        .listing-row--actions .btn-more {
            padding: 6px 10px;
            font-size: 12px;
        }
}
