/*
 * bizbank/stats-grid. Values follow the production grid_section: the
 * homepage and /pro-bank/ mosaic for "numbers", the digital products tabs
 * for "text". The look depends on the card position (nth-child), so the
 * cards are the direct children of .bb-stats-grid__grid, on the front end
 * and in the editor alike. Production rows are a fixed 282px; here a row
 * grows when a card's text does not fit, and looks the same when it does.
 * The "strip" and "trust" tiles at the end of the file take their values
 * from the BISeshka credit card mock (b-strip, b-trust) and use their own
 * classes, so none of the mosaic rules reach them. "facts" after them is the
 * white three-card variant of the Factoring page and follows the same rule.
 */

.bb-stats-grid {
	padding: 39px 0;
}

.bb-stats-grid .bb-stats-grid__title {
	margin: 0;
	padding: 16px 20px;
	font-size: 40px;
	font-weight: 800;
	line-height: 1.2;
}

.bb-stats-grid .bb-stats-grid__title + .bb-stats-grid__slider {
	margin-top: 14px;
}

.bb-stats-grid .bb-stats-grid__grid {
	position: relative;
	display: grid;
	grid-auto-rows: minmax(282px, auto);
	grid-auto-columns: 1fr 1fr 1fr;
	gap: 10px;
}

.bb-stats-grid--text .bb-stats-grid__grid {
	grid-template-columns: 42.5% calc(15% - 20px) 42.5%;
}

.bb-stats-grid .bb-stats-grid__card {
	position: relative;
	display: grid;
	align-content: end;
	min-height: 282px;
	max-width: none;
	margin: 0;
	padding: 34px 50px;
	border-radius: 20px;
	background-color: var(--bb-white);
}

.bb-stats-grid .bb-stats-grid__card:nth-child(4n+1) {
	grid-column: span 2;
}

.bb-stats-grid .bb-stats-grid__card:nth-child(4n+4) {
	grid-column: 2 / span 2;
}

.bb-stats-grid .bb-stats-grid__grid:has(> .bb-stats-grid__card:last-child:nth-child(odd)) > .bb-stats-grid__card:last-child {
	grid-column: 1 / 4;
}

.bb-stats-grid .bb-stats-grid__card:nth-child(2),
.bb-stats-grid .bb-stats-grid__card:nth-child(3) {
	background-color: var(--bb-yellow);
}

.bb-stats-grid--squirrels .bb-stats-grid__card:nth-child(1)::after {
	content: "";
	display: block;
	position: absolute;
	right: 34px;
	bottom: 0;
	width: 235px;
	height: 235px;
	background: url(../assets/img/stats-grid-squirrel-yellow.svg) right bottom no-repeat;
	pointer-events: none;
}

.bb-stats-grid--squirrels .bb-stats-grid__card:nth-child(4) {
	background: var(--bb-white) url(../assets/img/stats-grid-squirrel-grey.svg) right bottom no-repeat;
}

.bb-stats-grid .bb-stats-grid__value {
	margin: 0;
	padding: 0;
	font-size: 55px;
	font-weight: 800;
	line-height: 1;
}

.bb-stats-grid .bb-stats-grid__text {
	max-width: 520px;
	margin: 0;
	padding: 41px 0 0;
	font-size: 32px;
	font-weight: 400;
	line-height: 1.5;
}

.bb-stats-grid--text .bb-stats-grid__text {
	max-width: none;
	padding: 12.8px 0;
	font-weight: 600;
}

.bb-stats-grid .bb-stats-grid__dots {
	display: none;
}

