/* Buy Now Button Block — frontend styles. */

.wp-block-buy-now-button {
    display: block;
    margin: 1.5em 0;
    text-align: left;
}

.wp-block-buy-now-button.aligncenter {
    text-align: center;
}
.wp-block-buy-now-button.alignright {
    text-align: right;
}
.wp-block-buy-now-button.alignwide,
.wp-block-buy-now-button.alignfull {
    text-align: center;
}

/* The button itself — <a> tag with WC core classes + our styling. */
a.bnb-button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5em;
    padding: 0.75em 1.75em;
    border-radius: 999px; /* fully rounded (pill shape) */
    font-size: 1em;
    font-weight: 600;
    line-height: 1.4;
    text-decoration: none;
    cursor: pointer;
    border: 2px solid #F3A227; /* default border per brand spec */
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.1s ease, opacity 0.2s ease;
    -webkit-user-select: none;
    user-select: none;
}

a.bnb-button-link:active {
    transform: translateY(1px);
}

/* WC core adds `.loading` and `.added` classes during/after AJAX — style them. */
a.bnb-button-link.loading {
    opacity: 0.75;
    pointer-events: none;
}
a.bnb-button-link.loading .bnb-button-spinner {
    display: inline-block;
}

a.bnb-button-link.added .bnb-button-text::after {
    content: " ✓";
    margin-left: 0.25em;
}

/* Sizes. */
a.bnb-button-link.bnb-size-small {
    padding: 0.45em 1.4em;
    font-size: 0.875em;
}
a.bnb-button-link.bnb-size-large {
    padding: 1em 2.2em;
    font-size: 1.15em;
}

/* Style: primary — white bg, orange border (vivobite brand). */
a.bnb-button-link.bnb-style-primary {
    background: #ffffff;
    color: #F3A227;
    border: 2px solid #F3A227;
}
a.bnb-button-link.bnb-style-primary:hover,
a.bnb-button-link.bnb-style-primary:focus {
    background: #F3A227;
    color: #ffffff;
    border-color: #F3A227;
}

/* Style: secondary (blue). */
a.bnb-button-link.bnb-style-secondary {
    background: #2271b1;
    color: #fff;
    border-color: #2271b1;
}
a.bnb-button-link.bnb-style-secondary:hover,
a.bnb-button-link.bnb-style-secondary:focus {
    background: #135e96;
    border-color: #135e96;
    color: #fff;
}

/* Style: outline. */
a.bnb-button-link.bnb-style-outline {
    background: transparent;
    color: #d63638;
    border-color: #d63638;
}
a.bnb-button-link.bnb-style-outline:hover,
a.bnb-button-link.bnb-style-outline:focus {
    background: #d63638;
    color: #fff;
}

/* Style: dark. */
a.bnb-button-link.bnb-style-dark {
    background: #1d2327;
    color: #fff;
    border-color: #1d2327;
}
a.bnb-button-link.bnb-style-dark:hover,
a.bnb-button-link.bnb-style-dark:focus {
    background: #2c3338;
    border-color: #2c3338;
    color: #fff;
}

/* Spinner. */
.bnb-button-spinner {
    display: none;
    width: 1em;
    height: 1em;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: bnb-spin 0.6s linear infinite;
}

@keyframes bnb-spin {
    to { transform: rotate(360deg); }
}

/* Placeholder shown when no product selected. */
.bnb-placeholder {
    padding: 1.25em;
    text-align: center;
    background: #f7f7f7;
    border: 1px dashed #c3c4c7;
    border-radius: 4px;
    color: #666;
    font-size: 0.95em;
}

/* ------------------------------------------------------------------ *
 * Hide "Xem giỏ hàng" (View cart) button inside the Mini-Cart drawer.
 * Backup for the JS-based hiding — works even if JS is delayed or fails.
 * Targets WC Blocks selectors.
 * ------------------------------------------------------------------ */
.wc-block-mini-cart__footer-cart,
.wp-block-woocommerce-mini-cart-cart-button-block,
.bnb-view-cart-hidden {
    display: none !important;
}
.wp-block-buy-now-button .added_to_cart.wc-forward { display: none }
.wp-block-buy-now-button.btn-submit {padding: 0;}