/*
 * CSS-only slider fixes for the Online Electro Store homepage slider.
 *
 * The parent script initializes Swiper with fixed slide counts and
 * `spaceBetween: 30`. The parent CSS then changes real slide widths to
 * 25%/50% and adds flex gap, so the rendered flex layout no longer matches
 * Swiper's translation grid. With 6 slides this mismatch becomes visible after
 * the first loop movement. These overrides keep the layout on Swiper's grid.
 */

.online-electro-store-slider .swiper-wrapper {
	gap: 0 !important;
}

.online-electro-store-slider .swiper-slide {
	max-width: none !important;
	margin-left: 0 !important;
	margin-right: 30px !important;
	margin-block-start: 0 !important;
	transition: none !important;
}

.online-electro-store-slider .swiper-slide .wp-block-cover {
	width: 100%;
	height: 100%;
	overflow: hidden;
}

@media screen and (min-width: 1200px) {
	.online-electro-store-slider .swiper-slide {
		box-sizing: border-box;
		width: calc((100% - 60px) / 3) !important;
		flex-basis: calc((100% - 60px) / 3) !important;
		max-width: none !important;
		margin-left: 0 !important;
		margin-right: 30px !important;
		overflow: visible;
		transition: none !important;
	}

	.online-electro-store-slider .swiper-slide.swiper-slide-active {
		width: calc((100% - 60px) / 3) !important;
		flex-basis: calc((100% - 60px) / 3) !important;
		z-index: 2;
	}

	.online-electro-store-slider .swiper-slide .wp-block-cover {
		position: relative;
		left: 50%;
		flex: 0 0 auto;
		transform: translateX(-50%);
		transition: width 0.45s ease;

		/* Inactive slide */
		width: 86% !important;
	}

	.online-electro-store-slider .swiper-slide.swiper-slide-active .wp-block-cover {
		/* Active slide */
		width: 118% !important;
	}

	.online-electro-store-slider .swiper-slide .slide-box {
		opacity: 0;
		visibility: hidden;
		transition: opacity 0.25s ease;
	}

	.online-electro-store-slider .swiper-slide.swiper-slide-active .slide-box {
		display: block !important;
		opacity: 1;
		visibility: visible;
	}

	.online-electro-store-pagination.swiper-pagination-clickable.swiper-pagination-bullets {
		left: 50%;
	}
}