/* HRW Inpakvoorkeur: popup en keuzeblok, in de huisstijl van hetrotterdamswarenhuis.nl */

.hrw-ip-overlay,
.hrw-ip-block {
	--hrw-ip-green: var(--color-primary, #02922b);
	--hrw-ip-green-soft: var(--color-secondary, #d9efdf);
	--hrw-ip-green-tint: #f1f9f3;
	--hrw-ip-grey: var(--color-quaternary, #e8eceb);
	--hrw-ip-line: #d4d4d4;
	--hrw-ip-dot-line: var(--color-quinary, #adadad);
	--hrw-ip-ink: var(--color-dark, #000);
	--hrw-ip-paper: var(--color-light, #fff);
	--hrw-ip-error: #b3261e;
	--hrw-ip-error-tint: #fdf1f0;
	font-family: 'Poppins', system-ui, sans-serif;
	color: var(--hrw-ip-ink);
	box-sizing: border-box;
}

.hrw-ip-overlay *,
.hrw-ip-block * {
	box-sizing: border-box;
}

html.hrw-ip-lock {
	overflow: hidden;
}

/* ---------- popup ---------- */

.hrw-ip-overlay {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: rgba(0, 0, 0, 0.45);
}

.hrw-ip-overlay[hidden] {
	display: none;
}

.hrw-ip-dialog {
	position: relative;
	width: 100%;
	max-width: 540px;
	max-height: calc(100vh - 32px);
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	gap: 18px;
	padding: 34px 34px 22px;
	background: var(--hrw-ip-paper);
	border-radius: 8px;
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

.hrw-ip-grab {
	display: none;
	width: 40px;
	height: 4px;
	border-radius: 2px;
	background: var(--hrw-ip-line);
	align-self: center;
}

.hrw-ip-close {
	position: absolute;
	top: 10px;
	right: 10px;
	width: 44px;
	height: 44px;
	display: grid;
	place-items: center;
	padding: 0;
	border: 0;
	background: none;
	color: var(--hrw-ip-ink);
	cursor: pointer;
}

.hrw-ip-head {
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding-right: 40px;
}

.hrw-ip-icon {
	width: 48px;
	height: 48px;
	flex-shrink: 0;
	display: grid;
	place-items: center;
	border-radius: 50%;
	background: var(--hrw-ip-green-soft);
	color: var(--hrw-ip-green);
}

.hrw-ip-title {
	margin: 0;
	font-family: 'Battambang', Georgia, serif;
	font-size: 30px;
	font-weight: 700;
	line-height: 1.2;
	text-wrap: balance;
	color: var(--hrw-ip-ink);
}

.hrw-ip-desc {
	margin: 0;
	font-size: 14px;
	line-height: 1.7;
}

.hrw-ip-actions {
	display: flex;
	gap: 12px;
}

.hrw-ip-btn {
	flex: 1;
	height: 48px;
	padding: 0 20px;
	border: 1px solid var(--hrw-ip-green);
	border-radius: 4px;
	background: var(--hrw-ip-green);
	color: #fff;
	font: inherit;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
}

.hrw-ip-btn:hover {
	background: var(--hrw-ip-ink);
	border-color: var(--hrw-ip-ink);
}

.hrw-ip-btn--secondary {
	background: var(--hrw-ip-paper);
	border-color: var(--hrw-ip-ink);
	color: var(--hrw-ip-ink);
	font-weight: 500;
}

.hrw-ip-btn--secondary:hover {
	color: #fff;
}

.hrw-ip-btn.is-off,
.hrw-ip-btn.is-off:hover {
	background: var(--hrw-ip-grey);
	border-color: var(--hrw-ip-grey);
	color: #6b6b6b;
	cursor: not-allowed;
}

.hrw-ip-later {
	align-self: center;
	min-height: 36px;
	padding: 0 8px;
	border: 0;
	background: none;
	color: #555;
	font: inherit;
	font-size: 12px;
	text-decoration: underline;
	cursor: pointer;
}

.hrw-ip-close:focus-visible,
.hrw-ip-btn:focus-visible,
.hrw-ip-later:focus-visible {
	outline: 3px solid var(--hrw-ip-green);
	outline-offset: 2px;
}

/* ---------- keuzekaarten (popup en blok) ---------- */

.hrw-ip-choices {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.hrw-ip-choice {
	position: relative;
	display: flex;
	align-items: flex-start;
	gap: 14px;
	margin: 0;
	padding: 16px 18px;
	border: 2px solid var(--hrw-ip-line);
	border-radius: 6px;
	background: var(--hrw-ip-paper);
	cursor: pointer;
}

.hrw-ip-choice:hover {
	border-color: var(--hrw-ip-ink);
}

.hrw-ip-choice.is-on {
	border-color: var(--hrw-ip-green);
	background: var(--hrw-ip-green-tint);
}

.hrw-ip-choice input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
	margin: 0;
}

.hrw-ip-choice:focus-within {
	outline: 3px solid var(--hrw-ip-green);
	outline-offset: 2px;
}

.hrw-ip-dot {
	position: relative;
	width: 24px;
	height: 24px;
	flex-shrink: 0;
	margin-top: 1px;
	border: 2px solid var(--hrw-ip-dot-line);
	border-radius: 50%;
}

.hrw-ip-choice.is-on .hrw-ip-dot {
	border-color: var(--hrw-ip-green);
	background: var(--hrw-ip-green);
}

.hrw-ip-choice.is-on .hrw-ip-dot::after {
	content: '';
	position: absolute;
	left: 6px;
	top: 2px;
	width: 6px;
	height: 11px;
	border: solid #fff;
	border-width: 0 3px 3px 0;
	transform: rotate(45deg);
}

.hrw-ip-text {
	display: flex;
	flex-direction: column;
	gap: 3px;
	font-size: 13px;
	line-height: 1.45;
	color: #444;
}

.hrw-ip-text strong {
	font-size: 15px;
	font-weight: 600;
	color: var(--hrw-ip-ink);
}

/* Disclaimer onder de keuzes: zichtbaar, maar rustig. */
.hrw-ip-note {
	margin: 0;
	color: #555;
	font-size: 12px;
	line-height: 1.5;
}

.hrw-ip-block.hrw-ip-block .hrw-ip-note {
	margin: 0;
}

.hrw-ip-error {
	margin: 0;
	color: var(--hrw-ip-error);
	font-size: 13px;
	font-weight: 500;
	line-height: 1.5;
}

.hrw-ip-error[hidden] {
	display: none;
}

/* ---------- blok in winkelmand en afrekenen ---------- */

/*
 * In de winkelmand staat het blok in het besteloverzicht, dat in het thema een
 * eigen (groene) achtergrond heeft. Het blok zelf is daarom doorzichtig en lijnt uit met de
 * rest van het overzicht; alleen de keuzekaarten zijn wit. De dubbele class
 * wint van de algemene label- en alinea-stijlen van thema en WooCommerce.
 */
.hrw-ip-block.hrw-ip-block {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin: 16px 0;
	padding: 16px 0 0;
	border: 0;
	border-top: 1px solid rgba(0, 0, 0, 0.12);
	border-radius: 0;
	background: transparent;
}

/* In de winkelmand; bij het afrekenen volgt de kop de stijl van de stappen. */
.hrw-ip-block.hrw-ip-block:not(.hrw-ip-block--main) .hrw-ip-block__title {
	margin: 0;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.4;
}

.hrw-ip-block.hrw-ip-block .hrw-ip-block__intro {
	margin: 0;
	font-size: 13px;
	line-height: 1.5;
}

.hrw-ip-block.hrw-ip-block .hrw-ip-choices {
	gap: 8px;
	margin: 0;
}

.hrw-ip-block.hrw-ip-block .hrw-ip-choice {
	margin: 0;
	padding: 12px 14px;
	border-color: transparent;
	background: var(--hrw-ip-paper);
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.hrw-ip-block.hrw-ip-block .hrw-ip-choice:hover {
	border-color: var(--hrw-ip-ink);
}

.hrw-ip-block.hrw-ip-block .hrw-ip-choice.is-on {
	border-color: var(--hrw-ip-green);
	background: var(--hrw-ip-paper);
	box-shadow: none;
}

.hrw-ip-block.hrw-ip-block .hrw-ip-text strong {
	font-size: 14px;
}

.hrw-ip-block.hrw-ip-block.is-error .hrw-ip-choice:not(.is-on) {
	border-color: var(--hrw-ip-error);
	box-shadow: none;
}

.hrw-ip-block.hrw-ip-block .hrw-ip-error {
	margin: 0;
}

/*
 * Bij het afrekenen staat het blok in de hoofdkolom, boven de algemene
 * voorwaarden. De kop krijgt daar de stijl van de andere stappen
 * (Contactgegevens enz.); de keuzes staan naast elkaar, even hoog.
 */
.hrw-ip-slot {
	margin: 0 0 24px;
}

/* Geen cadeaupakket én ander artikel: geen lege ruimte. */
.hrw-ip-slot:empty {
	display: none;
}

.hrw-ip-block.hrw-ip-block.hrw-ip-block--main {
	margin: 0;
	padding: 0;
	border-top: 0;
}

.hrw-ip-block.hrw-ip-block--main .hrw-ip-block__title.wc-block-components-title {
	margin: 0;
}

.hrw-ip-block.hrw-ip-block--main .hrw-ip-choices {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
}

@media (max-width: 600px) {
	.hrw-ip-block.hrw-ip-block--main .hrw-ip-choices {
		grid-template-columns: 1fr;
	}
}

/* ---------- mobiel: paneel van onderen ---------- */

@media (max-width: 640px) {
	.hrw-ip-overlay {
		align-items: flex-end;
		padding: 0;
	}

	.hrw-ip-dialog {
		max-width: none;
		max-height: 92vh;
		gap: 14px;
		padding: 10px 16px calc(20px + env(safe-area-inset-bottom, 0px));
		border-radius: 16px 16px 0 0;
	}

	.hrw-ip-grab {
		display: block;
	}

	.hrw-ip-head {
		flex-direction: row;
		align-items: center;
	}

	.hrw-ip-icon {
		width: 40px;
		height: 40px;
	}

	.hrw-ip-title {
		font-size: 24px;
	}

	.hrw-ip-actions {
		flex-direction: column-reverse;
		gap: 10px;
	}

	.hrw-ip-btn {
		width: 100%;
		flex: none;
	}
}

@media (prefers-reduced-motion: no-preference) {
	.hrw-ip-dialog {
		animation: hrw-ip-rise 0.22s ease-out;
	}

	@keyframes hrw-ip-rise {
		from {
			transform: translateY(16px);
			opacity: 0.4;
		}
		to {
			transform: none;
			opacity: 1;
		}
	}
}
