/**
 * BST cart page — cart.php + cart-empty.php (enqueued in CLMS_CartPage.php, cart page only).
 * Only what Tailwind utilities can't express: keyframes, grid-rows accordion,
 * spin-button reset, toasts, and markup generated by WooCommerce / Subscriptions.
 */

/* Hide the "Select more courses" notice from CLMS_Woo (no flash before JS runs) */
.continue-course-wrapper {
    display: none !important;
}

@keyframes bstSpin {
    to {
        transform: rotate(360deg);
    }
}

.bst-spin {
    animation: bstSpin 0.75s linear infinite;
}

.bst-qty-input::-webkit-inner-spin-button,
.bst-qty-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
}

.bst-cart-row.bst-updating {
    opacity: 0.45;
    pointer-events: none;
    transition: opacity 0.15s;
}

#bst-toast-container {
    position: fixed;
    bottom: 1.5rem;
    right: 1.25rem;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    max-width: 340px;
    pointer-events: none;
}

.bst-toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    background: #fff;
    border: 1px solid #e6eaf3;
    border-radius: 12px;
    padding: 0.875rem 1rem;
    box-shadow: 0 8px 24px -4px rgba(21, 35, 64, 0.15);
    font-size: 13.5px;
    font-weight: 600;
    color: #152340;
    animation: bstToastIn 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    transition: opacity 0.3s, transform 0.3s;
}

.bst-toast.bst-toast-out {
    opacity: 0;
    transform: translateX(12px);
}

.bst-toast-icon {
    flex-shrink: 0;
    margin-top: 1px;
}

.bst-toast-success .bst-toast-icon {
    color: #0f9d67;
}

.bst-toast-error .bst-toast-icon {
    color: #cf5757;
}

.bst-toast-notice .bst-toast-icon {
    color: #1c3f6e;
}

.bst-coupon-panel {
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.3s ease;
}

.bst-coupon-panel.is-open {
    grid-template-rows: 1fr;
}

.bst-coupon-panel-inner {
    overflow: hidden;
    min-height: 0;
}

.bst-coupon-chevron {
    transition: transform 0.3s ease;
}

.bst-coupon-toggle[aria-expanded="true"] .bst-coupon-chevron {
    transform: rotate(180deg);
}

.bst-coupon-toggle:focus-visible {
    outline: 2px solid #1c3f6e;
    outline-offset: 3px;
    border-radius: 4px;
}

@keyframes bstToastIn {
    from {
        opacity: 0;
        transform: translateX(12px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Summary rows rendered by PHP/AJAX — hidden when there is nothing to show */
#bst-summary-lines:empty,
#bst-recurring:empty {
    display: none;
}

/* WooCommerce "(includes £x VAT)" and Subscriptions "First renewal: …" under totals */
#bst-total .includes_tax,
.bst-recurring-amount .includes_tax,
.bst-recurring-amount .first-payment-date {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #8892a8;
}

#bst-summary-lines small {
    font-size: 11px;
    color: #8892a8;
}

/* Express payment buttons (Apple Pay / Google Pay / PayPal …) */
.bst-express-checkout:empty {
    display: none;
}