/*
 * «Или от X/мес» и всплывашка «Сроки рассрочки» (PAY-01 п. 9, партиал
 * app/partials/pay-from.php). Подключается только там, где у сайта есть
 * сервисы рассрочки: сайт без них (doirastan.kz) этот файл не грузит.
 * Цвета — токены сайта из landing.css.
 */

.payfrom { position: relative; margin: 0 0 14px; }

.payfrom__line {
	display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px;
	padding: 9px 12px; border-radius: 10px; background: var(--tint, #eff6ff);
	list-style: none; cursor: pointer; user-select: none;
}
.payfrom__line::-webkit-details-marker { display: none; }
.payfrom__line::marker { content: ''; }
.payfrom__line:focus-visible { outline: 2px solid var(--blue, #1d4ed8); outline-offset: 2px; }

.payfrom__logos { display: inline-flex; align-items: center; gap: 6px; }
.payfrom__logo { display: block; height: 16px; width: auto; max-width: 64px; }
.payfrom__badge {
	padding: 1px 6px; border-radius: 6px; background: #fff; border: 1px solid var(--line, #e5e7eb);
	color: var(--ink, #111827); font-size: 11px; font-weight: 700; white-space: nowrap;
}

.payfrom__sum { color: var(--blue, #1d4ed8); font-size: 14px; font-weight: 700; }
.payfrom__more { margin-left: auto; color: var(--blue, #1d4ed8); font-size: 13px; text-decoration: underline; }
.payfrom__sub { flex-basis: 100%; color: var(--muted, #6b7280); font-size: 12px; }

.payfrom__pop {
	position: absolute; z-index: 30; top: calc(100% + 8px); left: 0;
	width: min(420px, calc(100vw - 32px)); padding: 16px 18px;
	border: 1px solid var(--line, #e5e7eb); border-radius: 14px; background: #fff;
	box-shadow: 0 18px 40px rgba(17, 24, 39, .14); text-align: left;
}
/* В корзине строка у правого края — всплывашка раскрывается влево. */
.payfrom--checkout .payfrom__pop { left: auto; right: 0; }

.payfrom__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.payfrom__head b { font-size: 16px; }
.payfrom__x {
	border: 0; background: none; color: var(--muted, #6b7280); font-size: 22px; line-height: 1; cursor: pointer; padding: 0 4px;
}

.payfrom__service {
	display: flex; align-items: center; gap: 8px; margin-top: 8px;
	padding: 8px 10px; border-radius: 10px; background: var(--bg-soft, #f2f6fc); font-size: 14px;
}
.payfrom__for {
	margin-left: auto; padding: 2px 8px; border-radius: 999px; background: var(--tint, #eff6ff);
	color: var(--blue, #1d4ed8); font-size: 11px; font-weight: 600; white-space: nowrap;
}

.payfrom__caption { margin: 8px 0; color: var(--muted, #6b7280); font-size: 12px; line-height: 1.45; }

.payfrom__terms { display: grid; gap: 8px; margin: 8px 0; padding: 0; list-style: none; }
.payfrom__term {
	display: flex; align-items: center; gap: 10px; padding: 9px 12px;
	border: 1px solid var(--line, #e5e7eb); border-radius: 10px; font-size: 14px;
}
.payfrom__term.is-from { border-color: transparent; background: var(--tint, #eff6ff); }
.payfrom__months { font-weight: 600; }
.payfrom__pct { padding: 1px 6px; border-radius: 6px; background: var(--bg-soft, #f2f6fc); color: var(--muted, #6b7280); font-size: 11px; }
.payfrom__money { margin-left: auto; display: grid; justify-items: end; }
.payfrom__money b { font-size: 14px; }
.payfrom__term.is-from .payfrom__money b { color: var(--blue, #1d4ed8); }
.payfrom__money small { color: var(--muted, #6b7280); font-size: 11px; }

.payfrom__hint { margin: 6px 0 0; color: var(--muted, #6b7280); font-size: 12px; line-height: 1.45; }

/* Галочка «Оставить заявку на рассрочку» в форме корзины. */
.payask {
	display: flex; align-items: flex-start; gap: 8px; margin: 0 0 12px;
	padding: 10px 12px; border: 1px solid var(--blue, #1d4ed8); border-radius: 10px;
	color: var(--blue, #1d4ed8); font-size: 14px; font-weight: 600; cursor: pointer;
}
.payask input,
.lead .payask input {
	width: auto; height: auto; flex: none; margin: 3px 0 0; padding: 0; border: 0;
	background: none; box-shadow: none; accent-color: var(--blue, #1d4ed8);
}
.payask__note { display: block; margin: 0 0 14px; color: var(--muted, #6b7280); font-size: 12px; line-height: 1.45; }

/* /raschet: блоки сервисов под «При оплате сразу». */
.rasch-inst { display: grid; gap: 10px; margin-top: 10px; }
.rasch-inst__service { padding: 10px 12px; border: 1px solid var(--line, #e5e7eb); border-radius: 12px; }
.rasch-inst__head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 14px; }
.rasch-inst__head .payfrom__for { margin-left: auto; }
.rasch-inst__row {
	display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 8px;
	padding: 5px 0; border-top: 1px solid var(--line, #e5e7eb); font-size: 13px;
}
.rasch-inst__head + .rasch-inst__row { border-top: 0; }
.rasch-inst__row .payfrom__months { white-space: nowrap; }
.rasch-inst__row .payfrom__money b { white-space: nowrap; }

@media (max-width: 600px) {
	.payfrom__pop { position: fixed; left: 16px; right: 16px; top: auto; bottom: 16px; width: auto; max-height: 80vh; overflow: auto; }
	.payfrom--checkout .payfrom__pop { left: 16px; right: 16px; }
}

/* Карточка тарифа: пример, от которого считается рассрочка. */
.plan__example { margin: -8px 0 10px; color: var(--ink, #111827); font-size: 13px; font-weight: 600; }
.rasch-inst__row.is-from .payfrom__money b { color: var(--blue, #1d4ed8); }

/* Четыре тарифа в ряд (Битрикс24): карточки узкие — строка плотнее. */
.plans--four .payfrom__line { gap: 2px 6px; padding: 8px 10px; }
.plans--four .payfrom__sum { font-size: 13px; }
