/*
 * Cadibo — cautare in header pe mobil.
 * Tot ce tine de modal e scopat pe #cdb-msearch, ca sa nu atinga formularul de
 * cautare din header-ul de desktop sau restul stilurilor Avada.
 */

/* ============================================================
   1. Iconita de lupa din meniul header-ului
   Peste 1024px exista deja campul de cautare in header (coloana
   Avada e vizibila de la 1025px in sus), deci ascundem lupa.
   ============================================================ */
@media (min-width: 1025px) {
	.cdb-msearch-item {
		display: none !important;
	}
}

/* ============================================================
   2. Containerul modalului
   Deschiderea merge si fara JS, prin :target (link #cdb-msearch).
   ============================================================ */
.cdb-msearch {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	/* peste butonul flotant de WhatsApp (z-index 999999999). */
	z-index: 1000000000;
	background: #fff;
}

.cdb-msearch:target,
.cdb-msearch.is-open {
	display: block;
}

.cdb-msearch__form {
	display: flex;
	flex-direction: column;
	height: 100%;
	height: 100dvh;
	margin: 0;
	padding: 0;
	background: #fff;
}

/* ============================================================
   3. Bara de sus: camp de cautare + Anuleaza
   ============================================================ */
.cdb-msearch__bar {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 14px;
	border-bottom: 1px solid #e8ebef;
	background: #fff;
}

#cdb-msearch .fusion-search-form-content {
	position: relative;
	flex: 1 1 auto;
	min-width: 0;
	display: block;
	margin: 0;
}

#cdb-msearch .fusion-search-field {
	margin: 0;
	padding: 0;
	width: auto;
}

#cdb-msearch .fusion-search-field label {
	display: block;
	margin: 0;
	padding: 0;
	width: 100%;
}

#cdb-msearch input.fusion-live-search-input {
	display: block;
	width: 100%;
	height: 46px !important;
	box-sizing: border-box;
	margin: 0;
	padding: 0 40px 0 42px !important;
	font-size: 16px !important; /* sub 16px, iOS mareste pagina la focus */
	line-height: 1.2;
	color: #10203a;
	background: #f3f5f8;
	border: 1px solid #e2e6ec;
	border-radius: 23px;
	box-shadow: none;
	-webkit-appearance: none;
	appearance: none;
}

#cdb-msearch input.fusion-live-search-input:focus {
	background: #fff;
	border-color: #002089;
	outline: none;
	box-shadow: 0 0 0 3px rgba(0, 32, 137, 0.12);
}

#cdb-msearch input.fusion-live-search-input::placeholder {
	color: #8a93a1;
	opacity: 1;
}

#cdb-msearch input.fusion-live-search-input::-webkit-search-cancel-button,
#cdb-msearch input.fusion-live-search-input::-webkit-search-decoration {
	-webkit-appearance: none;
	appearance: none;
}

.cdb-msearch__ico {
	position: absolute;
	top: 50%;
	left: 14px;
	transform: translateY(-50%);
	color: #8a93a1;
	line-height: 0;
	pointer-events: none;
}

/* Butonul de submit al Avada nu ne trebuie vizual (avem "Vezi toate
   rezultatele"), dar containerul lui e ancora pentru spinnerul de incarcare,
   pe care Avada il pozitioneaza absolut fata de el. */
#cdb-msearch .fusion-search-button {
	position: absolute;
	top: 50%;
	left: 24px;
	width: 0;
	height: 0;
	margin: 0;
	padding: 0;
	pointer-events: none;
}

#cdb-msearch .fusion-search-submit {
	display: none !important;
}

#cdb-msearch .fusion-slider-loading {
	margin: -0.6em 0 0 -0.6em;
	width: 1.2em;
	height: 1.2em;
	font-size: 16px;
	border-top: 0.16em solid rgba(0, 32, 137, 0.2);
	border-right: 0.16em solid rgba(0, 32, 137, 0.2);
	border-bottom: 0.16em solid #002089;
	border-left: 0.16em solid rgba(0, 32, 137, 0.2);
	background: #fff;
}

.cdb-msearch__clear {
	position: absolute;
	top: 50%;
	right: 6px;
	transform: translateY(-50%);
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	padding: 0;
	color: #6b7484;
	background: transparent;
	border: 0;
	border-radius: 50%;
	cursor: pointer;
	line-height: 0;
}

.cdb-msearch__clear[hidden] {
	display: none;
}

.cdb-msearch__close {
	flex: 0 0 auto;
	padding: 0 2px;
	font-size: 15px;
	font-weight: 500;
	color: #002089;
	background: transparent;
	border: 0;
	cursor: pointer;
	white-space: nowrap;
}

/* ============================================================
   4. Corpul: sugestii live / mesaje
   ============================================================ */
.cdb-msearch__body {
	flex: 1 1 auto;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
}

.cdb-msearch__intro {
	padding: 18px 16px;
}

.cdb-msearch.has-query .cdb-msearch__intro {
	display: none;
}

