/* UX15+: sticky/fixed header (logo+phone+burger), mobile burger drawer, scroll-top.
   BB-104: calc 2×2 (.header__calc) is static in flow — no hide-on-scroll.
   BB-107: mobile .header-chrome always position:fixed (+ spacer / padding). */

:root {
	--header-h: 0px;
	--clr-main: #74bb17;
}

html {
	scroll-behavior: smooth;
	scroll-padding-top: calc(var(--header-h) + 12px);
}

/* House calc width/length: room for values like 10,3 (was 60–109px).
   !important: page CSS (e.g. blochnye-doma-*.css) loads after head extras. */
.calculator__input {
	width: 170px !important;
	min-width: 170px !important;
	max-width: 170px !important;
	box-sizing: border-box;
	padding: 0 10px;
}
/* LF: заказчик — ширина полей 140px */
.lf-calc .calculator__input {
	width: 140px !important;
	min-width: 140px !important;
	max-width: 140px !important;
}

/* Header shell keeps makeup header-bg; sticky applies to .header-chrome only. */
.bg-header {
	position: relative;
	width: 100%;
}
.header-chrome {
	position: relative;
	top: auto;
	z-index: 400;
	width: 100%;
	transition: box-shadow 0.2s ease;
}
.header-chrome.is-scrolled {
	box-shadow: none;
}
/* Mobile sticky scrolled: solid bar so content does not show through */
@media (max-width: 992px) {
	.header-chrome.is-scrolled {
		background-color: #fff;
		box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
	}
}

/* BB-104: calc strip stays in normal flow (no collapse/expand) */
.header__calc {
	overflow: visible;
	max-height: none;
	opacity: 1;
}

/* Spacer only for mobile fixed fallback */
.bg-header-spacer {
	display: none;
	width: 100%;
	pointer-events: none;
}

/*
 * BB-113: .mod-px gutters — border-box so content-box + padding cannot
 * overflow and get clipped by html/body overflow-x:clip (belstroi-qa).
 * Fallbacks keep clamp valid if --max-width / --mod-px-value are missing.
 */
.mod-px {
	box-sizing: border-box;
	padding-left: clamp(
		1rem,
		calc((var(--mod-px-value, 40) / var(--max-width, 1366)) * 100vw),
		calc(var(--mod-px-value, 40) / 16 * 1rem)
	);
	padding-right: clamp(
		1rem,
		calc((var(--mod-px-value, 40) / var(--max-width, 1366)) * 100vw),
		calc(var(--mod-px-value, 40) / 16 * 1rem)
	);
}

/* Desktop: never pin header chrome (avoids jump) */
@media (min-width: 993px) {
	.header-chrome,
	body.is-header-fixed .header-chrome {
		position: relative !important;
		left: auto;
		right: auto;
	}
	body.is-header-fixed .bg-header-spacer {
		display: none !important;
		height: 0 !important;
	}
	/*
	 * BB-113: BB-104 split .header__top and .header__calc into separate
	 * wrappers, so makeup .header { row-gap: calc(var(--gap)/2) } no longer
	 * applies between nav and green CTA. Restore on desktop only — do not
	 * touch mobile fixed .header-chrome (BB-107).
	 */
	.header-chrome + .container {
		margin-top: calc(var(--gap, 40px) / 2);
	}
}

