/* ==========================================================================
   Search Modal — styles
   Tuned to match the site's Elementor design (font, colors, spacing).
   Adjust the CSS variables below if your brand colors differ slightly.
   ========================================================================== */

:root {
	--sm-font: var(--e-global-typography-text-font-family), Tahoma, Sans-serif;

	--sm-radius: 24px;
	--sm-border: #EDEFF2;
	--sm-text: #1D2433;
	--sm-text-muted: #8A93A6;

	--sm-bg: #ffffff;
	--sm-bg-soft: #F7F8FA;

	--sm-mint-bg: #E8F7EF;
	--sm-mint-text: #17794A;

	--sm-active-bg: #E8F7EF;
	--sm-active-text: #14532D;

	--sm-highlight-bg: #F7D488;
	--sm-highlight-text: #1D2433;

	--sm-shadow: 0 24px 64px rgba(16, 24, 40, 0.16);
	--sm-max-width: 1180px;
}

.sm-no-scroll { overflow: hidden; }

/* ---------------------------------------------------------------------- */
/* Overlay + modal shell                                                   */
/* ---------------------------------------------------------------------- */

.sm-overlay {
	position: fixed;
	inset: 0;
	background: rgba(16, 24, 40, 0.45);
	z-index: 99999;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: 6vh 16px;
	overflow-y: auto;
}

.sm-overlay[hidden] { display: none; }

.sm-modal {
	direction: rtl;
	font-family: var(--sm-font);
	position: relative;
	width: 100%;
	max-width: var(--sm-max-width);
	background: var(--sm-bg);
	border: 1px solid var(--sm-border);
	border-radius: var(--sm-radius);
	box-shadow: var(--sm-shadow);
	padding: 32px 36px 36px;
	box-sizing: border-box;
	color: var(--sm-text);
}

.sm-modal * { box-sizing: border-box; font-family: inherit; }

.sm-close {
	position: absolute;
	top: 18px;
	left: 18px;
	width: 32px;
	height: 32px;
	border: none;
	background: var(--sm-bg-soft);
	color: var(--sm-text-muted);
	border-radius: 50%;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
}
.sm-close:hover { background: var(--sm-border); }

/* ---------------------------------------------------------------------- */
/* Search bar                                                              */
/* ---------------------------------------------------------------------- */

.sm-search-bar {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 12px;
	border-bottom: 1px solid var(--sm-border);
	padding-bottom: 18px;
	margin-bottom: 26px;
}

.sm-search-icon { color: var(--sm-text); display: flex; flex: 0 0 auto; }

.sm-input {
	flex: 1;
	border: none;
	outline: none;
	font-size: 17px;
	color: var(--sm-text);
	background: transparent;
	direction: rtl;
	text-align: right;
}
.sm-input::placeholder { color: #98A2B3; }

/* ---------------------------------------------------------------------- */
/* Browse state: right-hand tabs + main content                            */
/* ---------------------------------------------------------------------- */

.sm-browse {
	display: flex;
	flex-direction: row;
	gap: 36px;
	align-items: flex-start;
}

.sm-browse-main { flex: 1; min-width: 0; }

.sm-section { margin-bottom: 26px; }
.sm-section:last-child { margin-bottom: 0; }

.sm-section-title {
	font-size: 15px;
	color: var(--sm-text);
	margin: 0 0 16px;
	font-weight: 600;
}

/* Popular search pills */
.sm-popular-tags { display: flex; flex-wrap: wrap; gap: 10px; }

.sm-tag {
	border: none;
	background: var(--sm-mint-bg);
	color: var(--sm-mint-text);
	font-size: 14px;
	font-weight: 500;
	padding: 10px 18px;
	border-radius: 10px;
	cursor: pointer;
	transition: background .15s ease;
	white-space: nowrap;
}
.sm-tag:hover { background: #d9f0e2; }

/* Latest items grid: title ABOVE the image, no card background */
.sm-latest-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 24px 28px;
}

.sm-card {
	display: flex;
	flex-direction: column;
	gap: 10px;
	text-decoration: none;
	color: inherit;
}

.sm-card-title {
	font-size: 15px;
	font-weight: 600;
	color: var(--sm-text);
	text-align: right;
}

.sm-card-image {
	width: 100%;
	aspect-ratio: 2.3 / 1;
	border-radius: 14px;
	overflow: hidden;
	background: #E4E7EC;
}
.sm-card-image img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Right-hand vertical tabs (first in DOM so it sits on the right under RTL) */
.sm-tabs {
	flex: 0 0 210px;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.sm-tab {
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: flex-start;
	gap: 10px;
	border: none;
	background: transparent;
	padding: 12px 14px;
	border-radius: 12px;
	cursor: pointer;
	font-size: 14px;
	color: var(--sm-text-muted);
	text-align: right;
	width: 100%;
}
.sm-tab:hover { background: var(--sm-bg-soft); }
.sm-tab.is-active {
	background: var(--sm-active-bg);
	font-weight: 700;
	color: var(--sm-active-text);
}

/* icon sits first in the DOM -> right-most edge under direction:rtl */
.sm-tab-icon { display: flex; width: 20px; height: 20px; flex: 0 0 auto; order: 1; }
.sm-tab-icon img { width: 100%; height: 100%; }
.sm-tab-label { order: 2; }

/* ---------------------------------------------------------------------- */
/* Search results state                                                    */
/* ---------------------------------------------------------------------- */

.sm-results-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.sm-result-row + .sm-result-row { border-top: 1px solid var(--sm-border); }

.sm-result-link {
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	padding: 20px 4px;
	text-decoration: none;
	color: inherit;
}
.sm-result-link:hover { background: var(--sm-bg-soft); }

.sm-result-text {
	display: flex;
	flex-direction: column;
	gap: 6px;
	flex: 1;
	min-width: 0;
	text-align: right;
}

.sm-result-title {
	font-size: 15px;
	font-weight: 600;
	color: var(--sm-text);
	line-height: 1.6;
}

.sm-result-subtitle {
	font-size: 13px;
	color: var(--sm-text-muted);
}

.sm-highlight {
	background: var(--sm-highlight-bg);
	color: var(--sm-highlight-text);
	border-radius: 4px;
	padding: 1px 4px;
	font-weight: 600;
}

.sm-badge {
	flex: 0 0 auto;
	font-size: 13px;
	font-weight: 600;
	padding: 7px 16px;
	border-radius: 999px;
	color: var(--sm-badge-color, #667085);
	background: color-mix(in srgb, var(--sm-badge-color, #667085) 12%, white);
	white-space: nowrap;
}

.sm-empty {
	text-align: center;
	color: var(--sm-text-muted);
	padding: 24px;
	font-size: 14px;
}

/* ---------------------------------------------------------------------- */
/* Responsive                                                               */
/* ---------------------------------------------------------------------- */

@media (max-width: 720px) {
	.sm-browse { flex-direction: column; gap: 20px; }
	.sm-tabs {
		flex-direction: row;
		flex-wrap: wrap;
		border-bottom: 1px solid var(--sm-border);
		padding-bottom: 14px;
		width: 100%;
		flex-basis: auto;
	}
	.sm-latest-grid { grid-template-columns: 1fr; }
}
