/**
 * B2B Commerce Kit -- Discount Notices & Product Page Displays
 *
 * Covers:
 *  - Cart notice boxes (success, info, bogo-prompt)
 *  - BOGO free-item badges in cart
 *  - Discount message on product page
 *  - Quantity pricing table on product page
 *  - BOGO offer card on product page (cross-product)
 *  - BOGO same-product offer text
 *
 * @package B2B_Catalyst
 * @since   2.0.0
 */


/* ==========================================================================
   1. CART NOTICES
   ========================================================================== */

.woob2b-discount-notices {
    margin-bottom: 20px;
}

.woob2b-discount-notice {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 1.5;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

/* Success: green -- deal earned */
.woob2b-notice-success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

/* Info: blue -- upsell */
.woob2b-notice-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

/* BOGO prompt: amber -- add product to cart */
.woob2b-notice-bogo-prompt {
    background: #fef3c7;
    border: 1px solid #fcd34d;
    color: #92400e;
}

/* Add-to-cart button inside notices & cards */
.woob2b-bogo-add-btn {
    display: inline-block;
    background: #059669 !important;
    color: #fff !important;
    border: none !important;
    padding: 6px 16px !important;
    border-radius: 4px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    cursor: pointer;
    text-decoration: none !important;
    white-space: nowrap;
    line-height: 1.4 !important;
    transition: background 0.15s;
}
.woob2b-bogo-add-btn:hover {
    background: #047857 !important;
    color: #fff !important;
}


/* ==========================================================================
   2. BOGO CART BADGES
   ========================================================================== */

.woob2b-bogo-free-badge {
    display: inline-block;
    background: #059669;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-left: 6px;
    vertical-align: middle;
}

.woob2b-bogo-discount-badge {
    display: inline-block;
    background: #f59e0b;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    margin-left: 6px;
    vertical-align: middle;
}


/* ==========================================================================
   3. PRODUCT PAGE -- DISCOUNT MESSAGE
   ========================================================================== */

.woob2b-discount-info {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 6px;
    padding: 10px 14px;
    margin: 12px 0;
    font-size: 14px;
    line-height: 1.5;
    color: #166534;
}
.woob2b-discount-info p {
    margin: 0 0 4px;
}
.woob2b-discount-info p:last-child {
    margin-bottom: 0;
}
.woob2b-discount-info small {
    display: block;
    font-size: 12px;
    color: #15803d;
    margin-top: 2px;
}


/* ==========================================================================
   4. PRODUCT PAGE -- QUANTITY PRICING TABLE
   ========================================================================== */

.woob2b-quantity-table {
    margin: 16px 0;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.woob2b-quantity-table__title {
    background: #f3f4f6;
    margin: 0;
    padding: 10px 14px;
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    border-bottom: 1px solid #e5e7eb;
}

.woob2b-quantity-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.woob2b-quantity-table thead th {
    background: #f9fafb;
    padding: 8px 14px;
    text-align: left;
    font-weight: 600;
    color: #374151;
    border-bottom: 2px solid #e5e7eb;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.woob2b-quantity-table tbody td {
    padding: 8px 14px;
    border-bottom: 1px solid #f3f4f6;
    color: #1f2937;
}

.woob2b-quantity-table tbody tr:last-child td {
    border-bottom: none;
}

.woob2b-quantity-table tbody tr:hover {
    background: #f0fdf4;
}

/* Highlight active tier (added via JS or manually) */
.woob2b-quantity-table tbody tr.woob2b-tier-active {
    background: #ecfdf5;
    font-weight: 600;
}

.woob2b-quantity-table__message {
    padding: 8px 14px;
    margin: 0;
    font-size: 12px;
    color: #6b7280;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}


/* ==========================================================================
   5. PRODUCT PAGE -- BOGO SAME-PRODUCT OFFER
   ========================================================================== */

.woob2b-bogo-same-offer {
    background: #fef3c7;
    border-color: #fcd34d;
    color: #92400e;
}
.woob2b-bogo-same-offer p {
    font-weight: 600;
    font-size: 15px;
    color: #78350f;
}
.woob2b-bogo-same-offer small {
    color: #92400e;
}
.woob2b-bogo-custom-msg {
    font-weight: 400;
    font-size: 13px;
}


/* ==========================================================================
   6. PRODUCT PAGE -- BOGO CROSS-PRODUCT OFFER CARD
   ========================================================================== */

.woob2b-bogo-offer-card {
    margin: 16px 0;
    border: 2px solid #a7f3d0;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}

.woob2b-bogo-offer-card__header {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    padding: 12px 16px;
    border-bottom: 1px solid #a7f3d0;
}

.woob2b-bogo-offer-badge {
    font-size: 15px;
    font-weight: 700;
    color: #065f46;
}

.woob2b-bogo-offer-card__products {
    padding: 16px;
}

.woob2b-bogo-get-product {
    display: flex;
    gap: 14px;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #f3f4f6;
}
.woob2b-bogo-get-product:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.woob2b-bogo-get-product__image {
    flex: 0 0 80px;
    display: block;
}
.woob2b-bogo-get-product__image img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
}

.woob2b-bogo-get-product__info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.woob2b-bogo-get-product__name {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    text-decoration: none;
}
.woob2b-bogo-get-product__name:hover {
    color: #059669;
    text-decoration: underline;
}

.woob2b-bogo-get-product__price {
    font-size: 14px;
    color: #374151;
}
.woob2b-bogo-get-product__price del {
    color: #9ca3af;
    font-size: 13px;
}
.woob2b-bogo-get-product__price strong {
    color: #059669;
    font-size: 15px;
}

.woob2b-bogo-get-product__info .woob2b-bogo-add-btn {
    align-self: flex-start;
    margin-top: 4px;
}

.woob2b-bogo-offer-card__message {
    padding: 8px 16px;
    margin: 0;
    font-size: 13px;
    color: #6b7280;
    border-top: 1px solid #f3f4f6;
}

.woob2b-bogo-offer-card__recursive {
    display: block;
    padding: 6px 16px 10px;
    font-size: 12px;
    color: #6b7280;
}


/* ==========================================================================
   7. DISMISSIBLE NOTICE BUTTON
   ========================================================================== */

.woob2b-discount-notice {
    position: relative;
}

.woob2b-notice-dismiss {
    position: absolute;
    top: 8px;
    right: 10px;
    background: none;
    border: none;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    color: currentColor;
    opacity: 0.5;
    padding: 0 4px;
    transition: opacity 0.15s;
    flex-shrink: 0;
    margin-left: auto;
}
.woob2b-notice-dismiss:hover {
    opacity: 1;
}


/* ==========================================================================
   8. RESPONSIVE
   ========================================================================== */

@media (max-width: 768px) {

    .woob2b-discount-notice {
        flex-direction: column;
        align-items: flex-start;
    }

    .woob2b-bogo-add-btn {
        width: 100%;
        text-align: center;
        padding: 10px 16px !important;
    }

    .woob2b-bogo-get-product {
        flex-direction: column;
        align-items: flex-start;
    }

    .woob2b-bogo-get-product__image {
        flex: 0 0 auto;
    }

    .woob2b-bogo-get-product__info .woob2b-bogo-add-btn {
        align-self: stretch;
    }

    .woob2b-quantity-table table {
        font-size: 12px;
    }

    .woob2b-quantity-table thead th,
    .woob2b-quantity-table tbody td {
        padding: 6px 10px;
    }
}
