/* ================================================
   PRELOVED ARCHIVE GRID — CLEAN 3/2/1 LAYOUT
================================================ */

/* Grid container */
.preloved-archive-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 28px;
    width: 100%;
}

/* Tablet */
@media (max-width: 1100px) {
    .preloved-archive-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

/* Mobile */
@media (max-width: 767px) {
    .preloved-archive-grid {
        grid-template-columns: 1fr;
    }
}

/* ==================================================
   CARD BASE
================================================== */

.preloved-card {
    border: 3px solid var(--brand-color, #999);
    border-radius: 12px;
    background: #fff;
    display: flex;
    flex-direction: column;
    padding: 18px;
    transition: box-shadow 0.25s ease;
}

.preloved-card:hover {
    box-shadow: 0 4px 18px rgba(0,0,0,0.12);
}

/* ==================================================
   BRAND LOGO
================================================== */

.brand-logo-wrapper {
    text-align: center;
    margin-bottom: 12px;
}

.machine-brand-logo {
    max-width: 180px;
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* ==================================================
   IMAGE SYSTEM — PRESERVE FULL IMAGE (NO CROP)
================================================== */

.image-wrapper {
    width: 100%;
    aspect-ratio: 4 / 3;  /* This is the stabilizer */
    background: #f5f5f5;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: contain;   /* ← KEY: show full image, no cropping */
    display: block;
}

/* "No Image" placeholder */
.no-image {
    font-size: 1rem;
    color: #777;
}

/* ==================================================
   CARD BODY
================================================== */

.card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-top: 14px;
}

/* Title stays neat and multi-line safe */
.machine-title {
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.3;
    min-height: 2.8em; /* 2 lines reserved */
    margin-bottom: 10px;
}

/* Status badge */
.status-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.status-available { background: #d4edda; color: #155724; }
.status-pending   { background: #fff3cd; color: #856404; }
.status-sold      { background: #f8d7da; color: #721c24; }

/* Price */
.machine-price {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 16px;
}

/* Buttons block sticks to bottom of card */
.card-ctas {
    margin-top: auto;
    padding-top: 14px;
    border-top: 1px solid #eee;
}

.card-ctas .btn {
    width: 100%;
    margin-bottom: 10px;
}