/* Квиз-бот «Подбор измельчителя» */
.cq,
.cq *,
.cq *::before,
.cq *::after {
	box-sizing: border-box;
}

html.cq-open,
html.cq-open body {
	overflow: hidden;
}

.cq[hidden] {
	display: none;
}

.cq {
	position: fixed;
	inset: 0;
	z-index: 100000;
	font-family: 'Onest', Arial, sans-serif;
	color: #102631;
}

.cq__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(10, 20, 30, 0.45);
}

.cq__dialog {
	position: absolute;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	width: min(660px, calc(100vw - 24px));
	height: min(694px, calc(100vh - 24px));
	display: flex;
	flex-direction: column;
	background: #fff;
	border-radius: 28px;
	overflow: hidden;
}

.cq__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 32px 32px 10px 32px;
}

.cq__title {
	font-size: 22px;
	font-weight: 700;
	color: rgba(16, 38, 49, 0.55);
}

.cq__close {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 0;
	background: transparent;
	color: rgba(16, 38, 49, 0.45);
	cursor: pointer;
	border-radius: 8px;
}
.cq__close:hover { color: #102631; }

.cq__progress {
	display: flex;
	align-items: center;
	gap: 40px;
	padding: 20px 32px 20px 32px;
	box-shadow: 0 8px 16px -8px rgba(16, 38, 49, 0.18);
	position: relative;
	z-index: 2;
}

.cq__step-label {
	font-size: 16px;
	font-weight: 500;
	color: rgba(68, 68, 68, 1);
	white-space: nowrap;
}
.cq__step-text { display: none; }
.cq__step-num { display: inline; }
@media (min-width: 768px) {
	.cq__step-num { display: none; }
	.cq__step-text { display: inline; }
}

.cq__dots {
	display: flex;
	align-items: center;
	flex: 1;
}

.cq__dot {
	position: relative;
	flex: 0 0 auto;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	border: 1px solid rgba(185, 185, 185, 1);
	background: #fff;
}
.cq__dot + .cq__dot {
	margin-left: 64px;
}
.cq__dot + .cq__dot::before {
	content: '';
	position: absolute;
	right: calc(100% + 6px);
	top: 50%;
	width: 52px;
	height: 1px;
	transform: translateY(-50%);
	background: rgba(16, 38, 49, 0.15);
}
.cq__dot.is-done,
.cq__dot.is-current {
	background: rgba(48, 51, 255, 1);
	border-color: rgba(48, 51, 255, 1);
}
.cq__dot.is-done::before {
	background: #2B44E4;
}

.cq__body {
	flex: 1;
	overflow-y: auto;
	padding: 20px 32px;
	scrollbar-width: thin;
	scrollbar-color: rgba(16, 38, 49, 0.18) transparent;
}
.cq__body::-webkit-scrollbar {
	width: 6px;
}
.cq__body::-webkit-scrollbar-track {
	background: transparent;
}
.cq__body::-webkit-scrollbar-thumb {
	background: rgba(16, 38, 49, 0.15);
	border-radius: 3px;
}
.cq__body::-webkit-scrollbar-thumb:hover {
	background: rgba(16, 38, 49, 0.3);
}

.cq__bubble-row {
	display: flex;
	align-items: flex-end;
	gap: 10px;
	margin-bottom: 16px;
}

.cq__avatar {
	flex: 0 0 auto;
	width: 52px;
	height: 52px;
	border-radius: 50%;
	object-fit: cover;
	background: #fff;
}

.cq__bubble {
	flex: 1;
	background: #fff;
	border: 1px solid rgba(16, 38, 49, 0.12);
	border-radius: 24px;
	border-bottom-left-radius: 6px;
	padding: 16px 20px;
}

.cq__q {
	margin: 0 0 4px;
	font-size: 18px;
	font-weight: 600;
	line-height: 1.35;
}
.cq__q--greeting {
	margin: 0;
	font-weight: 400;
}

.cq__hint {
	margin: 0;
	font-size: 16px;
	font-weight: 500;
	color: rgba(153, 153, 153, 1);
}

/* Варианты ответов */
.cq__opts { display: grid; gap: 10px; }
.cq__opts--cards2 { grid-template-columns: repeat(2, 1fr); }
.cq__opts--cards3 { grid-template-columns: repeat(3, 1fr); }
.cq__opts--pills { display: flex; flex-wrap: wrap; gap: 10px; }
.cq__opts--buttons2 { grid-template-columns: repeat(2, 1fr); }

.cq__opt {
	position: relative;
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 16px;
	border: 1.5px solid rgba(16, 38, 49, 0.12);
	border-radius: 16px;
	background: #F5F6FA;
	font: inherit;
	color: inherit;
	text-align: left;
	cursor: pointer;
	transition: border-color .15s, background .15s;
}
.cq__opt:hover { border-color: rgba(48, 51, 255, 1); }
.cq__opt.is-selected {
	border-color: rgba(48, 51, 255, 1);
	background: rgba(237, 240, 255, 1);
}

.cq__opt--pills {
	padding: 10px 18px;
	border-radius: 8px;
	background: #fff;
}
.cq__opt--buttons2 {
	justify-content: center;
	padding: 14px;
	background: #fff;
	text-align: center;
}
.cq__opt--wide { grid-column: 1 / -1; }

.cq__opt--cards2 .cq__opt-img {
	flex: 0 0 64px;
	width: 64px;
	height: 64px;
	border-radius: 10px;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
	background: transparent;
}
.cq__opt--cards2 .cq__opt-img img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
}
.cq__opt-img--unknown {
	font-size: 26px;
	font-weight: 600;
	color: rgba(16, 38, 49, 0.35);
}
.cq__opt--cards2 .cq__opt-img--unknown {
	background: #fff;
	border-radius: 50%;
}
.cq__opt--cards2 .cq__opt-img--unknown img {
	max-width: 55%;
	max-height: 55%;
}

