/*
 * @package     StarTech.Component.Fefcocalc
 * @subpackage  com_fefcocalc
 *
 * Стили каталога конструктивов FEFCO (view=catalog / view=cataloggroup) —
 * перенесены из образца верстки S/200.html и S/fefco-all.html, с префиксом
 * fcc- (FEFCo Catalog) во избежание конфликта с fc- классами калькулятора
 * (media/css/calculator.css), который может быть подключён на той же
 * странице шаблона.
 */

:root {
	--fcc-primary: #0076a3;
	--fcc-text: #333;
	--fcc-bg: #fff;
	--fcc-border: #ddd;
	--fcc-box-bg: #fdfaf4;
	--fcc-new: #00a896;
}

.fefcocalc-catalog, .fefcocalc-cataloggroup {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: var(--fcc-text);
	line-height: 1.5;
	max-width: 1200px;
	margin: 0 auto;
	padding: 20px;
	box-sizing: border-box;
}

.fefcocalc-catalog *, .fefcocalc-cataloggroup * {
	box-sizing: border-box;
}

.fcc-header, .fcg-header {
	border-bottom: 3px solid var(--fcc-primary);
	padding-bottom: 10px;
	margin-bottom: 10px;
	display: flex;
	justify-content: space-between;
	align-items: flex-end;
	flex-wrap: wrap;
	gap: 8px;
}

.fcc-header h1, .fcg-header h1 {
	font-size: 28px;
	font-weight: 700;
	margin: 0;
}

.fcc-series, .fcg-series {
	font-size: 24px;
	color: var(--fcc-primary);
	font-weight: bold;
}

.fcc-lead, .fcg-lead {
	color: #666;
	font-size: 15px;
	margin: 16px 0 30px 0;
	max-width: 800px;
}

.fcc-note, .fcg-note {
	background: #fff6e5;
	border: 1px solid #f0c674;
	border-radius: 6px;
	padding: 14px 16px;
	display: flex;
	gap: 10px;
	margin-bottom: 24px;
}

/* --- Обзорная страница (view=catalog): плашки групп --- */

.fcc-group-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
	gap: 24px;
	margin-bottom: 60px;
}

.fcc-group-card {
	border: 1px solid var(--fcc-border);
	border-radius: 6px;
	padding: 20px;
	background: var(--fcc-bg);
	transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
	cursor: pointer;
	text-decoration: none;
	color: inherit;
	display: flex;
	flex-direction: column;
}

.fcc-group-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
	border-color: var(--fcc-primary);
}

.fcc-thumb {
	height: 170px;
	display: flex;
	align-items: center;
	justify-content: center;
	/* Обложка группы — всегда JPG-мокап на собственном белом фоне (студийный
	   рендер), а не чертёж — поэтому белый, не бежевый var(--fcc-box-bg)
	   (бежевый даёт заметный шов вокруг белого прямоугольника фото). */
	background: #fff;
	border: 1px solid var(--fcc-border);
	border-radius: 4px;
	margin-bottom: 16px;
	overflow: hidden;
}

.fcc-thumb img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
}

.fcc-group-title {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-bottom: 10px;
}

.fcc-code {
	font-weight: 700;
	font-size: 20px;
}

.fcc-code span {
	color: var(--fcc-primary);
}

.fcc-arrow {
	color: var(--fcc-primary);
	font-size: 20px;
	transition: transform 0.2s;
	flex-shrink: 0;
}

.fcc-group-card:hover .fcc-arrow {
	transform: translateX(4px);
}

.fcc-group-card p {
	color: #555;
	font-size: 14.5px;
	flex-grow: 1;
	margin: 0 0 8px 0;
}

.fcc-count {
	font-size: 12.5px;
	color: #888;
}

.fcc-footer, .fcg-footer {
	margin-top: 40px;
	border-top: 1px solid var(--fcc-border);
	padding: 20px 0;
	display: flex;
	justify-content: space-between;
	font-size: 12px;
	color: #777;
}

.fcc-logo, .fcg-logo {
	font-weight: bold;
	color: var(--fcc-primary);
	font-size: 16px;
}

/* --- Страница группы (view=cataloggroup): сетка кодов + поиск --- */

.fcg-back {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-bottom: 20px;
	padding: 8px 16px;
	border: 1px solid var(--fcc-primary);
	border-radius: 6px;
	background: var(--fcc-bg);
	color: var(--fcc-primary);
	text-decoration: none;
	font-size: 14px;
	font-weight: 600;
	transition: background 0.15s, color 0.15s, transform 0.15s;
}

.fcg-back:hover {
	background: var(--fcc-primary);
	color: #fff;
	text-decoration: none;
	transform: translateX(-2px);
}

.fcg-search {
	width: 100%;
	max-width: 320px;
	padding: 9px 12px;
	border: 1px solid var(--fcc-border);
	border-radius: 6px;
	font-size: 14px;
	margin-bottom: 24px;
}

.fcg-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
	gap: 14px;
	margin-bottom: 40px;
}

