﻿/* ================================================================
   LISTA COMPACTA DE PUBLICACIONES - PRESTADOR
   Una línea horizontal por publicación con toda la info
   ================================================================ */

/* Contenedor de cada publicación */
.publicacion-list-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1rem;
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    margin-bottom: 0.75rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

    .publicacion-list-item:hover {
        border-color: rgba(139, 29, 29, 0.2);
        box-shadow: 0 4px 12px rgba(139, 29, 29, 0.08);
        transform: translateX(3px);
    }

/* ===== MINI FOTO ===== */
.pub-list-thumbnail {
    position: relative;
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    border-radius: 10px;
    overflow: hidden;
    background: #f8f9fa;
}

.pub-list-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pub-list-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.8);
}

/* Badge oferta en la mini foto */
.pub-list-badge-oferta {
    position: absolute;
    top: 4px;
    right: 4px;
    background: linear-gradient(135deg, #ff6f00 0%, #ff9800 100%);
    color: white;
    font-size: 0.55rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 2px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

    .pub-list-badge-oferta i {
        font-size: 0.5rem;
    }

/* ===== CONTENIDO PRINCIPAL ===== */
.pub-list-content {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex: 1;
    min-width: 0; /* Para que funcione el text-overflow */
}

.pub-list-main {
    flex: 1;
    min-width: 0;
}

/* Título */
.pub-list-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: #212529;
    margin: 0 0 0.35rem 0;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.publicacion-list-item:hover .pub-list-title {
    color: #8B1D1D;
}

/* Metadata: ubicación, fecha, vistas */
.pub-list-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    font-size: 0.75rem;
    color: #6c757d;
}

.pub-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

    .pub-meta-item i {
        font-size: 0.7rem;
        opacity: 0.7;
    }

    .pub-meta-item .fa-map-marker-alt {
        color: #D4AF37;
    }

.pub-meta-divider {
    color: #dee2e6;
    font-weight: 300;
}

/* ===== PRECIO ===== */
.pub-list-price {
    flex-shrink: 0;
    text-align: right;
    min-width: 140px;
}

.pub-price-amount {
    font-size: 1.1rem;
    font-weight: 800;
    color: #8B1D1D;
    display: block;
    line-height: 1.2;
}

/* ===== BOTÓN VER DETALLE ===== */
.pub-list-action {
    flex-shrink: 0;
}

.btn-pub-detalle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    background: linear-gradient(145deg, #8B1D1D, #6d1717);
    color: white;
    font-size: 0.8rem;
    font-weight: 700;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    box-shadow: 0 2px 6px rgba(139, 29, 29, 0.2);
}

    .btn-pub-detalle:hover {
        background: linear-gradient(145deg, #6d1717, #8B1D1D);
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(139, 29, 29, 0.3);
    }

    .btn-pub-detalle:active {
        transform: translateY(0);
    }

    .btn-pub-detalle i {
        font-size: 0.75rem;
    }

/* ===== COLORES POR CATEGORÍA ===== */
.cat-bg-1 {
    background-color: #1976d2;
}

.cat-bg-2 {
    background-color: #ff6f00;
}

.cat-bg-3 {
    background-color: #4caf50;
}

.cat-bg-4 {
    background-color: #c2185b;
}

.cat-bg-5 {
    background-color: #7b1fa2;
}

.cat-bg-0 {
    background-color: #9e9e9e;
}

/* ================================================================
   MOBILE ULTRA MINIMALISTA
   Fuente simple + botón "Ver"
   ================================================================ */

/* ================================================================
   MOBILE: LAYOUT 3 LÍNEAS VERTICALES
   ⚠️ SOLO MOBILE - DESKTOP NO SE TOCA
   ================================================================ */

/* ================================================================
   MOBILE: 3 LÍNEAS VERTICALES - LABEL "VER" ALINEADO
   ⚠️ REEMPLAZAR SOLO EL BLOQUE @media (max-width: 768px)
   ================================================================ */

@media (max-width: 768px) {
    /* ===== CONTENEDOR ===== */
    .publicacion-list-item {
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
        display: flex;
        flex-direction: row;
        align-items: stretch;
        gap: 0.75rem;
        padding: 0.75rem;
        margin-bottom: 0.65rem;
    }

    /* ===== FOTO: SE ESTIRA VERTICALMENTE ===== */
    .pub-list-thumbnail {
        width: 70px;
        height: auto;
        flex-shrink: 0;
        align-self: stretch;
    }

    .pub-list-img,
    .pub-list-placeholder {
        height: 100%;
    }

    .pub-list-badge-oferta {
        font-size: 0.5rem;
        padding: 2px 5px;
    }

        .pub-list-badge-oferta i {
            font-size: 0.45rem;
        }

    /* ===== CONTENIDO: LAYOUT VERTICAL ===== */
    .pub-list-content {
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        gap: 0.5rem;
        flex: 1;
        min-width: 0;
    }

    /* ===== LÍNEA 1: TÍTULO ===== */
    .pub-list-main {
        flex: 0 0 auto;
    }

    .pub-list-title {
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
        font-size: 0.9rem;
        font-weight: 500;
        margin: 0;
        line-height: 1.3;
        letter-spacing: -0.01em;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        white-space: normal;
    }

    /* ===== LÍNEA 2: UBICACIÓN + VISTAS ===== */
    .pub-list-meta {
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
        font-size: 0.7rem;
        font-weight: 400;
        gap: 0.4rem;
        margin: 0;
        flex: 0 0 auto;
    }

    .pub-meta-item {
        font-weight: 400;
    }

        .pub-meta-item i {
            font-size: 0.65rem;
        }

        /* Ocultar fecha */
        .pub-meta-item:nth-child(3),
        .pub-meta-divider:nth-child(2) {
            display: none;
        }

    /* ===== LÍNEA 3: PRECIO + LABEL "VER" EN FILA ===== */
    .pub-list-price {
        text-align: left;
        min-width: auto;
        flex: 1;
        align-self: flex-end; /* ✅ Alinea al final */
        display: inline-flex;
        align-items: center;
    }

    .pub-list-action {
        flex: 0 0 auto;
        align-self: flex-end; /* ✅ Alinea al final */
        display: inline-flex;
        align-items: center;
    }

    .pub-price-amount {
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
        font-size: 0.95rem;
        font-weight: 600;
        line-height: 1;
        white-space: nowrap;
        letter-spacing: -0.02em;
        color: #8B1D1D;
    }

    /* ===== LABEL "VER" ===== */
    .btn-pub-detalle {
        /* Resetear estilos de botón */
        background: transparent;
        border: none;
        padding: 0;
        box-shadow: none;
        /* Estilos de label */
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
        font-size: 0.8rem;
        font-weight: 600;
        color: #8B1D1D;
        text-decoration: underline;
        cursor: pointer;
        white-space: nowrap;
        line-height: 1;
        transition: all 0.2s ease;
    }

        .btn-pub-detalle:hover {
            background: transparent;
            color: #6d1717;
            transform: none;
            box-shadow: none;
            text-decoration: underline;
        }

        .btn-pub-detalle:active {
            transform: none;
        }

        .btn-pub-detalle i {
            display: none;
        }

    /* Buscador */
    .pub-search-wrapper {
        padding: 0.65rem;
        margin-bottom: 0.75rem;
    }

    .pub-search-input {
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
        font-size: 0.8rem;
        padding: 0.65rem 0;
    }

    .pub-search-results span {
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
        font-size: 0.7rem;
    }
}

/* ===== EXTRA SMALL ===== */
@media (max-width: 400px) {
    .publicacion-list-item {
        padding: 0.6rem;
        gap: 0.65rem;
    }

    .pub-list-thumbnail {
        width: 65px;
    }

    .pub-list-title {
        font-size: 0.85rem;
    }

    .pub-price-amount {
        font-size: 0.9rem;
    }

    .btn-pub-detalle {
        font-size: 0.75rem;
    }
}


@media (max-width: 576px) {
    .publicacion-list-item {
        display: flex;
        align-items: stretch;
        gap: .75rem;
        padding: .7rem;
    }

    .pub-list-thumbnail {
        width: 82px;
        height: 82px;
        flex: 0 0 82px;
    }

    .pub-list-img,
    .pub-list-placeholder {
        width: 82px;
        height: 82px;
        object-fit: cover;
        border-radius: 10px;
    }

    .pub-list-content {
        flex: 1;
        min-width: 0;
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-areas:
            "main main"
            "meta meta"
            "price action";
        align-items: center;
        column-gap: .75rem;
        row-gap: .25rem;
    }

    .pub-list-main {
        grid-area: main;
        min-width: 0;
    }

    .pub-list-title {
        margin: 0;
        font-size: .9rem;
        line-height: 1.2;
        font-weight: 800;
        display: -webkit-box;
        -webkit-line-clamp: 1;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .pub-list-meta {
        grid-area: meta;
        margin-top: .15rem;
        display: flex;
        align-items: center;
        gap: .35rem;
        font-size: .72rem;
        line-height: 1;
        white-space: nowrap;
        overflow: hidden;
    }

        .pub-list-meta .pub-meta-item:nth-of-type(2),
        .pub-list-meta .pub-meta-divider:nth-of-type(2) {
            display: none;
        }

    .pub-list-price {
        grid-area: price;
        margin: 0;
        min-width: 0;
    }

    .pub-price-amount {
        display: block;
        font-size: .86rem;
        font-weight: 900;
        color: #8B1D1D;
        white-space: nowrap;
    }

    .pub-list-action {
        grid-area: action;
        justify-self: end;
        align-self: center;
        margin: 0;
    }

    .btn-pub-detalle {
        font-size: .78rem;
        font-weight: 800;
        padding: 0;
        border: 0;
        background: transparent;
        color: #8B1D1D;
        text-decoration: underline;
    }
}



/* ================================================================
   BUSCADOR DE PUBLICACIONES
   Agregar al archivo publicacion-lista-compacta.css
   ================================================================ */

.pub-search-wrapper {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    border: 1px solid #e9ecef;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.pub-search-box {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: #ffffff;
    border: 2px solid #dee2e6;
    border-radius: 10px;
    padding: 0 1rem;
    transition: all 0.25s ease;
}

    .pub-search-box:focus-within {
        border-color: #8B1D1D;
        box-shadow: 0 0 0 3px rgba(139, 29, 29, 0.1);
    }

.pub-search-icon {
    color: #6c757d;
    font-size: 0.95rem;
    flex-shrink: 0;
}

.pub-search-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 0.75rem 0;
    font-size: 0.9rem;
    color: #212529;
    background: transparent;
}

    .pub-search-input::placeholder {
        color: #adb5bd;
    }

.pub-search-clear {
    width: 28px;
    height: 28px;
    border: none;
    background: #e9ecef;
    color: #6c757d;
    border-radius: 50%;
    cursor: pointer;
    display: none; /* Oculto por defecto, se muestra con JS */
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

    .pub-search-clear:hover {
        background: #8B1D1D;
        color: #ffffff;
        transform: scale(1.1);
    }

    .pub-search-clear i {
        font-size: 0.7rem;
    }

.pub-search-results {
    margin-top: 0.75rem;
    text-align: center;
}

    .pub-search-results span {
        display: none; /* Oculto por defecto, se muestra con JS */
        font-size: 0.8rem;
        color: #6c757d;
        font-weight: 600;
    }

/* ===== RESPONSIVE ===== */
/* ================================================================
   MOBILE - LAYOUT VERTICAL SIMPLE
   Todo alineado a la izquierda, una línea por elemento
================================================================ */
@media (max-width: 768px) {

    /* CONTENEDOR */
    .publicacion-list-item {
        display: flex;
        flex-direction: row;
        align-items: stretch;
        gap: 0.75rem;
        padding: 0.7rem;
        margin-bottom: 0.65rem;
    }

    /* FOTO: cuadrada, se estira con el alto del contenido */
    .pub-list-thumbnail {
        width: 82px;
        flex: 0 0 82px;
        height: auto;
        align-self: stretch;
    }

    .pub-list-img,
    .pub-list-placeholder {
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: 10px;
    }

    .pub-list-badge-oferta {
        font-size: 0.5rem;
        padding: 2px 5px;
    }

        .pub-list-badge-oferta i {
            font-size: 0.45rem;
        }

    /* CONTENIDO: TODO APILADO Y ALINEADO IZQUIERDA */
    .pub-list-content {
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        justify-content: flex-start !important;
        gap: 0.45rem !important;
        flex: 1;
        min-width: 0;
    }

    .pub-list-main {
        width: 100%;
        min-width: 0;
        margin: 0 !important;
    }

    /* LÍNEA 1-2: TÍTULO (2 líneas máx) - CON MARGEN INFERIOR */
    .pub-list-title {
        font-size: 0.9rem;
        font-weight: 700;
        color: #212529;
        margin: 0 0 0.4rem 0 !important; /* ✅ margen abajo del título */
        line-height: 1.3;
        text-align: left;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
        white-space: normal;
        word-break: break-word;
    }

    /* LÍNEA 3: UBICACIÓN + VISTAS */
    .pub-list-meta {
        display: flex;
        align-items: center;
        gap: 0.8rem;
        font-size: 0.72rem;
        line-height: 1;
        margin: 0;
        width: 100%;
        text-align: left;
    }

    .pub-meta-item {
        display: inline-flex;
        align-items: center;
        gap: 0.25rem;
    }

        .pub-meta-item i {
            font-size: 0.65rem;
        }

    /* Ocultar fecha */
    .pub-list-meta .pub-meta-item:nth-of-type(2),
    .pub-list-meta .pub-meta-divider:nth-of-type(2) {
        display: none;
    }

    /* LÍNEA 4: PRECIO */
    .pub-list-price {
        width: 100%;
        text-align: left !important;
        min-width: 0 !important;
        margin: 0 !important;
        flex: 0 0 auto !important;
        display: block !important;
    }

    .pub-price-amount {
        display: inline-block;
        font-size: 0.95rem;
        font-weight: 800;
        color: #8B1D1D;
        line-height: 1;
        white-space: nowrap;
    }

    /* LÍNEA 5: BOTÓN VER DETALLE */
    .pub-list-action {
        width: auto;
        text-align: left !important;
        margin: 0 !important;
        flex: 0 0 auto !important;
        display: inline-block !important;
    }

    /* ✅ BOTÓN con icono + texto */
    .btn-pub-detalle {
        display: inline-flex !important;
        align-items: center;
        gap: 0.4rem;
        padding: 0.45rem 0.9rem !important;
        background: linear-gradient(145deg, #8B1D1D, #6d1717) !important;
        color: #ffffff !important;
        font-size: 0.75rem !important;
        font-weight: 700 !important;
        border: none !important;
        border-radius: 8px !important;
        text-decoration: none !important;
        cursor: pointer;
        line-height: 1;
        box-shadow: 0 2px 6px rgba(139, 29, 29, 0.2) !important;
        transition: all 0.2s ease;
    }

        .btn-pub-detalle:hover {
            background: linear-gradient(145deg, #6d1717, #8B1D1D) !important;
            color: #ffffff !important;
            text-decoration: none !important;
            transform: translateY(-1px);
            box-shadow: 0 4px 10px rgba(139, 29, 29, 0.3) !important;
        }

        .btn-pub-detalle:active {
            transform: translateY(0);
        }

        /* ✅ Mostrar el icono */
        .btn-pub-detalle i {
            display: inline-block !important;
            font-size: 0.7rem !important;
        }

    /* Buscador */
    .pub-search-wrapper {
        padding: 0.65rem;
        margin-bottom: 0.75rem;
    }

    .pub-search-input {
        font-size: 0.8rem;
        padding: 0.65rem 0;
    }

    .pub-search-results span {
        font-size: 0.7rem;
    }
}

/* EXTRA SMALL */
@media (max-width: 400px) {
    .publicacion-list-item {
        padding: 0.6rem;
        gap: 0.65rem;
    }

    .pub-list-thumbnail {
        width: 72px;
        flex: 0 0 72px;
    }

    .pub-list-title {
        font-size: 0.85rem;
    }

    .pub-price-amount {
        font-size: 0.9rem;
    }

    .btn-pub-detalle {
        font-size: 0.75rem;
    }
}