/* Герой: веб-форма внутри слайда (без maxwidth-theme на обёртке — иначе Aspro даёт position:absolute;inset:0) */

.rscable-banners-big__wrapper--hero-form {
	position: relative;
}

.rscable-banners-big__wrapper--hero-form .banners-big__item {
	position: relative;
	overflow: hidden;
}

/* Фон слайда — по центру, заполняет область.
 * Селектор без [style*='background-image']: атрибутные условия нормализуются
 * по-разному в Firefox и Chrome → риск несрабатывания. Специфичность 0-3-0
 * за счёт .main-slider__item перебивает Aspro .main-slider .main-slider__item (0-2-0). */
.rscable-banners-big__wrapper--hero-form .swiper-slide.main-slider__item {
	background-position: center center !important;
	background-size: cover;
	background-repeat: no-repeat;
}
.rscable-banners-big__wrapper--hero-form .banners-big__inner-wrap {
	background-position: center center;
	background-size: cover;
	background-repeat: no-repeat;
}
.rscable-banners-big__wrapper--hero-form .banners-big__adaptive-img {
	background-position: center center;
	background-size: cover;
}

/* Фон/картинка слайда не вылезают за границы; масштаб как cover, текст колонки поверх */
.rscable-banners-big__wrapper--hero-form .banners-big__img-wrapper {
	overflow: hidden;
	background: #2b2b2b;
}

/* Картинка заполняет слайд (cover), без «пустых полей» как у contain */
.rscable-banners-big__wrapper--hero-form .banners-big__item .banners-big__img-wrapper .banners-big__img {
	left: 0;
	right: 0;
	top: 0;
	bottom: 0;
	width: 100%;
	height: 100%;
	max-height: none;
	object-fit: cover;
	object-position: center center;
}

.rscable-banners-big__wrapper--hero-form .banners-big__text {
	position: relative;
	z-index: 5;
	/* Блок заголовка + формы ниже по вертикали */
	padding-top: clamp(52px, 7vw, 96px);
}

.rscable-banners-big__wrapper--hero-form .banners-big__text-wrapper {
	margin-top: 14px;
}

.rscable-banners-big__wrapper--hero-form .banners-big__title,
.rscable-banners-big__wrapper--hero-form .banners-big__title h1,
.rscable-banners-big__wrapper--hero-form .banners-big__text-wrapper,
.rscable-banners-big__wrapper--hero-form .banners-big__text-block {
	position: relative;
	/* Выше .rscable-hero-form-wrap (z-index:10), иначе заголовок визуально «пропадает» под формой */
	z-index: 15;
	text-shadow: 0 1px 10px rgba(0, 0, 0, 0.75), 0 0 1px rgba(0, 0, 0, 0.9);
}

/* theme-dark: --white_text_black_reverse в теме = тёмный текст; на герое нужен белый как на светлой схеме */
.rscable-banners-big__wrapper--hero-form .theme-dark .banners-big__title,
.rscable-banners-big__wrapper--hero-form .theme-dark .banners-big__title h1,
.rscable-banners-big__wrapper--hero-form .theme-dark .banners-big__text-block,
.rscable-banners-big__wrapper--hero-form .theme-dark .banners-big__text-block p {
	color: #fff;
}

/* Подзаголовок слайда — всегда одна строка (сброс Aspro .lineclamp-5 / переносы) */
.rscable-banners-big__wrapper--hero-form .banners-big__text-block.lineclamp-5 {
	display: block !important;
	-webkit-line-clamp: unset !important;
	line-clamp: unset;
	-webkit-box-orient: unset !important;
	overflow: visible;
	word-break: normal;
}

.rscable-banners-big__wrapper--hero-form .banners-big__text-block p {
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 100%;
	margin: 0;
}

/*
 * ТЗ: текст баннера сверху в левой колонке, под ним — форма, всё внутри баннера.
 * У .banners-big__inner по умолчанию align-items: flex-end — колонка текста прижата к низу слайда,
 * контент внутри колонки идёт сверху вниз: заголовок → подзаголовок → кнопки → форма.
 */
.rscable-banners-big__wrapper--hero-form .banners-big__inner {
	align-items: flex-end;
}

.rscable-banners-big__wrapper--hero-form .banners-big__text.banners-big__depend-height {
	justify-content: flex-start;
	align-items: flex-start;
	text-align: left;
	min-height: 0;
	max-height: none;
	box-sizing: border-box;
}

