/*
 * Product page on phones: bar with name, price and "In den Warenkorb" at the bottom (src/StickyCart.php,
 * js/sticky-cart.js). Fixed and moved with transform only, so it never shifts the page. Below the header (z-index 100),
 * the menus and popups, the slide-in cart and the cookie box; lifted above the Brotguide bar by --jo-stc-lift.
 */

.jo-stc {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 95;
	box-sizing: border-box;
	padding: 8px 16px calc(8px + env(safe-area-inset-bottom, 0px));
	background: #fff;
	border-top: 1px solid rgba(25, 25, 25, 0.12);
	box-shadow: 0 -4px 16px rgba(25, 25, 25, 0.08);
	color: #191919;
	font-family: "Open Sans", sans-serif;
	visibility: hidden;
	transform: translateY(calc(100% + 24px));
	transition: transform 220ms ease-out, visibility 0s linear 220ms;
}

.jo-stc.is-shown {
	visibility: visible;
	transform: translateY(calc(-1 * var(--jo-stc-lift, 0px)));
	transition: transform 220ms ease-out, visibility 0s;
}

/* slide-in cart or cookie box open: out of the way at once */
body.slideActive .jo-stc,
body:has(#BorlabsCookieBox > div.show-cookie-box) .jo-stc {
	visibility: hidden;
	transform: translateY(calc(100% + 24px));
	transition: none;
}

@media (prefers-reduced-motion: reduce) {
	.jo-stc,
	.jo-stc.is-shown {
		transition: none;
	}
}

@media (min-width: 834px) {
	.jo-stc {
		display: none !important;
	}
}

.jo-stc__inner {
	display: flex;
	align-items: center;
	gap: 12px;
	max-width: 640px;
	margin: 0 auto;
}

.jo-stc__info {
	flex: 1 1 auto;
	min-width: 0;
}

.jo-stc .jo-stc__name {
	margin: 0;
	overflow: hidden;
	font-size: 13px;
	font-weight: 600;
	line-height: 18px;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.jo-stc .jo-stc__price {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	column-gap: 6px;
	margin: 2px 0 0;
	font-size: 15px;
	font-weight: 700;
	line-height: 20px;
}

.jo-stc__amount {
	white-space: nowrap;
}

.jo-stc__note {
	color: #5f564c;
	font-size: 11px;
	font-weight: 400;
	line-height: 14px;
}

.jo-stc .jo-stc__button {
	flex: 0 0 auto;
	min-height: 44px;
	margin: 0;
	padding: 0 16px;
	border: 0;
	border-radius: 6px;
	background: #191919;
	color: #fff;
	font-family: "Open Sans", sans-serif;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.2;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

.jo-stc .jo-stc__button:focus-visible {
	outline: 2px solid #191919;
	outline-offset: 2px;
}

/* size choice after a tap on the bar while no size is chosen */
.jo-stc-attention {
	border-radius: 6px;
	box-shadow: 0 0 0 3px rgba(25, 25, 25, 0.35);
	transition: box-shadow 400ms ease-out;
}

@media (prefers-reduced-motion: reduce) {
	.jo-stc-attention {
		transition: none;
	}
}
