/* ===== CloudBuy Page - 独立产品选购页 ===== */

.cloudbuy-page { width: 100%; min-height: 100vh; background: #f5f7fa; }
.cloudbuy-page * { box-sizing: border-box; }

/* 分组名展示栏 */
.cb-group-name-bar {
    display: flex;
    align-items: center;
    padding: 0 20px 12px;
    background: #fff;
}
.cb-group-tag {
    display: inline-flex;
    align-items: center;
    background: #f0fff5;
    border: 1px solid #b5e8c9;
    color: #15a55c;
    font-size: 13px;
    padding: 4px 12px;
    border-radius: 16px;
    font-weight: 500;
}
.cb-tag-icon {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #15a55c;
    margin-right: 6px;
}

/* Banner */
.cb-banner {
    width: 100%;
    height: 240px;
    background: linear-gradient(135deg, #0a7a3d 0%, #15a55c 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding-top: 60px;
    padding-bottom: 40px;
    box-sizing: border-box;
}
.cb-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(255,255,255,0.06) 0%, transparent 70%);
    border-radius: 50%;
}
.cb-banner-content { text-align: center; color: #fff; position: relative; z-index: 1; }
.cb-banner-content h1 { font-size: 32px; font-weight: 700; margin: 0 0 10px; letter-spacing: 2px; }
.cb-banner-content p { font-size: 15px; margin: 0; opacity: 0.9; }

/* Container */
.cb-container {
    max-width: 1300px;
    margin: -40px auto 40px;
    padding: 0 20px;
    position: relative;
    z-index: 2;
}

/* 公告栏 */
.cb-notice-bar {
    background: #fff;
    border-radius: 12px;
    margin-bottom: 16px;
    padding: 14px 20px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    display: flex;
    align-items: center;
    justify-content: center;
}
.cb-notice-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #15a55c;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    transition: color 0.2s ease;
}
.cb-notice-link:hover {
    color: #0d7a42;
}
.cb-notice-icon {
    font-size: 18px;
    line-height: 1;
}
.cb-notice-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
@media (max-width: 768px) {
    .cb-notice-bar { padding: 12px 16px; margin-bottom: 12px; }
    .cb-notice-link { font-size: 13px; }
    .cb-notice-text { max-width: 260px; }
}

/* Picker Card */
.cb-picker-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    margin-bottom: 20px;
    overflow: hidden;
}
.cb-picker-loading {
    padding: 40px;
    text-align: center;
    color: #909399;
    font-size: 14px;
}

/* 一级分类 Tab */
.cb-main-tabs {
    display: flex;
    border-bottom: 1px solid #ebeef5;
    padding: 0 20px;
    overflow-x: auto;
    scrollbar-width: thin;
    background: #fff;
}
.cb-main-tab {
    padding: 14px 24px;
    font-size: 15px;
    color: #606266;
    cursor: pointer;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    position: relative;
}
.cb-main-tab:hover { color: #15a55c; }
.cb-main-tab.active {
    color: #15a55c;
    border-bottom-color: #15a55c;
    font-weight: 600;
}

/* 二级分类区域 */
.cb-second-row {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #fff;
}
.cb-second-labels {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}
.cb-group-btn {
    display: inline-flex;
    align-items: center;
    padding: 7px 18px;
    font-size: 14px;
    color: #606266;
    cursor: pointer;
    white-space: nowrap;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    background: #f5f7fa;
    transition: all 0.2s;
    user-select: none;
}
.cb-group-btn:hover {
    color: #15a55c;
    border-color: #15a55c;
}
.cb-group-btn.active {
    color: #fff;
    background: #15a55c;
    border-color: #15a55c;
}

/* 三级分类区域 */
.cb-third-row {
    padding: 0 20px 16px;
    background: #fff;
    border-top: 1px dashed #ebeef5;
}
.cb-third-labels {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding-top: 12px;
}
.cb-third-btn {
    display: inline-flex;
    align-items: center;
    padding: 7px 18px;
    font-size: 14px;
    color: #606266;
    cursor: pointer;
    white-space: nowrap;
    border: 1px solid #dcdfe6;
    border-radius: 4px;
    background: #f5f7fa;
    transition: all 0.2s;
    user-select: none;
}
.cb-third-btn:hover {
    color: #15a55c;
    border-color: #15a55c;
}
.cb-third-btn.active {
    color: #fff;
    background: #15a55c;
    border-color: #15a55c;
}

/* 产品列表区域 */
.cb-products-wrap {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    padding: 12px;
    min-height: 300px;
}
.cb-products-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: #909399;
}
.cb-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #ebeef5;
    border-top-color: #15a55c;
    border-radius: 50%;
    animation: cb-spin 1s linear infinite;
    margin-bottom: 12px;
}
@keyframes cb-spin {
    to { transform: rotate(360deg); }
}