@media screen and (max-width: 991px) {

	.bb-stats-grid {
		padding: 20px 0 32px;
	}

	.bb-stats-grid .bb-stats-grid__title {
		padding: 16px 0 23px;
		font-size: 28px;
	}

	.bb-stats-grid .bb-stats-grid__title + .bb-stats-grid__slider {
		margin-top: 0;
	}

	.bb-stats-grid .bb-stats-grid__slider {
		margin-left: -16px;
	}

	.bb-stats-grid .bb-stats-grid__grid {
		display: flex;
		align-items: flex-start;
		gap: 0;
		overflow-x: auto;
		overscroll-behavior-x: contain;
		scroll-snap-type: x mandatory;
		scrollbar-width: none;
		-webkit-overflow-scrolling: touch;
	}

	.bb-stats-grid .bb-stats-grid__grid::-webkit-scrollbar {
		display: none;
	}

	.bb-stats-grid .bb-stats-grid__card:nth-child(n) {
		flex: 0 0 calc(100% - 16px);
		min-height: 270px;
		margin: 0 0 2px 16px;
		padding: 31px 16px;
		scroll-margin-left: 16px;
		scroll-snap-align: start;
		scroll-snap-stop: always;
	}

	.bb-stats-grid--squirrels .bb-stats-grid__card:nth-child(1)::after {
		top: 15px;
		bottom: auto;
		width: 105px;
		background: url(../assets/img/stats-grid-squirrel-yellow-mob.svg) center top / 100% auto no-repeat;
	}

	.bb-stats-grid .bb-stats-grid__value {
		font-size: 40px;
		line-height: 1.3;
	}

	.bb-stats-grid .bb-stats-grid__text {
		padding-top: 23px;
		font-size: 24px;
	}

	.bb-stats-grid--text .bb-stats-grid__text {
		padding: 12.8px 0;
	}

	.bb-stats-grid .bb-stats-grid__dots {
		display: flex;
		justify-content: center;
		align-items: flex-end;
		height: 30px;
		margin: 0;
		padding: 0;
	}

	.bb-stats-grid .bb-stats-grid__dots[hidden] {
		display: none;
	}

	.bb-stats-grid .bb-stats-grid__dot {
		display: block;
		flex: 0 0 auto;
		width: 16px;
		height: 16px;
		margin: 0 7px;
		padding: 0;
		border: 0;
		border-radius: 100%;
		background: var(--bb-black);
		font-size: 0;
		opacity: 0.3;
		cursor: pointer;
		transition: opacity 0.3s;
		appearance: none;
	}

	.bb-stats-grid .bb-stats-grid__dot[aria-current="true"],
	.bb-stats-grid .bb-stats-grid__dot:hover {
		opacity: 1;
	}

	.bb-stats-grid .bb-stats-grid__dot:focus-visible {
		outline: 2px solid var(--bb-black);
		outline-offset: 2px;
	}
}

/*
 * "strip" and "trust". A tile caption is an inline box in a line of the
 * tile's own text (24px/36px, 20px/30px up to 991px), as the mock renders
 * its <span> captions, so a caption line is as tall as that line whatever
 * the caption size.
 */
.bb-stats-grid.bb-stats-grid--strip {
	padding: 0 0 50px;
}

.bb-stats-grid.bb-stats-grid--trust {
	padding: 0 0 60px;
}

.bb-stats-grid:is(.bb-stats-grid--strip, .bb-stats-grid--trust) .bb-stats-grid__title {
	margin: 0 0 18px;
	padding: 0;
	font-size: 40px;
	font-weight: 800;
	line-height: 1.15;
	letter-spacing: -0.5px;
}

.bb-stats-grid .bb-stats-grid__tiles {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 14px;
}

.bb-stats-grid .bb-stats-grid__tile {
	display: block;
	min-width: 0;
	margin: 0;
	font-size: 24px;
	font-weight: 400;
	line-height: 36px;
}

.bb-stats-grid--strip .bb-stats-grid__tile {
	padding: 24px 26px;
	border: 0;
	border-radius: 20px;
	background: #111;
	color: var(--bb-white);
}

.bb-stats-grid--trust .bb-stats-grid__tile {
	padding: 22px 24px;
	border: 1px solid #e3e9ef;
	border-radius: 18px;
	background: var(--bb-white);
	color: var(--bb-black);
}

.bb-stats-grid .bb-stats-grid__tile-value {
	display: block;
	margin: 0 0 8px;
	padding: 0;
	font-weight: 700;
}

.bb-stats-grid--strip .bb-stats-grid__tile-value {
	font-size: 34px;
	line-height: 1.1;
	color: var(--bb-yellow);
}

.bb-stats-grid--trust .bb-stats-grid__tile-value {
	font-size: 20px;
	line-height: 1.5;
	color: var(--bb-black);
}

.bb-stats-grid .bb-stats-grid__tile-text {
	display: inline;
	margin: 0;
	padding: 0;
	font-weight: 400;
}

.bb-stats-grid--strip .bb-stats-grid__tile-text {
	font-size: 15px;
	line-height: 1.4;
	color: #d6dade;
}

.bb-stats-grid--trust .bb-stats-grid__tile-text {
	font-size: 14px;
	line-height: 1.5;
	color: #4b555f;
}

