/*
 * Route `cars` — the Explore Cars page.
 *
 * Ported from `pca-web/explore-cars.html`. Raw hex values became the semantic
 * tokens declared in public.css so the page inherits dark mode for free, and
 * every physical direction became a logical property so the layout mirrors in
 * Arabic. The prototype's breakpoints are unchanged.
 *
 * The card grid itself is the shared `.pca-grid` (5 desktop / 3 tablet /
 * 2 mobile) — nothing here redefines its columns.
 */

/* ==========================================================================
   1. Page heading (English lead, Arabic companion)
   ========================================================================== */

.filters-section {
	padding: 40px 0 10px;
}

.filters-section-form {
	padding-block-start: 0;
}

.section-heading-row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 14px;
	flex-wrap: wrap;
}

.section-heading-row h1,
.section-heading-row h3 {
	font-size: clamp(20px, 3vw, 30px);
	font-weight: 900;
	color: var(--heading-ink);
	margin: 0;
}

.section-heading-row .ar {
	font-size: clamp(17px, 2.6vw, 24px);
	font-weight: 800;
	color: var(--blue-bright);
}

/* ==========================================================================
   2. Filter bar
   ========================================================================== */

.filters-row {
	display: flex;
	gap: 14px;
	flex-wrap: wrap;
	margin-block-start: 26px;
}

.filter-field {
	flex: 1 1 220px;
	min-width: 200px;
}

.filter-field label {
	display: block;
	font-size: 12px;
	font-weight: 800;
	color: var(--heading-ink);
	margin-block-end: 6px;
}

.filter-field label .ar {
	font-weight: 700;
	color: var(--blue-bright);
	margin-inline-start: 6px;
	font-size: 11.5px;
}

.filter-field select,
.filter-field input[type='search'] {
	width: 100%;
	padding: 13px 14px;
	border-radius: 12px;
	border: 1.8px solid var(--field-border);
	background: var(--field-bg);
	font-family: inherit;
	font-size: 14.5px;
	color: var(--body-ink);
	transition: border-color 0.18s ease;
}

.filter-field select {
	cursor: pointer;
}

.filter-field select:focus,
.filter-field input[type='search']:focus {
	outline: none;
	border-color: var(--blue-bright);
}

/* The action column is not a labelled field, so its control aligns to the
   bottom of the row rather than to the (absent) label. */
.filter-field-actions {
	display: flex;
	align-items: flex-end;
	gap: 12px;
	flex: 0 1 auto;
	min-width: 0;
}

.filter-field-actions .btn {
	padding: 13px 26px;
	font-size: 14.5px;
}

.filters-reset {
	font-size: 13px;
	font-weight: 800;
	color: var(--blue-bright);
	padding-block: 13px;
	white-space: nowrap;
}

.filters-reset:hover {
	text-decoration: underline;
}

.results-count {
	margin-block-start: 16px;
	font-size: 13px;
	color: var(--muted);
	font-weight: 700;
}

/* ==========================================================================
   3. Car cards
   ========================================================================== */

.cars-section {
	padding: 16px 0 40px;
}

.car-card {
	border: 2px solid var(--heading-ink);
	border-radius: var(--radius);
	background: var(--card-bg);
	padding: 18px;
	text-align: center;
	display: flex;
	flex-direction: column;
	align-items: center;
	transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.car-card:hover {
	transform: translateY(-4px);
	box-shadow: var(--shadow);
}

.car-card .name {
	width: 100%;
}

.car-card .name .en {
	display: block;
	font-weight: 800;
	color: var(--heading-ink);
	font-size: 15.5px;
	line-height: 1.25;
}

.car-card .name .ar {
	display: block;
	font-weight: 700;
	color: var(--muted);
	font-size: 12px;
	margin-block-start: 2px;
	letter-spacing: 0.2px;
}

.car-card .photo {
	position: relative;
	width: 100%;
	aspect-ratio: 4 / 3;
	border-radius: 14px;
	overflow: hidden;
	margin-block: 12px;
	background: var(--blue-pale);
}

.car-card .photo img,
.car-card .photo picture {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.car-card .photo-placeholder {
	display: block;
	width: 100%;
	height: 100%;
	background: var(--blue-pale);
}

.car-card .car-award-badge {
	position: absolute;
	inset-block-start: 8px;
	inset-inline-end: 8px;
	z-index: 2;
	font-size: 10px;
	padding: 4px 10px;
}

.car-card .tags {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
	justify-content: center;
	margin-block-start: 4px;
}

.car-card .tag {
	font-size: 10.5px;
	font-weight: 800;
	color: var(--blue-bright);
	background: var(--blue-pale);
	padding: 3px 10px;
	border-radius: 999px;
}

/* ==========================================================================
   4. Empty state and pagination
   ========================================================================== */

.cars-empty .ar {
	display: block;
	font-size: 14px;
	font-weight: 700;
	color: var(--blue-bright);
	margin-block-end: 6px;
}

.cars-empty p {
	margin: 0 auto 18px;
	max-width: 460px;
	line-height: 1.7;
}

/* Matches the admin pagination class contract so both surfaces read as one
   component. */
.pca-pagination {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin-block-start: 28px;
}

.pca-pagination-count {
	font-size: 13px;
	font-weight: 700;
	color: var(--muted);
	margin-inline-end: 8px;
}

.pca-page-link {
	min-width: 38px;
	height: 38px;
	padding-inline: 10px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 10px;
	border: 1.5px solid var(--card-border);
	background: var(--card-bg);
	color: var(--heading-ink);
	font-size: 13.5px;
	font-weight: 800;
	transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.pca-page-link:hover {
	border-color: var(--blue-bright);
	color: var(--blue-bright);
}

.pca-page-link.is-current {
	background: var(--heading-ink);
	border-color: var(--heading-ink);
	color: var(--white);
}

.pca-pagination-gap {
	color: var(--muted);
	font-weight: 800;
	padding-inline: 2px;
}

/* ==========================================================================
   5. Responsive
   ========================================================================== */

@media (max-width: 639px) {
	.filters-section {
		padding-block-start: 26px;
	}

	.filter-field {
		flex-basis: 100%;
	}

	.filter-field-actions {
		flex-basis: 100%;
	}

	.filter-field-actions .btn {
		flex: 1 1 auto;
	}

	.car-card {
		padding: 12px;
	}

	.car-card .name .en {
		font-size: 13.5px;
	}

	.car-card .name .ar {
		font-size: 11px;
	}
}