.rscable-banners-big__wrapper--hero-form .banners-big__text--center {
	text-align: left;
	align-items: flex-start;
	margin-left: 0;
	margin-right: 0;
}

/* Форма под текстом, в потоке колонки */
.rscable-hero-form-wrap--in-banner-text {
	position: relative;
	z-index: 10;
	width: 100%;
	max-width: 100%;
	margin-top: 20px;
	padding: 0;
	box-sizing: border-box;
	touch-action: pan-y;
}

/* После инициализации Swiper отключаем клики по форме на неактивных слайдах */
.main-slider.swiper-initialized .swiper-slide:not(.swiper-slide-active) .rscable-hero-form-inner {
	pointer-events: none;
}

/* Только картинка: форма поверх слайда снизу */
.rscable-hero-form-wrap--overlay-bottom {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 12;
	padding: 0 24px 28px;
	box-sizing: border-box;
	touch-action: pan-y;
}

.rscable-hero-form-inner {
	pointer-events: auto;
	max-width: 100%;
	width: 100%;
	min-width: 0;
	box-sizing: border-box;
	display: flex;
	justify-content: flex-start;
	align-items: flex-start;
}

/* Курсор: не наследовать grab/grabbing от Swiper на зоне формы */
.rscable-banners-big__wrapper--hero-form .rscable-hero-form-wrap,
.rscable-banners-big__wrapper--hero-form .rscable-hero-form-inner {
	cursor: auto;
}

.rscable-banners-big__wrapper--hero-form .rscable-hero-form-wrap input[type="text"],
.rscable-banners-big__wrapper--hero-form .rscable-hero-form-wrap input[type="tel"],
.rscable-banners-big__wrapper--hero-form .rscable-hero-form-wrap input[type="email"],
.rscable-banners-big__wrapper--hero-form .rscable-hero-form-wrap textarea {
	cursor: text;
}

.rscable-banners-big__wrapper--hero-form .rscable-hero-form-wrap button,
.rscable-banners-big__wrapper--hero-form .rscable-hero-form-wrap label[for],
.rscable-banners-big__wrapper--hero-form .rscable-hero-form-wrap .rscable-hero-form__file-label,
.rscable-banners-big__wrapper--hero-form .rscable-hero-form-wrap input[type="file"],
.rscable-banners-big__wrapper--hero-form .rscable-hero-form-wrap input[type="checkbox"] {
	cursor: pointer;
}

.main-slider.swiper-initialized .swiper-slide-active .rscable-hero-form-wrap {
	cursor: auto !important;
}

/* Колонка текста шире стандартных ~50% Aspro; карточка формы остаётся max 736px (rscable_hero/style.css). */
@media (min-width: 768px) {
	/*
	 * Контент слайда (в т.ч. форма и список файлов) не выходит за рамки .banners-big__inner-wrap —
	 * см. hero-callback-widget-invariants.md (инвариант inner-wrap).
	 */
	.rscable-banners-big__wrapper--hero-form .banners-big__inner-wrap {
		overflow: hidden;
		max-height: 100%;
		box-sizing: border-box;
	}

	.rscable-banners-big__wrapper--hero-form .banners-big__inner {
		min-height: 0;
		max-height: 100%;
		overflow: hidden;
	}

	.rscable-banners-big__wrapper--hero-form .banners-big__text.banners-big__depend-height {
		width: min(75%, 920px);
		max-width: min(75%, 920px);
		min-height: 0;
		max-height: 100%;
		/* overflow-x:hidden режет горизонтальный скролл у .rscable-hero-form__file-list */
		overflow-x: visible;
		overflow-y: hidden;
		display: flex;
		flex-direction: column;
		align-items: flex-start;
	}

	.rscable-banners-big__wrapper--hero-form .rscable-hero-form-wrap--in-banner-text {
		flex: 1 1 auto;
		min-height: 0;
		min-width: 0;
		max-height: none;
		overflow: visible;
	}

	/* Отступ карточки формы от нижней границы слайда / inner-wrap */
	.rscable-banners-big__wrapper--hero-form .rscable-hero-form__card {
		margin-bottom: 20px;
	}
}

.rscable-hero-form-wrap--overlay-bottom .rscable-hero-form-inner {
	align-items: flex-end;
}

