/* ============================================================
 * 商品推荐卡片样式（响应式，PC+移动共用）
 * ============================================================ */

/* 推荐区域容器 */
.recommend-section {
    margin-top: 16px;
}

.recommend-section__title {
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.recommend-section__subtitle {
    font-size: 12px;
    color: #64748b;
    font-weight: 400;
    margin-left: 8px;
}

/* 商品网格 */
.product-grid {
    display: grid;
    gap: 12px;
    margin-bottom: 16px;
}

/* PC端 Modal 内：4列 */
@media (min-width: 768px) {
    .product-grid--modal {
        grid-template-columns: repeat(4, 1fr);
    }
    .product-grid--shop {
        grid-template-columns: repeat(5, 1fr);
    }
}

/* 移动端：2列网格 */
@media (max-width: 767px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}

/* 移动端 step4 内：横向滚动 */
.product-grid--scroll {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 10px;
    padding-bottom: 8px;
    -webkit-overflow-scrolling: touch;
}

.product-grid--scroll .product-card {
    flex: 0 0 140px;
    scroll-snap-align: start;
}

/* 商品卡片 */
.product-card {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    transition: box-shadow 0.2s, transform 0.2s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    border-color: #3b82f6;
}

/* 商品图片 */
.product-card__img-wrap {
    position: relative;
    width: 100%;
    padding-top: 100%;
    overflow: hidden;
    background: #f8fafc;
}

.product-card__img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.product-card:hover .product-card__img {
    transform: scale(1.05);
}

/* 平台标签 */
.product-card__platform {
    position: absolute;
    top: 6px;
    left: 6px;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    color: #fff;
    font-weight: 600;
    z-index: 1;
}

.product-card__platform--pdd {
    background: #e02e24;
}

.product-card__platform--taobao {
    background: #ff6700;
}

.product-card__platform--jd {
    background: #e1251b;
}

/* 券标签 */
.product-card__coupon-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    color: #fff;
    background: #ef4444;
    font-weight: 600;
    z-index: 1;
}

/* 商品信息区 */
.product-card__body {
    padding: 8px 10px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* 商品标题 */
.product-card__title {
    font-size: 13px;
    line-height: 1.4;
    color: #1e293b;
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 36px;
}

/* 价格区 */
.product-card__price-row {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin-bottom: 4px;
    flex-wrap: wrap;
}

.product-card__price {
    font-size: 16px;
    font-weight: 700;
    color: #ef4444;
}

.product-card__price::before {
    content: '\00a5';
    font-size: 12px;
}

.product-card__original-price {
    font-size: 11px;
    color: #94a3b8;
    text-decoration: line-through;
}

.product-card__coupon {
    font-size: 10px;
    color: #ef4444;
    background: #fef2f2;
    padding: 1px 4px;
    border-radius: 3px;
}

/* 销量/佣金 */
.product-card__meta {
    font-size: 11px;
    color: #64748b;
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.product-card__sales {
    color: #94a3b8;
}

.product-card__commission {
    color: #10b981;
    font-weight: 600;
}

/* 店铺名 */
.product-card__shop {
    font-size: 10px;
    color: #94a3b8;
    margin-top: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 分组标题 */
.product-group__title {
    font-size: 14px;
    font-weight: 600;
    color: #334155;
    margin: 12px 0 8px;
    padding-left: 8px;
    border-left: 3px solid #3b82f6;
}

/* 加载中 */
.product-loading {
    text-align: center;
    padding: 24px;
    color: #94a3b8;
    font-size: 13px;
}

.product-loading .spinner-border {
    width: 1.2rem;
    height: 1.2rem;
}

/* 空状态 */
.product-empty {
    text-align: center;
    padding: 20px;
    color: #94a3b8;
    font-size: 13px;
}

/* 移动端适配 */
@media (max-width: 767px) {
    .product-card__title {
        font-size: 12px;
        min-height: 32px;
    }

    .product-card__price {
        font-size: 15px;
    }

    .product-card__body {
        padding: 6px 8px;
    }

    .recommend-section__title {
        font-size: 15px;
    }
}

/* 选材商城页面样式 */
.shop-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 16px;
}

.shop-page__search {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.shop-page__search-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.shop-page__search-input:focus {
    border-color: #3b82f6;
}

.shop-page__search-btn {
    padding: 10px 24px;
    background: #3b82f6;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.shop-page__search-btn:hover {
    background: #2563eb;
}

.shop-page__tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.shop-page__tab {
    padding: 6px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    font-size: 13px;
    color: #64748b;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.shop-page__tab.active {
    background: #3b82f6;
    color: #fff;
    border-color: #3b82f6;
}
