/**
 * Sticky add-to-cart balk (productpagina).
 *
 * Wordt altijd in de HTML gerenderd en hier met een media-query verborgen.
 * Server-side op wp_is_mobile() gaan zitten kan niet: Varnish varieert niet op
 * user-agent, dus de eerste bezoeker van een pagina bepaalt wat iedereen krijgt.
 */

#pwh-sticky-atc {
	display: none;
}

@media (max-width: 768px) {

	#pwh-sticky-atc {
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 9998;
		display: flex;
		align-items: center;
		gap: 10px;
		padding: 9px 12px calc(9px + env(safe-area-inset-bottom, 0px));
		background: #fff;
		border-top: 1px solid #e7e3d8;
		box-shadow: 0 -4px 16px rgba(0, 0, 0, .10);
		transform: translateY(115%);
		transition: transform .22s ease-out;
	}

	#pwh-sticky-atc.is-visible {
		transform: translateY(0);
	}

	#pwh-sticky-atc .pwh-info {
		flex: 1 1 auto;
		min-width: 0;
	}

	#pwh-sticky-atc .pwh-titel {
		margin: 0 0 1px;
		font-size: 11px;
		line-height: 1.2;
		color: #000;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}

	#pwh-sticky-atc .pwh-excl {
		font-size: 18px;
		font-weight: 700;
		line-height: 1.1;
		/* zelfde groen als de hoofdprijs op de pagina (.price-display) */
		color: #61da06;
	}

	#pwh-sticky-atc .pwh-incl {
		display: block;
		font-size: 10px;
		line-height: 1.2;
		color: #000;
	}

	#pwh-sticky-atc .pwh-qty {
		flex: 0 0 auto;
		display: flex;
		align-items: center;
		height: 44px;
		border: 1px solid #d9d5c9;
		border-radius: 6px;
		overflow: hidden;
	}

	#pwh-sticky-atc .pwh-qty button {
		width: 32px;
		height: 44px;
		padding: 0;
		border: 0;
		background: #f4f2ec;
		font-size: 18px;
		line-height: 1;
		color: #333;
		cursor: pointer;
	}

	#pwh-sticky-atc .pwh-qty button:active {
		background: #e7e3d8;
	}

	#pwh-sticky-atc .pwh-qty input {
		width: 38px;
		height: 44px;
		border: 0;
		background: #fff;
		text-align: center;
		font-size: 15px;
		font-weight: 600;
		-moz-appearance: textfield;
	}

	#pwh-sticky-atc .pwh-qty input::-webkit-outer-spin-button,
	#pwh-sticky-atc .pwh-qty input::-webkit-inner-spin-button {
		-webkit-appearance: none;
		margin: 0;
	}

	#pwh-sticky-atc .pwh-knop {
		flex: 0 0 auto;
		display: flex;
		align-items: center;
		justify-content: center;
		width: 52px;
		height: 44px;
		padding: 0;
		border: 0;
		border-radius: 6px;
		background: #61da06;
		cursor: pointer;
	}

	#pwh-sticky-atc .pwh-knop img {
		width: 22px;
		height: 22px;
		filter: brightness(0) invert(1);
	}

	#pwh-sticky-atc .pwh-knop:active {
		filter: brightness(.94);
	}

	/* Chatwidget en taalkiezer staan ook onderaan vast; die moeten bereikbaar blijven. */
	body.pwh-bar-open #chatra.chatra--webkit,
	body.pwh-bar-open .trp-floating-switcher {
		bottom: 74px !important;
		transition: bottom .22s ease-out;
	}

	.pwh-maat-flash {
		outline: 3px solid #61da06 !important;
		outline-offset: 3px;
	}
}
