﻿/* =========================================
   feed-cards.css (VERSIÓN MIXTA: Tarjetas Originales + Modal Premium)
   ========================================= */

/* --- 1. ESTRUCTURA DE LA GRILLA --- */
.feed-col {
    flex: 0 0 auto;
    width: 100%;
    padding: 0 10px;
}

.feed-fade {
    opacity: 0;
    transition: opacity .3s;
}

    .feed-fade.show {
        opacity: 1;
    }

/* Responsive */
@media (min-width:576px) {
    .feed-col {
        width: 50%;
    }
}

@media (min-width:992px) {
    .feed-col {
        width: 33.333%;
    }
}

@media (min-width:1200px) {
    .feed-col {
        width: 25%;
    }
}


/* --- 2. TARJETA (CONTENEDOR) --- */
.feed-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fff;
    border: 1px solid #cfa34b;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 6px 12px rgba(0,0,0,0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    z-index: 1;
}

    .feed-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 12px 24px rgba(207, 163, 75, 0.25);
        border-color: #b58b35;
    }

    .feed-card::after {
        content: "";
        position: absolute;
        inset: 0;
        pointer-events: none;
        background: radial-gradient(circle at top left,rgba(255,255,255,0.8),transparent 70%);
        opacity: 0;
        transition: opacity .3s;
    }

    .feed-card:hover::after {
        opacity: 0.3;
    }


/* --- 3. IMAGEN Y BADGES (TARJETAS) --- */
/* 🔥 VUELTA ATRÁS: Usamos contain para ver el producto entero */
.feed-img-wrap {
    position: relative;
    width: 100%;
    height: 180px;
    background: #f8fafc; /* Fondo grisacio suave */
    overflow: hidden;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

    .feed-img-wrap img {
        max-width: 100%;
        max-height: 100%;
        width: auto;
        height: auto;
        /* CONTAIN: Muestra toda la foto sin recortar nada */
        object-fit: contain;
        padding: 10px; /* Margen interno para que no toque los bordes */
        transition: transform 0.3s ease;
    }

.feed-card:hover .feed-img-wrap img {
    transform: scale(1.05);
}

/* Badges */
.feed-badge, .feed-cond {
    position: absolute;
    top: 8px;
    padding: .2rem .4rem;
    font-size: .6rem;
    font-weight: 700;
    border-radius: 4px;
    color: #fff;
    text-transform: uppercase;
    backdrop-filter: blur(2px);
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.feed-badge {
    left: 8px;
}

.feed-cond {
    right: 8px;
}

/* Colores */
.feed-badge[data-tipo="PRODUCTO"] {
    background: #2563EB;
}

.feed-badge[data-tipo="SERVICIO"] {
    background: #7C3AED;
}

.feed-badge[data-tipo="INMUEBLE"] {
    background: #15803D;
}

.feed-badge[data-tipo="VEHICULO"] {
    background: #D97706;
}

.feed-badge[data-tipo="EVENTO"] {
    background: #DC2626;
}

.feed-badge[data-tipo="BOLSATRABAJO"] {
    background: #0F766E;
}

.feed-badge[data-tipo="SOLIDARIDAD"] {
    background: #16A34A;
}

.feed-badge[data-tipo="CURRICULUM"] {
    background: #475569;
}

.feed-cond[data-cond="NUEVO"] {
    background: #ef4444;
}

.feed-cond[data-cond="USADO"] {
    background: #eab308;
}


/* --- 4. CONTENIDO --- */
.feed-body {
    padding: 25px 14px 4px 14px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-grow: 1;
}

/* Badge Vistas */
.feed-views-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 1px 6px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 10px;
    background: rgba(148,163,184,.1);
    border: 1px solid rgba(148,163,184,.2);
    color: #64748b;
    white-space: nowrap;
    margin-left: auto;
}

    .feed-views-badge.hot {
        background: rgba(255, 159, 10, .1);
        border-color: rgba(255, 159, 10, .3);
        color: #d97706;
    }

/* Título */
.feed-title {
    font-weight: 700;
    font-size: 0.9rem;
    line-height: 1.35;
    color: #334155;
    margin-bottom: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Descripción */
.feed-desc {
    color: #64748b;
    font-size: 0.78rem;
    line-height: 1.4;
    margin-top: 12px !important;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Precio */
.feed-price {
    font-size: 1rem;
    font-weight: 800;
    color: #059669;
    letter-spacing: -0.3px;
    margin-top: auto;
}

/* Ubicación y Fecha */
.feed-loc {
    font-size: 0.7rem;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 3px;
    margin-top: 4px;
}

.feed-date {
    font-size: 0.65rem;
    color: #64748b;
    margin-top: 2px;
}

/* --- 5. FOOTER --- */
.feed-footer {
    margin-top: 8px;
    padding: 10px 14px 12px;
    border-top: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #fff;
}

.feed-btn {
    font-size: 0.75rem;
    padding: 0.35rem 0.9rem;
    font-weight: 600;
    border-radius: 6px;
    width: auto;
}

/* --- 6. BOTONES COMPARTIR --- */
.share-btn {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    color: white;
    transition: transform .15s;
}

    .share-btn:hover {
        transform: scale(1.1);
    }

    .share-btn.whatsapp {
        background: #25D366;
    }

    .share-btn.facebook {
        background: #1877F2;
    }

    .share-btn.instagram {
        background: radial-gradient(circle at 30% 30%, #ffdc80, #fcaf45, #f77737, #fd1d1d, #e1306c, #c13584, #833ab4);
    }

.feed-share {
    display: flex;
    gap: 5px;
}

    .feed-share .share-main {
        display: inline-flex;
        width: 24px;
        height: 24px;
        background: transparent;
        color: #94a3b8;
        cursor: default;
        transition: none !important;
        box-shadow: none !important;
    }

        .feed-share .share-main:hover {
            background: transparent !important;
            color: #94a3b8 !important;
            transform: none !important;
        }

/* =======================================================
   🔥 SOLUCIÓN ESTILO PREMIUM DEL MODAL (Mejorado)
   ======================================================= */

/* 1. Título Fino y Elegante */
#feedModalTitle {
    font-size: 1rem !important; /* Chico y prolijo */
    font-weight: 600 !important;
    letter-spacing: -0.01em;
    color: #334155;
    margin: 0;
}

/* 2. Cabecera Limpia (Sin Línea o muy suave) */
#feedModal .modal-header {
    padding: 0.8rem 1rem !important;
    border-bottom: 1px solid #f1f5f9; /* Línea muy sutil */
    min-height: auto;
    align-items: center;
}

/* 3. Badge del Modal más sutil */
#feedModalTipo.badge {
    font-weight: 600;
    font-size: 0.65rem;
    letter-spacing: 0.5px;
    padding: 0.35em 0.6em;
    border-radius: 6px;
    opacity: 0.9;
}

/* 4. Foto del Modal: Fondo Negro y Centrada */
#feedModal .gallery-wrap {
    background-color: #000 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 350px !important; /* Altura fija */
}

/* La foto en el modal SÍ usamos contain para verla entera pero grande */
#galImg {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain !important;
    width: auto !important;
    height: auto !important;
}
/* --- CORRECCIÓN DE ALINEACIÓN (GAL-STAGE) --- */
/* Esto obliga al contenedor intermedio a centrar la foto */
#feedModal .gal-stage {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-grow: 1 !important; /* Ocupa todo el espacio entre las flechas */
    width: 100% !important;
    height: 100% !important;
}