/* Магазин рамок профиля (modules_extra/frames/templates/solution/tpl/index.tpl). Префикс fs-. */

.fs {
	--fs-panel: #1e1e21;
	--fs-panel-hi: #26262a;
	--fs-line: rgba(255, 255, 255, .07);
	--fs-text: #d4d4dc;
	--fs-muted: #8e8e98;
	--fs-accent: #da9256;
	--fs-accent-hi: #eda162;
	--fs-green: 62, 207, 110;

	margin-bottom: 30px;
	font-family: Montserrat, sans-serif;
}

/* ---------- шапка ---------- */

.fs-head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 20px;
	margin-bottom: 20px;
}

.fs-head__title {
	margin: 0 0 6px;
	color: #fff;
	font-family: 'Exo 2', Montserrat, sans-serif;
	font-size: 28px;
	font-weight: 900;
	font-style: italic;
	text-transform: uppercase;
}

.fs .fs-head__sub {
	max-width: 560px;
	margin: 0;
	color: var(--fs-muted);
	font-size: 13px;
	line-height: 1.55;
}

.fs-head__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.fs-chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 34px;
	padding: 0 12px;
	border: 1px solid var(--fs-line);
	border-radius: 10px;
	background: var(--fs-panel);
	color: var(--fs-text);
	font-size: 12.5px;
	font-weight: 600;
	white-space: nowrap;
}

.fs-chip i {
	color: var(--fs-muted);
	font-size: 16px;
}

.fs-chip--accent {
	border-color: rgba(218, 146, 86, .3);
	background: rgba(218, 146, 86, .1);
}

.fs-chip--accent i {
	color: var(--fs-accent-hi);
}

/* ---------- раскладка ---------- */

.fs-layout {
	display: grid;
	grid-template-columns: 320px minmax(0, 1fr);
	gap: 20px;
	align-items: start;
}

/* ---------- предпросмотр ---------- */

.fs-preview {
	position: sticky;
	top: 88px; /* под липкой шапкой */
	padding: 18px;
	border: 1px solid var(--fs-line);
	border-radius: 20px;
	background: var(--fs-panel);
}

.fs-preview__stage {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 18px;
	padding: 34px 0 20px;
	border-radius: 16px;
	background:
		radial-gradient(circle at 50% 40%, rgba(218, 146, 86, .22), transparent 60%),
		linear-gradient(180deg, #2a2420, #1a1a1d);
}

.fs-preview__avatar.previewAvatarWrapper {
	position: relative;
	width: 120px;
	height: 120px;
	overflow: visible;
}

.fs-preview__avatar .svgMask {
	position: absolute;
	top: 0;
	left: 0;
	z-index: 1;
}

.fs-preview__avatar .avatarDecoration {
	position: absolute;
	top: -12px;
	left: -12px;
	z-index: 2;
}

/* без рамки — не показывать пустую картинку (битый значок) */
#fs_frame:not([src]),
#fs_frame[src=""] {
	visibility: hidden;
}

.fs-preview__login {
	color: #fff;
	font-size: 15px;
	font-weight: 700;
}

.fs-preview__info {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	margin: 16px 0 14px;
	text-align: center;
}

.fs-preview__title {
	color: #fff;
	font-size: 17px;
	font-weight: 700;
}

.fs-preview__status {
	color: var(--fs-muted);
	font-size: 12.5px;
	font-weight: 600;
}

.fs-preview__status.is-ok {
	color: rgb(var(--fs-green));
}

.fs-preview__actions {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.fs-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	width: 100%;
	height: 46px;
	border: 1px solid var(--fs-line);
	border-radius: 13px;
	background: var(--fs-panel-hi);
	color: var(--fs-text);
	font-family: Montserrat, sans-serif;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
	transition: filter .2s ease, border-color .2s ease, color .2s ease;
}

.fs-btn:hover {
	border-color: rgba(218, 146, 86, .4);
	color: #fff;
}

.fs-btn--primary {
	border: 0;
	background: linear-gradient(23deg, #995d2b 0%, #da9256 55%, #eda162 100%);
	box-shadow: 0 6px 18px rgba(218, 146, 86, .35);
	color: #fff;
}

.fs-btn--primary:hover {
	filter: brightness(1.08);
}

.fs-btn i {
	font-size: 18px;
}

.fs-preview__hint {
	display: flex;
	gap: 6px;
	margin: 14px 2px 0;
	color: #6c6c75;
	font-size: 11.5px;
	line-height: 1.5;
}

.fs-preview__hint i {
	flex: 0 0 auto;
	margin-top: 1px;
	font-size: 14px;
}

/* ---------- каталог ---------- */

.fs-catalog {
	padding: 18px;
	border: 1px solid var(--fs-line);
	border-radius: 20px;
	background: var(--fs-panel);
}

.fs-tabs {
	display: flex;
	gap: 6px;
	margin-bottom: 16px;
}

.fs-tab {
	height: 36px;
	padding: 0 14px;
	border: 1px solid var(--fs-line);
	border-radius: 11px;
	background: transparent;
	color: var(--fs-muted);
	font-family: Montserrat, sans-serif;
	font-size: 13px;
	font-weight: 700;
	cursor: pointer;
	transition: background .2s ease, color .2s ease, border-color .2s ease;
}

.fs-tab small {
	margin-left: 4px;
	opacity: .7;
}

.fs-tab:hover {
	color: #fff;
}

.fs-tab.is-active {
	border-color: var(--fs-accent);
	background: var(--fs-accent);
	color: #fff;
}

.fs-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
	gap: 10px;
}

