/* BetaDarou — theme search: the header box, the suggestion list, the full-screen search on phones.
   Sized and coloured to sit where FiboSearch's box was. Everything is prefixed .bds-. */

/* ---------- the box ---------- */
.bds-search { position: relative; width: 100%; max-width: 100%; }
.bds-search .bds-form { position: relative; margin: 0; }
.bds-search .bds-form input.bds-input {
	display: block;
	width: 100%;
	height: 50px;
	margin: 0;
	/* text starts on the right; the button sits on the left */
	padding: 10px 14px 10px 54px;
	border: 0;
	border-radius: var(--shayanweb-betadarou-radius, 5px);
	box-shadow: var(--shayanweb-betadarou-shadow, 0 3px 15px rgba(0, 0, 0, .1));
	background: #fff;
	color: var(--shayanweb-betadarou-light-dark, #515151);
	font: inherit;
	font-size: 14px;
	line-height: 30px;
	text-align: right;
	direction: rtl;
	-webkit-appearance: none;
	appearance: none;
}
.bds-search .bds-form input.bds-input::placeholder { color: var(--shayanweb-betadarou-light-dark, #515151); opacity: 1; font-style: normal; }
.bds-search .bds-form input.bds-input:focus { background: #fafafa; box-shadow: 0 3px 30px rgba(0, 0, 0, .1); outline: none; }
.bds-search .bds-form input.bds-input:focus-visible { outline: 2px solid var(--shayanweb-betadarou-maincolor, #4e4ee5); outline-offset: 1px; }
/* the browser's own «×» and magnifier inside a search field */
.bds-input::-webkit-search-cancel-button,
.bds-input::-webkit-search-decoration,
.bds-ov__input::-webkit-search-cancel-button,
.bds-ov__input::-webkit-search-decoration { -webkit-appearance: none; appearance: none; display: none; }

.bds-search .bds-form button.bds-submit {
	position: absolute;
	top: 0;
	left: 0;
	width: 50px;
	height: 50px;
	margin: 0;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 0;
	border-radius: var(--shayanweb-betadarou-radius, 5px);
	background: transparent;
	box-shadow: none;
	color: var(--shayanweb-betadarou-black, #333);
	cursor: pointer;
}
.bds-search .bds-form button.bds-submit:hover,
.bds-search .bds-form button.bds-submit:focus { background: transparent; color: var(--shayanweb-betadarou-maincolor, #4e4ee5); }
.bds-search .bds-form button.bds-submit:focus-visible { outline: 2px solid var(--shayanweb-betadarou-maincolor, #4e4ee5); outline-offset: -4px; }

/* The button that opens the full-screen search; only the phone header shows it. */
.bds-search button.bds-open { display: none; }

/* ---------- phone header ----------
   core/header.php lays .search-mobile over the magnifier icon. Inside it the box is hidden and a
   transparent button — a little larger than the icon, for fingers — opens the full-screen search. */
.search-mobile .bds-search { position: absolute; inset: 0; width: auto; }
.search-mobile .bds-search .bds-form { display: none; }
.search-mobile .bds-search button.bds-open {
	display: block;
	position: absolute;
	inset: -12px;
	width: auto;
	height: auto;
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	box-shadow: none;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}
.search-mobile .bds-search button.bds-open:hover,
.search-mobile .bds-search button.bds-open:focus { background: transparent; }
.search-mobile .bds-search button.bds-open:focus-visible { outline: 2px solid var(--shayanweb-betadarou-maincolor, #4e4ee5); }

/* ---------- suggestions (shared by the dropdown and the full-screen search) ---------- */
.bds-list { direction: rtl; text-align: right; font-size: 14px; line-height: 1.7; color: #1c1c40; }
.bds-list .bds-h { padding: 12px 16px 4px; font-size: 12px; font-weight: 800; color: #6a6a92; }
.bds-list a.bds-item {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 8px 16px;
	color: #1c1c40;
	text-decoration: none;
}
.bds-list a.bds-item:hover,
.bds-list a.bds-item.is-active { background: #eeeefd; color: #1c1c40; }
.bds-list a.bds-item:focus-visible { outline: 2px solid #4e4ee5; outline-offset: -2px; }
.bds-list .bds-item img {
	flex: none;
	width: 44px;
	height: 44px;
	border-radius: 8px;
	object-fit: contain;
	background: #f4f5fb;
}
.bds-list .bds-item img.bds-noimg { visibility: hidden; }
.bds-list .bds-item__t { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.bds-list .bds-item__t b { font-weight: 800; color: #4e4ee5; }
.bds-list .bds-item__n { flex: none; font-size: 12px; color: #6a6a92; white-space: nowrap; }
.bds-list .bds-item--t { min-height: 40px; }
.bds-list .bds-item--oos img { opacity: .55; }
.bds-list .bds-item--oos .bds-item__t { color: #6a6a92; }
.bds-list .bds-oos {
	flex: none;
	padding: 1px 9px;
	border: 1px solid #fcd9a0;
	border-radius: 999px;
	background: #fff7e6;
	color: #9a4a00;
	font-size: 11.5px;
	font-weight: 700;
	white-space: nowrap;
}
.bds-list a.bds-all {
	display: block;
	margin-top: 6px;
	padding: 12px 16px;
	border-top: 1px solid #e4e5f2;
	color: #4e4ee5;
	font-weight: 800;
	text-align: center;
	text-decoration: none;
}
.bds-list a.bds-all:hover,
.bds-list a.bds-all.is-active { background: #eeeefd; color: #4e4ee5; }
.bds-list .bds-empty { padding: 18px 16px; color: #6a6a92; }

/* ---------- desktop dropdown (attached to <body>, placed under the box by search.js) ---------- */
.bds-dd {
	box-sizing: border-box;
	position: absolute;
	z-index: 100000;
	max-height: min(84vh, 680px);
	overflow-y: auto;
	overscroll-behavior: contain;
	background: #fff;
	border: 1px solid #e4e5f2;
	border-radius: 12px;
	box-shadow: 0 18px 50px -12px rgba(21, 21, 58, .35);
	padding: 4px 0;
}
.bds-dd[hidden] { display: none; }

/* ---------- full-screen search on phones ---------- */
.bds-ov, .bds-ov * { box-sizing: border-box; }
.bds-ov {
	position: fixed;
	inset: 0;
	z-index: 100001;
	display: flex;
	flex-direction: column;
	background: #fff;
	direction: rtl;
}
.bds-ov[hidden] { display: none; }
.bds-ov form.bds-ov__bar {
	flex: none;
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 0;
	padding: 8px 10px;
	border-bottom: 1px solid #e4e5f2;
	background: #fff;
}
.bds-ov input.bds-ov__input {
	flex: 1;
	min-width: 0;
	height: 46px;
	margin: 0;
	padding: 0 14px;
	border: 0;
	border-radius: 12px;
	background: #f4f5fb;
	box-shadow: none;
	color: #1c1c40;
	font: inherit;
	/* 16px: anything smaller makes iOS zoom the page when the field is focused */
	font-size: 16px;
	text-align: right;
	direction: rtl;
	-webkit-appearance: none;
	appearance: none;
}
.bds-ov input.bds-ov__input:focus { outline: 2px solid #4e4ee5; outline-offset: 0; background: #fff; }
.bds-ov button.bds-ov__back,
.bds-ov button.bds-ov__clear {
	flex: none;
	width: 44px;
	height: 44px;
	min-width: 0;
	margin: 0;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	border: 0;
	border-radius: 50%;
	background: transparent;
	box-shadow: none;
	color: #39397c;
	cursor: pointer;
}
.bds-ov button.bds-ov__clear[hidden] { display: none; }
.bds-ov button.bds-ov__back:hover, .bds-ov button.bds-ov__back:focus,
.bds-ov button.bds-ov__clear:hover, .bds-ov button.bds-ov__clear:focus { background: #eeeefd; color: #39397c; }
/* «back» points to the right in a right-to-left page */
.bds-ov button.bds-ov__back::before {
	content: "";
	width: 10px;
	height: 10px;
	border-top: 2px solid currentColor;
	border-right: 2px solid currentColor;
	transform: translateX(-2px) rotate(45deg);
}
.bds-ov button.bds-ov__clear::before,
.bds-ov button.bds-ov__clear::after {
	content: "";
	position: absolute;
	width: 16px;
	height: 2px;
	border-radius: 2px;
	background: currentColor;
}
.bds-ov button.bds-ov__clear { position: relative; }
.bds-ov button.bds-ov__clear::before { transform: rotate(45deg); }
.bds-ov button.bds-ov__clear::after { transform: rotate(-45deg); }
.bds-ov .bds-ov__list {
	flex: 1;
	min-height: 0;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
	padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
	font-size: 15px;
}
.bds-ov .bds-list a.bds-item { padding: 10px 16px; }
/* The page behind must not scroll while the full-screen search is open. */
html.bds-lock, html.bds-lock body { overflow: hidden !important; }

@media print { .bds-dd, .bds-ov { display: none !important; } }
