/* Advanced Search v2 — visual identity aligned with Figma mock */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;800&display=swap');

body.is-search {
	--av2-ink: #1f2430;
	--av2-muted: #6b7280;
	--av2-border: #e5e7eb;
	--av2-gold: #ffc107;
	--av2-dark: #1f2430;
	--av2-bg: #f5f6f8;
	--av2-radius: 12px;
	--av2-radius-sm: 8px;
	font-family: Tajawal, Cairo, sans-serif !important;
	background: var(--av2-bg) !important;
	color: var(--av2-ink);
}

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

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

body.is-search .hv2-footer {
	background: #fff;
	border-top: 1px solid var(--av2-border);
}

.av2-page {
	padding: 20px 0 48px;
}

.av2-container {
	width: 100%;
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 20px;
	box-sizing: border-box;
}

.av2-crumbs {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	margin-bottom: 18px;
	font-size: 13px;
	color: var(--av2-muted);
}

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

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

.av2-crumbs__sep {
	opacity: 0.45;
}

.av2-crumbs__current {
	color: var(--av2-ink);
	font-weight: 700;
}

.av2-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 300px;
	gap: 20px;
	align-items: start;
}

.av2-main {
	display: flex;
	flex-direction: column;
	gap: 0;
	min-width: 0;
}

.av2-panel {
	background: #fff;
	border: 1px solid var(--av2-border);
	border-bottom: 0;
	border-radius: var(--av2-radius) var(--av2-radius) 0 0;
	padding: 22px 22px 8px;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.av2-panel__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 8px;
}

.av2-title {
	margin: 0;
	font-size: 24px;
	font-weight: 800;
	color: var(--av2-ink);
}

.av2-reset {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	border: 0;
	background: transparent;
	color: var(--av2-gold);
	font-family: inherit;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
	padding: 6px 4px;
}

.av2-reset i {
	color: var(--av2-gold);
}

.av2-section {
	padding: 18px 0 10px;
	border-top: 1px solid var(--av2-border);
}

.av2-section:first-of-type {
	border-top: 0;
	padding-top: 8px;
}

.av2-section__title {
	margin: 0 0 14px;
	font-size: 16px;
	font-weight: 800;
	color: var(--av2-ink);
}

.av2-label {
	display: block;
	margin-bottom: 8px;
	font-size: 13px;
	font-weight: 700;
	color: var(--av2-muted);
}

.av2-fgroup {
	margin-bottom: 14px;
}

.av2-grid {
	display: grid;
	gap: 12px;
	margin-bottom: 8px;
}

.av2-grid--5 {
	grid-template-columns: repeat(5, minmax(0, 1fr));
}

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

/* Category cascading lists — keep JS hooks, modern look */
.av2-cats {
	display: flex;
	gap: 10px;
	overflow-x: auto;
	padding-bottom: 4px;
	margin-bottom: 8px;
}

.av2-cats__col {
	min-width: 180px;
	flex: 1 1 180px;
}

.av2-cats__col:empty {
	display: none;
}

.av2-cats__list,
.av2-cats .list-group,
.av2-cats .scrollable-menu {
	max-height: 220px;
	overflow-y: auto;
	border: 1px solid var(--av2-border);
	border-radius: var(--av2-radius-sm);
	background: #fff;
	margin: 0;
	padding: 6px;
}

body.is-search .av2-cats .list-group-item,
body.is-search .av2-cat {
	display: block;
	border: 0 !important;
	border-radius: 8px !important;
	margin: 2px 0 !important;
	padding: 10px 12px !important;
	background: transparent !important;
	color: var(--av2-ink) !important;
	font-size: 13px;
	font-weight: 600;
	text-decoration: none !important;
	cursor: pointer;
}

body.is-search .av2-cats .list-group-item:hover,
body.is-search .av2-cat:hover {
	background: #f3f4f6 !important;
}

body.is-search .av2-cats .list-group-item.active,
body.is-search .av2-cat.active {
	background: var(--av2-gold) !important;
	color: var(--av2-ink) !important;
}

/* Native selects — skip Select2 via .selectUi */
body.is-search .av2-select,
body.is-search select.av2-select,
body.is-search .av2-input,
body.is-search input.av2-input,
body.is-search .av2-main input.form-control,
body.is-search .av2-main select {
	width: 100% !important;
	height: 44px;
	border-radius: var(--av2-radius-sm) !important;
	border: 1px solid rgba(0, 0, 0, 0.16) !important;
	padding: 8px 36px 8px 12px !important;
	font-size: 13px !important;
	line-height: 1.3 !important;
	color: var(--av2-ink) !important;
	background-color: #fff !important;
	box-shadow: none !important;
	font-family: inherit !important;
	appearance: none !important;
	-webkit-appearance: none !important;
}

body.is-search .av2-select,
body.is-search select.av2-select,
body.is-search .av2-main select {
	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;
	cursor: pointer;
}

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

body.is-search .av2-input,
body.is-search input.av2-input,
body.is-search .av2-main input.form-control {
	padding: 8px 12px !important;
	background-image: none !important;
}

body.is-search .av2-select:focus,
body.is-search .av2-input:focus,
body.is-search .av2-main input:focus,
body.is-search .av2-main select:focus {
	outline: none !important;
	border-color: var(--av2-gold) !important;
	box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.22) !important;
}

