/* Category v2 — light surface + proper RTL/LTR sidebar */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;800&display=swap');

body.is-category {
	--cv2-bg: #f5f6f8;
	--cv2-surface: #ffffff;
	--cv2-ink: #1f2430;
	--cv2-gold: #ffc107;
	--cv2-muted: #6b7280;
	--cv2-border: #e5e7eb;
	--cv2-urgent: #ef4444;
	--cv2-verified: #2563eb;
	--cv2-radius: 12px;
	font-family: Tajawal, Cairo, sans-serif !important;
	background: var(--cv2-bg) !important;
	color: var(--cv2-ink);
}

body.is-category .main-content {
	padding: 0 !important;
	background: var(--cv2-bg) !important;
	min-height: 70vh;
}

body.is-category #top-header,
body.is-category .site-header,
body.is-category .nav-bar,
body.is-category .site-footer,
body.is-category #banner {
	display: none !important;
}

/* الترويسة وأزرارها موحّدة من home-v2.css — لا تُعاد كتابتها هنا */

/* Light footer to match page */
body.is-category .hv2-footer {
	background: #fff;
	border-top: 1px solid var(--cv2-border);
}

body.is-category .hv2-footer a,
body.is-category .hv2-footer h4,
body.is-category .hv2-footer__copy,
body.is-category .hv2-footer__brand p {
	color: var(--cv2-muted);
}

body.is-category .hv2-footer a:hover {
	color: var(--cv2-ink);
}

body.is-category .hv2-footer h4 {
	color: var(--cv2-ink);
}

/* Page shell */
.cv2-page {
	width: 100%;
	max-width: 1280px;
	margin: 0 auto;
	padding: 20px 24px 64px;
	box-sizing: border-box;
}

.cv2-crumbs {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	align-items: center;
	justify-content: flex-start;
	margin: 0 0 18px;
	padding: 0;
	list-style: none;
	font-size: 13px;
	color: var(--cv2-muted);
}

.cv2-crumbs li:not(:last-child)::after {
	content: '·';
	margin-inline-start: 6px;
	opacity: 0.5;
}

.cv2-crumbs a {
	color: var(--cv2-muted);
	text-decoration: none;
}

.cv2-crumbs a:hover {
	color: var(--cv2-ink);
}

.cv2-crumbs .active,
.cv2-crumbs .active a {
	color: var(--cv2-ink);
	font-weight: 600;
}

/*
 * Sidebar placement follows document direction:
 * - RTL: first grid column sits on the right (filters at start)
 * - LTR: first grid column sits on the left
 * DOM order: sidebar then main — do NOT force direction:ltr
 */
.cv2-layout {
	display: grid;
	grid-template-columns: 308px minmax(0, 1fr);
	gap: 24px;
	align-items: start;
}

.cv2-mobile-filters {
	display: none;
}

.cv2-sidebar {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.cv2-map-link {
	display: inline-flex;
	align-items: center;
	justify-content: flex-start;
	gap: 8px;
	width: 100%;
	color: var(--cv2-ink);
	text-decoration: none;
	font-size: 15px;
	margin-bottom: 4px;
	font-weight: 600;
}

.cv2-map-link:hover {
	color: #b45309;
}

.cv2-filters {
	background: var(--cv2-surface);
	color: var(--cv2-ink);
	border-radius: var(--cv2-radius);
	border: 1px solid #f3f4f6;
	box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.06);
	overflow: hidden;
}

.cv2-filters__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px;
	border-bottom: 1px solid #f3f4f6;
}

.cv2-filters__head h2 {
	margin: 0;
	font-size: 20px;
	font-weight: 800;
	color: #191c1d;
}

.cv2-filters__reset {
	color: #d69c2f;
	font-size: 12px;
	text-decoration: none;
	font-weight: 600;
}

