/**
 * Каталог МФО. Мобильная вёрстка первой, десктоп — через min-width.
 * Никаких внешних шрифтов и картинок: всё наследуется от темы.
 */

.mfo-catalog {
	--mfo-accent: #0f6b54;
	--mfo-accent-hover: #0b5644;
	--mfo-ink: #17211d;
	--mfo-muted: #5f6a64;
	--mfo-line: #dfe4e1;
	--mfo-surface: #fff;
	--mfo-soft: #f4f7f5;
	--mfo-radius: 10px;

	margin: 0 0 2rem;
}

.mfo-catalog *,
.mfo-catalog *::before,
.mfo-catalog *::after {
	box-sizing: border-box;
}

.mfo-catalog__title {
	margin: 0 0 1rem;
}

/* ---------- Фильтры ---------- */

.mfo-filters {
	background: var(--mfo-soft);
	border: 1px solid var(--mfo-line);
	border-radius: var(--mfo-radius);
	padding: 14px;
	margin-bottom: 18px;
}

.mfo-filters__row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
}

@media (min-width: 760px) {
	.mfo-filters__row {
		grid-template-columns: repeat(4, 1fr);
	}
}

.mfo-field label {
	display: block;
	font-size: 12px;
	font-weight: 600;
	color: var(--mfo-muted);
	margin-bottom: 4px;
}

.mfo-field__input {
	position: relative;
	display: flex;
	align-items: center;
}

.mfo-field input,
.mfo-field select {
	width: 100%;
	padding: 9px 11px;
	font-size: 15px;
	line-height: 1.2;
	color: var(--mfo-ink);
	background: var(--mfo-surface);
	border: 1px solid var(--mfo-line);
	border-radius: 7px;
	-webkit-appearance: none;
	appearance: none;
}

.mfo-field select {
	background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%235f6a64' stroke-width='1.8' d='M1 1.5 6 6.5l5-5'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 11px center;
	padding-right: 30px;
}

.mfo-field input:focus,
.mfo-field select:focus {
	outline: 2px solid var(--mfo-accent);
	outline-offset: 1px;
	border-color: var(--mfo-accent);
}

.mfo-field__unit {
	position: absolute;
	right: 11px;
	font-size: 13px;
	color: var(--mfo-muted);
	pointer-events: none;
}

.mfo-field__input input {
	padding-right: 48px;
}

.mfo-filters__flags {
	display: flex;
	flex-wrap: wrap;
	gap: 7px;
	border: 0;
	padding: 12px 0 0;
	margin: 0;
}

.mfo-chip {
	display: inline-flex;
	align-items: center;
	cursor: pointer;
}

.mfo-chip input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
}

.mfo-chip span {
	display: inline-block;
	padding: 5px 11px;
	font-size: 13.5px;
	line-height: 1.35;
	color: var(--mfo-muted);
	background: var(--mfo-surface);
	border: 1px solid var(--mfo-line);
	border-radius: 20px;
	transition: background-color .14s, color .14s, border-color .14s;
}

.mfo-chip input:checked + span {
	background: var(--mfo-accent);
	border-color: var(--mfo-accent);
	color: #fff;
}

.mfo-chip input:focus-visible + span {
	outline: 2px solid var(--mfo-accent);
	outline-offset: 2px;
}

.mfo-filters__foot {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	min-height: 20px;
	margin-top: 10px;
}

.mfo-filters__count {
	margin: 0;
	font-size: 13.5px;
	color: var(--mfo-muted);
}

.mfo-filters__reset {
	background: none;
	border: 0;
	padding: 0;
	font-size: 13.5px;
	color: var(--mfo-accent);
	text-decoration: underline;
	cursor: pointer;
}

/* ---------- Список ---------- */

.mfo-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
	counter-reset: mfo;
}

.mfo-catalog__empty {
	padding: 16px;
	border: 1px dashed var(--mfo-line);
	border-radius: var(--mfo-radius);
	color: var(--mfo-muted);
	text-align: center;
	margin-bottom: 12px;
}

.mfo-card {
	display: grid;
	grid-template-columns: 1fr;
	gap: 12px;
	background: var(--mfo-surface);
	border: 1px solid var(--mfo-line);
	border-radius: var(--mfo-radius);
	padding: 14px;
}

.mfo-card[hidden] {
	display: none;
}

@media (min-width: 760px) {
	.mfo-card {
		grid-template-columns: 180px 1fr 190px;
		align-items: center;
		gap: 18px;
		padding: 16px 18px;
	}

	.mfo-card__meta {
		grid-column: 1 / -1;
	}
}

/* Бренд */

.mfo-card__brand {
	display: flex;
	flex-direction: column;
	gap: 4px;
	align-items: flex-start;
}

.mfo-card__logo {
	display: block;
	max-width: 150px;
}

.mfo-card__logo img {
	display: block;
	width: auto;
	height: auto;
	max-width: 150px;
	max-height: 46px;
	object-fit: contain;
}

.mfo-card__logo--text {
	font-weight: 700;
	font-size: 17px;
	color: var(--mfo-ink);
	text-decoration: none;
}

.mfo-card__name {
	font-weight: 600;
	font-size: 15px;
	color: var(--mfo-ink);
	text-decoration: none;
}

.mfo-card__name:hover {
	color: var(--mfo-accent);
}

.mfo-card__license {
	font-size: 11.5px;
	color: var(--mfo-muted);
}

