/**
 * OPT-LINE: только главный слайдер на главной (body.index)
 * Высота 300px; фон — cover (кафе); поверх — моноблок contain без обрезки;
 * спецблок скрыт — слайдер на всю ширину ряда.
 * Баннеры / каталог / товары / шапка — не затрагиваются.
 *
 * Отступ до баннеров: margin-top у .index-banners-wrap = 16px (≥481px).
 */

body.index {
	--opt-home-slider-h: 300px;
	--opt-home-after-slider-gap: 16px;
	--opt-slider-monoblock: url("/local/images/opt-slider-titan.png");
}

/* мягкий градиент только под текстом — читаемость после cover, без серого слоя на весь слайд */
body.index #slider .sliderContent::before {
	content: "";
	position: absolute;
	inset: -24px -40px -24px -48px;
	z-index: 0;
	pointer-events: none;
	border-radius: 4px;
	background: linear-gradient(
		90deg,
		rgba(255, 255, 255, 0.72) 0%,
		rgba(255, 255, 255, 0.35) 55%,
		rgba(255, 255, 255, 0) 100%
	);
}

body.index #slider .sliderContent > * {
	position: relative;
	z-index: 1;
}

@media (min-width: 1025px) {
	body.index #sliderBlock,
	body.index #slider,
	body.index #slider .slideBox,
	body.index #slider ul li {
		height: var(--opt-home-slider-h);
		min-height: 0;
		max-height: var(--opt-home-slider-h);
	}

	/* перебить шаблонные 555/500/450 */
	body.index #slider ul li span,
	body.index #slider .slideVideoContainer,
	body.index #slider .videoPoster {
		height: var(--opt-home-slider-h) !important;
		max-height: var(--opt-home-slider-h);
	}

	/*
	 * Фон слайда: кафе (cover на всю площадь).
	 * Моноблок — отдельный слой ::after, background-size: contain (без обрезки техники).
	 */
	body.index #slider ul li span {
		background-size: cover !important;
		background-position: center center !important;
		background-repeat: no-repeat !important;
		background-color: transparent !important;
	}

	body.index #slider ul li::after {
		content: "";
		position: absolute;
		top: 8px;
		right: 24px;
		bottom: 8px;
		width: min(40%, 380px);
		z-index: 2;
		pointer-events: none;
		background-image: var(--opt-slider-monoblock);
		background-repeat: no-repeat;
		background-position: right bottom;
		background-size: contain;
	}

	body.index #slider .slideVideo {
		width: auto;
		height: 100%;
		object-fit: contain;
		left: 50%;
		transform: translate(-50%, -50%);
	}

	/* текст и кнопка читаемы в 300px */
	body.index #slider .sliderContent {
		left: 48px;
		max-width: 48%;
	}

	body.index #slider .sliderContent .bigText,
	body.index #slider .sliderContent .bigTextColor,
	body.index #slider .sliderContent .bigTextLight {
		font-size: 28px;
		line-height: 32px;
	}

	body.index #slider .sliderContent .mediumText,
	body.index #slider .sliderContent .mediumTextColor,
	body.index #slider .sliderContent .mediumTextLight {
		font-size: 16px;
		line-height: 22px;
	}

	body.index #slider .sliderContent .cButton,
	body.index #slider .sliderContent .cButtonLight {
		height: 42px;
		line-height: 42px;
		padding: 0 22px;
		margin-top: 10px;
	}

	body.index #slider ol {
		bottom: 10px;
		margin-bottom: 0;
	}

	body.index #slider .sliderBtnLeft,
	body.index #slider .sliderBtnRight {
		z-index: 5;
	}

	/*
	 * Спецпредложение скрыто: иначе #specialBlock (~543px) тянет ряд выше слайдера (300px)
	 * и под кадром остаётся серая пустота. Слайдер занимает всю ширину #promoBlock.
	 * Откат: убрать этот блок правил.
	 */
	body.index #specialBlock {
		display: none !important;
	}

	body.index #promoBlock {
		min-height: 0;
		width: 100%;
	}

	body.index #sliderBlock {
		display: block !important;
		width: 100% !important;
		min-height: 0;
		max-height: var(--opt-home-slider-h);
	}

	body.index #slider {
		width: 100% !important;
	}
}

/*
 * Серый просвет (body #f3f3f3) между #promoBlock/#slider и белыми карточками баннеров.
 * Источник: .index-banners-wrap { margin-top: 24px } в indexBanners/style.css.
 * #slider / #promoBlock margin/padding-bottom = 0 (не они).
 * Точки слайдера (#slider ol) внутри блока, высоту ряда не добавляют.
 * Действует от планшета/десктопа; на ≤480px у шаблона margin-top: 0 — не трогаем.
 */
@media (min-width: 481px) {
	body.index #promoBlock,
	body.index #sliderBlock,
	body.index #slider {
		margin-bottom: 0;
		padding-bottom: 0;
	}

	body.index .index-banners-wrap {
		margin-top: var(--opt-home-after-slider-gap);
		padding-top: 0;
	}
}

@media (max-width: 1024px) {
	body.index {
		--opt-home-slider-h: 260px;
	}

	body.index #sliderBlock,
	body.index #slider,
	body.index #slider .slideBox,
	body.index #slider ul li {
		height: var(--opt-home-slider-h);
		max-height: var(--opt-home-slider-h);
	}

	body.index #slider ul li span,
	body.index #slider .slideVideoContainer,
	body.index #slider .videoPoster {
		height: var(--opt-home-slider-h) !important;
		background-size: cover !important;
		background-position: center center !important;
		background-repeat: no-repeat !important;
		background-color: transparent !important;
	}

	body.index #slider ul li::after {
		content: "";
		position: absolute;
		top: 6px;
		right: 12px;
		bottom: 6px;
		width: min(42%, 320px);
		z-index: 2;
		pointer-events: none;
		background-image: var(--opt-slider-monoblock);
		background-repeat: no-repeat;
		background-position: right bottom;
		background-size: contain;
	}
}

@media (max-width: 768px) {
	body.index {
		--opt-home-slider-h: 220px;
	}

	body.index #slider .sliderContent {
		left: 24px;
		max-width: 70%;
	}

	body.index #slider .sliderContent .bigText,
	body.index #slider .sliderContent .bigTextColor,
	body.index #slider .sliderContent .bigTextLight {
		font-size: 22px;
		line-height: 26px;
	}
}

@media (max-width: 480px) {
	body.index {
		--opt-home-slider-h: 180px;
	}

	body.index #slider ul li span {
		background-size: cover !important;
		background-position: center center !important;
		background-color: transparent !important;
	}

	body.index #slider ul li::after {
		right: 8px;
		width: min(48%, 200px);
	}

	body.index #slider .sliderContent::before {
		inset: -12px -16px -12px -24px;
		background: linear-gradient(
			90deg,
			rgba(255, 255, 255, 0.78) 0%,
			rgba(255, 255, 255, 0.4) 60%,
			rgba(255, 255, 255, 0) 100%
		);
	}
}