.cv2-filters__body {
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.cv2-fgroup {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.cv2-fgroup__label {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	font-size: 14px;
	color: #374151;
	font-weight: 500;
}

.cv2-fgroup__label .count {
	background: #f3f4f6;
	color: #9ca3af;
	font-size: 10px;
	font-weight: 700;
	padding: 1px 5px;
	border-radius: 4px;
}

.cv2-op {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	overflow: hidden;
}

.cv2-op label {
	margin: 0;
	cursor: pointer;
	text-align: center;
}

.cv2-op input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.cv2-op span {
	display: block;
	padding: 9px 8px;
	font-size: 12px;
	color: #6b7280;
	background: #fff;
}

.cv2-op input:checked + span {
	background: var(--cv2-gold);
	color: #1f2430;
	font-weight: 800;
}

.cv2-filters input.form-control,
.cv2-filters input[type="text"],
.cv2-filters input[type="number"],
.cv2-filters input[type="search"] {
	width: 100% !important;
	max-width: 100%;
	height: 42px;
	border-radius: 8px !important;
	border: 1px solid rgba(0, 0, 0, 0.18) !important;
	padding: 8px 12px !important;
	font-size: 13px !important;
	line-height: 1.3 !important;
	color: #1f2430 !important;
	background: #fff !important;
	box-shadow: none !important;
	font-family: inherit !important;
}

.cv2-filters select,
.cv2-select {
	width: 100% !important;
	max-width: 100%;
	height: 42px;
	border-radius: 8px !important;
	border: 1px solid rgba(0, 0, 0, 0.18) !important;
	padding: 8px 36px 8px 12px !important;
	font-size: 13px !important;
	line-height: 1.3 !important;
	color: #1f2430 !important;
	background-color: #fff !important;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%236b7280' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
	background-repeat: no-repeat !important;
	background-position: left 12px center !important;
	background-size: 12px 8px !important;
	box-shadow: none !important;
	font-family: inherit !important;
	appearance: none !important;
	-webkit-appearance: none !important;
	-moz-appearance: none !important;
	cursor: pointer;
}

html[dir="rtl"] .cv2-filters select,
html[dir="rtl"] .cv2-select {
	padding: 8px 12px 8px 36px !important;
	background-position: right 12px center !important;
	text-align: right;
}

.cv2-filters select:focus,
.cv2-select:focus,
.cv2-filters input:focus {
	outline: none !important;
	border-color: #ffc107 !important;
	box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.2) !important;
}

/* Kill Select2 chrome on category filters (selection + body-attached dropdowns) */
body.is-category .cv2-filters .select2-container,
body.is-category .cv2-toolbar .select2-container,
body.is-category > .select2-container {
	display: none !important;
	visibility: hidden !important;
	pointer-events: none !important;
}

body.is-category .cv2-filters .select2-hidden-accessible,
body.is-category .cv2-toolbar .select2-hidden-accessible {
	position: static !important;
	width: 100% !important;
	height: 42px !important;
	padding: 8px 36px 8px 12px !important;
	margin: 0 !important;
	border: 1px solid rgba(0, 0, 0, 0.18) !important;
	border-radius: 8px !important;
	clip: auto !important;
	clip-path: none !important;
	overflow: visible !important;
	opacity: 1 !important;
	pointer-events: auto !important;
}

html[dir="rtl"] body.is-category .cv2-filters .select2-hidden-accessible,
html[dir="rtl"] body.is-category .cv2-toolbar .select2-hidden-accessible {
	padding: 8px 12px 8px 36px !important;
}

.cv2-row2 {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
}

.cv2-toolbar__sort .cv2-select,
.cv2-toolbar__sort select {
	width: auto !important;
	min-width: 160px;
	height: 40px;
}

.cv2-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.cv2-chip {
	border: 0;
	background: #f3f4f6;
	color: #4b5563;
	font-size: 11px;
	padding: 6px 10px;
	border-radius: 999px;
	cursor: pointer;
	font-family: inherit;
}

.cv2-chip.is-active,
.cv2-chip:hover {
	background: rgba(255, 193, 7, 0.28);
	color: #1f2430;
}

.cv2-filters .panel,
.cv2-filters .accordion-header,
.cv2-filters .accordion-btn,
.cv2-filters .panel-group {
	background: transparent !important;
	border: 0 !important;
	box-shadow: none !important;
	margin: 0 !important;
	padding: 0 !important;
}

.cv2-filters .accordion-title,
.cv2-filters .accordion-title span,
.cv2-filters h4 {
	font-size: 14px !important;
	color: #374151 !important;
	font-weight: 500 !important;
	margin: 0 0 8px !important;
}

.cv2-filters .panel-body {
	padding: 0 !important;
}

.cv2-filters .checkbox {
	margin: 0 0 6px !important;
}

.cv2-filters .checkbox label {
	font-size: 13px;
	color: #4b5563;
	font-weight: 400;
}

.cv2-filters .category-filter-list {
	max-height: 160px;
	overflow: auto;
}

.cv2-filters .category-filter-list a {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 8px 10px;
	border-radius: 8px;
	color: #374151;
	text-decoration: none;
	font-size: 13px;
}

.cv2-filters .category-filter-list a:hover {
	background: #f3f4f6;
}

.cv2-filters .category-filter-list small {
	color: #9ca3af;
	font-size: 11px;
}

.cv2-apply,
.cv2-filters .btn {
	display: block;
	width: 100%;
	border: 0;
	border-radius: 8px;
	background: #1f2430 !important;
	color: #fff !important;
	font-weight: 800;
	font-size: 14px;
	padding: 14px 16px;
	cursor: pointer;
	text-align: center;
	font-family: inherit;
	margin-top: 4px;
}

.cv2-promo {
	background: var(--cv2-gold);
	color: #1f2430;
	border-radius: var(--cv2-radius);
	padding: 20px;
}

.cv2-promo h3 {
	margin: 0 0 8px;
	font-size: 18px;
	font-weight: 800;
}

.cv2-promo p {
	margin: 0 0 14px;
	font-size: 13px;
	line-height: 1.65;
	opacity: 0.92;
}

.cv2-promo a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 10px 16px;
	border: 1.5px solid #1f2430;
	border-radius: 8px;
	color: #1f2430;
	text-decoration: none;
	font-weight: 800;
	font-size: 13px;
	background: transparent;
}

