/* =====================================================
   Card Style — Facebook Marketplace inspired
   ===================================================== */

/* ── Card Grid ── */
.card-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    align-items: stretch;
}

@media (min-width: 640px)  { .card-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px)  { .card-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 1100px) { .card-grid { grid-template-columns: repeat(5, 1fr); } }

/* ── Card Shell ── */
.annonce-card {
    background: #fff !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    cursor: pointer !important;
    transition: box-shadow .2s !important;
    box-shadow: 0 1px 2px rgba(0,0,0,.1) !important;
    position: relative !important;
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    border: none !important;
}
.annonce-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,.15) !important;
}
.ann-boosted {
    box-shadow: 0 0 0 2px #F59E0B !important;
}

/* ── Image Zone ── */
.ad-img-wrap {
    position: relative !important;
    aspect-ratio: 16/9 !important;
    background: #f0f2f5 !important;
    overflow: hidden !important;
    flex-shrink: 0 !important;
}
.ad-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
}

/* ── Badges on Image ── */
.badge-tl, .badge-tr, .badge-bl {
    position: absolute;
    font-size: 11px;
    font-weight: 600;
    border-radius: 4px;
    padding: 4px 8px;
    line-height: 1.2;
    z-index: 2;
}
.badge-tl {
    top: 8px; left: 8px;
    background: rgba(0,0,0,.6);
    color: #fff;
}
.badge-tr {
    top: 8px; right: 8px;
    z-index: 2;
}
.badge-bl {
    bottom: 8px; left: 8px;
    background: rgba(0,0,0,.6);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
}
.badge-bl-exchange {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(245, 158, 11, 0.95);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    z-index: 3;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.badge-bl-exchange i {
    font-size: 9px;
}

/* ── Top-Right Container (Date + Estimation) ── */
.badge-tr-container {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    z-index: 3;
}
.badge-date {
    background: rgba(0,0,0,0.7);
    color: #fff;
    font-size: 10px;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
}
.badge-date i {
    font-size: 9px;
}

/* ── Estimation Badge on Image ── */
.badge-tr-container .estimation-badge {
    margin-top: 0;
    background: rgba(255,255,255,0.95) !important;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.badge-tr-container .estimation-badge.estimation-good {
    background: rgba(255,255,255,0.95) !important;
    color: #1877f2;
    border: 1px solid #1877f2;
}
.badge-tr-container .estimation-badge.estimation-fair {
    background: rgba(255,255,255,0.95) !important;
    color: #65676b;
    border: 1px solid #65676b;
}
.badge-tr-container .estimation-badge.estimation-high {
    background: rgba(255,255,255,0.95) !important;
    color: #f02849;
    border: 1px solid #f02849;
}
.badge-tr-container .estimation-badge.estimation-very-high {
    background: rgba(255,255,255,0.95) !important;
    color: #f02849;
    border: 1px solid #f02849;
}

.badge-premium { background: #F59E0B; color: #fff; }
.badge-new     { background: #1A56DB; color: #fff; }

/* ── Card Body ── */
.card-body {
    padding: 8px 10px 10px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 2px !important;
}

/* ── Price ── */
.card-price {
    font-size: 22px;
    font-weight: 800;
    color: #014fa3;
    line-height: 1.2;
    display: flex;
    align-items: baseline;
    gap: 4px;
    flex-wrap: wrap;
    letter-spacing: -0.4px;
}
.card-price .currency {
    font-size: 0.8rem;
    font-weight: 600;
    color: #64748b;
    margin-left: 2px;
}
.card-price .nego {
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: #31a24c;
    border-radius: 3px;
    padding: 2px 6px;
    margin-left: 6px;
    letter-spacing: 0.3px;
}
.card-price .exchange {
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    background: #f59e0b;
    border-radius: 3px;
    padding: 2px 6px;
    margin-left: 6px;
    letter-spacing: 0.3px;
}
.badge-price-unknown {
    font-size: 13px;
    color: #65676b;
    font-style: italic;
}

/* ── Title ── */
.ad-title {
    font-size: 15px;
    font-weight: 600;
    color: #334155;
    line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    letter-spacing: -0.1px;
    margin : 5px 0px;
}

/* ── Meta (time) ── */
.card-meta {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #65676b;
    margin-top: 2px;
}
.card-meta i {
    font-size: 11px;
    flex-shrink: 0;
}

/* ── Spec Pills ── */
.card-specs {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}
.spec-pill {
    font-size: 11px;
    font-weight: 500;
    color: #65676b;
    background: #f0f2f5;
    border-radius: 4px;
    padding: 3px 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.spec-pill i {
    color: #014fa3;
    font-size: 9px;
}

/* ── Region at Bottom ── */
.card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 6px;
    gap: 8px;
}
.card-region {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #65676b;
    font-weight: 500;
    flex: 1;
}
.card-region i {
    font-size: 10px;
    color: #65676b;
}
.card-date {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: #65676b;
    font-weight: 500;
}
.card-date i {
    font-size: 9px;
    color: #65676b;
}

/* ── Estimation Badge ── */
.estimation-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1px;
    white-space: nowrap;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.estimation-badge i {
    font-size: 9px;
}
.estimation-badge span {
    line-height: 1.1;
}
.estimation-badge.estimation-good {
    background: #1877f2;
    color: #fff;
    border: none;
}
.estimation-badge.estimation-fair {
    background: #65676b;
    color: #fff;
    border: none;
}
.estimation-badge.estimation-high {
    background: #f02849;
    color: #fff;
    border: none;
}
.estimation-badge.estimation-very-high {
    background: #f02849;
    color: #fff;
    border: none;
}

/* ── Mobile Optimizations ── */
@media (max-width: 575px) {
    .card-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 6px;
    }
    .annonce-card {
        border-radius: 6px !important;
    }
    .ad-img-wrap {
        aspect-ratio: 1/1 !important;
    }
    .card-body {
        padding: 6px 8px 8px !important;
        gap: 2px !important;
    }
    .card-price {
        font-size: 17px !important;
    }
    .card-price .currency {
        font-size: 0.75rem !important;
    }
    .ad-title {
        font-size: 14px !important;
        -webkit-line-clamp: 2 !important;
        line-clamp: 2 !important;
    }
    .card-specs {
        gap: 3px;
        margin-top: 3px;
    }
    .spec-pill {
        font-size: 10px;
        padding: 2px 6px;
    }
    .spec-desktop {
        display: none !important;
    }
}
