/*
 * Shared marketplace presentation.
 * Used by product and promo cards without coupling product rendering to ShopPromo assets.
 */

.marketplace-content-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--bs-border-color, #dfe5ed);
    border-radius: 8px;
    background: var(--bs-body-bg, #fff);
    color: var(--bs-body-color, #263244);
}

.marketplace-content-card .marketplace-card-media {
    position: relative;
    display: block;
    flex: 0 0 180px;
    height: 180px;
    min-height: 180px;
    overflow: hidden;
    padding: 0;
    margin: 0;
    border: 0;
    background: var(--bs-tertiary-bg, #f4f6f9);
}

.marketplace-content-card .marketplace-card-media .product-img,
.marketplace-content-card .marketplace-card-media .promo-card-photo {
    display: block;
    width: 100%;
    height: 100% !important;
    margin: 0;
    object-fit: cover;
}

.marketplace-content-card .marketplace-card-body {
    display: flex !important;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    min-height: 0;
    padding: 4px !important;
    box-sizing: border-box;
}

.marketplace-content-card .marketplace-card-title {
    display: block;
    flex: 0 0 auto;
    min-width: 0;
    min-height: 20px;
    max-height: 40px;
    overflow: hidden;
    color: var(--bs-body-color, #263244);
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    text-decoration: none;
}

.marketplace-content-card .marketplace-card-title .card-title {
    display: -webkit-box;
    max-height: 40px;
    margin: 0 !important;
    overflow: hidden;
    color: inherit;
    font: inherit;
    line-height: 20px;
    overflow-wrap: anywhere;
    text-overflow: ellipsis;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

/*
 * Natural-height information area.
 * It only grows when real information is present: price, discount, condition,
 * description, badges or future marketplace metadata.
 */
.marketplace-content-card .marketplace-card-info {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    width: 100%;
    min-width: 0;
    min-height: 0;
    height: auto;
    overflow: visible;
    text-align: center;
}

.marketplace-content-card .marketplace-card-info > * {
    max-width: 100%;
}

.marketplace-content-card .price-section,
.marketplace-content-card .marketplace-card-price-section {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 3px 6px;
    width: 100%;
    max-width: 100%;
    margin: 0 !important;
}

.marketplace-card-price-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 3px 6px;
    min-width: 0;
    max-width: 100%;
}

.marketplace-card-price-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    min-width: 0;
    max-width: 100%;
}

.marketplace-card-price,
.marketplace-card-discount,
.marketplace-card-condition {
    min-width: 0;
    max-width: 100%;
}

.marketplace-card-discount {
    flex: 0 1 auto;
}

.marketplace-group-copy {
    max-width: 100%;
    overflow: hidden;
    color: var(--bs-secondary-color, #687487);
    font-size: 11px;
    line-height: 15px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.marketplace-content-card .marketplace-card-action {
    display: flex !important;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 100%;
    min-height: 36px;
    height: auto !important;
    max-height: none;
    margin: auto 0 0 !important;
    padding: 4px 5px !important;
    box-sizing: border-box;
    font-size: 12px !important;
    line-height: 16px !important;
    text-align: center;
    text-decoration: none;
    white-space: normal;
    cursor: pointer;
}

.marketplace-card-state-badge {
    position: static !important;
    flex: 0 0 auto;
    margin: 0;
}

.marketplace-card-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 7px;
    width: 100%;
    height: 100%;
    color: var(--bs-secondary-color, #a1aabb);
    font-size: 12px;
}

.marketplace-card-placeholder i {
    font-size: 28px;
}

.marketplace-type-badge {
    position: absolute;
    top: 7px;
    left: 7px;
    z-index: 1;
    display: inline-flex;
    width: fit-content;
    align-items: center;
    margin: 0;
    padding: 4px 7px;
    border-radius: 5px;
    background: var(--bs-secondary-bg, #e9effa);
    color: var(--bs-secondary-color, #345b89);
    box-shadow: 0 1px 5px rgba(0, 0, 0, .05);
    font-size: 10px;
    font-weight: 750;
    letter-spacing: .035em;
}

.marketplace-type-badge.is-product {
    background: var(--bs-success-bg-subtle, #e9f6ee);
    color: var(--bs-success-text-emphasis, #247142);
}

.market-results-grid .product-img,
.market-results-grid .promo-card-photo {
    width: 100%;
    height: 170px;
    object-fit: cover;
}

.market-results-grid .product-card {
    height: 100%;
}

.market-product-badge {
    margin: 8px 6px 6px;
    background: var(--bs-success-bg-subtle, #e9f6ee);
    color: var(--bs-success-text-emphasis, #247142);
}

.product-featured-strip .marketplace-card-media {
    flex-basis: 150px;
    height: 150px;
    min-height: 150px;
}

@media (max-width: 575.98px) {
    .marketplace-content-card .marketplace-card-media {
        flex-basis: 135px;
        height: 135px;
        min-height: 135px;
    }

    .marketplace-content-card .marketplace-card-title {
        font-size: 13px;
    }

    .marketplace-content-card .marketplace-card-action {
        font-size: 11px !important;
    }

    .market-results-grid .product-img,
    .market-results-grid .promo-card-photo {
        height: 135px;
    }
}