.cv2-promo a:hover {
	background: #1f2430;
	color: var(--cv2-gold);
}

.cv2-main {
	min-width: 0;
}

.cv2-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: flex-start;
	margin: 0 0 18px;
}

.cv2-pill {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 8px 22px;
	border-radius: 9999px;
	background: #fff;
	color: #45464c;
	font-size: 14px;
	line-height: 20px;
	text-decoration: none;
	border: 1px solid #e8eaef;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
	white-space: nowrap;
	transition: background 0.15s, color 0.15s;
}

.cv2-pill:hover {
	color: #111;
}

.cv2-pill.is-active {
	background: #1f2430;
	color: #fff;
	border-color: transparent;
}

.cv2-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 16px;
}

.cv2-toolbar__count {
	font-size: 15px;
	color: var(--cv2-ink);
}

.cv2-toolbar__count strong {
	color: var(--cv2-ink);
	font-weight: 800;
}

.cv2-toolbar__sort {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	color: var(--cv2-muted);
}

.cv2-toolbar__sort select {
	appearance: none;
	-webkit-appearance: none;
	background-color: #fff;
	color: var(--cv2-ink);
	border: 1px solid var(--cv2-border);
	border-radius: 8px;
	padding: 8px 14px;
	font-family: inherit;
	min-width: 150px;
	font-size: 13px;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

/* arrow handled by .cv2-select rules */

.cv2-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 16px;
}

.cv2-card {
	background: #fff;
	color: var(--cv2-ink);
	border-radius: 14px;
	overflow: hidden;
	border: 1px solid rgba(222, 233, 252, 0.7);
	box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.08);
	display: flex;
	flex-direction: column;
	text-decoration: none !important;
	transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.cv2-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
	color: inherit;
}

.cv2-card__media {
	position: relative;
	height: 180px;
	background: #e8eaef;
	overflow: hidden;
}

.cv2-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.cv2-card__fav {
	position: absolute;
	top: 12px;
	inset-inline-start: 12px;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.95);
	display: flex;
	align-items: center;
	justify-content: center;
	color: #6b7280;
	z-index: 2;
	font-size: 14px;
}

.cv2-card__badges {
	position: absolute;
	top: 12px;
	inset-inline-end: 12px;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 6px;
	z-index: 2;
}

.cv2-badge {
	display: inline-flex;
	align-items: center;
	padding: 4px 9px;
	border-radius: 6px;
	font-size: 11px;
	font-weight: 800;
	color: #fff;
	line-height: 1.2;
}

