/**
 * Header mini-cart dropdown.
 *
 * Styles the shared dropdown shell used by both the Arà Shop cart
 * (`.ara-mini-cart-body`) and the WooCommerce widget (`.widget_shopping_cart_content`),
 * so the header looks the same whichever backend is active.
 * Loaded by `inc/shop-bridge.php` whenever the header cart is shown.
 */

.ara-cart-dropdown .dropdown-menu.ara-mini-cart {
	min-width: 320px;
	max-width: 92vw;
}

/* Arà Shop mini-cart body. */
.ara-mini-cart-items {
	max-height: 50vh;
	overflow-y: auto;
}

.ara-mini-cart-items > li + li {
	border-top: 1px solid var(--ara-border-color, rgba(0, 0, 0, 0.075));
}

.ara-mini-cart-items img {
	width: 48px;
	height: 48px;
	flex: 0 0 auto;
	object-fit: cover;
	border-radius: 0.375rem;
}

/* Allow the name to truncate inside the flex row. */
.ara-mini-cart-items .flex-grow-1 {
	min-width: 0;
}

.ara-add-to-cart.is-added {
	pointer-events: none;
}

/* Cart page: keep the summary in view while scrolling the items (desktop only). */
@media ( min-width: 992px ) {
	.ara-cart-summary {
		position: sticky;
		top: 1rem;
	}
}

/* Quote wizard step indicator (Cart -> Your details -> Request sent). */
.ara-steps {
	gap: 0.5rem;
}

.ara-step {
	display: flex;
	flex: 1 1 0;
	min-width: 0;
	align-items: center;
	gap: 0.5rem;
	color: var( --ara-secondary-color, #6c757d );
	font-size: 0.875rem;
}

.ara-step:not( :last-child )::after {
	content: "";
	flex: 1 1 auto;
	height: 2px;
	margin-left: 0.5rem;
	background: var( --ara-border-color, rgba( 0, 0, 0, 0.15 ) );
}

.ara-step__num {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 2rem;
	height: 2rem;
	border: 2px solid var( --ara-border-color, rgba( 0, 0, 0, 0.15 ) );
	border-radius: 50%;
	font-weight: 600;
	line-height: 1;
}

.ara-step__label {
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}

/* Completed steps are links back to their page. */
.ara-step__link {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	min-width: 0;
	color: inherit;
	text-decoration: none;
}

.ara-step__link:hover .ara-step__label,
.ara-step__link:focus .ara-step__label {
	text-decoration: underline;
}

.ara-step--active {
	color: var( --ara-primary, #0d6efd );
	font-weight: 600;
}

.ara-step--active .ara-step__num {
	border-color: var( --ara-primary, #0d6efd );
	color: var( --ara-primary, #0d6efd );
}

.ara-step--done {
	color: var( --ara-primary, #0d6efd );
}

.ara-step--done .ara-step__num {
	border-color: var( --ara-primary, #0d6efd );
	background: var( --ara-primary, #0d6efd );
	color: #fff;
}

@media ( max-width: 575.98px ) {
	.ara-step__label {
		display: none;
	}
}

/* Transient error toast (shown by the cart JS when an action fails). */
.ara-cart-toast {
	position: fixed;
	z-index: 1080;
	right: 1rem;
	bottom: 1rem;
	max-width: 22rem;
	margin: 0;
}

/* WooCommerce widget cart rendered inside the shared dropdown shell. */
.ara-mini-cart .widget_shopping_cart_content .cart_list {
	max-height: 50vh;
	margin: 0;
	padding: 0.25rem;
	overflow-y: auto;
	list-style: none;
}

.ara-mini-cart .widget_shopping_cart_content .total {
	padding: 0.5rem 1rem;
	border-top: 1px solid var(--ara-border-color, rgba(0, 0, 0, 0.075));
}

.ara-mini-cart .widget_shopping_cart_content .buttons {
	display: grid;
	gap: 0.5rem;
	padding: 0.75rem;
	margin: 0;
}

.ara-mini-cart .widget_shopping_cart_content .buttons .button {
	display: inline-block;
	text-align: center;
}