.fcg-item {
	border: 1px solid var(--fcc-border);
	border-radius: 6px;
	padding: 10px;
	background: var(--fcc-bg);
	text-decoration: none;
	color: inherit;
	display: block;
	cursor: pointer;
	transition: border-color 0.15s, box-shadow 0.15s;
}

.fcg-item:hover, .fcg-item.is-active {
	border-color: var(--fcc-primary);
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.fcg-item .fcg-item-code {
	font-weight: 700;
	font-size: 14px;
	margin-bottom: 6px;
	display: flex;
	justify-content: space-between;
	align-items: baseline;
}

.fcg-item .fcg-item-code span.m {
	font-size: 11px;
	font-weight: 500;
	color: #999;
}

.fcg-box-thumb {
	height: 90px;
	display: flex;
	align-items: center;
	justify-content: center;
	/* JPG-мокап на своём белом фоне — не бежевый, см. .fcc-thumb выше. */
	background: #fff;
	border: 1px solid var(--fcc-border);
	border-radius: 4px;
	overflow: hidden;
}

.fcg-box-thumb img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
}

.fcg-section-title {
	font-size: 20px;
	font-weight: 700;
	margin: 30px 0 18px 0;
	padding-top: 10px;
	border-top: 1px solid var(--fcc-border);
}

.fcg-model-detailed {
	border: 1px solid var(--fcc-border);
	border-radius: 6px;
	padding: 18px;
	margin-bottom: 16px;
	background: var(--fcc-bg);
	scroll-margin-top: 20px;
}

.fcg-model-detailed.is-hidden {
	display: none;
}

.fcg-model-header {
	display: flex;
	align-items: baseline;
	gap: 10px;
	margin-bottom: 14px;
}

.fcg-model-title {
	font-size: 22px;
	font-weight: 700;
}

.fcg-model-title span {
	font-size: 13px;
	font-weight: 500;
	color: #999;
	margin-left: 6px;
}

.fcg-model-split {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 18px;
}

.fcg-blueprint-view, .fcg-mockup-view {
	border-radius: 4px;
	padding: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 220px;
}

/* Чертёж — прозрачный SVG, бежевый фон плашки ему идёт (просил сохранить). */
.fcg-blueprint-view {
	background: var(--fcc-box-bg);
}

/* 3D-мокап — JPG на собственном белом студийном фоне; бежевая плашка под
   ним давала заметный шов вокруг белого прямоугольника фото — белый фон
   плашки убирает шов без переделки самих картинок. */
.fcg-mockup-view {
	background: #fff;
	border: 1px solid var(--fcc-border);
}

.fcg-blueprint-view img, .fcg-mockup-view img {
	max-width: 100%;
	max-height: 320px;
	object-fit: contain;
}

@media (max-width: 700px) {
	.fcg-model-split {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 480px) {
	.fcc-group-grid {
		grid-template-columns: 1fr;
	}
}

/* --- layout=fefco (v3.0.0, переименован из "withcalc" в 3.0.4): объединённая страница «каталог + расчёт» --- */

.fefcocalc-cataloggroup--fefco .is-hidden {
	display: none !important;
}

.fcgc-layout {
	display: grid;
	grid-template-columns: 1fr 280px;
	gap: 24px;
	align-items: start;
	margin-bottom: 40px;
}

.fcgc-main {
	min-width: 0;
}

.fcgc-thumbs {
	position: sticky;
	top: 20px;
	max-height: calc(100vh - 40px);
	overflow-y: auto;
	padding-right: 2px;
}

.fcgc-thumbs .fcg-search {
	max-width: none;
}

.fcgc-thumbs .fcg-grid {
	grid-template-columns: repeat(2, 1fr);
	margin-bottom: 0;
}

/* Шаг "1. Конструктив" калькулятора скрыт в этом режиме — его роль
   (выбор кода) теперь играет сетка миниатюр справа; сам select/codeList
   остаются в разметке живыми (ими управляет router-скрипт), просто не
   показываются пользователю. */
.fcgc-main #fefcocalc-app > .fc-grid > div:first-child > .fc-panel:first-child {
	display: none;
}

.fcgc-main #fefcocalc-app {
	margin: 0 0 24px;
}

.fcg-item--nocalc {
	opacity: 0.82;
}

.fcg-item-soon {
	margin-top: 6px;
	font-size: 11px;
	font-weight: 600;
	color: var(--fcc-primary);
	text-align: center;
}

.fcgc-soon-badge {
	font-size: 12px;
	font-weight: 600;
	color: var(--fcc-primary);
	background: #eef6fa;
	border: 1px solid var(--fcc-primary);
	border-radius: 4px;
	padding: 2px 8px;
}

@media (max-width: 900px) {
	.fcgc-layout {
		grid-template-columns: 1fr;
	}

	.fcgc-thumbs {
		position: static;
		max-height: none;
		order: -1;
	}

	.fcgc-thumbs .fcg-grid {
		grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
	}
}