.cq__opt--cards2 .cq__opt-body { min-width: 0; }
.cq__opt--cards2 .cq__opt-body b {
	display: block;
	font-size: 16px;
	font-weight: 500;
	line-height: 1.25;
	margin-bottom: 6px;
}
.cq__opt--cards2 .cq__opt-body span {
	display: block;
	font-size: 14px;
	font-weight: 400;
	line-height: 1.35;
	color: rgba(68, 68, 68, 1);
}

.cq__opt--cards3 {
	flex-direction: column;
	align-items: stretch;
	gap: 8px;
	padding: 10px;
}
.cq__opt--cards3 .cq__opt-img {
	display: block;
	height: 92px;
	border-radius: 8px;
	overflow: hidden;
}
.cq__opt--cards3 .cq__opt-img img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}
.cq__opt--cards3 .cq__opt-label {
	font-size: 14px;
	font-weight: 400;
	line-height: 1.3;
	text-align: center;
}

.cq__opt-check { display: none; }

/* Загрузка */
.cq__loading {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 16px;
	min-height: 300px;
	color: rgba(16, 38, 49, 0.6);
	font-size: 14px;
}
.cq__spinner {
	width: 44px;
	height: 44px;
	border: 4px solid rgba(43, 68, 228, 0.15);
	border-top-color: #2B44E4;
	border-radius: 50%;
	animation: cq-spin .8s linear infinite;
}
@keyframes cq-spin { to { transform: rotate(360deg); } }

/* Результат */
.cq__result {
	display: flex;
	gap: 18px;
	align-items: flex-start;
}
.cq__result-media {
	flex: 0 0 40%;
	max-width: 250px;
}
.cq__result-media img {
	width: 100%;
	height: auto;
	display: block;
}
.cq__result-label {
	display: block;
	font-size: 12px;
	font-weight: 500;
	color: rgba(16, 38, 49, 0.5);
	margin-bottom: 4px;
}
.cq__result-title {
	margin: 0 0 8px;
	font-size: 18px;
	font-weight: 800;
	line-height: 1.25;
}
.cq__result-text {
	margin: 0 0 12px;
	font-size: 13px;
	line-height: 1.55;
	color: rgba(16, 38, 49, 0.7);
}
.cq__result-link,
.cq__alt-link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 15px;
	font-weight: 600;
	color: rgba(48, 51, 255, 1);
	text-decoration: none;
}
.cq__result-link:hover,
.cq__alt-link:hover { text-decoration: underline; }

.cq__specs { margin-top: 20px; }
.cq__specs-title {
	margin: 0 0 12px;
	font-size: 17px;
	font-weight: 700;
}
.cq__specs-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 12px;
}
.cq__spec b {
	display: block;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.25;
	margin-bottom: 3px;
}
.cq__spec span {
	font-size: 12px;
	line-height: 1.3;
	color: rgba(16, 38, 49, 0.5);
}

.cq__alt { margin-top: 22px; }
.cq__alt-title {
	margin: 0 0 6px;
	font-size: 14px;
	font-weight: 500;
	color: rgba(153, 153, 153, 1);
}
.cq__alt-name {
	margin: 0 0 6px;
	font-size: 17px;
	font-weight: 700;
	line-height: 1.3;
}
.cq__alt-text {
	margin: 0 0 10px;
	font-size: 14px;
	color: rgba(16, 38, 49, 0.6);
	line-height: 1.45;
}

