/* ==========================================================================
   Калькулятор стоимости
   ========================================================================== */

.calc-layout {
	display: grid;
	grid-template-columns: 1fr 360px;
	gap: clamp(1.5rem, 3vw, 2.5rem);
	align-items: start;
}

.calc-loading {
	color: var(--text-muted);
	padding: var(--space-lg);
}

/* --- Шаг --- */
.calc-step {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	padding: clamp(1.2rem, 2.5vw, 1.8rem);
	margin-bottom: var(--space-md);
}

.calc-step__head {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin-bottom: var(--space-md);
}

.calc-step__num {
	width: 34px;
	height: 34px;
	flex: none;
	border-radius: 50%;
	background: var(--accent);
	color: var(--on-accent);
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 700;
	font-size: 0.95rem;
}

.calc-step__title {
	font-family: var(--font-display);
	font-size: 1.4rem;
	font-weight: 600;
	color: var(--heading);
	margin: 0;
}

.calc-step__hint {
	font-size: var(--fs-sm);
	color: var(--text-muted);
	margin: -0.5rem 0 var(--space-md) calc(34px + 0.75rem);
}

/* --- Сетка опций --- */
.calc-options {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 0.75rem;
}

.calc-options--text {
	grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}

/* --- Карточка опции --- */
.calc-option {
	position: relative;
	display: flex;
	flex-direction: column;
	border: 1.5px solid var(--border-strong);
	border-radius: var(--radius);
	background: var(--surface);
	cursor: pointer;
	overflow: hidden;
	transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.calc-option:hover {
	border-color: var(--accent);
}

.calc-option.is-selected {
	border-color: var(--accent);
	box-shadow: var(--ring);
	background: var(--accent-soft);
}

.calc-option input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.calc-option__thumb {
	aspect-ratio: 4 / 3;
	background: var(--surface-2) center/cover no-repeat;
	position: relative;
}

.calc-option__swatch {
	aspect-ratio: 4 / 3;
	background: linear-gradient(135deg, #ccbfa8, #a89580);
}

.calc-option__zoom {
	position: absolute;
	top: 6px;
	right: 6px;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	border: none;
	background: rgba(255, 255, 255, 0.92);
	color: var(--heading);
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: var(--shadow-sm);
	z-index: 2;
}

.calc-option__zoom svg {
	width: 16px;
	height: 16px;
}

.calc-option__zoom:hover {
	background: var(--accent);
	color: #fff;
}

.calc-option__body {
	padding: 0.6rem 0.7rem;
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
	flex: 1;
}

.calc-option__name {
	font-size: var(--fs-sm);
	font-weight: 600;
	color: var(--heading);
	line-height: 1.25;
}

.calc-option__price {
	font-size: var(--fs-xs);
	color: var(--accent-hover);
	font-weight: 600;
}

.calc-option__country {
	font-size: var(--fs-xs);
	color: var(--text-muted);
}

/* Текстовые опции без картинки (тип изделия, форма, толщина) */
.calc-option--plain .calc-option__body {
	padding: 0.85rem 1rem;
	min-height: 56px;
	justify-content: center;
}

/* --- Размеры (сегменты) --- */
.calc-segments {
	display: grid;
	gap: var(--space-md);
}

.calc-segment {
	display: grid;
	grid-template-columns: auto 1fr 1fr;
	gap: 0.75rem;
	align-items: end;
}

.calc-segment__label {
	font-weight: 600;
	color: var(--heading);
	padding-bottom: 0.8rem;
	font-size: var(--fs-sm);
}

/* --- Опции (чекбоксы / количество) --- */
.calc-addons {
	display: grid;
	gap: 0.6rem;
}

.calc-addon {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	padding: 0.75rem 1rem;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--surface);
}

.calc-addon.is-on {
	border-color: var(--accent);
	background: var(--accent-soft);
}

.calc-addon__check {
	width: 22px;
	height: 22px;
	flex: none;
	accent-color: var(--accent);
}

.calc-addon__name {
	flex: 1;
	font-weight: 500;
	color: var(--heading);
	font-size: var(--fs-sm);
}

.calc-addon__price {
	font-size: var(--fs-sm);
	color: var(--text-muted);
	white-space: nowrap;
}

.calc-addon__qty {
	width: 70px;
	padding: 0.45rem 0.5rem;
	border: 1px solid var(--border-strong);
	border-radius: var(--radius-sm);
	font-family: inherit;
	text-align: center;
}

/* --- Сводка --- */
.calc-summary__sticky {
	position: sticky;
	top: calc(var(--header-h) + 1rem);
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	padding: var(--space-md);
	box-shadow: var(--shadow-md);
}

.calc-summary__label {
	font-size: var(--fs-xs);
	text-transform: uppercase;
	letter-spacing: 0.1em;
	color: var(--text-muted);
}

.calc-summary__total {
	font-family: var(--font-display);
	font-size: clamp(2rem, 5vw, 2.8rem);
	font-weight: 700;
	color: var(--accent);
	line-height: 1.1;
	margin: 0.2rem 0 var(--space-md);
}

.calc-summary__rows {
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
	margin-bottom: var(--space-md);
	border-top: 1px solid var(--border);
	padding-top: var(--space-md);
}

.calc-summary__rows li {
	display: flex;
	justify-content: space-between;
	gap: 0.5rem;
	font-size: var(--fs-sm);
}

.calc-summary__rows .row-label {
	color: var(--text-muted);
}

.calc-summary__rows .row-sum {
	font-weight: 600;
	color: var(--heading);
	white-space: nowrap;
}

.calc-lead-form {
	margin-top: var(--space-md);
	border-top: 1px solid var(--border);
	padding-top: var(--space-md);
}

.calc-lead-success {
	text-align: center;
	padding: var(--space-md) 0 0;
}

.calc-lead-success svg {
	width: 48px;
	height: 48px;
	color: var(--accent);
	margin: 0 auto 0.5rem;
}

/* --- Адаптив --- */
@media (max-width: 920px) {
	.calc-layout {
		grid-template-columns: 1fr;
	}

	.calc-summary__sticky {
		position: static;
	}
}

@media (max-width: 520px) {
	.calc-segment {
		grid-template-columns: 1fr 1fr;
	}

	.calc-segment__label {
		grid-column: 1 / -1;
		padding-bottom: 0;
	}
}
