/**
 * Catalog v2 — واجهة تصفح العائلات والإصدارات والقطع.
 * تُحمَّل بعد front.css على صفحات /catalog/ فقط.
 */

body.apf-catalog-page {
	background: var(--tem-bg, #f4f5f7);
}

.apf-catalog--v2 {
	--apf-radius: 18px;
	--apf-radius-sm: 12px;
	--apf-line: var(--tem-line, #e2e6ec);
	--apf-field: var(--tem-field-bg, #fff);
	--apf-ink: var(--tem-ink, #101828);
	--apf-muted: var(--tem-muted, #667085);
	--apf-accent: var(--tem-accent, #c8102e);
	--apf-accent-soft: color-mix(in srgb, var(--apf-accent) 9%, transparent);
	--apf-gold: var(--tem-gold-300, #b8893b);
	--apf-mono: var(--tem-font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
	--apf-font: var(--tem-font-arabic, "IBM Plex Sans Arabic", system-ui, sans-serif);
	width: 100%;
	max-width: 1200px;
	margin-inline: auto;
	padding: 8px 24px 64px;
	color: var(--apf-ink);
	font-family: var(--apf-font);
	font-size: 15px;
	line-height: 1.65;
}

.apf-catalog--v2 *,
.apf-catalog--v2 *::before,
.apf-catalog--v2 *::after {
	box-sizing: border-box;
}

.apf-catalog--v2 img {
	max-width: 100%;
	height: auto;
}

.apf-catalog--v2 a {
	color: inherit;
	text-decoration: none;
}

.apf-catalog--v2 :focus-visible {
	outline: 2px solid var(--apf-accent);
	outline-offset: 3px;
	border-radius: 6px;
}

.apf-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ===== breadcrumbs ===== */
.apf-catalog--v2 .apf-crumbs {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	margin: 4px 0 18px;
	color: var(--apf-muted);
	font-size: 12.5px;
	line-height: 1.5;
}

.apf-catalog--v2 .apf-crumbs a {
	color: var(--apf-muted);
	text-decoration: underline;
	text-underline-offset: 3px;
	text-decoration-thickness: 1px;
}

.apf-catalog--v2 .apf-crumbs a:hover {
	color: var(--apf-accent);
}

.apf-catalog--v2 .apf-crumbs__sep {
	color: color-mix(in srgb, var(--apf-muted) 55%, transparent);
}

.apf-catalog--v2 .apf-crumbs__orig {
	font-size: 11px;
	opacity: 0.75;
}

/* ===== shared type ===== */
.apf-cat-eyebrow {
	margin: 0 0 5px;
	color: var(--apf-gold);
	font-family: var(--apf-mono);
	font-size: 10.5px;
	font-weight: 700;
	letter-spacing: 0.09em;
	text-transform: uppercase;
}

.apf-cat-title {
	margin: 0;
	color: var(--apf-ink);
	font-family: var(--apf-font);
	font-size: clamp(1.9rem, 4.4vw, 2.7rem);
	font-weight: 800;
	line-height: 1.18;
	letter-spacing: -0.01em;
}

.apf-cat-en {
	margin: 3px 0 0;
	color: var(--apf-muted);
	font-family: var(--apf-mono);
	font-size: 12.5px;
	letter-spacing: 0.04em;
}

.apf-cat-lead {
	max-width: 62ch;
	margin: 10px 0 0;
	color: var(--apf-muted);
	font-size: 14px;
	line-height: 1.8;
}

.apf-cat-hint {
	max-width: 64ch;
	margin: 5px 0 0;
	color: var(--apf-muted);
	font-size: 12.5px;
	line-height: 1.65;
}

.apf-cat-arrow {
	width: 18px;
	height: 18px;
	flex: none;
	color: var(--apf-muted);
}

/* ===== hero ===== */
.apf-cat-hero {
	display: grid;
	grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.95fr);
	align-items: center;
	gap: clamp(20px, 4vw, 48px);
	margin-bottom: 30px;
	padding: clamp(18px, 3vw, 30px);
	border: 1px solid var(--apf-line);
	border-radius: 22px;
	background:
		radial-gradient(1100px 300px at 88% -20%, color-mix(in srgb, var(--apf-accent) 7%, transparent), transparent 65%),
		var(--tem-surface, #fff);
	box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

.apf-cat-hero--compact {
	grid-template-columns: minmax(0, 1fr);
	padding: clamp(20px, 4vw, 38px);
}

.apf-cat-hero__body {
	min-width: 0;
}

.apf-cat-hero__media {
	position: relative;
	display: grid;
	place-items: center;
	min-height: 230px;
	overflow: hidden;
	border: 1px solid var(--apf-line);
	border-radius: 16px;
	background:
		linear-gradient(145deg, color-mix(in srgb, var(--apf-accent) 4%, transparent), transparent 60%),
		var(--tem-field-bg, #f8f9fb);
}

.apf-cat-hero__media::after {
	content: "";
	position: absolute;
	inset-inline-start: -30px;
	bottom: -60px;
	width: 180px;
	height: 180px;
	border: 1px solid color-mix(in srgb, var(--apf-gold) 22%, transparent);
	border-radius: 50%;
	pointer-events: none;
}

.apf-cat-img {
	position: relative;
	z-index: 1;
	width: 100%;
	height: 100%;
	max-height: 280px;
	object-fit: contain;
	padding: 12px;
}

.apf-cat-img.is-empty {
	display: block;
	min-height: 160px;
}

.apf-cat-stats {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 1px;
	margin: 18px 0 0;
	overflow: hidden;
	border: 1px solid var(--apf-line);
	border-radius: 14px;
	background: var(--apf-line);
}

.apf-cat-stats > div {
	padding: 10px 12px;
	background: var(--tem-surface, #fff);
}

.apf-cat-stats dt {
	margin: 0 0 2px;
	color: var(--apf-muted);
	font-size: 10.5px;
	font-weight: 500;
	line-height: 1.4;
}

.apf-cat-stats dd {
	margin: 0;
	color: var(--apf-ink);
	font-family: var(--apf-mono);
	font-size: 17px;
	font-weight: 700;
	line-height: 1.3;
	font-variant-numeric: tabular-nums;
}

.apf-cat-stats--gen dd {
	font-size: 16px;
}

.apf-cat-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 9px;
	margin-top: 18px;
}

.apf-cat-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 0 18px;
	border: 1px solid var(--apf-line);
	border-radius: 999px;
	background: var(--tem-surface, #fff);
	color: var(--apf-ink);
	font-size: 13px;
	font-weight: 700;
	line-height: 1;
	transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.apf-cat-btn:hover {
	border-color: color-mix(in srgb, var(--apf-accent) 40%, var(--apf-line));
	color: var(--apf-accent);
}

.apf-cat-btn--primary {
	border-color: var(--apf-accent);
	background: var(--apf-accent);
	color: #fff;
}

.apf-cat-btn--primary:hover {
	border-color: color-mix(in srgb, var(--apf-accent) 82%, #000);
	background: color-mix(in srgb, var(--apf-accent) 82%, #000);
	color: #fff;
}

/* ===== section head + tools ===== */
.apf-cat-section {
	margin-top: 34px;
	scroll-margin-top: 90px;
}

.apf-cat-section__head,
.apf-cat-products__head {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
	align-items: end;
	gap: 18px 28px;
}

.apf-cat-section__head h2,
.apf-cat-products__head h2,
.apf-cat-help h2,
.apf-cat-trust h2 {
	margin: 0;
	color: var(--apf-ink);
	font-family: var(--apf-font);
	font-size: clamp(1.25rem, 2.4vw, 1.6rem);
	font-weight: 800;
	line-height: 1.3;
}

.apf-cat-tools {
	display: grid;
	gap: 10px;
	min-width: 0;
}

.apf-cat-label {
	display: block;
	margin-bottom: 5px;
	color: var(--apf-ink);
	font-size: 11.5px;
	font-weight: 600;
}

.apf-cat-search {
	min-width: 0;
}

.apf-cat-search__field {
	position: relative;
	display: flex;
	align-items: center;
	height: 48px;
	overflow: hidden;
	border: 1px solid var(--apf-line);
	border-radius: 12px;
	background: var(--apf-field);
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.apf-cat-search__field:focus-within {
	border-color: var(--apf-accent);
	outline: 2px solid var(--apf-accent);
	outline-offset: 2px;
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--apf-accent) 12%, transparent);
}

.apf-cat-search__icon {
	position: absolute;
	inset-inline-start: 14px;
	z-index: 2;
	width: 18px;
	height: 18px;
	color: var(--apf-muted);
	pointer-events: none;
}

body.apf-catalog-page .apf-cat-search input[type="search"] {
	width: 100%;
	height: 100%;
	min-block-size: 0;
	margin: 0;
	padding: 0 44px 0 104px;
	border: 0;
	border-radius: 0;
	outline: 0;
	background: transparent;
	color: var(--apf-ink);
	font-family: var(--apf-font);
	font-size: 14px;
	font-weight: 600;
	line-height: 1.4;
	box-shadow: none;
	appearance: none;
}

body.apf-catalog-page .apf-cat-search input[type="search"]::placeholder {
	color: color-mix(in srgb, var(--apf-muted) 78%, transparent);
	font-weight: 400;
}

.apf-cat-search__submit {
	position: absolute;
	inset-inline-end: 2px;
	z-index: 2;
	min-width: 84px;
	min-height: 44px;
	padding: 0 16px;
	border: 0;
	border-radius: 9px;
	background: var(--apf-accent);
	color: #fff;
	font-family: var(--apf-font);
	font-size: 12.5px;
	font-weight: 700;
	cursor: pointer;
}

.apf-cat-search__submit:hover {
	background: color-mix(in srgb, var(--apf-accent) 84%, #000);
}

.apf-cat-clear {
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	margin-top: 0;
	color: var(--apf-accent);
	font-size: 11.5px;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.apf-cat-sort {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 5px;
	color: var(--apf-muted);
	font-size: 11.5px;
}

.apf-cat-sort a {
	display: inline-flex;
	align-items: center;
	min-height: 36px;
	padding: 0 10px;
	border: 1px solid transparent;
	border-radius: 999px;
	color: var(--apf-muted);
	font-weight: 600;
}

.apf-cat-sort a:hover {
	border-color: var(--apf-line);
	color: var(--apf-accent);
}

.apf-cat-sort a.is-active {
	border-color: color-mix(in srgb, var(--apf-accent) 25%, var(--apf-line));
	background: var(--apf-accent-soft);
	color: var(--apf-accent);
}

.apf-cat-result {
	margin: 14px 0 10px;
	color: var(--apf-muted);
	font-size: 12px;
	font-weight: 500;
}

/* ===== family grid ===== */
.apf-cat-family-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	align-items: start;
	gap: 14px;
}

.apf-cat-family {
	display: flex;
	flex-direction: column;
	min-width: 0;
	overflow: hidden;
	border: 1px solid var(--apf-line);
	border-radius: var(--apf-radius);
	background: var(--tem-surface, #fff);
	box-shadow: 0 1px 2px rgba(16, 24, 40, 0.035);
}

.apf-cat-family__head {
	display: grid;
	grid-template-columns: 58px minmax(0, 1fr) auto;
	align-items: center;
	gap: 12px;
	padding: 14px 16px;
	border-bottom: 1px solid var(--apf-line);
	background: color-mix(in srgb, var(--tem-field-bg, #f8f9fb) 70%, transparent);
}

.apf-cat-family__code {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 58px;
	height: 46px;
	border: 1px solid color-mix(in srgb, var(--apf-gold) 35%, var(--apf-line));
	border-radius: 10px;
	background: color-mix(in srgb, var(--apf-gold) 8%, var(--tem-surface, #fff));
	color: color-mix(in srgb, var(--apf-gold) 78%, var(--apf-ink));
	font-family: var(--apf-mono);
	font-size: 13px;
	font-weight: 800;
	letter-spacing: 0.02em;
}

.apf-cat-family__title {
	min-width: 0;
}

.apf-cat-family__title h3 {
	margin: 0;
	color: var(--apf-ink);
	font-family: var(--apf-font);
	font-size: 16.5px;
	font-weight: 800;
	line-height: 1.35;
}

.apf-cat-family__title p {
	margin: 2px 0 0;
	color: var(--apf-muted);
	font-size: 11.5px;
	line-height: 1.5;
}

.apf-cat-family__parts {
	display: flex;
	flex-direction: column;
	align-items: center;
	min-width: 54px;
	padding: 4px 7px;
	border-radius: 9px;
	background: var(--apf-accent-soft);
	color: var(--apf-accent);
	line-height: 1.15;
}

.apf-cat-family__parts strong {
	font-family: var(--apf-mono);
	font-size: 13px;
	font-weight: 800;
	font-variant-numeric: tabular-nums;
}

.apf-cat-family__parts small {
	font-size: 8.5px;
	font-weight: 500;
}

.apf-cat-variants {
	display: flex;
	flex-direction: column;
}

.apf-cat-variant {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto auto;
	align-items: center;
	gap: 10px;
	min-height: 62px;
	padding: 10px 16px;
	border-top: 1px solid color-mix(in srgb, var(--apf-line) 78%, transparent);
	background: transparent;
	transition: background-color 0.18s ease;
}

.apf-cat-variant:first-child {
	border-top: 0;
}

a.apf-cat-variant:hover {
	background: color-mix(in srgb, var(--apf-accent) 4%, transparent);
}

.apf-cat-variant__main {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 3px 9px;
	min-width: 0;
}

.apf-cat-variant__main strong {
	color: var(--apf-ink);
	font-size: 13px;
	font-weight: 700;
	line-height: 1.4;
}

.apf-cat-variant__meta {
	color: var(--apf-muted);
	font-size: 11px;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.apf-cat-codes {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 3px;
	align-items: center;
}

.apf-cat-codes code,
.apf-cat-codebar code {
	display: inline-flex;
	align-items: center;
	min-height: 19px;
	padding: 0 6px;
	border: 1px solid var(--apf-line);
	border-radius: 5px;
	background: var(--tem-field-bg, #f8f9fb);
	color: color-mix(in srgb, var(--apf-ink) 82%, var(--apf-muted));
	font-family: var(--apf-mono);
	font-size: 9.5px;
	font-weight: 600;
	letter-spacing: 0.02em;
}

.apf-cat-codes__more {
	color: var(--apf-muted);
	font-family: var(--apf-mono);
	font-size: 9.5px;
}

.apf-cat-variant__side {
	display: flex;
	align-items: center;
	gap: 7px;
	white-space: nowrap;
}

.apf-cat-variant__count {
	color: var(--apf-ink);
	font-family: var(--apf-mono);
	font-size: 12px;
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}

.apf-cat-variant__count small {
	color: var(--apf-muted);
	font-family: var(--apf-font);
	font-size: 9px;
	font-weight: 500;
}

.apf-cat-variant.is-empty {
	background: color-mix(in srgb, var(--apf-muted) 3%, transparent);
}

.apf-cat-variant.is-empty .apf-cat-variant__main strong {
	color: var(--apf-muted);
}

.apf-cat-request {
	display: inline-flex;
	align-items: center;
	min-height: 30px;
	padding: 0 10px;
	border: 1px solid color-mix(in srgb, var(--apf-accent) 35%, var(--apf-line));
	border-radius: 999px;
	color: var(--apf-accent);
	font-size: 10.5px;
	font-weight: 700;
	white-space: nowrap;
}

.apf-cat-request:hover {
	background: var(--apf-accent);
	color: #fff;
}

/* ===== help / trust ===== */
.apf-cat-help,
.apf-cat-trust {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 22px;
	margin-top: 32px;
	padding: 20px 22px;
	border: 1px solid color-mix(in srgb, var(--apf-gold) 28%, var(--apf-line));
	border-radius: var(--apf-radius);
	background:
		radial-gradient(600px 160px at 90% 0%, color-mix(in srgb, var(--apf-gold) 10%, transparent), transparent 65%),
		var(--tem-surface, #fff);
}

.apf-cat-help > div,
.apf-cat-trust > div {
	max-width: 70ch;
}

.apf-cat-help p,
.apf-cat-trust p {
	margin: 5px 0 0;
	color: var(--apf-muted);
	font-size: 12.5px;
	line-height: 1.75;
}

.apf-cat-help .apf-cat-btn,
.apf-cat-trust .apf-cat-btn {
	flex: none;
}

/* ===== generation header ===== */
.apf-cat-back {
	margin: 0 0 12px;
	font-size: 12px;
}

.apf-cat-back a {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	min-height: 36px;
	color: var(--apf-muted);
	font-weight: 600;
}

.apf-cat-back a:hover {
	color: var(--apf-accent);
}

.apf-cat-back svg {
	width: 15px;
	height: 15px;
}

.apf-cat-hero--gen {
	grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
	margin-bottom: 18px;
}

.apf-cat-codebar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 5px;
	margin-top: 12px;
	color: var(--apf-muted);
	font-size: 11px;
}

.apf-cat-codebar > span:first-child {
	margin-inline-end: 3px;
}

.apf-cat-siblings {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	margin: 0 0 22px;
	padding: 10px 12px;
	border: 1px solid var(--apf-line);
	border-radius: 12px;
	background: var(--tem-surface, #fff);
}

.apf-cat-siblings__label {
	margin-inline-end: 3px;
	color: var(--apf-muted);
	font-size: 11px;
	font-weight: 600;
}

.apf-cat-sibling {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	min-height: 34px;
	padding: 0 10px;
	border: 1px solid var(--apf-line);
	border-radius: 999px;
	color: var(--apf-ink);
	font-size: 11px;
	font-weight: 600;
}

.apf-cat-sibling bdi {
	color: var(--apf-muted);
	font-family: var(--apf-mono);
	font-size: 9.5px;
}

a.apf-cat-sibling:hover {
	border-color: color-mix(in srgb, var(--apf-accent) 40%, var(--apf-line));
	color: var(--apf-accent);
}

.apf-cat-sibling.is-current {
	border-color: color-mix(in srgb, var(--apf-accent) 30%, var(--apf-line));
	background: var(--apf-accent-soft);
	color: var(--apf-accent);
}

/* ===== products ===== */
.apf-cat-products {
	margin-top: 28px;
	scroll-margin-top: 90px;
}

.apf-cat-search--products {
	width: 100%;
}

.apf-cat-product-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 12px;
	margin-top: 6px;
}

.apf-cat-product {
	display: grid;
	grid-template-columns: 92px minmax(0, 1fr);
	align-items: stretch;
	min-width: 0;
	min-height: 104px;
	overflow: hidden;
	border: 1px solid var(--apf-line);
	border-radius: 14px;
	background: var(--tem-surface, #fff);
	transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.apf-cat-product:hover {
	border-color: color-mix(in srgb, var(--apf-accent) 32%, var(--apf-line));
	box-shadow: 0 6px 18px rgba(16, 24, 40, 0.07);
	transform: translateY(-1px);
}

.apf-cat-product__media {
	display: grid;
	place-items: center;
	height: 100%;
	min-height: 104px;
	padding: 6px;
	overflow: hidden;
	border-inline-end: 1px solid color-mix(in srgb, var(--apf-line) 75%, transparent);
	background: var(--tem-field-bg, #f8f9fb);
}

.apf-cat-product__media img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	mix-blend-mode: multiply;
}

.apf-cat-product__media.is-empty {
	background:
		radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--apf-accent) 5%, transparent), transparent 62%),
		var(--tem-field-bg, #f8f9fb);
}

.apf-cat-product__ph {
	display: grid;
	place-items: center;
	width: 42px;
	height: 42px;
	color: color-mix(in srgb, var(--apf-muted) 55%, var(--apf-line));
}

.apf-cat-product__ph svg {
	width: 100%;
	height: 100%;
}

.apf-cat-product__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	justify-content: center;
	gap: 4px;
	min-width: 0;
	padding: 10px 11px 11px;
}

.apf-cat-product__title {
	display: -webkit-box;
	overflow: hidden;
	color: var(--apf-ink);
	font-size: 12.5px;
	font-weight: 600;
	line-height: 1.5;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
}

.apf-cat-product__sku {
	margin-top: 2px;
	color: var(--apf-muted);
	font-family: var(--apf-mono);
	font-size: 9.5px;
	letter-spacing: 0.03em;
}

.apf-cat-product > .apf-cat-arrow {
	display: none;
}

/* ===== pager ===== */
.apf-cat-pager {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin-top: 24px;
}

.apf-cat-pager__pages {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px;
}

.apf-cat-pager__link,
.apf-cat-pager__step {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 38px;
	min-height: 38px;
	padding: 0 10px;
	border: 1px solid var(--apf-line);
	border-radius: 9px;
	background: var(--tem-surface, #fff);
	color: var(--apf-ink);
	font-size: 12px;
	font-weight: 600;
}

.apf-cat-pager__link:hover,
.apf-cat-pager__step:hover {
	border-color: color-mix(in srgb, var(--apf-accent) 40%, var(--apf-line));
	color: var(--apf-accent);
}

.apf-cat-pager__link.is-current {
	border-color: var(--apf-accent);
	background: var(--apf-accent);
	color: #fff;
}

.apf-cat-pager__step.is-disabled {
	opacity: 0.42;
	pointer-events: none;
}

.apf-cat-pager__gap {
	padding: 0 3px;
	color: var(--apf-muted);
}

.apf-cat-pagecount {
	margin: 8px 0 0;
	color: var(--apf-muted);
	font-size: 11px;
	text-align: center;
}

/* ===== empty ===== */
.apf-cat-empty {
	margin-top: 14px;
	padding: 34px 22px;
	border: 1px dashed color-mix(in srgb, var(--apf-muted) 35%, var(--apf-line));
	border-radius: var(--apf-radius);
	background: var(--tem-surface, #fff);
	text-align: center;
}

.apf-cat-empty h2 {
	margin: 0;
	color: var(--apf-ink);
	font-size: 19px;
	font-weight: 800;
}

.apf-cat-empty p {
	max-width: 60ch;
	margin: 7px auto 0;
	color: var(--apf-muted);
	font-size: 13px;
	line-height: 1.75;
}

.apf-cat-empty .apf-cat-actions {
	justify-content: center;
}

/* ===== root cards ===== */
.apf-cat-model-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 12px;
	margin-top: 18px;
}

.apf-cat-model {
	display: grid;
	grid-template-columns: 64px minmax(0, 1fr) auto;
	align-items: center;
	gap: 10px;
	min-height: 88px;
	padding: 10px;
	border: 1px solid var(--apf-line);
	border-radius: 14px;
	background: var(--tem-surface, #fff);
	transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.apf-cat-model:hover {
	border-color: color-mix(in srgb, var(--apf-accent) 32%, var(--apf-line));
	box-shadow: 0 5px 16px rgba(16, 24, 40, 0.07);
}

.apf-cat-model__media {
	display: grid;
	place-items: center;
	width: 64px;
	height: 60px;
	overflow: hidden;
	border-radius: 9px;
	background: var(--tem-field-bg, #f8f9fb);
}

.apf-cat-model__media .apf-cat-img {
	padding: 4px;
	max-height: 60px;
}

.apf-cat-model__body {
	display: flex;
	flex-direction: column;
	min-width: 0;
	gap: 1px;
}

.apf-cat-model__name {
	color: var(--apf-ink);
	font-size: 14px;
	font-weight: 700;
	line-height: 1.4;
}

.apf-cat-model__en {
	overflow: hidden;
	color: var(--apf-muted);
	font-family: var(--apf-mono);
	font-size: 9.5px;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.apf-cat-model__meta {
	display: flex;
	flex-wrap: wrap;
	gap: 2px 8px;
	margin-top: 3px;
	color: var(--apf-muted);
	font-size: 10px;
	font-variant-numeric: tabular-nums;
}

.apf-cat-model__meta span:last-child {
	color: color-mix(in srgb, var(--apf-accent) 82%, var(--apf-ink));
	font-weight: 600;
}

/* ===== dark ===== */
html.theme-b .apf-catalog--v2,
body.theme-b .apf-catalog--v2 {
	--apf-line: color-mix(in srgb, var(--tem-line, #2a3444) 88%, #fff);
}

html.theme-b .apf-cat-hero,
body.theme-b .apf-cat-hero,
html.theme-b .apf-cat-family,
body.theme-b .apf-cat-family,
html.theme-b .apf-cat-product,
body.theme-b .apf-cat-product,
html.theme-b .apf-cat-help,
body.theme-b .apf-cat-help,
html.theme-b .apf-cat-trust,
body.theme-b .apf-cat-trust {
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}

html.theme-b .apf-cat-product__media img,
body.theme-b .apf-cat-product__media img {
	mix-blend-mode: normal;
}

/* Desktop: عائلة واحدة في الصف، والإصدارات جنبًا إلى جنب. */
@media (min-width: 901px) {
	.apf-cat-family-grid {
		grid-template-columns: minmax(0, 1fr);
		gap: 10px;
	}

	.apf-cat-variants {
		display: grid;
		grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
		gap: 0;
		border-top: 1px solid color-mix(in srgb, var(--apf-line) 78%, transparent);
	}

	.apf-cat-variant {
		min-height: 56px;
		padding: 8px 14px;
		border-top: 0;
		border-inline-start: 1px solid color-mix(in srgb, var(--apf-line) 78%, transparent);
	}

	.apf-cat-variant:first-child {
		border-inline-start: 0;
	}
}

/* ===== responsive ===== */
@media (max-width: 1080px) {
	.apf-cat-hero,
	.apf-cat-hero--gen {
		grid-template-columns: minmax(0, 1fr) minmax(250px, 0.8fr);
		gap: 22px;
	}

	.apf-cat-product-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.apf-cat-model-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 900px) {
	.apf-catalog--v2 {
		padding-inline: 18px;
	}

	.apf-cat-hero,
	.apf-cat-hero--gen {
		grid-template-columns: minmax(0, 1fr);
	}

	.apf-cat-hero--series .apf-cat-hero__media {
		order: 2;
	}

	.apf-cat-hero__media {
		min-height: 200px;
	}

	.apf-cat-section__head,
	.apf-cat-products__head {
		grid-template-columns: minmax(0, 1fr);
		align-items: start;
	}

	.apf-cat-family-grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.apf-cat-product-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.apf-cat-help,
	.apf-cat-trust {
		flex-direction: column;
		align-items: flex-start;
	}
}

@media (max-width: 640px) {
	.apf-catalog--v2 {
		padding: 2px 16px 44px;
		font-size: 14px;
	}

	.apf-catalog--v2 .apf-crumbs {
		margin-bottom: 12px;
		font-size: 11.5px;
	}

	.apf-cat-hero {
		padding: 16px;
		border-radius: 18px;
		margin-bottom: 22px;
	}

	.apf-cat-title {
		font-size: clamp(1.65rem, 8vw, 2.1rem);
	}

	.apf-cat-lead {
		font-size: 13px;
		line-height: 1.7;
	}

	.apf-cat-hero__media {
		min-height: 170px;
	}

	.apf-cat-stats {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		margin-top: 14px;
	}

	.apf-cat-stats > div {
		padding: 8px 10px;
	}

	.apf-cat-stats dd {
		font-size: 15px;
	}

	.apf-cat-actions {
		margin-top: 14px;
	}

	.apf-cat-btn {
		flex: 1 1 auto;
		padding: 0 14px;
		font-size: 12px;
	}

	.apf-cat-section {
		margin-top: 24px;
	}

	.apf-cat-section__head,
	.apf-cat-products__head {
		gap: 14px;
	}

	.apf-cat-section__head h2,
	.apf-cat-products__head h2,
	.apf-cat-help h2,
	.apf-cat-trust h2 {
		font-size: 1.2rem;
	}

	.apf-cat-search__field {
		height: 50px;
	}

	body.apf-catalog-page .apf-cat-search input[type="search"] {
		padding: 0 42px 0 94px;
		font-size: 16px;
	}

	.apf-cat-search__submit {
		min-width: 76px;
		min-height: 44px;
		padding: 0 12px;
		font-size: 12px;
	}

	.apf-cat-sort {
		flex-wrap: nowrap;
		overflow-x: auto;
		padding-bottom: 3px;
		scrollbar-width: none;
	}

	.apf-cat-sort::-webkit-scrollbar {
		display: none;
	}

	.apf-cat-sort a {
		flex: 0 0 auto;
		min-height: 36px;
	}

	.apf-cat-family__head {
		grid-template-columns: 46px minmax(0, 1fr) auto;
		gap: 9px;
		padding: 11px 12px;
	}

	.apf-cat-family__code {
		width: 46px;
		height: 42px;
		font-size: 11px;
	}

	.apf-cat-family__title h3 {
		font-size: 14.5px;
	}

	.apf-cat-family__parts {
		min-width: 48px;
		padding: 3px 5px;
	}

	.apf-cat-family__parts strong {
		font-size: 12px;
	}

	.apf-cat-variant {
		grid-template-columns: minmax(0, 1fr) auto;
		gap: 5px 8px;
		padding: 10px 12px;
	}

	.apf-cat-variant__main {
		gap: 2px 7px;
	}

	.apf-cat-variant__main strong {
		font-size: 12.5px;
	}

	.apf-cat-variant__meta {
		font-size: 10.5px;
	}

	.apf-cat-codes code {
		font-size: 9px;
	}

	.apf-cat-variant__side {
		grid-column: 2;
		grid-row: 1 / span 2;
	}

	.apf-cat-variant__count {
		font-size: 11px;
	}

	.apf-cat-product-grid {
		grid-template-columns: minmax(0, 1fr);
		gap: 8px;
	}

	.apf-cat-product {
		grid-template-columns: 84px minmax(0, 1fr);
		min-height: 92px;
	}

	.apf-cat-product__media {
		min-height: 92px;
	}

	.apf-cat-product__body {
		padding: 8px 10px 9px;
	}

	.apf-cat-product__title {
		font-size: 12.5px;
		-webkit-line-clamp: 2;
	}

	.apf-cat-model-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 8px;
	}

	.apf-cat-model {
		grid-template-columns: minmax(0, 1fr) auto;
		min-height: 86px;
		padding: 9px;
	}

	.apf-cat-model__media {
		display: none;
	}

	.apf-cat-model__name {
		font-size: 13.5px;
	}

	.apf-cat-model__meta {
		font-size: 9.5px;
	}

	.apf-cat-siblings {
		flex-wrap: nowrap;
		overflow-x: auto;
		padding: 8px 10px;
		scrollbar-width: none;
	}

	.apf-cat-siblings::-webkit-scrollbar {
		display: none;
	}

	.apf-cat-siblings__label,
	.apf-cat-sibling {
		flex: 0 0 auto;
	}

	.apf-cat-pager__step {
		min-width: 34px;
		min-height: 36px;
		font-size: 11px;
	}

	.apf-cat-pager__link {
		min-width: 34px;
		min-height: 36px;
		font-size: 11px;
	}

	.apf-cat-help,
	.apf-cat-trust {
		margin-top: 24px;
		padding: 16px;
	}

	.apf-cat-empty {
		padding: 24px 16px;
	}
}

@media (max-width: 380px) {
	.apf-catalog--v2 {
		padding-inline: 12px;
	}

	.apf-cat-product-grid,
	.apf-cat-model-grid {
		gap: 7px;
	}

	.apf-cat-product {
		grid-template-columns: 74px minmax(0, 1fr);
		min-height: 86px;
	}

	.apf-cat-product__media {
		min-height: 86px;
		padding: 4px;
	}

	.apf-cat-product__ph {
		width: 34px;
		height: 34px;
	}

	.apf-cat-variant__side .apf-cat-arrow {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.apf-catalog--v2 *,
	.apf-catalog--v2 *::before,
	.apf-catalog--v2 *::after {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}

	.apf-cat-product:hover {
		transform: none;
	}
}
