/* ============================================================
   FlexiType Market — frontend
   ============================================================ */

.fxm-market,
.fxm-single,
.fxm-comments { --fxm-accent: #2563eb; }

/* ---------- Filter bar ---------- */
.fxm-filterbar {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 24px;
}
.fxm-filterbar__search { flex: 1 1 240px; }
.fxm-filterbar__controls { display: flex; gap: 10px; flex-wrap: wrap; }
.fxm-search, .fxm-filter {
	height: 44px;
	padding: 0 14px;
	border: 1px solid #e2e4ea;
	border-radius: 10px;
	background: #fff;
	font-size: 14px;
	width: 100%;
	color: #14161c;
}
.fxm-filter { min-width: 160px; cursor: pointer; }
.fxm-search:focus, .fxm-filter:focus { outline: none; border-color: var(--fxm-accent); }

/* ---------- Grid ---------- */
.fxm-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 24px;
}
.fxm-layout-list .fxm-grid { grid-template-columns: 1fr !important; }
.fxm-layout-list .fxm-card-item { display: grid; grid-template-columns: 280px 1fr; }
.fxm-layout-list .fxm-card-item__thumb { aspect-ratio: auto; height: 100%; }

/* ---------- Card ---------- */
.fxm-card-item {
	background: #fff;
	border: 1px solid #eef0f4;
	border-radius: 14px;
	overflow: hidden;
	transition: transform .2s ease, box-shadow .2s ease;
	display: flex;
	flex-direction: column;
}
.fxm-card-item:hover {
	transform: translateY(-4px);
	box-shadow: 0 12px 30px rgba(18, 25, 50, .12);
}
.fxm-card-item__thumb {
	display: block;
	position: relative;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background: #f3f4f7;
}
.fxm-card-item__thumb img {
	width: 100%; height: 100%;
	object-fit: cover;
	transition: transform .4s ease;
}
.fxm-card-item:hover .fxm-card-item__thumb img { transform: scale(1.05); }

