/* Shop example sticky-cart (docs/shop-examples.md): the bar at the bottom of the screen — image, name and price on the left,
 * the buttons on the right; below 922px no image, below 545px the buttons only (as the live Astra bar). On a phone the
 * site's bottom bar lifts it above itself (assets/css/site/mobile-nav.css). */
.myco-sticky-cart {
	position: fixed;
	z-index: var(--myco-z-header);
	inset-inline: 0;
	inset-block-end: 0;
	padding: 10px var(--myco-space-md) calc(10px + env(safe-area-inset-bottom));
	background: var(--myco-color-bg);
	box-shadow: 0 -1px 10px rgba(0, 0, 0, 0.1), 0 -1px 9px rgba(0, 0, 0, 0.06);
}

.myco-sticky-cart[hidden],
html.cookie-consent-pending .myco-sticky-cart {
	display: none;
}

/* No bar on a short screen (a phone turned sideways). */
@media (max-height: 36em) {
	.myco-sticky-cart {
		display: none;
	}
}

.myco-sticky-cart__inner {
	display: flex;
	gap: var(--myco-space-sm) var(--myco-space-md);
	align-items: center;
	max-width: var(--myco-container);
	margin-inline: auto;
}

.myco-sticky-cart__image {
	flex: 0 0 auto;
	width: 50px;
	height: 50px;
	object-fit: cover;
}

.myco-sticky-cart__title {
	flex: 1 1 10rem;
	min-width: 0;
	margin: 0;
	overflow: hidden;
	color: var(--myco-color-primary);
	font-family: var(--casetti-font-heading, inherit);
	font-weight: 500;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.myco-sticky-cart .price {
	flex: 0 0 auto;
	color: var(--myco-color-primary);
	font-weight: 700;
}

.myco-sticky-cart .price del {
	opacity: 0.45;
	font-weight: 400;
}

.myco-sticky-cart .price ins {
	text-decoration: none;
}

.myco-sticky-cart__actions {
	display: flex;
	flex: 1 1 auto;
	gap: 8px;
	min-width: 230px;
	max-width: 420px;
	margin-left: auto;
}

.myco-sticky-cart__actions .button {
	flex: 1 1 50%;
	white-space: nowrap;
}

@media (max-width: 921px) {
	.myco-sticky-cart__image {
		display: none;
	}
}

@media (max-width: 544px) {
	.myco-sticky-cart__title,
	.myco-sticky-cart .price {
		display: none;
	}

	.myco-sticky-cart__actions {
		max-width: none;
		min-width: 0;
		width: 100%;
	}
}

/* WCAG 2.4.11: a focused element is never hidden under the bar, and the end of the page scrolls above it (the cookie banner's way). */
html:not(.cookie-consent-pending):has(.myco-sticky-cart:not([hidden])) {
	scroll-padding-bottom: var(--myco-sticky-cart-height, 0px);
}

html:not(.cookie-consent-pending):has(.myco-sticky-cart:not([hidden])) body {
	padding-bottom: var(--myco-sticky-cart-height, 0px);
}

