/* Front-end button. Deliberately minimal - it reuses the theme's own .button styling so it
   looks native on every site, and only adds the spacing WooCommerce's hooks do not provide. */

.basket-quote-wrap {
    margin-top: 12px;
    text-align: center;
}

.basket-quote-wrap .basket-quote-button {
    display: inline-block;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
}

.basket-quote-hint {
    margin: 8px 0 0 0;
    font-size: 0.8em;
    line-height: 1.4;
    opacity: 0.75;
}

/* Mini cart / flyout. Space is tight and the checkout button is directly above, so this reads as
   the quieter secondary action: full width to line up with it, but outlined rather than filled,
   and without the explanatory line. Colours are inherited so it follows the theme's own button. */
.basket-quote-wrap--mini {
    margin-top: 8px;
}

.basket-quote-wrap--mini .basket-quote-button {
    background: transparent;
    border: 1px solid currentColor;
    opacity: 0.85;
    font-size: 0.9em;
    padding-top: 0.6em;
    padding-bottom: 0.6em;
}

/* Full width, so it lines up with the checkout button directly above it.
 *
 * This needs its own rule because Breakdance styles mini cart buttons through
 * `.bde-mini-cart-offcanvas .button` - three classes, which out-specifies the two-class rule
 * above, so a plain `width: 100%` there loses and the button shrinks to fit its label.
 *
 * The selector below is (0,3,1): this plugin's two classes, the element name, and the `button`
 * class that is already on our own anchor. That beats Breakdance without `!important` and,
 * because every part of it is on this one element, it cannot match any other button on the site.
 *
 * --bde-button-width is Breakdance's own mechanism - its button atom resolves
 * `width: var(--bde-button-width)` - so setting it here makes the button full width the way the
 * builder would, rather than overriding it. Custom properties inherit, but this one is set on the
 * anchor itself, so it goes no further than the button's own text. */
.basket-quote-wrap--mini a.basket-quote-button.button {
    --bde-button-width: 100%;
    width: 100%;
    box-sizing: border-box;
}

.basket-quote-wrap--mini .basket-quote-button:hover,
.basket-quote-wrap--mini .basket-quote-button:focus {
    opacity: 1;
}

.basket-quote-wrap--mini .basket-quote-hint {
    display: none;
}

/* In the basket actions row the button sits beside "Update basket", so it should not stretch. */
.woocommerce-cart-form__contents .basket-quote-wrap,
.actions .basket-quote-wrap {
    display: inline-block;
    margin-top: 0;
    text-align: left;
}

.woocommerce-cart-form__contents .basket-quote-wrap .basket-quote-button,
.actions .basket-quote-wrap .basket-quote-button {
    width: auto;
}

.woocommerce-cart-form__contents .basket-quote-hint,
.actions .basket-quote-hint {
    display: none;
}