.bb-stats-grid .bb-stats-grid__note {
	max-width: 1160px;
	margin: 18px 0 0;
	padding: 0;
	font-size: 15px;
	font-weight: 400;
	line-height: 1.6;
	color: #4b555f;
}

.bb-stats-grid .bb-stats-grid__note a {
	display: inline;
	color: var(--bb-blue);
	text-decoration: underline;
}

.bb-stats-grid .bb-stats-grid__note a:hover {
	text-decoration: none;
}

@media screen and (max-width: 1024px) {

	.bb-stats-grid:is(.bb-stats-grid--strip, .bb-stats-grid--trust) .bb-stats-grid__title {
		font-size: 32px;
	}

	.bb-stats-grid .bb-stats-grid__tiles {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media screen and (max-width: 991px) {

	.bb-stats-grid .bb-stats-grid__tile {
		font-size: 20px;
		line-height: 30px;
	}
}

@media screen and (max-width: 767px) {

	.bb-stats-grid.bb-stats-grid--strip {
		padding-bottom: 36px;
	}

	.bb-stats-grid.bb-stats-grid--trust {
		padding-bottom: 40px;
	}

	.bb-stats-grid:is(.bb-stats-grid--strip, .bb-stats-grid--trust) .bb-stats-grid__title {
		font-size: 24px;
		line-height: 1.2;
	}

	.bb-stats-grid .bb-stats-grid__tiles {
		grid-template-columns: minmax(0, 1fr);
	}

	.bb-stats-grid--strip .bb-stats-grid__tile {
		padding: 18px 20px;
	}

	.bb-stats-grid--trust .bb-stats-grid__tile {
		padding: 20px 18px;
		border-radius: 16px;
	}

	.bb-stats-grid--strip .bb-stats-grid__tile-value {
		font-size: 28px;
	}
}

/*
 * "facts": white cards of the Factoring mock (three in a row, a bold value
 * and a caption, a note under them). The section carries its own bottom
 * margin and no padding; the values switch at the mock's 650px. The
 * selectors have one class more than the shared tile rules above, so they
 * win at every width without !important. The caption is a block here, not
 * the inline box of "strip" and "trust".
 */
.bb.bb-stats-grid.bb-stats-grid--facts {
	margin: 0 0 64px;
	padding: 0;
}

.bb-stats-grid.bb-stats-grid--facts .bb-stats-grid__title {
	margin: 0 0 24px;
	padding: 0;
	font-size: 34px;
	font-weight: 800;
	line-height: 1.25;
	letter-spacing: normal;
	color: #000;
}

.bb-stats-grid.bb-stats-grid--facts .bb-stats-grid__tiles {
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 16px;
}

.bb-stats-grid.bb-stats-grid--facts .bb-stats-grid__tile {
	padding: 28px;
	border: 0;
	border-radius: 22px;
	background: var(--bb-white);
	color: #000;
	font-size: 18px;
	font-weight: 400;
	line-height: 1.5;
}

.bb-stats-grid.bb-stats-grid--facts .bb-stats-grid__tile-value {
	display: block;
	margin: 0 0 12px;
	font-size: 23px;
	font-weight: 800;
	line-height: 1.35;
	color: #000;
}

.bb-stats-grid.bb-stats-grid--facts .bb-stats-grid__tile-text {
	display: block;
	font-size: 18px;
	font-weight: 400;
	line-height: 1.5;
	color: #000;
}

.bb-stats-grid.bb-stats-grid--facts .bb-stats-grid__note {
	max-width: none;
	margin: 20px 0 0;
	font-size: 14px;
	font-weight: 400;
	line-height: 1.6;
	color: #000;
}

@media screen and (max-width: 650px) {

	.bb.bb-stats-grid.bb-stats-grid--facts {
		margin-bottom: 48px;
	}

	.bb-stats-grid.bb-stats-grid--facts .bb-stats-grid__title {
		font-size: 27px;
	}

	.bb-stats-grid.bb-stats-grid--facts .bb-stats-grid__tiles {
		grid-template-columns: minmax(0, 1fr);
	}

	.bb-stats-grid.bb-stats-grid--facts .bb-stats-grid__tile {
		padding: 24px;
		border-radius: 18px;
		font-size: 16px;
		line-height: 24px;
	}

	.bb-stats-grid.bb-stats-grid--facts .bb-stats-grid__tile-value {
		font-size: 22px;
	}

	.bb-stats-grid.bb-stats-grid--facts .bb-stats-grid__tile-text {
		font-size: 16px;
		line-height: 24px;
	}
}
