/* ==========================================================================
   Jalousie — конструктор изделия
   ========================================================================== */

.jlc { --jlc-stage-h: 280px; position: relative; }

/* Шапка и шаги */
.jlc-head { margin-bottom: 26px; }
.jlc-head__label { margin-bottom: 4px; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--jl-accent); }
.jlc-head__title { margin: 0 0 20px; font-size: clamp(28px, 3.6vw, 44px); font-weight: 800; letter-spacing: -.025em; }

.jlc-tabs {
	display: flex;
	gap: 8px;
	margin: 0;
	padding: 0 0 4px;
	list-style: none;
	overflow-x: auto;
	scrollbar-width: none;
}
.jlc-tabs::-webkit-scrollbar { display: none; }
.jlc-tab { flex: 1 0 auto; }
.jlc-tab button {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	padding: 10px 16px 10px 10px;
	border: 0;
	border-radius: 999px;
	background: var(--jl-soft);
	color: var(--jl-muted);
	font-size: 14px;
	font-weight: 600;
	white-space: nowrap;
	transition: background .15s, color .15s;
}
.jlc-tab button:hover { color: var(--jl-text); }
.jlc-tab__num {
	display: inline-flex; align-items: center; justify-content: center;
	width: 28px; height: 28px;
	flex-shrink: 0;
	border-radius: 50%;
	background: #fff;
	color: var(--jl-text);
	font-size: 13px;
	font-weight: 700;
}
.jlc-tab.is-done button { color: var(--jl-text); }
.jlc-tab.is-done .jlc-tab__num { background: var(--jl-dark); color: #fff; }
.jlc-tab.is-active button { background: var(--jl-dark); color: #fff; }
.jlc-tab.is-active .jlc-tab__num { background: var(--jl-accent); color: #fff; }

/* Раскладка */
.jlc-body {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 420px;
	gap: 36px;
	align-items: start;
}
.jlc-loading { padding: 60px 0; color: var(--jl-muted); }

.jlc-step__count { margin-bottom: 4px; font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--jl-muted); }
.jlc-step__title { margin: 0 0 22px; font-size: 28px; font-weight: 800; letter-spacing: -.02em; }

.jlc-group { margin-bottom: 30px; }
.jlc-group__head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.jlc-group__title { margin: 0; font-size: 18px; font-weight: 700; }
.jlc-help {
	display: inline-flex;
	padding: 2px;
	border: 0;
	border-radius: 50%;
	background: none;
	color: var(--jl-muted);
}
.jlc-help:hover { color: var(--jl-accent); }
.jlc-hint {
	margin: -4px 0 14px;
	padding: 14px 16px;
	border-radius: var(--jl-radius-sm);
	background: var(--jl-soft);
	color: #3a3a3c;
	font-size: 14px;
	line-height: 1.55;
}
.jlc-error { min-height: 0; margin-top: 8px; color: #c62828; font-size: 14px; font-weight: 600; }
.jlc-error:empty { display: none; }
.jlc-muted { color: var(--jl-muted); font-size: 14px; }
.jlc-link { display: inline-block; margin-top: 12px; color: var(--jl-accent); font-weight: 600; font-size: 14px; }

/* Карточки вариантов */
.jlc-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.jlc-card {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-height: 84px;
	padding: 16px 44px 16px 16px;
	border: 1.5px solid var(--jl-line);
	border-radius: var(--jl-radius);
	background: #fff;
	text-align: left;
	transition: border-color .15s, box-shadow .15s;
}
.jlc-card:hover { border-color: #c9c4bd; }
.jlc-card.is-selected { border-color: var(--jl-accent); box-shadow: inset 0 0 0 1px var(--jl-accent); }
.jlc-card__mark {
	position: absolute;
	top: 14px; right: 14px;
	display: flex; align-items: center; justify-content: center;
	width: 22px; height: 22px;
	border: 1.5px solid var(--jl-line);
	border-radius: 50%;
	color: transparent;
	transition: background .15s, border-color .15s;
}
.jlc-card.is-selected .jlc-card__mark { background: var(--jl-accent); border-color: var(--jl-accent); color: #fff; }
.jlc-card__mark svg { width: 13px; height: 13px; }
.jlc-card__text { display: flex; flex-direction: column; gap: 2px; }
.jlc-card__title { font-weight: 700; font-size: 15px; line-height: 1.3; }
.jlc-card__desc { color: var(--jl-muted); font-size: 13px; line-height: 1.35; }
.jlc-card__price { margin-top: auto; color: var(--jl-accent); font-size: 13px; font-weight: 700; }

.jlc-cards--img { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.jlc-cards--img .jlc-card { padding: 10px 10px 14px; }
.jlc-cards--img .jlc-card__mark { top: 18px; right: 18px; background: #fff; }
.jlc-card__img {
	display: flex; align-items: center; justify-content: center;
	aspect-ratio: 4 / 3;
	margin-bottom: 6px;
	border-radius: var(--jl-radius-sm);
	background: var(--jl-soft);
	color: #c9c4bd;
	overflow: hidden;
}
.jlc-card__img img { width: 100%; height: 100%; object-fit: cover; }

/* Кнопки-переключатели */
.jlc-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.jlc-pill {
	padding: 11px 20px;
	border: 1.5px solid var(--jl-line);
	border-radius: 999px;
	background: #fff;
	font-weight: 600;
	font-size: 15px;
	transition: background .15s, border-color .15s, color .15s;
}
.jlc-pill small { color: var(--jl-accent); font-weight: 700; }
.jlc-pill:hover { border-color: var(--jl-dark); }
.jlc-pill.is-selected { border-color: var(--jl-dark); background: var(--jl-dark); color: #fff; }
.jlc-pill.is-selected small { color: #fff; opacity: .8; }

/* Цвета */
.jlc-swatches { display: flex; flex-wrap: wrap; gap: 14px; }
.jlc-swatch {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	width: 84px;
	padding: 0;
	border: 0;
	background: none;
	font-size: 13px;
	text-align: center;
	line-height: 1.25;
}
.jlc-swatch__dot {
	width: 52px; height: 52px;
	border-radius: 50%;
	background-size: cover;
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12);
	outline: 2px solid transparent;
	outline-offset: 3px;
	transition: outline-color .15s;
}
.jlc-swatch:hover .jlc-swatch__dot { outline-color: var(--jl-line); }
.jlc-swatch.is-selected .jlc-swatch__dot { outline-color: var(--jl-accent); }
.jlc-swatch.is-selected .jlc-swatch__label { font-weight: 700; }
.jlc-swatch small { color: var(--jl-accent); font-weight: 700; }

/* Размеры */
.jlc-size { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.jlc-size__field { padding: 18px; border-radius: var(--jl-radius); background: var(--jl-soft); }
.jlc-size__label { display: block; margin-bottom: 10px; font-weight: 700; }
.jlc-num {
	display: flex;
	align-items: center;
	height: 54px;
	border: 1.5px solid var(--jl-line);
	border-radius: var(--jl-radius-sm);
	background: #fff;
	overflow: hidden;
}
.jlc-num:focus-within { border-color: var(--jl-dark); }
.jlc-num button {
	display: flex; align-items: center; justify-content: center;
	width: 48px; height: 100%;
	border: 0;
	background: none;
	color: var(--jl-muted);
}
.jlc-num button:hover { color: var(--jl-text); background: var(--jl-soft); }
.jlc-num input {
	flex: 1;
	min-width: 0;
	height: 100%;
	border: 0;
	outline: none;
	background: none;
	font-size: 22px;
	font-weight: 700;
	text-align: center;
	-moz-appearance: textfield;
}
.jlc-num input::-webkit-outer-spin-button,
.jlc-num input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.jlc-num--sm { height: 44px; width: 140px; }
.jlc-num--sm button { width: 40px; }
.jlc-num--sm input { font-size: 17px; }
.jlc-size__field.has-error .jlc-num { border-color: #e53935; }
.jlc-range { width: 100%; margin: 14px 0 4px; accent-color: var(--jl-accent); }
.jlc-size__limits { color: var(--jl-muted); font-size: 13px; }
.jlc-size__err { margin-top: 4px; color: #c62828; font-size: 13px; font-weight: 600; }
.jlc-size__err:empty { display: none; }
.jlc-size__overall { margin-top: 14px; font-size: 15px; color: var(--jl-muted); }
.jlc-size__overall strong { color: var(--jl-text); }

/* Материалы */
.jlc-filters { margin-bottom: 16px; }
.jlc-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.jlc-chip {
	display: inline-flex;
	flex-direction: column;
	align-items: flex-start;
	padding: 8px 14px;
	border: 1.5px solid var(--jl-line);
	border-radius: var(--jl-radius-sm);
	background: #fff;
	font-weight: 600;
	font-size: 14px;
	line-height: 1.25;
}
.jlc-chip small { color: var(--jl-muted); font-size: 12px; font-weight: 500; }
.jlc-chip.is-active { border-color: var(--jl-dark); background: var(--jl-dark); color: #fff; }
.jlc-chip.is-active small { color: rgba(255, 255, 255, .7); }
.jlc-filters__row { display: flex; gap: 8px; }
.jlc-filters__q { flex: 1; min-height: 44px; }
.jlc-filters__light { width: auto; min-height: 44px; max-width: 50%; }

.jlc-mats { display: grid; grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); gap: 16px 12px; }
.jlc-mat {
	display: flex;
	flex-direction: column;
	gap: 2px;
	padding: 0;
	border: 0;
	background: none;
	text-align: left;
}
.jlc-mat__swatch {
	position: relative;
	display: block;
	width: 100%;
	aspect-ratio: 1;
	margin-bottom: 6px;
	border-radius: var(--jl-radius-sm);
	background-size: cover;
	background-position: center;
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08);
	outline: 2px solid transparent;
	outline-offset: 2px;
	transition: outline-color .15s;
}
.jlc-mat:hover .jlc-mat__swatch { outline-color: var(--jl-line); }
.jlc-mat.is-selected .jlc-mat__swatch { outline-color: var(--jl-accent); }
.jlc-mat__check {
	position: absolute;
	right: 8px; bottom: 8px;
	display: none;
	align-items: center; justify-content: center;
	width: 26px; height: 26px;
	border-radius: 50%;
	background: var(--jl-accent);
	color: #fff;
}
.jlc-mat.is-selected .jlc-mat__check { display: flex; }
.jlc-mat__badge {
	position: absolute;
	top: 6px; left: 6px;
	padding: 2px 7px;
	border-radius: 5px;
	background: var(--jl-badge);
	color: var(--jl-dark);
	font-size: 11px;
	font-weight: 800;
}
.jlc-mat__title { font-weight: 700; font-size: 14px; line-height: 1.3; }
.jlc-mat__meta { color: var(--jl-muted); font-size: 12px; line-height: 1.3; }
.jlc-mat__price { font-size: 13px; font-weight: 700; }
.jlc-mat.is-disabled { opacity: .4; cursor: not-allowed; }
.jlc-more { margin-top: 18px; }

/* Навигация по шагам */
.jlc-nav {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 12px;
	margin-top: 10px;
	padding-top: 22px;
	border-top: 1px solid var(--jl-line);
}

/* Итог */
.jlc-save { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 12px; }
.jlc-save .jlc-link { padding: 0; border: 0; background: none; cursor: pointer; }
.jlc-notice { margin-bottom: 16px; padding: 14px 16px; border-radius: var(--jl-radius-sm); background: #e7f5ea; color: #1d5b2c; font-size: 14px; }
.jlc-notice a { font-weight: 700; }
.jlc-alert { margin-bottom: 16px; padding: 14px 16px; border-radius: var(--jl-radius-sm); background: #fdecea; color: #8a1c12; font-size: 14px; }
.jlc-table { width: 100%; border-collapse: collapse; margin-bottom: 20px; font-size: 15px; }
.jlc-table th,
.jlc-table td { padding: 11px 0; border-bottom: 1px dashed var(--jl-line); text-align: left; vertical-align: top; }
.jlc-table th { width: 45%; padding-right: 16px; color: var(--jl-muted); font-weight: 500; }
.jlc-table td { font-weight: 600; }
.jlc-total {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
	gap: 16px;
	margin-bottom: 18px;
	padding: 20px;
	border-radius: var(--jl-radius);
	background: var(--jl-soft);
}
.jlc-qty { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.jlc-total__price { display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.jlc-total__price del { color: var(--jl-muted); font-size: 16px; }
.jlc-total__price strong { font-size: 32px; font-weight: 800; line-height: 1.1; letter-spacing: -.02em; }
.jlc-total__price small { color: var(--jl-muted); font-size: 13px; }
.jlc-check { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; font-weight: 600; cursor: pointer; border-radius: 8px; transition: background .2s; }
.jlc-check input { width: 20px; height: 20px; accent-color: var(--jl-accent); }
.jlc-check.is-attention { background: #fff3cd; box-shadow: 0 0 0 6px #fff3cd; }
.jlc-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.jlc-actions .jl-btn { flex: 1 1 200px; }
.jlc-actions-msg { margin-top: 10px; color: #c62828; font-size: 14px; font-weight: 600; }
.jlc-actions-msg:empty { display: none; }
.jlc-order { margin-top: 20px; padding: 22px; border: 1.5px solid var(--jl-line); border-radius: var(--jl-radius); animation: jl-pop .25s; }
.jlc-order__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.jlc-reset { margin-top: 18px; padding: 0; border: 0; background: none; color: var(--jl-muted); font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
.jlc-reset:hover { color: var(--jl-accent); }

/* Правая колонка */
.jlc-side__sticky { position: sticky; top: calc(var(--jl-header-h) + 20px); }
.admin-bar .jlc-side__sticky { top: calc(var(--jl-header-h) + 52px); }
.jlc-preview { border-radius: var(--jl-radius); background: var(--jl-soft); overflow: hidden; }
.jlc-preview__tabs { display: flex; gap: 4px; margin: 12px 12px 0; padding: 4px; border-radius: 999px; background: rgba(255, 255, 255, .7); }
.jlc-preview__tabs button { flex: 1; padding: 8px 10px; border: 0; border-radius: 999px; background: none; font-size: 13px; font-weight: 600; color: var(--jl-muted); }
.jlc-preview__tabs button.is-active { background: #fff; color: var(--jl-text); box-shadow: 0 1px 4px rgba(0, 0, 0, .08); }
.jlc-preview__stage { display: flex; align-items: center; justify-content: center; min-height: calc(var(--jlc-stage-h) + 70px); padding: 18px; }
.jlc-preview__photo { width: 100%; max-height: calc(var(--jlc-stage-h) + 40px); object-fit: contain; border-radius: var(--jl-radius-sm); }
.jlc-preview__empty { color: #c9c4bd; }
.jlc-preview__note { padding: 0 16px 14px; color: var(--jl-muted); font-size: 12px; text-align: center; }
.jlc-preview__note strong { color: var(--jl-text); }

.jlc-side__info { padding: 20px 4px 0; }
.jlc-side__name { margin-bottom: 10px; font-size: 20px; font-weight: 800; }
.jlc-side__params { display: grid; gap: 6px; margin: 0 0 18px; padding: 0; list-style: none; font-size: 13px; }
.jlc-side__params li { display: flex; justify-content: space-between; gap: 12px; }
.jlc-side__params span { color: var(--jl-muted); }
.jlc-side__params b { font-weight: 600; text-align: right; }
.jlc-price { padding-top: 16px; border-top: 1px solid var(--jl-line); }
.jlc-price__label { display: flex; align-items: center; gap: 8px; color: var(--jl-muted); font-size: 14px; }
.jlc-price__badge { padding: 2px 8px; border-radius: 5px; background: var(--jl-accent); color: #fff; font-size: 12px; font-weight: 700; }
.jlc-price__row { display: flex; align-items: baseline; gap: 10px; }
.jlc-price__value { font-size: 34px; font-weight: 800; letter-spacing: -.02em; }
.jlc-price__row del { color: var(--jl-muted); font-size: 17px; }
.jlc-price__note { color: var(--jl-muted); font-size: 12px; }

/* Инструкция по замеру */
.jlc-guide { margin: 14px 0 6px; border-radius: var(--jl-radius-sm); background: var(--jl-soft); }
.jlc-guide__toggle { display: flex; align-items: center; gap: 8px; width: 100%; padding: 12px 14px; border: 0; background: none; color: var(--jl-text); font-weight: 600; text-align: left; cursor: pointer; }
.jlc-guide__toggle svg { color: var(--jl-accent); }
.jlc-guide__list { display: grid; gap: 12px; margin: 0; padding: 0 14px 14px; list-style: none; counter-reset: jlc-guide; }
.jlc-guide__item { display: flex; gap: 12px; align-items: flex-start; counter-increment: jlc-guide; }
.jlc-guide__item::before { content: counter(jlc-guide); flex: none; display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--jl-accent); color: #fff; font-size: 13px; font-weight: 700; }
.jlc-guide__item img { flex: none; width: 96px; height: 72px; border-radius: 8px; object-fit: cover; }
.jlc-guide__item p { margin: 2px 0 0; color: var(--jl-muted); font-size: 14px; line-height: 1.45; }

/* ---------- Схема изделия ---------- */

.jlc-scene { display: flex; align-items: center; justify-content: center; width: 100%; height: var(--jlc-stage-h); }
.jlc-svg { width: 100%; height: 100%; overflow: visible; }
.jlc-svg text { fill: #77716a; font-family: var(--jl-font); font-weight: 600; }
.jlc-preview__stage--room {
	position: relative;
	overflow: hidden;
	background-color: var(--jlc-wall);
	background-image:
		radial-gradient(ellipse 60% 55% at 50% 40%, rgba(255, 255, 255, .5), transparent 72%),
		linear-gradient(180deg, transparent 65%, rgba(0, 0, 0, .05));
}

/* Нижняя панель на телефоне */
.jlc-bar { display: none; }

/* ---------- Адаптив ---------- */

@media (max-width: 1100px) {
	.jlc-body { grid-template-columns: minmax(0, 1fr) 360px; gap: 28px; }
}

@media (max-width: 960px) {
	.jlc { --jlc-stage-h: 190px; }
	.jlc-body { grid-template-columns: 1fr; gap: 20px; }
	.jlc-side { order: -1; }
	.jlc-side__sticky { position: static; }
	.jlc-preview__stage { min-height: calc(var(--jlc-stage-h) + 60px); padding: 14px; }
	.jlc-side__info { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px; padding-top: 14px; }
	.jlc-side__name { margin: 0; font-size: 17px; }
	.jlc-side__params { display: none; }
	.jlc-price { padding: 0; border: 0; text-align: right; }
	.jlc-price__label, .jlc-price__note { display: none; }
	.jlc-price__value { font-size: 22px; }
	.jlc-price__row del { font-size: 14px; }
	.jlc-nav .jl-btn--lg { display: none; }

	.jlc-bar {
		position: fixed;
		left: 0; right: 0; bottom: 0;
		z-index: 95;
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 12px;
		padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
		background: #fff;
		box-shadow: 0 -6px 24px rgba(0, 0, 0, .1);
	}
	.jlc-bar__price { display: flex; flex-direction: column; line-height: 1.15; }
	.jlc-bar__price strong { font-size: 21px; font-weight: 800; }
	.jlc-bar__price del { color: var(--jl-muted); font-size: 13px; }
	.jlc-bar .jl-btn { flex: 0 0 auto; min-height: 48px; }
	body:has(.jlc) { padding-bottom: 80px; }
	body:has(.jlc) .jl-fab-wa { bottom: 92px; }
}

@media (max-width: 600px) {
	.jlc { --jlc-stage-h: 150px; }
	.jlc-preview__stage { min-height: calc(var(--jlc-stage-h) + 48px); padding: 10px; }
	.jlc-preview__tabs { margin: 8px 8px 0; }
	.jlc-preview__note, .jlc-side__info { display: none; }
	.jlc-head__title { font-size: 26px; margin-bottom: 14px; }
	.jlc-tab__label { display: none; }
	.jlc-tab.is-active .jlc-tab__label { display: inline; }
	.jlc-tab { flex: 0 0 auto; }
	.jlc-tab button { padding-right: 10px; }
	.jlc-tab.is-active button { padding-right: 16px; }
	.jlc-step__title { font-size: 23px; }
	.jlc-cards { grid-template-columns: 1fr 1fr; gap: 8px; }
	.jlc-card { padding: 12px 34px 12px 12px; min-height: 70px; }
	.jlc-card__mark { top: 10px; right: 10px; }
	.jlc-size { grid-template-columns: 1fr; gap: 12px; }
	.jlc-mats { grid-template-columns: repeat(3, 1fr); gap: 12px 8px; }
	.jlc-mat__meta { display: none; }
	.jlc-filters__row { flex-direction: column; }
	.jlc-filters__light { max-width: none; width: 100%; }
	.jlc-total { flex-direction: column; align-items: stretch; }
	.jlc-total__price { align-items: flex-start; text-align: left; }
	.jlc-order__grid { grid-template-columns: 1fr; }
	.jlc-table th { width: 50%; }
}