/* Scroll to top — lime / black, site style */
.scroll-top {
	position: fixed;
	right: max(12px, var(--gutter, 16px));
	bottom: max(16px, env(safe-area-inset-bottom, 0px) + 16px);
	z-index: 450;
	width: 48px;
	height: 48px;
	padding: 0;
	border: none;
	border-radius: 14px;
	background: var(--clr-main, #74bb17);
	color: #fff;
	cursor: pointer;
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease, background 0.15s ease;
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
}
.scroll-top.is-visible {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}
.scroll-top:hover {
	background: #5c9a12;
}
.scroll-top:focus-visible {
	outline: 2px solid #111;
	outline-offset: 3px;
}
.scroll-top__icon {
	display: block;
	width: 22px;
	height: 22px;
	margin: 0 auto;
}
@media (max-width: 992px) {
	.scroll-top {
		width: 44px;
		height: 44px;
		bottom: max(72px, env(safe-area-inset-bottom, 0px) + 72px); /* above cookie / fixed CTAs */
	}
}

/* Burger — mobile always; desktop only when scrolled (fixed top-right) */
.nav-burger {
	display: none;
	align-items: center;
	justify-content: center;
	flex-direction: column;
	gap: 4.5px;
	width: 40px; /* 44 × 0.9 */
	height: 40px;
	padding: 0;
	border: none;
	border-radius: 11px;
	background: var(--clr-main, #74bb17);
	cursor: pointer;
	justify-self: end;
	flex-shrink: 0;
	box-shadow: none;
}
.nav-burger__bar {
	display: block;
	width: 18px;
	height: 2px;
	background: #fff;
	border-radius: 1px;
	transition: transform 0.2s ease, opacity 0.2s ease;
}
body.is-drawer-open .nav-burger__bar:nth-child(1) {
	transform: translateY(6.5px) rotate(45deg);
}
body.is-drawer-open .nav-burger__bar:nth-child(2) {
	opacity: 0;
}
body.is-drawer-open .nav-burger__bar:nth-child(3) {
	transform: translateY(-6.5px) rotate(-45deg);
}
.nav-burger:focus-visible {
	outline: 2px solid #111;
	outline-offset: 3px;
}

/* Off-canvas drawer — always transform slide (never display:none snap on mobile) */
.site-drawer-backdrop {
	position: fixed;
	inset: 0;
	z-index: 480;
	background: rgba(0, 0, 0, 0.45);
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition:
		opacity 0.28s ease,
		visibility 0.28s ease;
}
body.is-drawer-open .site-drawer-backdrop {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}
.site-drawer {
	position: fixed;
	top: 0;
	left: auto;
	right: 0;
	z-index: 490;
	width: min(320px, 88vw);
	height: 100%;
	height: 100dvh;
	padding: 72px 20px 24px;
	box-sizing: border-box;
	background: #fff;
	box-shadow: -8px 0 28px rgba(0, 0, 0, 0.18);
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	/* Closed off-canvas right; open slides right → left; close reverses */
	transform: translate3d(105%, 0, 0);
	transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1) !important;
	will-change: transform;
	backface-visibility: hidden;
}
body.is-drawer-open .site-drawer {
	transform: translate3d(0, 0, 0);
}
.site-drawer__close {
	position: absolute;
	top: 16px;
	right: 16px;
	width: 38px;
	height: 38px;
	border: none;
	border-radius: 12px;
	color: white;
	background: var(--clr-main);
	font-size: 22px;
	line-height: 1;
	padding-top: 2px;
	cursor: pointer;
}
.site-drawer .main-nav {
	display: flex !important;
	flex-direction: column;
	gap: 14px;
	width: 100%;
	padding: 0;
	margin: 0 0 20px;
	order: 0;
	grid-column: auto;
}
.site-drawer .main-nav__item a {
	font-size: 22px !important;
	letter-spacing: 0;
}
.site-drawer .main-nav__item span {
	font-size: 12px;
}
.site-drawer .second-nav {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	flex-wrap: nowrap;
	gap: 8px;
	width: 100%;
}
.site-drawer .second-nav__item,
.site-drawer .dropdown-label {
	font-size: 16px;
}
.site-drawer .second-nav .dropdown {
	display: block;
	position: relative;
}
/* One outline only on the outer dropdown; kill nested pill border */
.site-drawer .second-nav__item--dropdown {
	border: 1px solid #111;
	border-radius: 14px;
	padding: 8px 10px;
	overflow: hidden;
}
.site-drawer .second-nav__item--dropdown > .dropdown-label {
	display: block;
	border: none !important;
	border-radius: 0;
	padding: 0;
	cursor: pointer;
}
.site-drawer .second-nav .submenu,
.site-drawer .second-nav .submenu.second-nav__submenu,
.site-drawer .second-nav .second-nav__submenu {
	position: static;
	display: none;
	min-width: 0;
	width: 100%;
	box-shadow: none !important;
	border: none !important;
	border-radius: 0;
	padding: 8px 0 4px 8px;
	background: transparent;
	list-style: none;
	margin: 0;
}
.site-drawer .second-nav .dropdown:hover .submenu {
	display: none; /* mobile: checkbox only */
}
/* Sibling submenu (Фундамент / Строительство домов) + nested legacy wrap */
.site-drawer .second-nav .dropdown-toggle:checked ~ .submenu,
.site-drawer .second-nav .dropdown-toggle:checked ~ .submenu.second-nav__submenu,
.site-drawer .second-nav .dropdown-toggle:checked ~ .submenu .second-nav__submenu {
	display: block;
}
.site-drawer .second-nav .submenu li + li {
	margin-top: 6px;
}

/* Drawer contacts: phone (tel:) + messengers (cloned from header) */
.site-drawer__contacts {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 6px;
	margin: 0 0 18px;
	padding: 0 0 14px;
	border-bottom: 1px solid rgba(0, 0, 0, 0.08);
	transform: none !important;
	justify-self: start;
	grid-column: auto;
}
.site-drawer__contacts .contact-phone__number {
	display: flex !important;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 12px;
	font-size: 18px !important;
	white-space: normal !important;
	line-height: 1.2;
}
.site-drawer__contacts .contact-phone__number > a[href^="tel"] {
	margin-left: 0 !important;
	font-weight: 700;
	color: #111;
	text-decoration: none;
}
.site-drawer__contacts .contact-phone__link {
	display: inline-flex;
	flex-shrink: 0;
}
.site-drawer__contacts .contact-phone__icon {
	height: 1.6em;
	width: auto;
	min-width: 1.6em;
}
.site-drawer__contacts .contact-phone__status {
	display: block !important;
	margin-top: 10px;
}

/* BB-71: «Сейчас работаем» ближе к номеру (макет Олега) */
.header .contact-phone__status,
.contact-phone .contact-phone__status {
	margin-top: 6px;
}

/* BB-65: ленточный калькулятор — как на макете (инпуты 140px + карточка справа) */
.lf-calc.calculator {
	border-top-left-radius: 30px;
	border-bottom-right-radius: 30px;
}
.lf-calc .calculator__form.lf-calc__grid {
	display: grid !important;
	grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.95fr);
	gap: 28px 40px;
	align-items: center;
	padding: 7% 8% 6% 8%;
	box-sizing: border-box;
}
.lf-calc__label {
	display: grid !important;
	grid-template-columns: minmax(0, 1fr) 140px;
	align-items: center;
	column-gap: 1rem;
}
.lf-calc__cost {
	height: auto;
	padding: 28px 30px;
	background: #fff;
	border-top-left-radius: 20px;
	border-bottom-right-radius: 20px;
	box-sizing: border-box;
}
.lf-calc__result-row {
	padding: 12px 0;
	flex-wrap: nowrap;
}
.lf-calc__result-row--total {
	/* Single separator only: page CSS already draws border-bottom on the previous row */
	padding-top: 16px;
	margin-top: 0;
	border-top: none;
	border-bottom: none;
	color: var(--clr-main, #74bb17);
}
@media (max-width: 890px) {
	.lf-calc .calculator__form.lf-calc__grid {
		grid-template-columns: 1fr;
		padding: 8% 8% 8%;
	}
}

/* Open-hours: off → no green pulse (JS toggles .is-closed on .--pulse-status) */
.--pulse-status.is-closed {
	color: #6b7280;
}
.--pulse-status.is-closed::before {
	background-color: #9ca3af;
	box-shadow: none;
	animation: none;
}

/*
 * Desktop second-nav: ONE pill outline only.
 * Page CSS (rascenki-*.css etc.) re-applies border on .second-nav__item--dropdown
 * after belstroi-ux — force parent border off; keep outline on the label only.
 */
.second-nav__item--dropdown,
.header__bottom .second-nav__item--dropdown,
.second-nav .second-nav__item--dropdown {
	border: none !important;
	box-shadow: none;
}
.second-nav__item--dropdown > .dropdown-label,
.header__bottom .second-nav__item--dropdown > .dropdown-label {
	display: inline-block;
	border: 1px solid #000;
	border-radius: 30px;
	padding: 3px 5px;
	cursor: pointer;
	box-sizing: border-box;
}
.second-nav__submenu {
	border: 1px solid #000;
	box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Inner pages: no decorative header-bg bleed (makeup: .pr-top .bg-header { none }).
   !important beats late page CSS that still sets .bg-header { url(...) }. */
body.page-inner .bg-header {
	background: none !important;
}

/* Desktop: clear gap under secondary pills (СТРОИТЕЛЬСТВО ДОМОВ / ФУНДАМЕНТ) before content */
@media (min-width: 993px) {
	.header__bottom {
		margin-bottom: 14px;
	}
	.header__bottom .second-nav {
		margin-bottom: 0;
	}
	/* Messengers stay tight; clear gap before the phone number */
	.contact-phone__number {
		display: flex;
		align-items: center;
		flex-wrap: nowrap;
		gap: 8px;
	}
	.contact-phone__number > a.contact-phone__link {
		margin-right: 0;
	}
	.contact-phone__number > a[href^="tel"] {
		margin-left: 14px;
	}
	/*
	 * Dropdowns: hover opens; click toggles checkbox.
	 * mouseleave JS unchecks — so leave always closes even after click-open.
	 * While hovering, :hover keeps panel open (click-close while hovered is a no-op by design).
	 */
	.header__bottom .dropdown .submenu {
		display: none;
	}
	.header__bottom .dropdown:hover .submenu,
	.header__bottom .dropdown-toggle:checked ~ .submenu {
		display: block;
	}
}

/* Mobile / tablet: fixed chrome = logo + phone + burger only (BB-104 / BB-107);
   .header--actions / .header__calc scroll away with content — never fixed. */
@media (max-width: 992px) {
	.header-chrome,
	body.is-header-fixed .header-chrome {
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		background-color: #fff;
		z-index: 400;
	}
	.header-chrome.is-scrolled {
		box-shadow: 0 4px 18px rgba(0, 0, 0, 0.08);
	}
	.header--actions {
		position: relative;
		z-index: 1;
	}
	.header--actions .header__calc {
		position: static;
		transform: none;
	}
	/* Spacer always reserves chrome height so content is not covered */
	.bg-header-spacer,
	body.is-header-fixed .bg-header-spacer {
		display: block;
	}

	.nav-burger {
		display: inline-flex;
	}
	/*
	 * BB-96: beat page CSS (uslugi-*.css etc. load AFTER belstroi-ux) that
	 * resets .header__top to 2 cols @≤1180 and .contact-phone__icon to 1em.
	 * Keep logo | messengers+phone | burger like contacts/home.
	 */
	.header-chrome .header__top,
	.header .header__top {
		display: grid !important;
		grid-template-columns: 72px minmax(0, 1fr) 40px !important;
		align-items: center !important;
		column-gap: 10px !important;
		row-gap: 0 !important;
	}
	.header-chrome .logo,
	.header .logo {
		width: 64px !important;
		height: auto !important;
		display: block;
	}
	.header-chrome .logo-link,
	.header .logo-link {
		grid-column: 1;
		grid-row: 1;
		align-self: center;
		padding-top: 12px;
		padding-bottom: 12px;
		line-height: 0;
	}
	.header-chrome .header__top > .main-nav,
	.header .header__top > .main-nav {
		display: none !important;
	}
	.header-chrome .contact-phone,
	.header .contact-phone {
		justify-self: end !important;
		align-self: center !important;
		min-width: 0;
		grid-column: 2 !important;
		grid-row: 1;
		padding-top: 0;
		transform: none;
	}
	.header-chrome .contact-phone__number,
	.header .contact-phone__number {
		display: flex !important;
		flex-wrap: nowrap !important;
		align-items: center;
		gap: 6px 8px;
		font-size: clamp(12px, 3.6vw, 15px) !important;
		white-space: nowrap !important;
		line-height: 1.15;
	}
	.header-chrome .contact-phone__number > a:last-child,
	.header-chrome .contact-phone__number > a[href^="tel"],
	.header .contact-phone__number > a:last-child,
	.header .contact-phone__number > a[href^="tel"] {
		flex-basis: auto !important;
		flex-shrink: 0;
		min-width: 0;
		white-space: nowrap !important;
	}
	.header-chrome .contact-phone__link,
	.header .contact-phone__link {
		display: inline-flex !important;
		flex-shrink: 0;
		vertical-align: middle;
	}
	/* Messenger icons — match contacts/home (not page CSS 1em) */
	.header-chrome .contact-phone__icon,
	.header .contact-phone__icon {
		height: 1.55em !important;
		width: auto !important;
		min-width: 1.55em !important;
	}
	.header-chrome .contact-phone__status,
	.header .contact-phone__status {
		display: none !important;
	}
	.header-chrome .nav-burger,
	.header .nav-burger {
		grid-column: 3 !important;
		grid-row: 1;
		align-self: center;
		justify-self: end;
		margin-top: 0;
		margin-left: 0;
		border: none;
	}
	.nav-burger__bar {
		background: #fff;
	}
	.header__bottom {
		display: none !important;
	}
	.header__calc {
		width: 100%;
	}
	.calc-nav {
		display: grid !important;
		width: 100% !important;
		max-width: 100% !important;
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
		font-size: 12px;
	}
	.calc-nav__header {
		display: none !important;
	}
	.calc-nav__item {
		padding: 12px 10px;
		min-width: 0;
	}
	.calc-nav__item--inverse {
		grid-column: auto !important;
	}
	.calc-nav__item--inverse span {
		display: block;
	}

	/* M2: drawer must fit all items — denser type + scrollable panel */
	.site-drawer {
		width: min(340px, 92vw);
		padding: 64px 16px 28px;
		overscroll-behavior: contain;
		-webkit-overflow-scrolling: touch;
	}
	.site-drawer .main-nav {
		gap: 8px;
		margin-bottom: 12px;
	}
	.site-drawer .main-nav__item a {
		font-size: 18px !important;
	}
	.site-drawer .main-nav__item span {
		font-size: 11px;
	}
	.site-drawer .second-nav {
		gap: 6px;
	}
	.site-drawer .second-nav__item,
	.site-drawer .dropdown-label {
		font-size: 14px;
	}
	.site-drawer .second-nav__item--dropdown {
		padding: 6px 8px;
	}
	.site-drawer .second-nav .submenu {
		padding: 6px 0 2px 6px;
	}
	.site-drawer .second-nav .submenu a {
		font-size: 13px;
		line-height: 1.25;
	}
	.site-drawer .second-nav .submenu li + li {
		margin-top: 4px;
	}
}

@media (max-width: 500px) {
	.calc-nav {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
		font-size: 11px;
	}
}

/* Desktop (≥md / 993+): floating burger on scroll (~2×); same R→L drawer as mobile */
@media (min-width: 993px) {
	.nav-burger {
		display: inline-flex; /* keep in tree for opacity transition */
		position: fixed;
		top: max(16px, env(safe-area-inset-top, 0px));
		right: max(16px, var(--gutter, 16px));
		z-index: 500;
		width: 80px; /* ~2× mobile 40 */
		height: 80px;
		gap: 9px;
		border-radius: 16px;
		box-shadow: 0 8px 22px rgba(0, 0, 0, 0.2);
		/* Hidden at page top; shown when scrolled or drawer open */
		opacity: 0;
		visibility: hidden;
		pointer-events: none;
		transform: translateY(-6px);
		transition:
			opacity 0.2s ease,
			transform 0.2s ease,
			visibility 0.2s ease;
	}
	.nav-burger__bar {
		width: 36px;
		height: 4px;
	}
	body.is-drawer-open .nav-burger__bar:nth-child(1) {
		transform: translateY(13px) rotate(45deg);
	}
	body.is-drawer-open .nav-burger__bar:nth-child(3) {
		transform: translateY(-13px) rotate(-45deg);
	}
	body.is-desktop-scrolled .nav-burger,
	body.is-drawer-open .nav-burger {
		opacity: 1;
		visibility: visible;
		pointer-events: auto;
		transform: translateY(0);
	}
	.site-drawer {
		width: min(360px, 32vw);
		padding: 72px 24px 28px;
	}
}

/* Site-wide modal motion — intentional fade + soft rise (not noisy) */
.modal {
	opacity: 0;
	visibility: hidden;
	pointer-events: none;
	transition:
		opacity 0.28s ease,
		visibility 0.28s ease;
}
.modal.is-open {
	opacity: 1;
	visibility: visible;
	pointer-events: auto;
}
/* Keep grid layout during close so opacity can animate (override [hidden]{display:none}) */
.modal.is-open,
.modal.is-closing {
	display: grid !important;
}
.modal__overlay {
	transition: opacity 0.28s ease;
}
.modal__container {
	transform: translateY(14px) scale(0.985);
	opacity: 0;
	transition:
		transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
		opacity 0.28s ease;
}
.modal.is-open .modal__container {
	transform: none;
	opacity: 1;
}
.modal.is-closing .modal__container {
	transform: translateY(10px) scale(0.985);
	opacity: 0;
}

/* BB-45/46: quiz / house-calc inside popups (not above footer) */
.modal__container--wide {
	width: min(960px, calc(100vw - 1.5rem));
	max-width: min(960px, calc(100vw - 1.5rem));
	max-height: calc(100dvh - 2rem);
}
.modal__content--quiz,
.modal__content--calc {
	overflow: auto;
	max-height: calc(100dvh - 6.5rem);
	-webkit-overflow-scrolling: touch;
}
.modal__content--quiz #quiz-wrap,
.modal__content--quiz .container {
	width: 100%;
	max-width: none;
	margin: 0;
	padding: 0;
}
.modal__content--quiz .bg-white {
	box-shadow: none;
	background: transparent;
	/* в попапе не нужны page-отступы программиста */
	padding-left: 0 !important;
	padding-right: 0 !important;
	margin-bottom: 0 !important;
}
/* убрать клипсу/оранжевую плашку квиза в попапе */
.modal__content--quiz .quiz {
	padding-top: 0.5rem;
}
.modal__content--quiz .quiz::before,
.modal__content--quiz .quiz::after {
	content: none !important;
	display: none !important;
}
/* заголовок квиза дублирует title модалки */
.modal__content--quiz .quiz > .page-title {
	display: none;
}
/* скролл у капчи в попапе (overflow:auto на .form__recaptcha) */
.modal__content--quiz .form__recaptcha,
.modal__content--quiz .form__field--recaptcha {
	overflow: visible !important;
	max-width: 100%;
}
.modal__content--quiz .form__recaptcha > div {
	max-width: 100%;
	overflow: visible !important;
}
.modal__content--calc .calculator-popup,
.modal__content--calc .calculator {
	width: 100%;
}
.modal__content--calc .calculator {
	grid-template-columns: 1fr !important;
	padding: 1rem 1.25rem 1.5rem;
	box-sizing: border-box;
}
.modal__content--calc .calculator__form {
	padding: 0;
}
.modal__content--calc .calculator__pic {
	display: none !important;
}
/* калькулятор: сетка тянется по высоте формы; картинка по центру ячейки (как в вёрстке) */
.calculator.grid--2x {
	align-items: stretch;
}
.calculator.grid--2x > .calculator__form,
.calculator.grid--2x > form,
.calculator.grid--2x > .calculator__pic {
	min-width: 0;
}
.calculator__pic {
	position: relative;
}
.calculator__pic img {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	margin: auto;
	max-width: 100%;
}
.calculator__cost-switch {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.75rem;
}
/* курсы валют (попап и страница) */
.calculator__price-trigger {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem 0.6rem;
	align-items: center;
	padding-top: 0.75rem;
	max-width: 100%;
}
.calculator__price-trigger .js-price-trigger {
	cursor: pointer;
	display: inline-block;
	padding: 7px 15px;
	font-size: clamp(0.85rem, 1.2vw, 1rem);
	font-weight: 900;
	text-transform: uppercase;
	color: var(--clr-main, #74bb17);
	text-decoration: underline;
	background: transparent;
	border: 0;
	border-radius: 50px;
}
.calculator__price-trigger .js-price-trigger.active,
.calculator__price-trigger .js-price-trigger[aria-pressed='true'] {
	color: #fff;
	background-color: var(--clr-main, #74bb17);
	text-decoration: none;
}
@media (max-width: 767px) {
	.modal__container--wide {
		width: calc(100vw - 0.75rem);
		max-width: calc(100vw - 0.75rem);
		max-height: calc(100dvh - 0.75rem);
	}
	.modal__content--calc .calculator.grid--2x {
		grid-template-columns: 1fr;
	}
}

/* BB-101: never let calc side art steal mobile layout (picture wrap included) */
@media (max-width: 890px) {
	.calculator > .calculator__pic {
		display: none !important;
	}
	.calculator.grid--2x {
		grid-template-columns: 1fr;
	}
}

@media (prefers-reduced-motion: reduce) {
	/* Keep drawer R→L slide (product requirement); soften other chrome */
	.header__calc,
	.nav-burger__bar,
	.scroll-top,
	.modal,
	.modal__container,
	.modal__overlay {
		transition: none !important;
	}
	.site-drawer {
		transition: transform 0.2s ease-out !important;
	}
	.site-drawer-backdrop {
		transition: opacity 0.2s ease, visibility 0.2s ease !important;
	}
}

/* BB-33: hearts (::before) above photos if anything creates a stacking context — no layout overrides */
.bg-imagin .imagin__list {
	z-index: 10;
}

/* Google reCAPTCHA v2 (injected by belstroi-forms.js on all /send-form forms) */
.form__field--recaptcha {
	width: 100%;
}
.form__recaptcha {
	display: block;
	max-width: 100%;
	overflow: visible;
	min-height: 78px;
}
.form__recaptcha > div {
	margin: 0;
}

/* BB-71: success modal after lead submit */
.modal__container--success {
	max-width: 420px;
}
.modal__content--success {
	text-align: center;
	padding: 0.5rem 0 1rem;
}
.modal-success__text {
	margin: 0 0 1.25rem;
	font-size: 1.05rem;
	line-height: 1.45;
	font-weight: 600;
}

/* BB-75: modal titles keep look without heading tags */
.modal__header .modal__title,
.modal__header p.modal__title {
	margin: 0;
	font-family: var(--h-font-family, inherit);
	font-size: clamp(1.25rem, 2vw, 1.5rem);
	font-weight: 900;
	line-height: 1.15;
	color: inherit;
}

/* BB-75: currency triggers stay on one row (€ included) on all pages */
.calculator__price-trigger,
.price-trigger.prices__price-trigger,
.house-calc .price-trigger,
.lf-calc .price-trigger,
.calculator .price-trigger {
	flex-wrap: nowrap;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	max-width: 100%;
}
.calculator__price-trigger .js-price-trigger,
.price-trigger .js-price-trigger,
.calculator .price-trigger .js-price-trigger {
	flex: 0 0 auto;
	white-space: nowrap;
	padding: 7px 12px;
}

/* BB-75: kill accidental page horizontal scroll */
html,
body {
	overflow-x: clip;
	max-width: 100%;
}

/* BB-79: calc-nav / hero text CTAs as buttons keep makeup look */
.calc-nav__item button {
	display: inline;
	padding: 0;
	border: 0;
	background: none;
	font: inherit;
	color: inherit;
	text-align: left;
	cursor: pointer;
	text-decoration: underline;
}
.calc-nav__item button span {
	display: block;
	text-transform: none;
}

/* BB-91: keep action-bar icons at makeup size even when page CSS 404s */
.calc-nav .--has-icon {
	display: inline-flex !important;
	align-items: center;
	gap: 0.3em;
}
.calc-nav .--has-icon::before {
	content: '';
	display: block;
	width: 36px;
	height: 36px;
	min-width: 36px;
	flex-shrink: 0;
	background-image: var(--icon-url);
	background-repeat: no-repeat;
	background-size: contain;
}
.hero__text-btn {
	display: inline;
	padding: 0;
	border: 0;
	background: none;
	font: inherit;
	color: inherit;
	cursor: pointer;
	text-decoration: underline;
}
.quiz__title {
	margin: 0;
}

/* BB-80: tabs must paint ABOVE .materials__content-wrapper (makeup look).
   Negative margin pulls white up under the tabs; without z-index white covers them. */
.materials > .mod-px:has(.materials__grid) {
	position: relative;
	z-index: 2;
}
.materials__content-wrapper {
	position: relative;
	z-index: 1;
}

/* BB-75/80: materials fade only on accordion */
.materials__accordion {
	position: relative;
	overflow: hidden;
}
.materials__accordion .ac-trigger {
	z-index: 2;
}
.materials__accordion .ac-trigger:before {
	pointer-events: none;
	z-index: 1;
}

/* =====================================================================
   BB-102: multi-col price / compare tables — scroll, no cell text overlap
   (home .prices, house pages, foundations, /ceny .pr-table)
   ===================================================================== */
.table-responsive-wrapper,
.pr-table-wrap {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior-x: contain;
	max-width: 100%;
}
.js-table-accordion {
	border-collapse: collapse;
}
@media (max-width: 900px) {
	.js-table-accordion {
		table-layout: fixed;
		width: 920px;
		min-width: 920px;
		max-width: none;
	}
	.js-table-accordion td {
		vertical-align: top;
		box-sizing: border-box;
	}
	.js-table-accordion thead > tr > td:not(:first-child),
	.js-table-accordion tbody > tr > td:not(:first-child) {
		min-width: 150px;
		overflow: hidden;
	}
	.prices__table-title {
		font-size: clamp(14px, 3.2vw, 20px);
		line-height: 1.15;
		overflow-wrap: break-word;
		hyphens: auto;
	}
	.prices__table-price-value {
		font-size: clamp(16px, 3.6vw, 22px);
		white-space: nowrap;
		display: inline-block;
		max-width: 100%;
	}
	.pr-table {
		min-width: 640px;
		width: 640px;
		max-width: none;
	}
	.pr-table__price,
	.pr-table__unit {
		white-space: nowrap;
	}
}

/* Mobile: keep native scroll feel (no JS scroll compensation after BB-104) */
@media (max-width: 992px) {
	html {
		scroll-behavior: auto;
	}
}

/* =====================================================================
   BB-105: mobile — gutters via .mod-px class on containers (not hardcoded).
   When .bg-facts > .container.mod-px (or .facts.mod-px) owns the gutter,
   kill legacy .fact__text side padding so green titles + text stay aligned.
   Do not touch sticky .header-chrome (BB-104).
   ===================================================================== */
@media (max-width: 830px) {
	.mod-px .facts .fact__text,
	.mod-px.facts .fact__text,
	.bd-facts.mod-px .fact__text,
	.mod-px .bd-facts .fact__text {
		padding-left: 0 !important;
		padding-right: 0 !important;
	}
}

/* =====================================================================
   BB-106: mobile — materials title was text-align:right and kissed the
   right edge (uslugi/gazobeton etc). Center + breathe under .h3-like.
   ≤600px: drop img border-radius (Igor).
   Do not touch sticky .header-chrome (BB-104).
   ===================================================================== */
@media (max-width: 767px) {
	.materials__title {
		text-align: center !important;
	}
	.page-title > .h3-like {
		padding-bottom: 12px;
	}
}
@media (max-width: 600px) {
	img {
		border-radius: 0 !important;
	}
}

/* =====================================================================
   BB-107 — Nikolai mobile pack + fixed header chrome
   ===================================================================== */

/* Materials: keep legacy white :before strip off (wrong on blue bg-materials).
   BB-110 restores soft fade via mask on the peek instead (any page bg). */
@media (max-width: 890px) {
	.materials__accordion .ac-trigger:before {
		content: none !important;
		display: none !important;
		background: none !important;
		height: 0 !important;
	}
	/* Hide per-material block photos on mobile */
	.materials__flex-center > picture,
	.materials__flex-center > img {
		display: none !important;
	}
}

/* =====================================================================
   BB-110: collapsed materials list — peek + mask fade before «Подробнее»
   (home + blochnye / materials tabs). Opened state: no mask; JS sets height.
   ===================================================================== */
@media (max-width: 890px) {
	.materials__accordion:not(:has(.ac-toggle:checked)) > .ac-content {
		max-height: 220px;
		opacity: 1;
		overflow: hidden;
		-webkit-mask-image: linear-gradient(
			to bottom,
			#000 0%,
			#000 42%,
			rgba(0, 0, 0, 0.55) 68%,
			transparent 100%
		);
		mask-image: linear-gradient(
			to bottom,
			#000 0%,
			#000 42%,
			rgba(0, 0, 0, 0.55) 68%,
			transparent 100%
		);
	}
	.materials__accordion:has(.ac-toggle:checked) > .ac-content {
		-webkit-mask-image: none;
		mask-image: none;
		opacity: 1;
	}
}

/* House calculator: even rows + slightly smaller type on narrow screens */
@media (max-width: 690px) {
	.calculator:not(.lf-calc) .calculator__form {
		padding-top: 1.25rem;
		padding-left: 5%;
		padding-right: 5%;
		padding-bottom: 1.5rem;
		gap: 0.75rem;
	}
	.calculator:not(.lf-calc) .calculator__label-text,
	.calculator:not(.lf-calc) legend {
		font-size: 15px;
	}
	.calculator:not(.lf-calc) .calculator__label-text span {
		font-size: 12px;
	}
	.calculator:not(.lf-calc) .calculator__input {
		width: 110px !important;
		min-width: 110px !important;
		max-width: 110px !important;
		height: 48px;
		font-size: 28px;
	}
	.calculator:not(.lf-calc) .calculator__select,
	.calculator:not(.lf-calc) .calculator__checkbox .custom-checkbox__text {
		height: 48px;
		font-size: 14px;
	}
	.calculator:not(.lf-calc) .flex-center.calculator__row,
	.calculator:not(.lf-calc) .calculator__row.flex-center {
		display: flex !important;
		flex-wrap: nowrap !important;
		align-items: center !important;
		justify-content: space-between;
		gap: 0.6rem !important;
		width: 100%;
	}
	.calculator:not(.lf-calc) .calculator__row > .flex-center,
	.calculator:not(.lf-calc) .calculator__row > label.flex-center {
		display: flex !important;
		flex-wrap: nowrap !important;
		align-items: center !important;
		justify-content: space-between;
		gap: 0.6rem !important;
		width: 100%;
		flex: 1 1 auto;
		min-width: 0;
	}
	.calculator:not(.lf-calc) .calculator__row .calculator__label-text {
		flex: 1 1 auto;
		min-width: 0;
	}
	.calculator:not(.lf-calc) .h4-like {
		font-size: 1.25rem;
	}
}

/* Gazobeton: center heading icons with multi-line titles.
   belstroi-ux.js wraps text after .gb-ico into .gb-title-body so flex
   align-items:center uses the full heading block (not the first line). */
@media (max-width: 992px) {
	h2.page-title:has(.gb-ico),
	h3.page-title:has(.gb-ico) {
		display: flex;
		align-items: center;
		flex-wrap: nowrap;
		column-gap: 0.22em;
	}
	h2.page-title:has(.gb-ico) > .gb-ico,
	h3.page-title:has(.gb-ico) > .gb-ico {
		flex: 0 0 auto;
		align-self: center;
		vertical-align: middle !important;
	}
	h2.page-title:has(.gb-ico) > .gb-title-body,
	h3.page-title:has(.gb-ico) > .gb-title-body {
		flex: 1 1 auto;
		min-width: 0;
	}
	/* Keep green lead + .h3-like subtitle as a 2-line block on mobile */
	h2.page-title:has(.gb-ico) > .gb-title-body > .h3-like,
	h3.page-title:has(.gb-ico) > .gb-title-body > .h3-like {
		display: block;
	}
	.gb-ico {
		vertical-align: middle !important;
		align-self: center;
		flex-shrink: 0;
	}
	.gb-callout--ico {
		align-items: center !important;
	}
	.gb-callout--ico > picture {
		margin-top: 0 !important;
	}
}

/* Strip foundation price table: colspan=7 group th is full table width, so
   position:sticky on the th itself never pins (nothing to stick against).
   Stick an inner label instead — same pattern as narrow row-label th. */
.lf-table--prices .lf-table__group th {
	position: static !important;
	left: auto !important;
	z-index: auto;
	background-color: #eef7e4;
	text-align: left;
}
.lf-table--prices .lf-table__group-label {
	position: sticky;
	left: 0;
	z-index: 3;
	display: inline-block;
	max-width: min(22rem, calc(100vw - 2.5rem));
	background-color: #eef7e4;
	box-shadow: 0.75rem 0 0.5rem -0.35rem #eef7e4;
	/* Match cell horizontal padding so sticky left:0 lines up with row labels */
	margin-left: -12px;
	padding-left: 12px;
	padding-right: 0.35em;
	box-sizing: border-box;
}

/* =====================================================================
   BB-109: hide info-block exclamation icon on mobile (picture or bare img).
   Desktop unchanged. Breakpoint matches neighboring ≤767 hide rules.
   ===================================================================== */
@media (max-width: 767px) {
	.info-block > picture,
	.info-block > img {
		display: none !important;
	}
}

/* =====================================================================
   BB-111 — Nikolai mobile pack (desktop untouched)
   1) Orange quiz clip (::before) + bar (::after) between «Подберите…»
      / calc and «Рассчитайте…» — hide on mobile (gazobeton + blochnye).
   2) Callback modal: consent row — checkbox + wrapping label aligned.
   ===================================================================== */
@media (max-width: 767px) {
	/* Decorative clip.avif “скрепка” over/between quiz + calculator */
	.quiz::before,
	.quiz::after {
		content: none !important;
		display: none !important;
		background: none !important;
		width: 0 !important;
		height: 0 !important;
	}
	.quiz {
		padding-top: 0.75rem;
	}

	/* «Заказать звонок»: consent checkbox + multi-line policy text */
	.modal .form__label--checkbox {
		display: flex !important;
		flex-direction: row !important;
		align-items: flex-start !important;
		justify-content: flex-start !important;
		gap: 0.5em;
		text-align: left;
		width: 100%;
		box-sizing: border-box;
	}
	.modal .form__label--checkbox .form__input-checkbox {
		flex: 0 0 auto;
		margin-top: 0.2em;
		margin-right: 0;
	}
	.modal .form__checkbox-text {
		flex: 1 1 auto;
		min-width: 0;
		line-height: 1.35;
		overflow-wrap: anywhere;
	}
	.modal .form__field:has(.form__label--checkbox) {
		padding-left: 1em;
		padding-right: 1em;
	}
}

/* =====================================================================
   BB-112: «Заказать звонок» / project modal — no horizontal scroll on
   mobile. Fixed-width reCAPTCHA (~304px) + modal/field padding can leave
   <304px inner width → grey h-scrollbar. Tighten padding, clip overflow,
   scale/contain captcha; wrap privacy link. Desktop unchanged.
   ===================================================================== */
@media (max-width: 767px) {
	.modal .modal__container:not(.modal__container--wide) {
		width: min(100%, calc(100vw - 1.25rem));
		max-width: 100%;
		box-sizing: border-box;
		padding: 1.25em 1em 1.75em;
		overflow-x: hidden;
	}
	.modal .modal__content:not(.modal__content--quiz):not(.modal__content--calc) {
		max-width: 100%;
		overflow-x: hidden;
		box-sizing: border-box;
	}
	.modal .form {
		max-width: 100%;
		min-width: 0;
		box-sizing: border-box;
	}
	.modal .form__field {
		max-width: 100%;
		min-width: 0;
		box-sizing: border-box;
		padding-left: 0.35em;
		padding-right: 0.35em;
	}
	.modal .form__field:has(.form__label--checkbox) {
		padding-left: 0.35em;
		padding-right: 0.35em;
	}
	.modal .form__checkbox-text,
	.modal .form__checkbox-text a {
		display: inline;
		white-space: normal;
		overflow-wrap: anywhere;
		word-break: break-word;
	}
	.modal .form__field--recaptcha,
	.modal .form__recaptcha {
		max-width: 100%;
		min-width: 0;
		box-sizing: border-box;
		overflow: hidden;
	}
	/* Google injects a ~304×78 iframe; scale into available width */
	.modal .form__recaptcha > div {
		max-width: 100%;
		transform: scale(0.88);
		transform-origin: left top;
	}
	.modal .form__recaptcha {
		min-height: 0;
		height: 70px; /* ~78 × 0.88 */
	}
}
