/**
 * Simracing.Fan — Feed Product Activity Styles
 *
 * Styles for:
 * 1. Product thumbnail grid (batch aggregation — "X added N new products")
 * 2. Featured product card (vendor opt-in share)
 *
 * Integrates with BuddyX/Youzify activity stream.
 * @version 1.0.0
 */

/* ============================================================
   1. PRODUCT THUMBNAIL GRID (Batch Aggregation)
   ============================================================ */

.sfn-product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 12px;
    padding: 0;
}

.sfn-product-grid__item {
    display: flex;
    flex-direction: column;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.sfn-product-grid__item:hover {
    border-color: #dee2e6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    text-decoration: none;
    color: inherit;
}

.sfn-product-grid__item img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
}

.sfn-product-grid__name {
    display: block;
    padding: 6px 8px 2px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.3;
    color: #333;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sfn-product-grid__price {
    display: block;
    padding: 0 8px 6px;
    font-size: 12px;
    font-weight: 700;
    color: #1B3A5C;
}

/* "+N more" badge */
.sfn-product-grid__more {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e9ecef;
    min-height: 120px;
}

.sfn-product-grid__more-count {
    font-size: 16px;
    font-weight: 700;
    color: #1B3A5C;
    padding: 0;
}

/* 2 columns on smaller screens */
@media (max-width: 480px) {
    .sfn-product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
}


/* ============================================================
   2. FEATURED PRODUCT CARD (Vendor Opt-In Share)
   ============================================================ */

.sfn-featured-product {
    display: flex;
    gap: 16px;
    margin-top: 12px;
    padding: 16px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    transition: border-color 0.2s ease;
}

.sfn-featured-product:hover {
    border-color: #dee2e6;
}

.sfn-featured-product__image {
    flex-shrink: 0;
    width: 180px;
    display: block;
}

.sfn-featured-product__image img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

.sfn-featured-product__info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    min-width: 0;
}

.sfn-featured-product__title {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    text-decoration: none;
    line-height: 1.3;
}

.sfn-featured-product__title:hover {
    color: #1B3A5C;
    text-decoration: none;
}

.sfn-featured-product__desc {
    font-size: 13px;
    color: #666;
    line-height: 1.4;
    margin: 2px 0;
}

.sfn-featured-product__price {
    font-size: 18px;
    font-weight: 700;
    color: #1B3A5C;
    margin: 4px 0;
}

/* Override WooCommerce price HTML styles inside the card */
.sfn-featured-product__price del {
    color: #999;
    font-size: 14px;
    font-weight: 400;
}

.sfn-featured-product__price ins {
    text-decoration: none;
}

.sfn-featured-product__vendor {
    font-size: 12px;
    color: #888;
}

.sfn-featured-product__cta {
    display: inline-block;
    margin-top: 8px;
    padding: 6px 16px;
    background: #1B3A5C;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
    text-decoration: none;
    text-align: center;
    transition: background 0.2s ease;
    align-self: flex-start;
}

.sfn-featured-product__cta:hover {
    background: #254d75;
    color: #fff;
    text-decoration: none;
}

/* Stack on mobile */
@media (max-width: 480px) {
    .sfn-featured-product {
        flex-direction: column;
        gap: 12px;
    }

    .sfn-featured-product__image {
        width: 100%;
    }

    .sfn-featured-product__image img {
        aspect-ratio: 16 / 9;
    }
}


/* ============================================================
   3. ACTIVITY STREAM INTEGRATION
   ============================================================ */

/* Ensure our content renders inside Youzify/BuddyX activity entries */
.activity-content .sfn-product-grid,
.activity-content .sfn-featured-product {
    margin-top: 10px;
}

/* Remove default link colors from grid items inside activity */
.activity-content .sfn-product-grid__item,
.activity-content .sfn-product-grid__item:visited {
    color: inherit;
}

/* Activity action text — slightly larger for batch posts */
.activity-header .activity-head [data-bp-activity-type="new_wc_products_batch"] {
    font-weight: 600;
}
