/**
 * Public CSS - Bundle Promotion
 * Layout combo: [SP gốc + SP mua kèm] | [thông tin combo bên cạnh]
 */

.ccpbp-bundle-box {
    margin: 20px 0;
    padding: 20px 24px;
    background: #f5f7fb;
    border-radius: 12px;
}

.ccpbp-bundle-title {
    margin: 0 0 16px;
    font-size: 20px;
    font-weight: 700;
    color: #1a3c8f;
}

.ccpbp-bundle-wrap {
    display: flex;
    align-items: flex-start;
    gap: 28px;
}

/* ===== Trái: SP gốc + SP mua kèm ===== */
.ccpbp-bundle-products {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    flex-wrap: wrap;
    flex: 1;
    min-width: 0;
}

.ccpbp-plus {
    align-self: center;
    font-size: 22px;
    font-weight: 600;
    color: #555;
    flex-shrink: 0;
}

.ccpbp-bundle-product {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 130px;
    flex-shrink: 0;
    text-align: center;
}

.ccpbp-product-thumb-wrap {
    width: 110px;
    height: 110px;
    background: #fff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.ccpbp-product-thumb {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.ccpbp-product-name,
.ccpbp-product-name a {
    font-size: 13px;
    color: #1a3c8f;
    font-weight: 500;
    text-decoration: none;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ccpbp-product-name a:hover {
    color: #d63638;
}

.ccpbp-product-price {
    font-size: 13px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1px;
}

.ccpbp-product-price del {
    color: #999;
    font-size: 12px;
}

.ccpbp-product-price ins {
    color: #d63638;
    font-weight: 700;
    text-decoration: none;
}

/* Checkbox chọn SP mua kèm (góc trên trái của ảnh) */
.ccpbp-item-check {
    position: absolute;
    top: 6px;
    left: 14px;
    z-index: 2;
    margin: 0;
    cursor: pointer;
}

.ccpbp-item-check input.ccpbp-bundle-checkbox {
    width: 18px;
    height: 18px;
    margin: 0;
    cursor: pointer;
    accent-color: #1a3c8f;
}

/* Item bỏ chọn thì mờ đi */
.ccpbp-bundle-item.ccpbp-unchecked .ccpbp-product-thumb-wrap,
.ccpbp-bundle-item.ccpbp-unchecked .ccpbp-product-name,
.ccpbp-bundle-item.ccpbp-unchecked .ccpbp-product-price {
    opacity: 0.45;
}

/* Dropdown chọn biến thể (cả SP gốc và SP mua kèm) */
.ccpbp-bundle-product .ccpbp-variation-select {
    width: 100%;
    max-width: 130px;
    font-size: 12px;
    padding: 3px 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
}

/* Nút Mua combo trạng thái loading */
.ccpbp-buy-combo.loading {
    opacity: 0.6;
    cursor: wait;
}

/* ===== Phải: thông tin combo ===== */
.ccpbp-bundle-summary {
    flex: 0 0 300px;
    max-width: 300px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ccpbp-summary-title {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: #1a3c8f;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ccpbp-summary-desc {
    margin: 0;
    font-size: 13px;
    color: #555;
    line-height: 1.4;
}

.ccpbp-summary-price {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.ccpbp-total-price {
    font-size: 22px;
    font-weight: 800;
    color: #d63638;
}

.ccpbp-total-price .woocommerce-Price-amount {
    font-size: inherit;
    font-weight: inherit;
    color: inherit;
}

.ccpbp-total-regular {
    color: #999;
    font-size: 14px;
}

.ccpbp-total-saving {
    font-size: 13px;
    color: #777;
}

.ccpbp-total-saving strong {
    color: #1a3c8f;
}

.ccpbp-buy-combo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 8px;
    padding: 12px 28px;
    background: #1a3c8f;
    color: #fff;
    font-size: 15px;
    font-weight: 700;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.15s ease;
    width: fit-content;
}

.ccpbp-buy-combo:hover {
    background: #d63638;
    color: #fff;
}

.ccpbp-bundle-note {
    margin: 6px 0 0;
    font-size: 12px;
    color: #999;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .ccpbp-bundle-wrap {
        flex-direction: column;
        gap: 16px;
    }

    .ccpbp-bundle-summary {
        flex: 1;
        max-width: none;
        width: 100%;
    }

    .ccpbp-buy-combo {
        width: 100%;
    }

    .ccpbp-bundle-product {
        width: 104px;
    }

    .ccpbp-product-thumb-wrap {
        width: 90px;
        height: 90px;
    }
}

/* ===== Giỏ hàng ===== */
.ccpbp-cart-bundle-label {
    margin-top: 4px;
}

.ccpbp-bundle-tag {
    display: inline-block;
    background: #d63638;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 3px;
}

.ccpbp-cart-bundle-label .ccpbp-campaign-name {
    font-size: 12px;
    color: #777;
}

/* ===== Giá mua kèm trong giỏ (đồng bộ markup với product-promotion) ===== */
.ccppp-price-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.ccppp-price-wrapper .ccppp-regular-price {
    color: #6b7280;
    font-size: 0.9em;
    order: 2;
}

.ccppp-price-wrapper .ccppp-sale-price {
    color: #0a529e;
    font-weight: 600;
    font-size: 1.1em;
    text-decoration: none;
    order: 1;
}

.ccppp-price-wrapper .ccppp-discount-badge {
    display: inline-block;
    background: #0a529e;
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 600;
    order: 3;
}
