/* =============================================================
   STICKY-CART — Kadence sticky/mobile add-to-cart bar
   Sources: Customizer CSS L1468-1538;
            New rules replacing deleted inject_stock_badge_script (Part 2 Bug 1)
   ============================================================= */

/* ==================== DUPLICATE STOCK BADGE SUPPRESSOR ==================== */

/* Hides the standard WC p.stock paragraph inside Kadence's ATC wrapper —
   deliver_time_calc renders Badge A (shortcode) above the form instead.
   Replaces the deleted inject_stock_badge_script() JS (Part 2 Bug 1 fix). */
.kwt-add-to-cart-wrap p.stock {
    display: none !important;
}

/* ==================== KADENCE PRO — PEWC IN STICKY BAR ==================== */

/* Prevent PEWC add-on fields from rendering inside the sticky bar
   (Bug 3 CSS fallback — hooks.php edit not possible on paid plugin) */
.kb-sticky-container .pewc-product-extra-groups-wrap,
.kb-sticky-container .pewc-total-field-wrapper {
    display: none !important;
}

/* ==================== MOBILE STICKY ADD-TO-CART ==================== */

@media (max-width: 767px) {

    /* Hide non-essentials in sticky bar */
    #kadence-mobile-sticky-add-to-cart .kadence-sticky-add-to-cart-title-wrap,
    #kadence-mobile-sticky-add-to-cart .quantity {
        display: none !important;
    }

    /* Container */
    #kadence-mobile-sticky-add-to-cart {
        padding: 10px 15px !important;
        background: var(--global-palette9) !important;
        box-shadow: 0 -4px 15px rgba(0,0,0,0.08) !important;
    }

    #kadence-mobile-sticky-add-to-cart .kadence-sticky-add-to-cart-content {
        height: auto !important;
        padding: 0 !important;
        width: 100% !important;
    }

    /* Price + button row */
    #kadence-mobile-sticky-add-to-cart .kadence-sticky-add-to-cart-action-wrap {
        width: 100% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 15px !important;
    }

    /* Price (left) — fixed corrupted white-space property */
    #kadence-mobile-sticky-add-to-cart .kadence-sticky-add-to-cart-action-price {
        font-size: 1.1rem !important;
        font-weight: 800 !important;
        color: var(--global-palette3) !important;
        white-space: nowrap !important;
        margin: 0 !important;
    }

    /* Form override — keep on one line */
    #kadence-mobile-sticky-add-to-cart form.cart {
        margin: 0 !important;
        width: auto !important;
        flex-grow: 1 !important;
        display: flex !important;
        flex-wrap: nowrap !important;
        justify-content: flex-end !important;
    }

    /* Button (right) */
    #kadence-mobile-sticky-add-to-cart button.single_add_to_cart_button {
        width: 100% !important;
        height: 48px !important;
        margin: 0 !important;
        border-radius: 8px !important;
        font-size: 15px !important;
        font-weight: 600 !important;
        padding: 0 20px !important;
        background-color: var(--global-palette4) !important;
        color: var(--global-palette9) !important;
    }
}