@media (max-width: 991px) {
	.rscable-hero-form-wrap--overlay-bottom {
		position: relative;
		left: auto;
		right: auto;
		bottom: auto;
		padding: 16px 16px 24px;
		pointer-events: auto;
	}

	.rscable-hero-form-wrap--in-banner-text {
		margin-top: 16px;
	}
}

/*
 * Aspro adaptive-3: .banners-big__text > :not(.banners-big__buttons) { display: none } — скрывает заголовок без обёртки a.title-link и форму.
 * Для героя с КП показываем все прямые дети колонки (кроме блока кнопок), выравниваем как на десктопе.
 */
@media (max-width: 767px) {
	.banners-big--adaptive-3 .rscable-banners-big__wrapper--hero-form .banners-big__item {
		padding-top: 0 !important;
		height: auto !important;
		min-height: min(360px, 78vh);
		position: relative;
		display: flex;
		flex-direction: column;
	}

	/* Заголовок слайда — компактно, без обрезки lineclamp (как в моб. макете) */
	.banners-big--adaptive-3 .rscable-banners-big__wrapper--hero-form .banners-big__title.lineclamp-3,
	.banners-big--adaptive-3 .rscable-banners-big__wrapper--hero-form .banners-big__title.switcher-title {
		display: block !important;
		-webkit-line-clamp: unset !important;
		line-clamp: unset;
		-webkit-box-orient: unset !important;
		overflow: visible;
		max-height: none;
	}

	.banners-big--adaptive-3 .rscable-banners-big__wrapper--hero-form .banners-big__title,
	.banners-big--adaptive-3 .rscable-banners-big__wrapper--hero-form .banners-big__title h1 {
		font-size: clamp(13px, 3.7vw, 17px) !important;
		line-height: 1.28 !important;
		font-weight: 600 !important;
	}

	.banners-big--adaptive-3 .rscable-banners-big__wrapper--hero-form .banners-big__adaptive-img {
		position: absolute;
		inset: 0;
		z-index: 0;
		background-size: cover;
		background-position: center;
	}

	.banners-big--adaptive-3 .rscable-banners-big__wrapper--hero-form .banners-big__inner-wrap {
		position: relative;
		z-index: 2;
		display: flex;
		flex-direction: column;
		flex: 1 1 0%;
		min-height: 0;
		overflow: hidden;
		border-radius: inherit;
	}

	.banners-big--adaptive-3 .rscable-banners-big__wrapper--hero-form .banners-big__inner {
		flex: 1 1 0%;
		display: flex;
		flex-direction: column;
		align-items: stretch !important;
		justify-content: flex-start;
		min-height: 0;
		overflow: hidden;
		max-width: 100%;
	}

	/* Заголовок + подзаголовок + форма — колонка по левому краю (adaptive-3) */
	.banners-big--adaptive-3 .rscable-banners-big__wrapper--hero-form .banners-big__text,
	.banners-big--adaptive-3 .rscable-banners-big__wrapper--hero-form .banners-big__text.banners-big__depend-height {
		position: relative;
		z-index: 5;
		display: flex !important;
		flex-direction: column !important;
		align-items: flex-start !important;
		text-align: left !important;
		justify-content: flex-start !important;
		box-sizing: border-box;
		padding: 10px 12px 14px;
		width: 100% !important;
		max-width: 100%;
		flex: 1 1 0%;
		min-height: 0;
		min-width: 0;
		overflow: hidden;
	}

	.banners-big--adaptive-3 .rscable-banners-big__wrapper--hero-form .banners-big__text > :not(.banners-big__buttons) {
		text-align: left;
	}

	/* Подзаголовок слайда — виден, перенос строк, мелкий шрифт */
	.banners-big--adaptive-3 .rscable-banners-big__wrapper--hero-form .banners-big__text-wrapper {
		display: block !important;
		width: 100%;
		max-width: 100%;
		margin-top: 6px;
		margin-bottom: 0;
		box-sizing: border-box;
	}

	.banners-big--adaptive-3 .rscable-banners-big__wrapper--hero-form .banners-big__text-block {
		font-size: 11px !important;
		line-height: 1.38 !important;
		margin-top: 0 !important;
	}

	.banners-big--adaptive-3 .rscable-banners-big__wrapper--hero-form .banners-big__text-block.lineclamp-5 {
		display: block !important;
		-webkit-line-clamp: unset !important;
		line-clamp: unset;
		-webkit-box-orient: unset !important;
		overflow: visible;
	}

	.banners-big--adaptive-3 .rscable-banners-big__wrapper--hero-form .banners-big__text-block p {
		white-space: normal !important;
		overflow: visible !important;
		text-overflow: unset !important;
		word-break: break-word;
		font-size: 11px !important;
		line-height: 1.38 !important;
		margin: 0;
	}

	.banners-big--adaptive-3 .rscable-banners-big__wrapper--hero-form .banners-big__text > *:not(.banners-big__buttons) {
		display: block !important;
		width: 100%;
		max-width: 100%;
		box-sizing: border-box;
	}

	.banners-big--adaptive-3 .rscable-banners-big__wrapper--hero-form .banners-big__text > .rscable-hero-form-wrap--in-banner-text {
		display: flex !important;
		flex-direction: column;
		align-items: stretch;
		justify-content: flex-start;
		flex: 1 1 0%;
		min-height: 0;
		min-width: 0;
		max-height: 100%;
		overflow: hidden;
		max-width: 100%;
		width: 100%;
		box-sizing: border-box;
	}

	.banners-big--adaptive-3 .rscable-banners-big__wrapper--hero-form .rscable-hero-form-inner {
		min-height: 0;
		flex: 1 1 0%;
		overflow: hidden;
		max-width: 100%;
		width: 100%;
		display: flex;
		flex-direction: column;
		box-sizing: border-box;
	}

	.banners-big--adaptive-3 .rscable-banners-big__wrapper--hero-form .rscable-hero-form__stack {
		flex: 1 1 0%;
		min-height: 0;
		max-width: 100%;
		overflow: hidden;
		display: flex;
		flex-direction: column;
		box-sizing: border-box;
	}

	.banners-big--adaptive-3 .rscable-banners-big__wrapper--hero-form .rscable-hero-form__card {
		margin-top: 12px;
		margin-left: auto;
		margin-right: auto;
		width: 100%;
		max-width: 100%;
		min-width: 0;
		min-height: 0;
		max-height: 100%;
		overflow-x: hidden;
		overflow-y: auto;
		-webkit-overflow-scrolling: touch;
		box-sizing: border-box;
	}

	.rscable-hero-form-wrap--in-banner-text {
		margin-top: 12px;
	}

	.banners-big--adaptive-3.banners-big--side-banners .rscable-banners-big__wrapper--hero-form ~ .banners-big__side-wrap {
		display: none;
	}

	.banners-big--adaptive-3 .rscable-banners-big__wrapper--hero-form .banners-big__buttons {
		display: none !important;
	}
}