body.is-search .av2-main .select2-container {
	display: none !important;
}

body.is-search .av2-main .select2-hidden-accessible {
	position: static !important;
	width: 100% !important;
	height: 44px !important;
	clip: auto !important;
	clip-path: none !important;
	overflow: visible !important;
	opacity: 1 !important;
	pointer-events: auto !important;
}

.av2-range {
	display: grid;
	grid-template-columns: 1fr 1fr 1fr;
	gap: 8px;
}

.av2-keyword {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 12px;
	align-items: center;
}

.av2-check {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	font-weight: 600;
	color: var(--av2-ink);
	cursor: pointer;
	user-select: none;
	margin: 0;
}

.av2-check input {
	width: 18px;
	height: 18px;
	accent-color: var(--av2-gold);
	flex-shrink: 0;
}

.av2-options {
	display: flex;
	flex-wrap: wrap;
	gap: 12px 18px;
	padding: 8px 0 16px;
}

.av2-dyn {
	margin-top: 8px;
}

body.is-search .av2-dyn .form-group,
body.is-search .av2-dyn .input-group,
body.is-search .av2-dyn .col-md-3,
body.is-search .av2-dyn .col-sm-3 {
	margin-bottom: 12px;
}

body.is-search .av2-dyn .input-group-addon,
body.is-search .av2-dyn .input-text {
	display: block;
	width: 100%;
	background: none;
	border: 0;
	padding: 0 0 6px;
	font-size: 13px;
	font-weight: 700;
	color: var(--av2-muted);
	text-align: start;
}

/* Bottom action bar */
.av2-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-top: 0;
	padding: 14px 18px;
	background: var(--av2-dark);
	border-radius: 0 0 var(--av2-radius) var(--av2-radius);
	color: #fff;
	position: sticky;
	bottom: 12px;
	z-index: 20;
	box-shadow: 0 8px 24px rgba(31, 36, 48, 0.25);
}

.av2-panel + .av2-bar {
	margin-top: -1px;
	border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.av2-bar__links {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
}

.av2-bar__link {
	color: rgba(255, 255, 255, 0.82);
	text-decoration: none;
	font-size: 13px;
	font-weight: 600;
}

.av2-bar__link:hover {
	color: #fff;
}

.av2-bar__link i {
	margin-inline-end: 6px;
}

.av2-submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	height: 48px;
	padding: 0 28px;
	border: 0;
	border-radius: var(--av2-radius-sm);
	background: var(--av2-gold);
	color: var(--av2-ink);
	font-family: inherit;
	font-size: 15px;
	font-weight: 800;
	cursor: pointer;
	white-space: nowrap;
}

.av2-submit:hover {
	filter: brightness(1.05);
}

/* Sidebar cards */
.av2-side {
	display: flex;
	flex-direction: column;
	gap: 14px;
	position: sticky;
	top: 96px;
}

.av2-card {
	background: #fff;
	border: 1px solid var(--av2-border);
	border-radius: var(--av2-radius);
	padding: 18px;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03);
}

.av2-card__title {
	margin: 0 0 12px;
	font-size: 15px;
	font-weight: 800;
	color: var(--av2-ink);
}

.av2-card__empty,
.av2-card__text {
	margin: 0;
	font-size: 13px;
	line-height: 1.6;
	color: var(--av2-muted);
}

.av2-saved {
	list-style: none;
	margin: 0;
	padding: 0;
}

.av2-saved li {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	padding: 10px 0;
	border-bottom: 1px solid var(--av2-border);
	font-size: 13px;
}

.av2-saved li:last-child {
	border-bottom: 0;
	padding-bottom: 0;
}

.av2-saved a {
	color: var(--av2-muted);
	text-decoration: none;
	font-weight: 600;
}

.av2-saved a:hover {
	color: var(--av2-ink);
}

.av2-card--alert .av2-card__icon {
	width: 40px;
	height: 40px;
	border-radius: 999px;
	background: rgba(255, 193, 7, 0.18);
	color: #d97706;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 10px;
	font-size: 16px;
}

.av2-ghost {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-top: 14px;
	height: 40px;
	padding: 0 16px;
	border-radius: var(--av2-radius-sm);
	border: 1.5px solid var(--av2-gold);
	color: #b45309;
	text-decoration: none;
	font-size: 13px;
	font-weight: 800;
	background: #fff;
}

.av2-ghost:hover {
	background: rgba(255, 193, 7, 0.1);
	color: #92400e;
}

@media (max-width: 1024px) {
	.av2-layout {
		grid-template-columns: 1fr;
	}

	.av2-side {
		position: static;
		order: 2;
	}

	.av2-grid--5 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.av2-grid--3 {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 640px) {
	.av2-grid--5 {
		grid-template-columns: 1fr;
	}

	.av2-range,
	.av2-keyword {
		grid-template-columns: 1fr;
	}

	.av2-bar {
		flex-direction: column;
		align-items: stretch;
		position: sticky;
		bottom: 8px;
	}

	.av2-submit {
		width: 100%;
	}

	.av2-panel__head {
		flex-direction: column;
		align-items: flex-start;
	}
}
