/**
 * Toegevoegd-aan-winkelwagen popup.
 *
 * Knoppen hergebruiken de bestaande .btn / .btn.b van het thema, dus die
 * krijgen hier alleen een breedte mee. Alleen de schil is nieuw.
 */

#pwh-atc-overlay {
	position: fixed;
	inset: 0;
	/*
	 * Hoger dan alles wat hier al vast op het scherm hangt:
	 * .site-header.has-topheader = 99991, TranslatePress-switcher = 99999,
	 * Chatra = 9999. Zonder dit prikt de header door de overlay heen.
	 */
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	background: rgba(0, 0, 0, .5);
	overflow-y: auto;
}

#pwh-atc-overlay[hidden] {
	display: none;
}

#pwh-atc-popup {
	position: relative;
	width: 100%;
	max-width: 520px;
	max-height: calc(100vh - 40px);
	overflow-y: auto;
	padding: 28px 24px 24px;
	border-radius: 16px;
	background: #fff;
	box-shadow: 0 12px 40px rgba(0, 0, 0, .25);
}

#pwh-atc-popup .pwh-atc-sluit {
	position: absolute;
	top: 10px;
	right: 12px;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	background: none;
	font-size: 26px;
	line-height: 1;
	color: #6b6b6b;
	cursor: pointer;
}

#pwh-atc-popup .pwh-atc-melding {
	margin: 0 0 20px;
	padding: 14px 16px;
	border-radius: 8px;
	background: #eefbe4;
	color: #2f6b12;
	font-weight: 600;
}

#pwh-atc-popup .pwh-atc-product {
	display: flex;
	align-items: center;
	gap: 16px;
	padding-bottom: 20px;
	border-bottom: 1px solid #e7e3d8;
}

#pwh-atc-popup .pwh-atc-foto img {
	display: block;
	width: 90px;
	height: auto;
	border-radius: 8px;
}

#pwh-atc-popup .pwh-atc-naam {
	margin: 0 0 4px;
	font-weight: 600;
	color: #000;
}

#pwh-atc-popup .pwh-atc-prijs {
	margin: 0;
	font-size: 18px;
	font-weight: 700;
	color: #61da06;
}

#pwh-atc-popup .pwh-atc-prijs-incl {
	margin: 2px 0 0;
	font-size: 14px;
	/* zelfde grijs als .price-incl-tax op de productpagina */
	color: #989898;
}

#pwh-atc-popup .pwh-atc-prijs del {
	font-size: 14px;
	font-weight: 400;
	color: #989898;
}

#pwh-atc-popup .pwh-atc-acties {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 20px 0 0;
}

#pwh-atc-popup .pwh-atc-acties .btn {
	flex: 1 1 auto;
	text-align: center;
	white-space: nowrap;
}

#pwh-atc-popup .pwh-atc-upsells {
	margin-top: 24px;
	padding-top: 20px;
	border-top: 1px solid #e7e3d8;
}

#pwh-atc-popup .pwh-atc-upsells-titel {
	margin: 0 0 14px;
	font-weight: 600;
	color: #000;
}

#pwh-atc-popup .pwh-atc-upsells ul {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 14px;
	margin: 0;
	padding: 0;
	list-style: none;
}

#pwh-atc-popup .pwh-atc-upsells a {
	display: block;
	text-decoration: none;
	color: #000;
}

#pwh-atc-popup .pwh-atc-upsells img {
	display: block;
	width: 100%;
	height: auto;
	margin-bottom: 8px;
	border-radius: 8px;
}

#pwh-atc-popup .pwh-atc-upsell-naam {
	display: block;
	font-size: 13px;
	line-height: 1.3;
	margin-bottom: 4px;
}

#pwh-atc-popup .pwh-atc-upsell-prijs {
	display: block;
	font-size: 14px;
	font-weight: 700;
	color: #61da06;
}

#pwh-atc-popup .pwh-atc-upsell-incl {
	margin: 1px 0 0;
	font-size: 12px;
	/* zelfde grijs als .price-incl-tax op de productpagina */
	color: #989898;
}

/* Achtergrond niet mee laten scrollen zolang de popup open staat. */
body.pwh-atc-open {
	overflow: hidden;
}

/*
 * Alles wat vast onderaan het scherm hangt, verbergen zolang de popup open staat.
 * De TranslatePress-switcher heeft z-index 99999 en Chatra 9999; die zouden anders
 * dwars door de overlay heen prikken. Een hogere z-index kiezen lost het niet echt
 * op: dan staan ze er nog steeds, alleen onzichtbaar in de weg.
 */
body.pwh-atc-open #pwh-sticky-atc,
body.pwh-atc-open #chatra,
body.pwh-atc-open .trp-floating-switcher {
	display: none !important;
}

@media (max-width: 768px) {

	#pwh-atc-overlay {
		/* Ruimte rondom, zodat de popup niet tegen de schermrand plakt. */
		padding: 14px;
		padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
	}

	#pwh-atc-popup {
		max-width: none;
		max-height: calc(100vh - 28px - env(safe-area-inset-bottom, 0px));
		padding: 24px 16px 16px;
	}

	#pwh-atc-popup .pwh-atc-acties {
		flex-direction: column;
	}

	#pwh-atc-popup .pwh-atc-acties .btn {
		width: 100%;
	}

	#pwh-atc-popup .pwh-atc-upsells ul {
		grid-template-columns: repeat(2, 1fr);
	}
}
