/*
 * INNER-EXPERIENCE-005: «أجهزة التكييف», on the catalog only. A short intro on the warm ground of the homes page, the search
 * and two rows of choices, the count and the active choices, cards in the home page's device language, and a short
 * band for projects. Scoped to .cat-page so the home and homes device sections keep their own look.
 */
.cat-page { --warm: #F7F4EE; }
.cat-page h1, .cat-page h2 { letter-spacing: 0; text-wrap: balance; }

/* Intro. */
.cat-head { background: var(--warm); padding-block-end: 24px; }
.cat-head-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; padding-block-start: 4px; }
.cat-eyebrow { margin: 0 0 6px; color: var(--link); font-weight: 600; font-size: 15px; }
.cat-head h1 { margin: 0; font-size: 30px; line-height: 1.3; }
.cat-head .lead { margin: 0; max-width: 34rem; color: var(--muted); font-size: 17px; line-height: 1.85; }
@media (min-width: 768px) { .cat-head h1 { font-size: 38px; } }
@media (min-width: 1024px) { .cat-head { padding-block-end: 32px; } .cat-head-grid { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 56px; align-items: end; } .cat-head h1 { font-size: 44px; } }

/* Tools. */
.cat-body { padding-block: 24px 56px; }
.cat-tools { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; padding-block-end: 18px; border-block-end: 1px solid var(--border); transition: opacity var(--t-fast) linear; }
.cat-tools.is-waiting { opacity: .6; pointer-events: none; }
.cat-search label { display: block; margin-block-end: 6px; color: var(--primary); font-weight: 600; font-size: 15px; }
.cat-search-row { display: flex; gap: 8px; }
.cat-search input { flex: 1; min-width: 0; min-height: 48px; padding: 0 14px; border: 2px solid var(--border); border-radius: 0; font: inherit; }
.cat-search input:focus { border-color: var(--primary); outline: 3px solid var(--accent); outline-offset: 1px; }
.cat-chips { min-width: 0; margin: 0; padding: 0; border: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cat-chips legend { float: inline-start; margin-inline-end: 6px; padding: 0; color: var(--muted); font-size: 14px; line-height: 44px; }
.cat-chip { position: relative; display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border: 1px solid var(--border); background: var(--white); color: var(--primary); font-weight: 600; font-size: 15px; cursor: pointer; transition: background-color var(--t-fast) linear, color var(--t-fast) linear, border-color var(--t-fast) linear; }
.cat-chip input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.cat-chip:hover { border-color: var(--primary); }
.cat-chip:has(:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }
.cat-chip:has(:checked) { background: var(--primary); border-color: var(--primary); color: var(--white); }
.cat-apply { margin: 0; }
/* Phones: the tools stay short so the first devices show early; a long row of brands scrolls inside itself. */
@media (max-width: 599px) {
	.cat-head { padding-block-end: 16px; }
	.cat-head h1 { font-size: 26px; }
	.cat-head .lead { font-size: 15px; line-height: 1.7; }
	.cat-body { padding-block-start: 16px; }
	.cat-tools { gap: 10px; padding-block-end: 12px; }
	.cat-chips { flex-wrap: nowrap; overflow-x: auto; padding-block: 3px; margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); scrollbar-width: thin; }
	.cat-chips legend { float: none; margin-block-end: 2px; line-height: 1.6; }
	.cat-chip { flex: none; padding: 0 14px; }
	.cat-status { padding-block: 10px 14px; }
}
@media (min-width: 900px) {
	.cat-tools { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 14px 32px; align-items: end; }
	.cat-search { grid-row: 1 / span 2; }
}

