/**
 * ZK京东CPS插件 - 前端样式
 * 
 * @package ZK_JD_CPS
 */

/* 通用样式 */
.zk-jd-cps-error {
    padding: 15px;
    background-color: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 4px;
    color: #856404;
    margin: 20px 0;
}

/* 卡片样式 */
.zk-jd-cps-card {
    max-width: 350px;
    margin: 20px auto;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    background: #fff;
}

.zk-jd-cps-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

.zk-jd-cps-card a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.zk-jd-cps-card-image {
    position: relative;
    width: 100%;
    padding-top: 100%;
    background-color: #f5f5f5;
    overflow: hidden;
}

.zk-jd-cps-card-image img {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.zk-jd-cps-card:hover .zk-jd-cps-card-image img {
    transform: translate(-50%, -50%) scale(1.05);
}

.zk-jd-cps-coupon {
    position: absolute;
    top: 10px;
    right: 10px;
    background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
    color: #fff;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
}

.zk-jd-cps-card-body {
    padding: 15px;
}

.zk-jd-cps-title {
    font-size: 16px;
    line-height: 1.5;
    margin: 0 0 12px 0;
    color: #333;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    height: 48px;
    font-weight: 500;
}

.zk-jd-cps-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 8px;
}

.zk-jd-cps-price {
    font-size: 24px;
    color: #e4393c;
    font-weight: bold;
}

.zk-jd-cps-commission {
    font-size: 12px;
    color: #ff6b6b;
    background-color: #fff0f0;
    padding: 3px 8px;
    border-radius: 4px;
}

.zk-jd-cps-shop {
    font-size: 13px;
    color: #666;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
}

.zk-jd-cps-shop::before {
    content: "🏪";
    margin-right: 5px;
}

.zk-jd-cps-button {
    text-align: center;
}

.zk-jd-cps-btn {
    display: inline-block;
    background: linear-gradient(135deg, #e4393c, #ff6b6b);
    color: #fff;
    padding: 10px 30px;
    border-radius: 25px;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
    cursor: pointer;
}

.zk-jd-cps-btn:hover {
    background: linear-gradient(135deg, #ff6b6b, #e4393c);
    box-shadow: 0 4px 12px rgba(228, 57, 60, 0.3);
}

/* 列表样式 */
.zk-jd-cps-list {
    display: flex;
    align-items: center;
    padding: 15px;
    margin: 20px 0;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    transition: all 0.3s ease;
}

.zk-jd-cps-list:hover {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
}

.zk-jd-cps-list a {
    display: flex;
    align-items: center;
    width: 100%;
    text-decoration: none;
    color: inherit;
}

.zk-jd-cps-list-image {
    flex-shrink: 0;
    width: 100px;
    height: 100px;
    margin-right: 15px;
    background-color: #f5f5f5;
    border-radius: 6px;
    overflow: hidden;
}

.zk-jd-cps-list-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.zk-jd-cps-list-content {
    flex: 1;
    min-width: 0;
}

.zk-jd-cps-list .zk-jd-cps-title {
    font-size: 15px;
    height: auto;
    -webkit-line-clamp: 2;
    margin-bottom: 8px;
}

.zk-jd-cps-list .zk-jd-cps-meta {
    gap: 10px;
}

.zk-jd-cps-list .zk-jd-cps-price {
    font-size: 20px;
}

.zk-jd-cps-list-action {
    flex-shrink: 0;
    margin-left: 15px;
}

.zk-jd-cps-list .zk-jd-cps-btn {
    padding: 8px 20px;
}

/* 迷你样式 */
.zk-jd-cps-mini {
    display: inline-flex;
    align-items: center;
    padding: 10px 15px;
    margin: 10px 5px;
    border: 1px solid #e0e0e0;
    border-radius: 25px;
    background: #fff;
    transition: all 0.3s ease;
}

.zk-jd-cps-mini:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-color: #e4393c;
}

.zk-jd-cps-mini a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
}

.zk-jd-cps-mini img {
    width: 40px;
    height: 40px;
    border-radius: 6px;
    margin-right: 10px;
    object-fit: cover;
}

.zk-jd-cps-mini-title {
    font-size: 14px;
    color: #333;
    margin-right: 10px;
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.zk-jd-cps-mini-price {
    font-size: 16px;
    color: #e4393c;
    font-weight: bold;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .zk-jd-cps-card {
        max-width: 100%;
        margin: 20px 0;
    }
    
    .zk-jd-cps-list {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .zk-jd-cps-list a {
        flex-direction: column;
    }
    
    .zk-jd-cps-list-image {
        width: 100%;
        height: 200px;
        margin-right: 0;
        margin-bottom: 15px;
    }
    
    .zk-jd-cps-list-action {
        margin-left: 0;
        margin-top: 10px;
        width: 100%;
    }
    
    .zk-jd-cps-list .zk-jd-cps-btn {
        width: 100%;
        text-align: center;
    }
    
    .zk-jd-cps-mini {
        width: 100%;
        box-sizing: border-box;
    }
    
    .zk-jd-cps-mini-title {
        max-width: 150px;
    }
}

/* 简化横向卡片样式 - 电商推广卡片 */
.zk-jd-cps-simple-card {
    position: relative;
    max-width: 700px;
    margin: 20px auto;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.zk-jd-cps-simple-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
}

/* 右上角广告标识 */
.zk-jd-cps-ad-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: #f5f5f5;
    color: #999;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 400;
    z-index: 10;
    border: 1px solid #e8e8e8;
}

.zk-jd-cps-simple-card a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

/* 左侧图片区域 - 固定75px */
.zk-jd-cps-simple-image {
    flex-shrink: 0;
    width: 75px;
    height: 75px;
    background-color: #fafafa;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    margin-right: 8px;
}

.zk-jd-cps-simple-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.zk-jd-cps-simple-card:hover .zk-jd-cps-simple-image img {
    transform: scale(1.05);
}

/* 右侧内容区域 - 占70% */
.zk-jd-cps-simple-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
}

/* 商品标题 - 加粗 */
.zk-jd-cps-simple-title {
    font-size: 14px;
    line-height: 1.5;
    color: #333;
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    height: 42px;
}

/* 店铺信息 - 灰色小字 */
.zk-jd-cps-simple-platform {
    font-size: 12px;
    color: #999;
    font-weight: 400;
}

/* 底部区域 - 价格和按钮 */
.zk-jd-cps-simple-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

/* 价格 - 橙色大号 */
.zk-jd-cps-simple-price {
    color: #ff6700;
    font-weight: bold;
    letter-spacing: -0.5px;
}

/* 购买按钮 - 橙色 */
.zk-jd-cps-simple-buy {
    color: #ff6700;
    /* font-size: 13px; */
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.zk-jd-cps-simple-card:hover .zk-jd-cps-simple-buy {
    transform: translateX(5px);
    color: #ff8533;
}

/* 响应式 - 简化卡片 */
@media (max-width: 768px) {
    .zk-jd-cps-simple-card {
        max-width: 100%;
        margin: 15px 0;
    }
    
    .zk-jd-cps-simple-image {
        width: 75px;
        height: 75px;
    }
    
    .zk-jd-cps-simple-title {
        line-height: 1.4;
        height: 36px;
    }
    
    .zk-jd-cps-simple-buy {
        font-size: 12px;
    }
}


/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.zk-jd-cps-card,
.zk-jd-cps-list,
.zk-jd-cps-mini,
.zk-jd-cps-simple-card {
    animation: fadeIn 0.4s ease;
}

