/*
 * «Монтаж» blocks in the shop (design 1e): product page offer, checkout
 * checkbox, thank-you note. Loaded on product pages with the flag and on
 * checkout only (inc/install.php). The catalogue badge lives in
 * product-card.css with the other card badges.
 */

:root {
	--ef-install-ink: var(--wp--preset--color--contrast, #111);
	--ef-install-muted: var(--wp--preset--color--contrast-subtle, #555);
	--ef-install-line: var(--wp--preset--color--border, #e5e5e5);
	--ef-install-soft: var(--wp--preset--color--base-soft, #f8f8f8);
	--ef-install-success: #3f7a47;
}

/* --- Product page ------------------------------------------------------- */

.ef-pinst {
	margin-top: var(--wp--preset--spacing--4, 16px);
	padding: 12px 14px;
	border-radius: var(--wp--custom--radius--lg, 12px);
	background: var(--ef-install-soft);
	color: var(--ef-install-ink);
	font-size: 14px;
	line-height: 1.4;
}

.ef-pinst p {
	margin: 0;
}

.ef-pinst__head {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 44px;
}

.ef-pinst__icon {
	display: flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 10px;
	background: var(--ef-install-ink);
	color: #fff;
}

.ef-pinst__icon .ef-inst-icon {
	width: 20px;
	height: 20px;
}

.ef-pinst__title {
	display: inline;
	font-weight: 700;
}

.ef-pinst__tag {
	display: inline-block;
	padding: 1px 8px;
	border-radius: 999px;
	background: var(--ef-install-ink);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	white-space: nowrap;
	vertical-align: 1px;
}

.ef-pinst__desc {
	display: inline;
	color: var(--ef-install-muted);
}

.ef-pinst__desc-full,
.ef-pinst__link--side {
	display: none;
}

.ef-pinst__link {
	color: var(--ef-install-ink);
	font-weight: 700;
	text-decoration: none;
}

.ef-pinst__link:hover {
	text-decoration: underline;
}

.ef-pinst__check {
	position: relative;
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 44px;
	font-weight: 600;
	cursor: pointer;
}

.ef-pinst__check input,
.ef-cinst__label input {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: 0;
	opacity: 0;
}

.ef-pinst__box,
.ef-cinst__box {
	display: flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	border: 2px solid var(--ef-install-ink);
	border-radius: 6px;
	background: #fff;
	color: transparent;
}

.ef-pinst__box .ef-inst-icon,
.ef-cinst__box .ef-inst-icon {
	width: 16px;
	height: 16px;
	stroke-width: 2.5;
}

.ef-pinst__check input:checked + .ef-pinst__box,
.ef-cinst__label input:checked + .ef-cinst__box {
	background: var(--ef-install-ink);
	color: #fff;
}

.ef-pinst__check input:focus-visible + .ef-pinst__box,
.ef-cinst__label input:focus-visible + .ef-cinst__box {
	outline: 2px solid var(--ef-install-ink);
	outline-offset: 3px;
}

.ef-pinst__hint {
	padding-left: 34px;
	font-size: 13px;
	color: var(--ef-install-muted);
}

.ef-pinst__hint[hidden] {
	display: none;
}

/* Desktop: the extended card with a separator above the checkbox. */
@media (min-width: 1024px) {
	.ef-pinst {
		padding: 20px 20px 8px;
		border: 1px solid var(--ef-install-line);
	}

	.ef-pinst__head {
		display: grid;
		grid-template-columns: 48px 1fr auto;
		gap: 16px;
	}

	.ef-pinst__icon {
		width: 48px;
		height: 48px;
		border-radius: 12px;
	}

	.ef-pinst__icon .ef-inst-icon {
		width: 24px;
		height: 24px;
	}

	.ef-pinst__title {
		display: flex;
		align-items: center;
		gap: 8px;
		font-size: 17px;
	}

	.ef-pinst__desc {
		display: block;
		margin-top: 2px;
		line-height: 1.45;
	}

	.ef-pinst__desc-full {
		display: inline;
	}

	.ef-pinst__desc-short,
	.ef-pinst__link--inline {
		display: none;
	}

	.ef-pinst__link--side {
		display: inline-flex;
		align-items: center;
		min-height: 44px;
		white-space: nowrap;
	}

	.ef-pinst__check {
		gap: 12px;
		min-height: 52px;
		margin-top: 8px;
		border-top: 1px solid var(--ef-install-line);
		font-size: 15px;
	}

	.ef-pinst__hint {
		padding: 0 0 12px 36px;
	}
}

/* --- Checkout ------------------------------------------------------------ */

.ef-cinst {
	margin-top: var(--wp--preset--spacing--5, 20px);
	padding: 14px 16px;
	border: 1px solid var(--ef-install-ink);
	border-radius: var(--wp--custom--radius--lg, 12px);
	background: var(--ef-install-soft);
}

.ef-cinst p {
	margin: 0;
}

.ef-cinst__label {
	position: relative;
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 44px;
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
}

.ef-cinst__note {
	margin: 2px 0 0 36px !important;
	font-size: 13px;
	line-height: 1.5;
	color: var(--ef-install-muted);
}

.ef-cinst__note-off {
	display: none;
	font-weight: 600;
}

.ef-cinst.is-unavailable {
	border-color: var(--ef-install-line);
}

.ef-cinst.is-unavailable .ef-cinst__label {
	color: #6b6b6b;
	cursor: not-allowed;
}

.ef-cinst.is-unavailable .ef-cinst__box {
	border-color: #c9c9c9;
	background: #ededed;
	color: transparent !important;
}

.ef-cinst.is-unavailable .ef-cinst__note-on {
	display: none;
}

.ef-cinst.is-unavailable .ef-cinst__note-off {
	display: inline;
}

/* --- Thank-you page ------------------------------------------------------ */

.ef-tinst {
	display: grid;
	grid-template-columns: 44px 1fr;
	gap: 14px;
	align-items: start;
	max-width: 1160px; /* = .ef-thanks__facts / __grid */
	margin: var(--wp--preset--spacing--6, 24px) 0;
	padding: 16px;
	border: 1px solid var(--ef-install-line);
	border-radius: var(--wp--custom--radius--lg, 12px);
	background: var(--ef-install-soft);
	color: var(--ef-install-ink);
}

.ef-tinst p {
	margin: 0;
}

.ef-tinst__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 12px;
	background: var(--ef-install-ink);
	color: #fff;
}

.ef-tinst__title {
	font-weight: 700;
}

.ef-tinst__text {
	margin: 2px 0 10px !important;
	font-size: 14px;
	line-height: 1.5;
	color: var(--ef-install-muted);
}

.ef-tinst__link {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	color: var(--ef-install-ink);
	font-size: 14px;
	font-weight: 700;
}

.ef-inst-icon {
	flex: none;
}