.fs-tile {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	aspect-ratio: 1 / 1.12;
	padding: 10px 8px 30px;
	border: 1px solid var(--fs-line);
	border-radius: 16px;
	background: var(--fs-panel-hi);
	cursor: pointer;
	transition: border-color .2s ease, transform .2s ease, background .2s ease;
}

.fs-tile:hover {
	border-color: rgba(218, 146, 86, .4);
	transform: translateY(-2px);
}

.fs-tile.is-selected {
	border-color: var(--fs-accent);
	background: linear-gradient(180deg, rgba(218, 146, 86, .16), var(--fs-panel-hi));
	box-shadow: 0 0 0 1px var(--fs-accent) inset;
}

.fs-tile img {
	width: 88%;
	height: auto;
	max-height: 100%;
	object-fit: contain;
	opacity: 0;
	transition: opacity .25s ease;
}

/* превью пришло (js/frames.js) — проявляем; до этого на плитке мерцает заглушка */
.fs-tile img.is-loaded {
	opacity: 1;
}

.fs-tile:not(.fs-tile--none):has(img:not(.is-loaded))::before {
	content: "";
	position: absolute;
	top: 18%;
	left: 50%;
	width: 58%;
	aspect-ratio: 1;
	border-radius: 50%;
	background: linear-gradient(100deg, rgba(255, 255, 255, .03) 30%, rgba(255, 255, 255, .08) 50%, rgba(255, 255, 255, .03) 70%) 0 0 / 300% 100%;
	transform: translateX(-50%);
	animation: fs-skel 1.4s ease-in-out infinite;
}

@keyframes fs-skel {
	from { background-position: 100% 0; }
	to { background-position: 0 0; }
}

.fs-tile--none i {
	color: var(--fs-muted);
	font-size: 42px;
}

.fs-tile__badge {
	position: absolute;
	left: 8px;
	right: 8px;
	bottom: 8px;
	overflow: hidden;
	padding: 3px 6px;
	border-radius: 8px;
	background: rgba(0, 0, 0, .35);
	color: var(--fs-accent-hi);
	font-size: 11.5px;
	font-weight: 700;
	text-align: center;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.fs-tile.is-owned .fs-tile__badge {
	background: rgba(var(--fs-green), .14);
	color: rgb(var(--fs-green));
}

.fs-tile.is-current .fs-tile__badge {
	background: var(--fs-accent);
	color: #fff;
}

.fs-tile.is-hidden {
	display: none;
}

.fs-empty {
	padding: 40px 10px;
	color: var(--fs-muted);
	font-size: 13px;
	text-align: center;
}

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

@media (max-width: 991px) {
	.fs-head {
		flex-direction: column;
		align-items: flex-start;
	}

	.fs-layout {
		grid-template-columns: 1fr;
	}

	/* на телефоне предпросмотр — компактной полосой сверху, прилипает при прокрутке сетки */
	.fs-preview {
		top: 0;
		z-index: 5;
		display: grid;
		grid-template-columns: auto minmax(0, 1fr);
		align-items: center;
		gap: 4px 14px;
		padding: 12px;
		border-radius: 16px;
		box-shadow: 0 10px 30px rgba(0, 0, 0, .45);
	}

	.fs-preview__stage {
		grid-row: span 2;
		padding: 20px;
		border-radius: 14px;
	}

	.fs-preview__avatar.previewAvatarWrapper {
		width: 72px;
		height: 72px;
	}

	.fs-preview__avatar svg.svgMask {
		width: 72px;
		height: 72px;
	}

	.fs-preview__avatar svg.avatarDecoration {
		top: -7px;
		left: -7px;
		width: 86px;
		height: 86px;
	}

	.fs-preview__login,
	.fs-preview__hint {
		display: none;
	}

	.fs-preview__info {
		align-items: flex-start;
		margin: 0;
		text-align: left;
	}

	.fs-btn {
		height: 40px;
		font-size: 13px;
	}

	.fs-catalog {
		padding: 12px;
	}

	.fs-grid {
		grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
		gap: 8px;
	}
}