.mfo-card__license a {
	color: inherit;
	text-decoration: none;
	border-bottom: 1px dotted currentColor;
}

/* Характеристики */

.mfo-card__specs {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 8px 14px;
	margin: 0;
}

@media (min-width: 520px) {
	.mfo-card__specs {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

.mfo-spec {
	min-width: 0;
}

.mfo-spec dt {
	font-size: 11.5px;
	text-transform: uppercase;
	letter-spacing: .05em;
	color: var(--mfo-muted);
	margin-bottom: 1px;
}

.mfo-spec dd {
	margin: 0;
	font-size: 15px;
	font-weight: 600;
	color: var(--mfo-ink);
	font-variant-numeric: tabular-nums;
}

.mfo-spec--amount dd,
.mfo-spec--rate dd {
	color: var(--mfo-accent);
}

/* Действие */

.mfo-card__action {
	display: flex;
	flex-direction: column;
	gap: 6px;
	align-items: stretch;
	text-align: center;
}

.mfo-card__cta {
	display: block;
	padding: 12px 18px;
	background: var(--mfo-accent);
	color: #fff;
	font-weight: 600;
	font-size: 15.5px;
	line-height: 1.2;
	text-decoration: none;
	border-radius: 7px;
	transition: background-color .14s;
}

.mfo-card__cta:hover,
.mfo-card__cta:focus {
	background: var(--mfo-accent-hover);
	color: #fff;
}

.mfo-card__more {
	font-size: 13px;
	color: var(--mfo-muted);
	text-decoration: none;
	border-bottom: 1px dotted currentColor;
	align-self: center;
}

.mfo-card__more:hover {
	color: var(--mfo-accent);
}

/* Признаки и годовая ставка */

.mfo-card__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 6px 14px;
	padding-top: 10px;
	border-top: 1px solid var(--mfo-line);
}

.mfo-card__tags {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0;
	padding: 0;
}

.mfo-card__tags li {
	font-size: 12px;
	color: var(--mfo-muted);
	background: var(--mfo-soft);
	border-radius: 4px;
	padding: 2px 8px;
}

.mfo-card__apr {
	margin: 0;
	font-size: 11.5px;
	color: var(--mfo-muted);
}

.mfo-catalog__note {
	margin: 12px 0 0;
	font-size: 12.5px;
	color: var(--mfo-muted);
}

/* ---------- Правовые блоки ---------- */

.mfo-disclaimer,
.mfo-risk {
	font-size: 13px;
	line-height: 1.55;
	color: #5f6a64;
	margin: 1rem 0;
}

.mfo-risk {
	border-left: 3px solid #b8860b;
	background: #fbf6ea;
	padding: 12px 14px;
	border-radius: 0 6px 6px 0;
	color: #5b4a20;
}

/* ---------- Кнопка «наверх» ---------- */

.mfo-top {
	position: fixed;
	right: 16px;
	bottom: 16px;
	z-index: 90;
	width: 44px;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #17211d;
	color: #fff;
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	transition: opacity .18s, transform .18s, visibility .18s;
	box-shadow: 0 2px 10px rgba(0, 0, 0, .18);
}

.mfo-top.is-visible {
	opacity: .9;
	visibility: visible;
	transform: none;
}

.mfo-top:hover {
	opacity: 1;
}

.mfo-top:focus-visible {
	outline: 2px solid #0f6b54;
	outline-offset: 2px;
}

/* ---------- Калькулятор ---------- */

.mfo-calc {
	border: 1px solid #dfe4e1;
	border-radius: 10px;
	padding: 16px;
	margin: 1.5rem 0;
	background: #fff;
}

.mfo-calc__title {
	margin: 0 0 12px;
	font-size: 17px;
	font-weight: 600;
}

.mfo-calc__controls {
	display: grid;
	grid-template-columns: 1fr;
	gap: 14px;
}

@media (min-width: 620px) {
	.mfo-calc__controls {
		grid-template-columns: repeat(3, 1fr);
	}
}

.mfo-calc__control label {
	display: block;
	font-size: 12px;
	font-weight: 600;
	color: #5f6a64;
	margin-bottom: 6px;
}

.mfo-calc__control output {
	display: block;
	font-size: 19px;
	font-weight: 700;
	color: #17211d;
	font-variant-numeric: tabular-nums;
	margin-bottom: 4px;
}

.mfo-calc__control input[type="range"] {
	width: 100%;
	accent-color: #0f6b54;
}

.mfo-calc__result {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 10px;
	margin-top: 16px;
	padding-top: 14px;
	border-top: 1px solid #dfe4e1;
}

@media (min-width: 620px) {
	.mfo-calc__result {
		grid-template-columns: repeat(3, 1fr);
	}
}

.mfo-calc__cell span {
	display: block;
	font-size: 11.5px;
	text-transform: uppercase;
	letter-spacing: .05em;
	color: #5f6a64;
	margin-bottom: 2px;
}

.mfo-calc__cell strong {
	font-size: 18px;
	font-variant-numeric: tabular-nums;
	color: #17211d;
}

.mfo-calc__cell--total strong {
	color: #0f6b54;
}

.mfo-calc__note {
	margin: 12px 0 0;
	font-size: 12px;
	color: #5f6a64;
}

@media (prefers-reduced-motion: reduce) {
	.mfo-top,
	.mfo-chip span,
	.mfo-card__cta {
		transition: none;
	}
}
