/*
 * Crazy Runners — product page: delivery and payment lines of the purchase information block,
 * purchase bar of phones. Loaded after style.css and woocommerce.css, on product pages only.
 * The block itself (.crs-pickup…) is styled in woocommerce.css.
 */

/* Delivery and payment: same rows as the shop's address, set apart by a hairline. */
.crs-buyinfo .crs-pickup__item + .crs-buyinfo__item {
	margin-top: 6px;
	padding-top: 6px;
	border-top: 1px solid var(--crs-border);
}

.crs-buyinfo .crs-buyinfo__item + .crs-buyinfo__item {
	margin-top: 0;
	padding-top: 0;
	border-top: 0;
}

.crs-buyinfo__item .crs-pickup__text {
	padding: 6px 0;
}

.crs-buyinfo__price {
	font-weight: 700;
	white-space: nowrap;
}

.crs-buyinfo__detail {
	color: var(--crs-muted);
}

.crs-buyinfo__detail .amount {
	white-space: nowrap;
}

/* Purchase bar: phones only, shown by product.js once the add-to-cart form is out of view. */
.crs-buybar,
.crs-buybar[hidden] {
	display: none;
}

@media (max-width: 699.98px) {
	.crs-buybar {
		position: fixed;
		right: 0;
		bottom: 0;
		left: 0;
		z-index: 90;
		display: block;
		visibility: hidden;
		padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
		border-top: 1px solid var(--crs-border);
		background: var(--crs-bg);
		box-shadow: 0 -6px 20px rgba(31, 35, 40, .06);
		transform: translateY(100%);
	}

	.crs-buybar[hidden] {
		display: none;
	}

	.crs-buybar.is-visible {
		visibility: visible;
		transform: none;
	}

	.crs-buybar__inner {
		display: flex;
		align-items: center;
		gap: 12px;
		max-width: var(--crs-container);
		margin: 0 auto;
	}

	.crs-buybar__info {
		display: flex;
		flex: 1 1 0;
		flex-direction: column;
		min-width: 0;
		margin: 0;
		font-size: .9375rem;
		line-height: 1.3;
	}

	.crs-buybar__name {
		overflow: hidden;
		font-weight: 700;
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	.crs-buybar__price {
		overflow: hidden;
		color: var(--crs-muted);
		text-overflow: ellipsis;
		white-space: nowrap;
	}

	.crs-buybar__price del {
		margin-right: 6px;
	}

	.crs-buybar__price ins {
		color: var(--crs-text);
		font-weight: 700;
		text-decoration: none;
	}

	.crs-buybar__action {
		flex: none;
		max-width: 60%;
		padding-right: 18px;
		padding-left: 18px;
		font-size: .9375rem;
	}

	/* Room for the bar under the page's last lines while it is shown (height measured by product.js). */
	body.crs-buybar-on {
		padding-bottom: var(--crs-buybar-height, 76px);
	}

	/* What keyboard focus brings into view stops above the bar, only while it is shown (the height stays set). */
	html:has(body.crs-buybar-on) {
		scroll-padding-bottom: var(--crs-buybar-height, 76px);
	}
}

@media (max-width: 699.98px) and (prefers-reduced-motion: no-preference) {
	.crs-buybar {
		transition: transform .2s ease, visibility 0s linear .2s;
	}

	.crs-buybar.is-visible {
		transition: transform .2s ease;
	}
}

@media print {
	.crs-buybar {
		display: none;
	}
}
