/* Buyamto phone bottom edge (see inc/buyamto-bottom-ui.php). --by-bottom-bar = height of the Add to Cart bar while it shows. */
@media (max-width: 849px) {
	/* Chat button: at the bottom; rises only while the Add to Cart bar is showing. */
	html .bchat-root:not(.is-open),
	html .bchat-root.bchat-onproduct:not(.is-open) { bottom: calc(var(--bchat-y, 20px) + var(--by-bottom-bar, 0px)); transition: bottom .2s ease; }

	/* Sale pop-up: no fixed lift on product pages; it waits while the Add to Cart bar is up. */
	html .bpulse.bpulse--product,
	html .bpulse.bpulse--product.bpulse--above-chat { bottom: var(--bp-y); }
	html.by-bar-up .bpulse { visibility: hidden; }

	/* Back-to-top arrow sits where the chat button is; phones scroll up easily, so it steps aside. */
	html.by-has-chat #top-link { display: none !important; }

	/* Slim, one-row Add to Cart bar. */
	.sticky-add-to-cart--active { padding: 8px 12px calc(8px + env(safe-area-inset-bottom)) !important; }
	.sticky-add-to-cart--active .sticky-add-to-cart__product { display: flex; align-items: center; gap: 8px; width: 100%; max-width: none !important; padding: 0; margin: 0; }
	.sticky-add-to-cart--active .sticky-add-to-cart-img { flex: none; width: 42px; height: 42px; margin: 0 !important; border-radius: 12px; object-fit: cover; }
	.sticky-add-to-cart--active form.cart { display: flex !important; flex: 1 1 auto; width: 100% !important; flex-wrap: nowrap; align-items: center; gap: 6px; min-width: 0; margin: 0 !important; padding: 0; width: auto; }
	.sticky-add-to-cart--active form.cart .quantity { flex: none; margin: 0 !important; height: 42px; display: inline-flex; align-items: center; }
	.sticky-add-to-cart--active form.cart .quantity .button { min-height: 42px; height: 42px; padding: 0 9px !important; margin: 0; font-size: 15px; }
	.sticky-add-to-cart--active form.cart .quantity input.qty { width: 30px; min-height: 42px; height: 42px; padding: 0; font-size: 15px; }
	.sticky-add-to-cart--active form.cart > .button { flex: 1 1 0; min-width: 0; min-height: 42px; height: 42px; margin: 0 !important; padding: 0 8px; font-size: 13.5px; line-height: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
@media (max-width: 600px) {
	html .bpulse.bpulse--m-bar,
	html .bpulse.bpulse--m-bar.bpulse--product { bottom: calc(10px + env(safe-area-inset-bottom)); }
	/* Leave room for the chat button on the right instead of sliding under it. */
	html.by-has-chat .bpulse.bpulse--m-bar { right: 84px; }
}
@media (max-width: 480px) {
	.sticky-add-to-cart--active .sticky-add-to-cart-img { display: none; }
}
@media (max-width: 600px) {
	/* Long product names: two lines at most, so the pop-up stays small. */
	html .bpulse.bpulse--m-bar .bpulse__text { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
}
