/**
 * Balance — конструктор наборов.
 * Токены темы (common.css). Новое: карточки-наборы, тарелка-SVG, карточки товаров.
 */

.bal-cc { padding: 24px 0 56px; }
.bal-cc__head { margin-bottom: 24px; }
.bal-cc__title { font-size: 26px; }
.bal-cc__subtitle { margin-top: 10px; max-width: 640px; font-size: 14px; }

/* ---------- Сетка ---------- */
.bal-cc__grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 360px;
	gap: 32px;
	align-items: start;
}
.bal-cc__catalog { grid-column: 1; grid-row: 1; min-width: 0; }
.bal-cc__aside   { grid-column: 2; grid-row: 1; min-width: 0; position: sticky; top: 120px; align-self: start; }

/* ---------- Шаг (номер + заголовок) ---------- */
.bal-cc-step2__head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.bal-cc-step2__head--mt { margin-top: 28px; }
.bal-cc-step2__num {
	width: 24px; height: 24px; flex-shrink: 0;
	display: flex; align-items: center; justify-content: center;
	border-radius: 9999px; background: var(--green); color: #fff;
	font-size: 12px; font-weight: 700;
}
.bal-cc-step2__title { font-size: 15px; font-weight: 700; }

/* ---------- Шаг 1: карточки наборов ---------- */
.bal-cc-pkgs {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 12px;
}
.bal-cc-pkg {
	position: relative;
	border: 2px solid var(--border);
	border-radius: var(--radius-xl);
	overflow: hidden;
	background: #fff;
	padding: 0;
	text-align: left;
	cursor: pointer;
	transition: border-color .15s, box-shadow .15s;
}
.bal-cc-pkg:hover { border-color: #BDD4B3; }
.bal-cc-pkg.is-selected { border-color: var(--green); box-shadow: var(--shadow-card); }
.bal-cc-pkg.is-disabled { opacity: .5; cursor: not-allowed; }
.bal-cc-pkg__thumb {
	position: relative;
	display: flex; align-items: center; justify-content: center;
	aspect-ratio: 4 / 3;
	background: var(--green-bg);
	overflow: hidden;
}
.bal-cc-pkg__thumb img { width: 100%; height: 100%; object-fit: cover; }
.bal-cc-pkg__ph { font-size: 26px; color: #BDD4B3; font-weight: 700; }
.bal-cc-pkg__soon {
	position: absolute; top: 6px; left: 6px;
	background: rgba(0,0,0,.5); color: #fff;
	font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
	padding: 2px 6px; border-radius: 9999px;
}
.bal-cc-pkg__body { display: block; padding: 8px 10px 10px; }
.bal-cc-pkg__name { display: block; font-size: 12px; font-weight: 700; line-height: 1.2; color: var(--text); }
.bal-cc-pkg__cells { display: block; margin-top: 2px; font-size: 11px; color: var(--muted); }
.bal-cc-pkg__check {
	position: absolute; top: 8px; right: 8px;
	width: 20px; height: 20px; border-radius: 9999px;
	background: var(--green); color: #fff;
	display: none; align-items: center; justify-content: center;
}
.bal-cc-pkg.is-selected .bal-cc-pkg__check { display: flex; }

/* ---------- Инфо-баннер ---------- */
.bal-cc-banner {
	display: flex; align-items: center; gap: 10px;
	background: var(--green-bg);
	border: 1px solid #D8EAD0;
	border-radius: var(--radius-xl);
	padding: 12px 18px;
	margin: 20px 0 4px;
	font-size: 13px; color: var(--green-dark); line-height: 1.4;
}
.bal-cc-banner__ic { color: var(--green); flex-shrink: 0; }

/* ---------- Подсказка Шаг 2 ---------- */
.bal-cc__hint { font-size: 12px; margin-bottom: 16px; }

/* ---------- Табы ---------- */
.bal-cc-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	background: var(--bg-gray);
	padding: 5px;
	border-radius: var(--radius-lg);
	margin-bottom: 20px;
}
.bal-cc-tab {
	padding: 9px 16px;
	border: 0;
	background: transparent;
	border-radius: var(--radius);
	font-size: 13px; font-weight: 600;
	color: var(--muted);
	cursor: pointer;
	position: relative;
	transition: background-color .15s, color .15s;
}
.bal-cc-tab:hover { color: var(--text); }
.bal-cc-tab.is-active {
	background: #fff;
	color: var(--green-dark);
	box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.bal-cc-tab.is-active::after {
	content: "";
	position: absolute;
	left: 16px; right: 16px; bottom: 3px; height: 2px;
	background: var(--gold);
	border-radius: 2px;
}

/* ---------- Сетка карточек товаров ---------- */
.bal-cc-products {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 16px;
}

/* ---------- Карточка товара (кнопка, клик = в ячейку) ---------- */
.bal-cc-card {
	position: relative;
	border: 1px solid var(--border);
	border-radius: var(--radius-lg);
	background: #fff;
	overflow: hidden;
	padding: 0;
	text-align: left;
	display: flex;
	flex-direction: column;
	transition: box-shadow .15s, border-color .15s;
}
.bal-cc-card[hidden] { display: none; } /* таб перебивает display:flex */
.bal-cc-card:hover { border-color: #BDD4B3; box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.bal-cc-card__thumb {
	position: relative;
	display: block;
	aspect-ratio: 1 / 1;
	background: var(--bg-gray);
}
.bal-cc-card__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bal-cc-card__cat {
	position: absolute; bottom: 6px; left: 6px;
	display: inline-flex; align-items: center; gap: 4px;
	background: rgba(255,255,255,.82);
	border-radius: 9999px;
	padding: 2px 8px;
	font-size: 10px; font-weight: 600; color: var(--text);
}
.bal-cc-card__cat i { width: 6px; height: 6px; border-radius: 9999px; }
.bal-cc-card__info { display: flex; flex-direction: column; flex: 1; padding: 10px 12px 12px; }
.bal-cc-card__title { display: block; font-size: 13px; font-weight: 600; line-height: 1.3; color: var(--text); }
.bal-cc-card__meta { display: flex; flex-direction: column; gap: 2px; margin: 6px 0 10px; }
.bal-cc-card__weight { font-size: 12px; color: var(--muted); }
.bal-cc-card__price { font-size: 13px; font-weight: 700; color: var(--green); }
.bal-cc-card__per { font-size: 11px; font-weight: 500; color: var(--muted-2); }
.bal-cc-card__add { width: 100%; height: 38px; margin-top: auto; font-size: 12px; }
.bal-cc-card__add.is-added { background: var(--green); color: #fff; }
.bal-cc-products.is-full .bal-cc-card__add { opacity: .45; pointer-events: none; }

/* ---------- Правая колонка: сводка ---------- */
.bal-cc-summary {
	border: 1px solid var(--border);
	border-radius: var(--radius-xl);
	background: #fff;
	padding: 20px;
	box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.bal-cc-summary__head { display: flex; align-items: baseline; justify-content: space-between; }
.bal-cc-summary__title { font-size: 18px; font-weight: 700; letter-spacing: -0.01em; }
.bal-cc-summary__ready {
	font-size: 11px; font-weight: 700; color: var(--green);
	background: var(--green-bg); padding: 2px 8px; border-radius: 9999px;
}
.bal-cc-summary__count { margin-top: 2px; font-size: 12px; color: var(--muted); }
.js-cc-filled { color: var(--green); font-weight: 700; }

/* Тарелка */
.bal-cc-plate { max-width: 300px; margin: 8px auto 16px; }
.bal-cc-plate__svg { width: 100%; height: auto; display: block; filter: drop-shadow(0 2px 12px rgba(0,0,0,.10)); }
.bal-cc-sector.is-filled { cursor: pointer; }
.bal-cc-sector.is-filled:hover path,
.bal-cc-sector.is-filled:hover circle { opacity: .85; }
.bal-cc-sector__name { font-weight: 700; fill: #3A3A3A; font-family: 'Manrope', sans-serif; }
.bal-cc-sector__w { fill: var(--muted); font-family: 'Manrope', sans-serif; }
.bal-cc-sector__plus { font-size: 18px; fill: #B8CCAE; }
.bal-cc-sector--center .bal-cc-sector__plus { font-size: 26px; fill: var(--green); }
.bal-cc-sector__clabel { font-size: 10px; font-weight: 600; fill: var(--muted-2); }

/* Состав */
.bal-cc-summary__list-title { font-size: 11px; font-weight: 700; color: var(--muted-2); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.bal-cc-summary__empty { font-size: 13px; color: var(--muted-2); text-align: center; font-style: italic; padding: 10px 0; line-height: 1.4; }
.bal-cc-summary__item {
	display: flex; align-items: center; gap: 10px;
	padding: 8px 0;
	border-bottom: 1px solid var(--border-light);
}
.bal-cc-summary__dot { width: 8px; height: 8px; border-radius: 9999px; flex-shrink: 0; }
.bal-cc-summary__item-name { flex: 1; min-width: 0; font-size: 13px; color: var(--text); }
.bal-cc-summary__item-g { font-size: 11px; color: var(--muted-2); margin-left: 6px; }
.bal-cc-summary__badge { display: inline-block; margin-left: 6px; font-size: 9px; font-weight: 700; color: var(--green); background: var(--green-bg); padding: 1px 6px; border-radius: 9999px; vertical-align: middle; }
.bal-cc-summary__del {
	width: 20px; height: 20px; flex-shrink: 0;
	border: 0; background: transparent;
	font-size: 17px; line-height: 1; color: var(--muted-2);
	cursor: pointer;
}
.bal-cc-summary__del:hover { color: var(--red); }

/* Блок стоимости */
.bal-cc-summary__costs {
	margin-top: 14px;
	background: var(--bg-gray);
	border-radius: var(--radius-lg);
	padding: 10px 12px;
}
.bal-cc-summary__row { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); }
.bal-cc-summary__row + .bal-cc-summary__row { margin-top: 6px; }
.bal-cc-summary__row b { font-size: 12px; font-weight: 600; color: var(--text); }

/* Итого */
.bal-cc-summary__total {
	display: flex; justify-content: space-between; align-items: baseline;
	margin-top: 14px; padding-top: 16px;
	border-top: 1px solid var(--border);
}
.bal-cc-summary__total span { font-size: 14px; font-weight: 600; }
.bal-cc-summary__total b { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; color: var(--text); }

.bal-cc-summary__add { width: 100%; height: 52px; margin-top: 16px; font-size: 14px; }
.bal-cc-summary__add:disabled { background: var(--border); color: var(--muted-2); cursor: not-allowed; }
.bal-cc-summary__add:disabled .bal-icon { color: var(--muted-2); }
.bal-cc-summary__add.is-loading { opacity: .7; pointer-events: none; }
.bal-cc-summary__reset {
	display: block; width: 100%;
	margin-top: 10px;
	border: 0; background: transparent;
	font-size: 12px; color: var(--muted-2);
	cursor: pointer;
}
.bal-cc-summary__reset:hover { color: var(--red); }

/* ---------- Как это работает ---------- */
.bal-cc-how { margin-top: 120px; }
.bal-cc-how__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 20px; }
.bal-cc-how__card { border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 28px; background: #fff; }
.bal-cc-how__num {
	width: 56px; height: 56px; margin-bottom: 14px;
	display: flex; align-items: center; justify-content: center;
	border-radius: 9999px; background: var(--green-bg); color: var(--green);
	font-size: 24px; font-weight: 800;
}
.bal-cc-how__title { font-size: 15px; font-weight: 700; margin-bottom: 8px; }
.bal-cc-how__card p { font-size: 13px; line-height: 1.6; }

/* ---------- FAQ (дубль из info.css — он тут не подключён) ---------- */
.bal-cc-faq { margin-top: 120px; }
.bal-cc-faq .bal-faq__list { margin-top: 20px; }
.bal-faq__list { display: flex; flex-direction: column; gap: 12px; }
.bal-faq__item { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.bal-faq__q { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px; background: #fff; border: 0; text-align: left; font-weight: 700; font-size: 15px; transition: background-color .15s; }
.bal-faq__q:hover { background: var(--bg-gray); }
.bal-faq__chev { color: var(--muted); flex-shrink: 0; transition: transform .2s; }
.bal-faq__item.is-open .bal-faq__chev { transform: rotate(90deg); }
.bal-faq__a { display: none; padding: 0 20px 20px; font-size: 14px; color: var(--muted); line-height: 1.7; }
.bal-faq__item.is-open .bal-faq__a { display: block; }

/* ---------- Адаптив ---------- */
@media (max-width: 1024px) {
	.bal-cc-products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.bal-cc-pkgs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
	.bal-cc__grid { grid-template-columns: 1fr; gap: 24px; }
	.bal-cc__catalog, .bal-cc__aside { grid-column: auto; grid-row: auto; position: static; }
	.bal-cc-how__grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
	.bal-cc__title { font-size: 22px; }
	.bal-cc-products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