.cv2-badge--urgent { background: var(--cv2-urgent); }
.cv2-badge--verified { background: var(--cv2-verified); }

.cv2-card__body {
	padding: 14px 14px 16px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	flex: 1;
}

.cv2-card__title {
	margin: 0;
	font-size: 16px;
	font-weight: 800;
	line-height: 1.35;
	color: #111;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	min-height: 2.7em;
}

.cv2-card__loc {
	font-size: 13px;
	color: #6b7280;
	display: flex;
	align-items: center;
	gap: 6px;
}

.cv2-card__specs {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0;
	margin-top: 2px;
	padding: 8px 10px;
	border: 1px solid #eef0f3;
	border-radius: 10px;
	background: #fafafa;
	font-size: 12px;
	color: #6b7280;
}

.cv2-card__specs span {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 0 10px;
}

.cv2-card__specs span + span {
	border-inline-start: 1px solid #e5e7eb;
}

.cv2-card__price {
	margin-top: auto;
	padding-top: 6px;
	font-size: 20px;
	font-weight: 800;
	color: var(--cv2-gold);
	letter-spacing: -0.02em;
}

.cv2-empty {
	background: #fff;
	border: 1px dashed var(--cv2-border);
	border-radius: 14px;
	padding: 48px 24px;
	text-align: center;
	color: var(--cv2-muted);
}

.cv2-pager {
	margin-top: 28px;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
}

body.is-category .cv2-pager .pager-info {
	display: none !important;
}

body.is-category .cv2-pager .pagination {
	display: flex !important;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: center;
	align-items: center;
	margin: 0 !important;
	padding: 0 !important;
	background: transparent !important;
	border: 0 !important;
	box-shadow: none !important;
}

body.is-category .cv2-pager .pagination > span,
body.is-category .cv2-pager .pagination > span > a {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 10px;
	border-radius: 10px;
	background: #fff !important;
	color: var(--cv2-ink) !important;
	border: 1px solid var(--cv2-border) !important;
	text-decoration: none !important;
	font-weight: 700;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04) !important;
}

body.is-category .cv2-pager .pagination > span.current,
body.is-category .cv2-pager .pagination > span.current > a {
	background: #1f2430 !important;
	color: #fff !important;
	border-color: transparent !important;
	box-shadow: 0 0 0 2px rgba(255, 193, 7, 0.35) !important;
}

body.is-category #category-breadcrumb,
body.is-category .mobile-category-toolbar,
body.is-category .category-toolbar {
	display: none !important;
}

@media (max-width: 1100px) {
	.cv2-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 900px) {
	.cv2-layout {
		grid-template-columns: 1fr;
	}
	.cv2-sidebar {
		display: none;
	}
	.cv2-sidebar.is-open {
		display: flex;
		position: fixed;
		inset: 0;
		z-index: 10060;
		background: rgba(15, 18, 22, 0.55);
		padding: 16px;
		overflow: auto;
	}
	.cv2-sidebar.is-open .cv2-filters,
	.cv2-sidebar.is-open .cv2-promo {
		width: 100%;
		max-width: 420px;
		margin: 0 auto;
	}
	.cv2-mobile-filters {
		display: inline-flex;
		align-items: center;
		gap: 8px;
		background: var(--cv2-gold);
		color: #1f2430;
		border: 0;
		border-radius: 999px;
		padding: 10px 16px;
		font-weight: 800;
		font-family: inherit;
		margin-bottom: 12px;
	}
	.cv2-pills {
		overflow-x: auto;
		flex-wrap: nowrap;
		padding-bottom: 4px;
		-webkit-overflow-scrolling: touch;
	}
}

@media (max-width: 560px) {
	.cv2-page {
		padding: 16px 14px 100px;
	}
	.cv2-grid {
		grid-template-columns: 1fr;
	}
	.cv2-card__media {
		height: 200px;
	}
}

/* Map section */
#map {
	min-height: 520px;
	border-radius: 12px;
	overflow: hidden;
}

#map_results {
	margin-top: 16px;
}

#map_pager {
	margin-top: 12px;
	color: #fff;
	text-align: center;
}

#map_pager a {
	color: #ffc107;
}