/* 产品卡片网格 */
.cb-products-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-start;
}

/* 产品卡片 */
.cb-product-card {
    background: #fff;
    border: 1px solid #ebeef5;
    border-radius: 10px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s, transform 0.2s;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    width: 300px;
    min-width: 300px;
    max-width: 300px;
    height: 410px;
    min-height: 410px;
    max-height: 410px;
    flex-shrink: 0;
}
.cb-product-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    transform: translateY(-2px);
    border-color: #c6e2ff;
}
.cb-product-recommend {
    position: absolute;
    top: 0;
    right: 0;
    background: #ff4d4f;
    color: #fff;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 0 0 0 8px;
    font-weight: 600;
}
.cb-product-name {
    font-size: 16px;
    font-weight: 700;
    color: #303133;
    margin-bottom: 8px;
    line-height: 1.4;
}
.cb-product-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}
.cb-product-header .cb-product-name {
    margin-bottom: 0;
    flex: 1;
}
.cb-stock-qty {
    font-size: 12px;
    color: #909399;
    white-space: nowrap;
    flex-shrink: 0;
}
.cb-product-desc {
    font-size: 13px;
    color: #909399;
    line-height: 1.6;
    flex: 1;
    margin-bottom: 12px;
    overflow: visible;
}
.cb-product-desc * { all: revert; }
.cb-product-desc::-webkit-scrollbar { width: 0; }
.cb-product-desc:hover::-webkit-scrollbar { width: 4px; }

.cb-product-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
    min-height: 22px;
}
.cb-product-tag {
    font-size: 12px;
    color: #15a55c;
    background: rgba(21,165,92,0.08);
    padding: 2px 8px;
    border-radius: 3px;
}

.cb-product-price-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 14px;
    gap: 8px;
}
.cb-product-price {
    display: flex;
    align-items: baseline;
    gap: 4px;
}
.cb-price-prefix {
    font-size: 13px;
    color: #f56c6c;
}
.cb-price-num {
    font-size: 24px;
    font-weight: 700;
    color: #f56c6c;
}
.cb-price-cycle {
    font-size: 13px;
    color: #606266;
}
.cb-original-price {
    font-size: 13px;
    color: #c0c4cc;
    text-decoration: line-through;
}

.cb-buy-btn {
    width: 100%;
    padding: 10px 0;
    background: #15a55c;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    text-align: center;
}
.cb-buy-btn:hover { background: #0a7a3d; }

/* 已售罄状态 */
.cb-product-card.cb-sold-out {
    opacity: 0.55;
    pointer-events: none;
}
.cb-product-card.cb-sold-out .cb-product-name {
    color: #c0c4cc;
}
.cb-sold-out-badge {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 60px;
    height: 60px;
    background: rgba(144, 147, 153, 0.85);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    letter-spacing: 2px;
    z-index: 2;
    pointer-events: none;
}
.cb-buy-btn--disabled {
    background: #c0c4cc !important;
    cursor: not-allowed;
    opacity: 0.7;
}
.cb-buy-btn--disabled:hover { background: #c0c4cc !important; }

/* 空状态 */
.cb-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 20px;
    text-align: center;
}
.cb-empty-icon {
    width: 64px;
    height: 64px;
    margin-bottom: 16px;
    border-radius: 50%;
    background: #f0f2f5;
    position: relative;
}
.cb-empty-icon::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 32px;
    height: 32px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23c0c4cc'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z'/%3E%3C/svg%3E") no-repeat center;
    background-size: contain;
}
.cb-empty-state p { color: #909399; font-size: 14px; margin: 0; }

/* 错误提示 */
.cb-picker-error {
    padding: 40px;
    text-align: center;
    color: #f56c6c;
    font-size: 14px;
}
.cb-picker-error a {
    color: #15a55c;
    cursor: pointer;
    text-decoration: underline;
}

/* 响应式 */
@media (max-width: 1024px) {
    .cb-product-card { width: calc((100% - 24px) / 3); }
}
@media (max-width: 768px) {
    .cb-banner { height: 200px; padding-top: 50px; padding-bottom: 30px; }
    .cb-banner-content h1 { font-size: 24px; }
    .cb-banner-content p { font-size: 13px; }
    .cb-container { margin: -30px auto 20px; padding: 0 12px; }
    .cb-main-tab { padding: 12px 16px; font-size: 14px; }
    .cb-second-row { padding: 12px; }
    .cb-group-btn { padding: 6px 14px; font-size: 13px; }
    .cb-products-grid { gap: 12px; }
    .cb-products-wrap { padding: 12px; }
    .cb-product-card { width: calc((100% - 12px) / 2); }
}
@media (max-width: 480px) {
    .cb-product-card { width: 100%; }
}