.cat-status { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; padding-block: 14px 22px; }
.cat-count { margin: 0; color: var(--primary); font-weight: 700; }
.cat-count:focus { outline: 3px solid var(--accent); outline-offset: 4px; }
.cat-active { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.cat-active a { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; background: #EDF3FC; color: var(--primary); font-size: 14px; text-decoration: none; }
.cat-active a:hover { background: #DCE8FB; }
.cat-active i { font-style: normal; font-size: 18px; line-height: 1; }
.cat-active .cat-clear a { background: none; color: var(--link); text-decoration: underline; text-underline-offset: 4px; }

/* Cards. */
.cat-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.cat-card { position: relative; display: flex; flex-direction: column; min-width: 0; padding: 18px; background: var(--white); border: 1px solid var(--border); border-block-end: 3px solid var(--primary); transition: border-color var(--t-fast) linear, box-shadow var(--t-fast) linear; }
.cat-card:hover { box-shadow: 0 6px 18px rgba(26, 19, 110, .08); }
.cat-card:has(:focus-visible) { border-color: var(--accent); }
.cat-brand { margin: 0; color: var(--link); font-weight: 600; font-size: 14px; }
.cat-title { margin: 2px 0 0; font-size: 19px; line-height: 1.45; overflow-wrap: anywhere; }
.cat-title a { color: var(--primary); text-decoration: none; }
.cat-title a:hover { text-decoration: underline; text-underline-offset: 4px; }
.cat-model { margin: 2px 0 0; color: var(--muted); font: 500 14px/1.6 var(--font-en); overflow-wrap: anywhere; }
.cat-media { position: relative; aspect-ratio: 4 / 3; margin-block: 14px; background: var(--surface); }
.cat-media img { position: absolute; inset: 8%; width: 84%; height: 84%; object-fit: contain; }
.cat-media.is-drawn { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--primary); background: var(--warm); }
.cat-media.is-drawn svg { width: 96px; height: 96px; }
.cat-media.is-drawn span { color: var(--muted); font-size: 14px; }
.cat-mark { position: absolute; inset: 30%; background: var(--mark) center / contain no-repeat; opacity: .12; }
.cat-specs { margin: 0; display: grid; gap: 0; }
.cat-specs div { display: flex; justify-content: space-between; gap: 12px; padding-block: 6px; border-block-end: 1px solid var(--border); font-size: 14px; }
.cat-specs dt { color: var(--muted); }
.cat-specs dd { margin: 0; font-weight: 600; text-align: end; overflow-wrap: anywhere; }
.cat-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin: auto 0 0; padding-block-start: 16px; }
.cat-more { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; }
.cat-card .test-badge { align-self: flex-start; margin-block-end: 8px; }
@media (min-width: 600px) { .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1024px) { .cat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; } }
@media (min-width: 1200px) { .cat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.cat-grid:has(> li:only-child) { grid-template-columns: minmax(0, 22rem); }
.cat-page .pagination { margin-block-start: 32px; }

/* States. */
.cat-empty { max-width: 40rem; padding: 28px; background: var(--warm); border-inline-start: 4px solid var(--accent); }
.cat-empty h2 { margin: 0 0 8px; font-size: 24px; }
.cat-empty p { margin: 0; line-height: 1.85; }
.cat-empty-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; margin-block-start: 16px !important; }
.cat-empty .text-link { display: inline-flex; align-items: center; min-height: 44px; }

/* Projects and several devices: short, after the results. */
.cat-more-band { padding-block: 40px; background: var(--primary); color: #E0E5F7; }
.cat-more-inner { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.cat-more-band h2 { margin: 0; color: var(--white); font-size: 24px; }
.cat-more-band p { margin: 8px 0 0; color: #E0E5F7; }
.cat-more-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; margin: 0 !important; }
.cat-more-band .button { background: var(--white); color: var(--primary); }
.cat-more-band .button:hover { background: #E6EDFC; color: var(--primary); }
.cat-more-link { display: inline-flex; align-items: center; min-height: 44px; color: var(--white); font-weight: 600; text-underline-offset: 5px; }
.cat-more-link:hover { color: var(--white); }
.cat-more-link bdi { font: 700 18px/1 var(--font-en); }
.cat-more-band a:focus-visible { outline: 3px solid var(--white); outline-offset: 3px; }
@media (max-width: 479px) { .cat-more-band .button { width: 100%; } }
@media (min-width: 900px) { .cat-more-inner { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 48px; align-items: center; } }

@media (prefers-reduced-motion: no-preference) {
	.cat-chip:has(:checked) span { animation: cat-pick .25s ease-out; }
	@keyframes cat-pick { 40% { transform: translateY(-2px); } }
}