.cq__result-actions {
	display: flex;
	gap: 10px;
	margin-top: 16px;
}
.cq__order,
.cq__consult {
	flex: 1;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 14px 18px;
	border-radius: 10px;
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
	transition: background .15s, color .15s;
}
.cq__order {
	border: 1.5px solid #2B44E4;
	background: #fff;
	color: #2B44E4;
}
.cq__order:hover { background: #EEF1FF; }
.cq__consult {
	border: 1.5px solid #2B44E4;
	background: #2B44E4;
	color: #fff;
}
.cq__consult:hover { background: #2236bd; }

/* Форма консультации */
.cq__form-title {
	margin: 0 0 8px;
	font-size: 17px;
	font-weight: 800;
	line-height: 1.3;
}
.cq__form-text {
	margin: 0 0 18px;
	font-size: 13px;
	line-height: 1.55;
	color: rgba(16, 38, 49, 0.65);
}
.cq__field {
	display: block;
	margin-bottom: 12px;
}
.cq__field span {
	display: block;
	margin-bottom: 6px;
	font-size: 13px;
	font-weight: 500;
}
.cq__field input {
	width: 100%;
	padding: 13px 14px;
	border: 1.5px solid rgba(16, 38, 49, 0.12);
	border-radius: 10px;
	background: #F5F6FA;
	font: inherit;
	font-size: 14px;
}
.cq__field input:focus {
	outline: none;
	border-color: #2B44E4;
	background: #fff;
}
.cq__field input.is-invalid { border-color: #d33; }
.cq__form-msg {
	margin: 8px 0 0;
	font-size: 13px;
	color: #c92a2a;
}

/* Успех */
.cq__success {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 300px;
	text-align: center;
	gap: 8px;
}
.cq__success-title {
	margin: 8px 0 0;
	font-size: 18px;
	font-weight: 800;
}
.cq__success-text {
	margin: 0;
	font-size: 14px;
	color: rgba(16, 38, 49, 0.6);
}

/* Нижняя навигация */
.cq__foot {
	display: flex;
	gap: 24px;
	padding: 28px 32px;
	border-top: none;
}
.cq__back,
.cq__next {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	padding: 14px 20px;
	border-radius: 10px;
	font: inherit;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: background .15s, color .15s, border-color .15s;
}
.cq__back {
	flex: 1;
	border: 1.5px solid rgba(48, 51, 255, 1);
	background: #fff;
	color: rgba(48, 51, 255, 1);
	font-size: 18px;
	font-weight: 600;
	border-radius: 8px;
}
.cq__back:hover:not(:disabled) { background: #EEF1FF; }
.cq__back:disabled {
	border-color: transparent;
	color: rgba(153, 153, 153, 1);
	background: rgba(246, 246, 249, 1);
	cursor: default;
}
.cq__next {
	flex: 1;
	border: 1.5px solid rgba(48, 51, 255, 1);
	background: rgba(48, 51, 255, 1);
	color: #fff;
	font-weight: 600;
	font-size: 18px;
	border-radius: 8px;
}
.cq__next:hover:not(:disabled) { background: #2236bd; }
.cq__next:disabled {
	border:none;
	background: rgba(246, 246, 249, 1);
	color: rgba(153, 153, 153, 1);
	cursor: default;
}

@media (max-width: 767px) {
	.cq__dialog {
		left: 0;
		top: 0;
		transform: none;
		width: 100vw;
		height: 100dvh;
		border-radius: 0;
	}
	.cq__head { padding: 14px 16px 4px; }
	.cq__progress { padding: 4px 16px 12px; }
	.cq__body { padding: 14px 16px; }
	.cq__foot { padding: 12px 16px; }
	.cq__opts--cards2 { grid-template-columns: 1fr; }
	.cq__opts--cards3 { grid-template-columns: repeat(2, 1fr); }
	.cq__opts--buttons2 { grid-template-columns: 1fr; }
	.cq__specs-grid { grid-template-columns: repeat(2, 1fr); }
	.cq__result { flex-direction: column; }
	.cq__result-media {
		flex: none;
		max-width: 220px;
		margin: 0 auto;
	}
	.cq__result-actions { flex-direction: column; }
	.cq__avatar { width: 44px; height: 44px; }
	.cq__dot { width: 18px; height: 18px; }
	.cq__dot + .cq__dot { margin-left: 34px; }
	.cq__dot + .cq__dot::before { width: 22px; }
}
