/**
 * Cart and Mini-Cart to quote button styles, scoped to the add-on's own
 * wpdevart-raqp-cart classes (theme and WooCommerce elements are never
 * restyled). The button itself carries the free quote buttons' classes
 * ("button wp-element-button" or the text link style), so it takes the
 * theme's button look; these rules only place it.
 *
 * @package WPDEVART_RAQP
 */

.wpdevart-raqp-cart {
	box-sizing: border-box;
	margin-top: 1em;
}
.wpdevart-raqp-cart[hidden] {
	display: none !important;
}

/* Classic cart: always under "Proceed to checkout", also where the theme
   floats that button. */
.wpdevart-raqp-cart.wpdevart-raqp-cart--cart {
	clear: both;
}
.wpdevart-raqp-cart__form {
	margin: 0;
	padding: 0;
	border: 0;
}

/* Classic cart (under "Proceed to checkout"), Mini-Cart block footer and
   Cart block totals column: as wide as the checkout button above it (the
   script sets a min-height when the theme's checkout button is taller). */
.wpdevart-raqp-cart--cart .wpdevart-raqp-cart__button:not(.wpdevart-raq-btn--link),
.wpdevart-raqp-cart--mini_block .wpdevart-raqp-cart__button:not(.wpdevart-raq-btn--link),
.wpdevart-raqp-cart--in-totals .wpdevart-raqp-cart__button:not(.wpdevart-raq-btn--link) {
	display: flex;
	box-sizing: border-box;
	align-items: center;
	justify-content: center;
	width: 100%;
}

/* Cart block without the script (or before the cart has rendered): after
   the whole block, at the end of the line (the start side in right-to-left
   languages). */
.wpdevart-raqp-cart--block .wpdevart-raqp-cart__form {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
}

/* Cart block, moved by the script into the totals column right under
   "Proceed to Checkout" (spaced like that button). */
.wpdevart-raqp-cart--block.wpdevart-raqp-cart--in-totals {
	margin-block: 0 16px;
}
.wpdevart-raqp-cart--block.wpdevart-raqp-cart--in-totals .wpdevart-raqp-cart__form {
	align-items: stretch;
}
.wpdevart-raqp-cart--block.wpdevart-raqp-cart--in-totals .wpdevart-raqp-cart__message {
	text-align: start;
}

/* Classic cart and Cart block whose theme shows a compact checkout button
   (the script compares the widths and sets a min-width): a compact button
   on the same side. */
.wpdevart-raqp-cart.wpdevart-raqp-cart--compact .wpdevart-raqp-cart__form {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
}
.wpdevart-raqp-cart.wpdevart-raqp-cart--compact[data-wpdevart-raqp-align="end"] .wpdevart-raqp-cart__form {
	align-items: flex-end;
}
.wpdevart-raqp-cart.wpdevart-raqp-cart--compact[data-wpdevart-raqp-align="center"] .wpdevart-raqp-cart__form {
	align-items: center;
}
.wpdevart-raqp-cart.wpdevart-raqp-cart--compact .wpdevart-raqp-cart__button:not(.wpdevart-raq-btn--link) {
	display: inline-flex;
	width: auto;
	max-width: 100%;
}
.wpdevart-raqp-cart.wpdevart-raqp-cart--compact[data-wpdevart-raqp-align="end"] .wpdevart-raqp-cart__message {
	text-align: end;
}

/* Mini-Cart block drawer: a full-width row of its own under "View cart" and
   "Go to checkout". WooCommerce lays the footer actions out as one flex row
   (a column on narrow screens) that does not wrap; it wraps only while it
   holds this button, which takes the whole next line, so the drawer's own
   buttons keep their size and place. */
.wc-block-mini-cart__footer-actions:has(> .wpdevart-raqp-cart--mini_block) {
	flex-wrap: wrap;
}
.wc-block-mini-cart__footer-actions > .wpdevart-raqp-cart--mini_block {
	order: 1;
	flex: 1 0 100%;
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
	margin-top: 0;
}
/* The button fills that row like the drawer's own buttons, also where the
   theme's WooCommerce styles give every submit button of WooCommerce pages a
   margin and inline-block display (Twenty Twenty-Three: ".woocommerce
   button[type=submit]:not(…)"); the script gives it the vertical padding of
   "Go to checkout" when it would be taller. */
.wc-block-mini-cart__footer-actions > .wpdevart-raqp-cart--mini_block .wpdevart-raq-btn.wpdevart-raqp-cart__button:not(.wpdevart-raq-btn--link) {
	display: flex;
	margin: 0;
}

/* Classic mini-cart widget (sidebar widgets and the header cart popups of
   classic themes): the buttons row was made for the theme's two buttons;
   this one takes a full-width row of its own under them (the row may wrap
   only while it holds this button), so the theme's buttons keep their size
   in every theme. It goes last in the flex order, after the row's clearfix
   ::after (WooCommerce's .buttons::before/::after are flex items), so the
   first line keeps the theme's own spacing of its buttons (justify-content:
   space-between keeps both pseudo-elements on it). In a row that is not a
   flex box (inline or floated buttons) it is a block of its own that clears
   them. */
.woocommerce-mini-cart__buttons:has(> .wpdevart-raqp-cart__button) {
	flex-wrap: wrap;
}
.woocommerce-mini-cart__buttons > .wpdevart-raq-btn.wpdevart-raqp-cart__button.wpdevart-raqp-cart__button--mini_cart {
	display: flex;
	order: 1;
	flex: 1 0 100%;
	align-items: center;
	justify-content: center;
	clear: both;
	float: none;
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
	min-width: 0;
	margin-block: 0.5em 5px;
	margin-inline: 0;
	text-align: center;
	white-space: normal;
}
.woocommerce-mini-cart__buttons > .wpdevart-raqp-cart__login {
	display: inline-block;
	margin-block: 0.5em 0;
}

/* Messages (live region). */
.wpdevart-raqp-cart__message {
	display: block;
	margin-top: 0.5em;
	font-size: 0.875em;
	line-height: 1.4;
}
.wpdevart-raqp-cart__message:empty {
	display: none;
}
.wpdevart-raqp-cart--block .wpdevart-raqp-cart__message {
	text-align: end;
}

/* Block editor preview. */
.wpdevart-raqp-cart--editor .wpdevart-raqp-cart__note {
	display: block;
	margin-top: 0.5em;
	font-size: 12px;
	opacity: 0.75;
}