.fxm-badge {
	position: absolute; top: 12px; left: 12px;
	padding: 4px 10px;
	font-size: 11px; font-weight: 700;
	text-transform: uppercase; letter-spacing: .04em;
	border-radius: 6px; color: #fff;
}
.fxm-badge--featured { background: var(--fxm-accent); }
.fxm-badge--free { background: #16a34a; }

.fxm-card-item__body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.fxm-card-item__cat {
	font-size: 12px; font-weight: 600; text-transform: uppercase;
	letter-spacing: .03em; color: var(--fxm-accent); text-decoration: none;
}
.fxm-card-item__title { margin: 0; font-size: 17px; line-height: 1.35; }
.fxm-card-item__title a { color: #14161c; text-decoration: none; }
.fxm-card-item__title a:hover { color: var(--fxm-accent); }

.fxm-card-item__meta { display: flex; align-items: center; gap: 12px; font-size: 13px; color: #6b7280; }
.fxm-rating { display: inline-flex; align-items: center; gap: 1px; }
.fxm-star { color: #d1d5db; font-size: 14px; line-height: 1; }
.fxm-star.is-full, .fxm-star.is-half { color: #f59e0b; }
.fxm-rating__count { color: #6b7280; margin-left: 4px; }

.fxm-card-item__footer {
	margin-top: auto;
	padding-top: 12px;
	display: flex; align-items: center; justify-content: space-between; gap: 10px;
	flex-wrap: wrap;
}
.fxm-price { font-size: 18px; font-weight: 700; color: #14161c; }
.fxm-price--free { color: #16a34a; }
.fxm-card-item__actions { display: flex; gap: 8px; }

/* ---------- Buttons ---------- */
.fxm-btn {
	display: inline-flex; align-items: center; justify-content: center;
	height: 38px; padding: 0 16px;
	border-radius: 9px; font-size: 13px; font-weight: 600;
	text-decoration: none; cursor: pointer; border: 1px solid transparent;
	transition: background .15s ease, color .15s ease, border-color .15s ease;
	white-space: nowrap;
}
.fxm-btn--block { width: 100%; height: 48px; font-size: 15px; }
.fxm-btn--ghost { background: transparent; border-color: #e2e4ea; color: #374151; }
.fxm-btn--ghost:hover { border-color: var(--fxm-accent); color: var(--fxm-accent); }
.fxm-btn--buy,
.fxm-card-item .edd-submit,
.fxm-single .edd-submit { background: var(--fxm-accent); color: #fff; border: none; }
.fxm-btn--buy:hover,
.fxm-card-item .edd-submit:hover,
.fxm-single .edd-submit:hover { background: #1d4ed8; color: #fff; }

/* ---------- Pagination ---------- */
.fxm-pagination { display: flex; justify-content: center; gap: 8px; margin-top: 32px; flex-wrap: wrap; }
.fxm-page {
	min-width: 40px; height: 40px;
	border: 1px solid #e2e4ea; border-radius: 9px;
	background: #fff; cursor: pointer; font-weight: 600; color: #374151;
}
.fxm-page.is-active { background: var(--fxm-accent); color: #fff; border-color: var(--fxm-accent); }
.fxm-loadmore { margin: 0 auto; background: #14161c; color: #fff; height: 46px; padding: 0 28px; }

.fxm-market.is-loading .fxm-grid { opacity: .5; pointer-events: none; transition: opacity .2s; }
.fxm-empty { grid-column: 1 / -1; text-align: center; color: #6b7280; padding: 40px 0; }

/* ---------- Single product ---------- */
.fxm-single__grid {
	display: grid;
	grid-template-columns: 1fr 360px;
	gap: 40px;
	align-items: start;
}
.fxm-single__thumb img { width: 100%; height: auto; border-radius: 14px; display: block; }
.fxm-single__desc { margin-top: 28px; line-height: 1.7; color: #374151; }
.fxm-single__changelog { margin-top: 28px; }
.fxm-single__changelog pre {
	background: #0f1115; color: #e6e8ee; padding: 16px; border-radius: 10px;
	overflow: auto; white-space: pre-wrap; font-size: 13px;
}
.fxm-single__panel {
	position: sticky; top: 24px;
	background: #fff; border: 1px solid #eef0f4; border-radius: 16px;
	padding: 24px;
	box-shadow: 0 8px 30px rgba(18, 25, 50, .06);
}
.fxm-single__cat {
	font-size: 12px; font-weight: 600; text-transform: uppercase;
	letter-spacing: .03em; color: var(--fxm-accent); text-decoration: none;
}
.fxm-single__title { margin: 8px 0 12px; font-size: 26px; line-height: 1.25; color: #14161c; }
.fxm-single__meta { display: flex; align-items: center; gap: 14px; font-size: 14px; color: #6b7280; margin-bottom: 16px; }
.fxm-single__price { font-size: 30px; font-weight: 800; color: #14161c; margin-bottom: 18px; }
.fxm-single__actions { display: flex; flex-direction: column; gap: 10px; margin-bottom: 18px; }
.fxm-single__version {
	display: flex; justify-content: space-between; align-items: center;
	padding-top: 14px; border-top: 1px solid #f0f0f1;
	font-size: 13px; color: #6b7280;
}
.fxm-single__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.fxm-tag {
	font-size: 12px; padding: 4px 10px; border-radius: 999px;
	background: #f3f4f7; color: #374151; text-decoration: none;
}
.fxm-tag:hover { background: var(--fxm-accent); color: #fff; }
.fxm-single--placeholder {
	padding: 24px; border: 1px dashed #c7ccd6; border-radius: 12px;
	color: #6b7280; text-align: center;
}

/* ---------- Comments ---------- */
.fxm-comments { margin-top: 40px; }
.fxm-comments__title { font-size: 20px; margin-bottom: 16px; }
.fxm-comments__list { list-style: none; margin: 0; padding: 0; }
.fxm-comments__list--tf .fxm-comment {
	padding: 16px; border: 1px solid #eef0f4; border-radius: 12px; margin-bottom: 12px;
}
.fxm-comment__author { font-weight: 700; color: #14161c; display: block; margin-bottom: 4px; }
.fxm-comment__text { color: #374151; line-height: 1.6; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
	.fxm-single__grid { grid-template-columns: 1fr; }
	.fxm-single__panel { position: static; }
}
@media (max-width: 640px) {
	.fxm-grid { grid-template-columns: 1fr !important; }
	.fxm-layout-list .fxm-card-item { grid-template-columns: 1fr; }
}