.cdb-msearch__hint {
	margin: 0;
	font-size: 14px;
	line-height: 1.5;
	color: #6b7484;
}

.cdb-msearch__recent[hidden] {
	display: none;
}

.cdb-msearch__recent {
	margin-top: 22px;
}

.cdb-msearch__recent-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	margin-bottom: 6px;
	font-size: 13px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: #8a93a1;
}

.cdb-msearch__recent-clear {
	padding: 0;
	font-size: 13px;
	font-weight: 500;
	text-transform: none;
	letter-spacing: 0;
	color: #002089;
	background: transparent;
	border: 0;
	cursor: pointer;
}

.cdb-msearch__recent-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.cdb-msearch__recent-list li {
	margin: 0;
	padding: 0;
	list-style: none;
}

.cdb-msearch__recent-item {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
	padding: 11px 0;
	font-size: 15px;
	text-align: left;
	color: #10203a;
	background: transparent;
	border: 0;
	border-bottom: 1px solid #eef0f3;
	cursor: pointer;
}

.cdb-msearch__recent-item svg {
	flex: 0 0 auto;
	color: #a2aab6;
}

/* Rezultatele Avada: implicit sunt un dropdown absolut, ascuns pana la
   focus. In modal le vrem in flux, mereu vizibile. */
#cdb-msearch .fusion-search-results-wrapper {
	position: static;
	width: auto;
	margin: 0;
}

#cdb-msearch .fusion-search-results {
	position: static;
	visibility: visible;
	opacity: 1;
	z-index: auto;
	width: auto;
	max-height: none;
	margin: 0;
	overflow: visible;
	background: transparent;
	border: 0;
	transition: none;
}

#cdb-msearch .fusion-search-result {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 16px !important;
	border: 0;
	border-bottom: 1px solid #eef0f3;
	color: #10203a;
	text-decoration: none;
}

#cdb-msearch .fusion-search-image {
	flex: 0 0 56px;
	width: 56px;
	height: 56px;
	margin: 0;
	padding: 0;
	background: #f7f8fa;
	border-radius: 6px;
	overflow: hidden;
}

#cdb-msearch .fusion-search-image img {
	display: block;
	width: 56px;
	height: 56px;
	object-fit: contain;
	margin: 0;
}

#cdb-msearch .fusion-search-content {
	min-width: 0;
	flex: 1 1 auto;
}

#cdb-msearch .fusion-search-post-title {
	font-size: 14px;
	font-weight: 600;
	line-height: 1.35;
	color: #10203a;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

#cdb-msearch .fusion-search-post-type {
	margin-top: 4px;
	font-size: 13px;
	line-height: 1.4;
	color: #6b7484;
	text-transform: none;
}

.cdb-msearch__sku {
	color: #8a93a1;
}

.cdb-msearch__dot {
	margin: 0 6px;
	color: #c8cdd6;
}

.cdb-msearch__price {
	font-weight: 600;
	color: #002089;
	white-space: nowrap;
}

.cdb-msearch__price .woocommerce-Price-amount {
	font-weight: 600;
}

.cdb-msearch__vat {
	font-weight: 400;
	color: #8a93a1;
}

/* Mesajul "niciun rezultat" pe care il randeaza Avada. */
#cdb-msearch .fusion-search-results.suggestions-empty .fusion-search-result {
	display: block;
	padding: 18px 16px !important;
	font-size: 14px;
	color: #6b7484;
	border-bottom: 0;
	cursor: default;
}

/* ============================================================
   5. Bara de jos: vezi toate rezultatele
   ============================================================ */
.cdb-msearch__foot {
	display: none;
	flex: 0 0 auto;
	padding: 12px 14px calc(12px + env(safe-area-inset-bottom));
	border-top: 1px solid #e8ebef;
	background: #fff;
}

.cdb-msearch.has-query .cdb-msearch__foot {
	display: block;
}

.cdb-msearch__all {
	display: block;
	width: 100%;
	min-height: 48px;
	padding: 13px 16px;
	font-size: 15px;
	font-weight: 600;
	color: #fff;
	background: #fa7403;
	border: 0;
	border-radius: 8px;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}

.cdb-msearch__all:active {
	background: #e06802;
}

/* Blocarea derularii paginii din spate cat timp modalul e deschis. */
body.cdb-msearch-lock {
	overflow: hidden;
}

/* Widgeturile flotante (WhatsApp, widgetul de consimtamant) stau peste coltul
   de jos al modalului si acopera butonul "Vezi toate rezultatele". Le ascundem
   cat timp modalul e deschis; reapar la inchidere. Clasa de pe body o pune
   JS-ul la deschidere. (Fara :has() aici: minificatorul WP Rocket taie tacit
   restul fisierului cand il intalneste.) */
body.cdb-msearch-lock .wa__btn_popup,
body.cdb-msearch-lock .wa__popup_chat_box,
body.cdb-msearch-lock [id^="CookiebotWidget"] {
	display: none !important;
}