/* Заголовок и лид не сжимаются при длинном списке файлов; форма — flex-остаток с min-height для внутреннего скролла */
.rscable-banners-big__wrapper--hero-form .banners-big__text.banners-big__depend-height > .banners-big__title,
.rscable-banners-big__wrapper--hero-form .banners-big__text.banners-big__depend-height > .banners-big__title h1,
.rscable-banners-big__wrapper--hero-form .banners-big__text.banners-big__depend-height > .banners-big__text-wrapper {
	flex-shrink: 0;
}

.rscable-banners-big__wrapper--hero-form .banners-big__text.banners-big__depend-height > .rscable-hero-form-wrap--in-banner-text {
	flex: 1 1 auto;
	min-height: 0;
	min-width: 0;
	align-self: stretch;
}

/* ТЗ: первый экран — ниже высота главного баннера, боковые — широкие «плитки», картинка целиком */
@media (min-width: 992px) {
	body.index .banners-big--normal {
		--big-banner-height: min(520px, 52vh);
	}

	body.index .banners-big--side-banners .banners-big__side-items {
		gap: 10px;
	}

	body.index .banners-big--side-banners .banners-big__side-item {
		flex: 1 1 auto;
		min-height: 0;
		max-height: min(160px, 18vh);
	}

	body.index .banners-big--side-banners .banners-big__side-item-image {
		background-size: contain;
		background-color: #2b2b2b;
		background-repeat: no-repeat;
		background-position: center center;
	}
}

/* После AJAX: успех без цепочки form/stack — не обрезать overflow:hidden у баннера */
.rscable-hero-form-wrap--ajax-success {
	overflow: visible !important;
	max-height: none !important;
}

.banners-big--adaptive-3 .rscable-banners-big__wrapper--hero-form .banners-big__text > .rscable-hero-form-wrap--ajax-success {
	overflow: visible !important;
	max-height: none !important;
}

.rscable-hero-form-inner.rscable-hero-form-inner--show-success {
	overflow: visible !important;
}
