/* ==========================================================================
 * SEARCH (Relevanssi)  —  styling for the [live_search] shortcode.
 *
 * Migrated from the theme's custom.css. The search field's appearance
 * (background, text, placeholder, border colour/width, corner radius, font)
 * is driven by CSS variables set from the module settings, with the original
 * values as fallbacks. The live-results dropdown keeps fixed structural styling.
 * ========================================================================== */

.bc-search-wrap {
	position: relative;
	width: 100%;
}

.bc-search-wrap .relevanssi-search-form {
	position: relative;
	width: 100%;
	z-index: 20;
}

.bc-search-wrap .relevanssi-search-form input[type="search"] {
	width: 100%;
	/* !important: themes (Divi) tend to override these on the bare input. */
	padding: var(--bc-search-padding, 10px 15px) !important;
	box-sizing: border-box;
	background-color: var(--bc-search-bg, #fff);
	color: var(--bc-search-text, #000);
	border: var(--bc-search-border-width, 3px) solid var(--bc-search-border-color, #f08e35);
	border-radius: var(--bc-search-radius, 45px) !important;
	font-family: var(--bc-search-font, inherit);
	font-size: var(--bc-search-font-size, 16px) !important;
}

.bc-search-wrap .relevanssi-search-form input[type="search"]::placeholder               { color: var(--bc-search-placeholder, #000); }
.bc-search-wrap .relevanssi-search-form input[type="search"]::-webkit-input-placeholder { color: var(--bc-search-placeholder, #000); }
.bc-search-wrap .relevanssi-search-form input[type="search"]::-moz-placeholder          { color: var(--bc-search-placeholder, #000); opacity: 1; }
.bc-search-wrap .relevanssi-search-form input[type="search"]:-ms-input-placeholder      { color: var(--bc-search-placeholder, #000); }

/* Live results dropdown */
#rlv-live-results {
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	width: 100%;
	z-index: 99999;
}

#rlv-live-results .relevanssi-live-search-results {
	position: static !important;
	top: auto !important;
	left: auto !important;
	width: 100% !important;
	margin: 0;
	background: #fff;
	border: 1px solid #ddd;
	border-radius: 16px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
	overflow: hidden;
}

#rlv-live-results .ajax-results {
	max-height: 420px;
	overflow-y: auto;
}

#rlv-live-results .relevanssi-live-search-result-count {
	margin: 0;
	padding: 12px 16px;
	background: #fff;
	border-bottom: 1px solid #eee;
}

#rlv-live-results .ajax-results a {
	display: block;
	padding: 12px 16px;
	text-decoration: none;
}

#rlv-live-results .ajax-results a:hover {
	background: #f9f9f9;
}

/* "Show search button" on: a search-icon submit button sitting inside the field. */
.bc-search-wrap--button .search-field-wrapper {
	position: relative;
	width: 100%;
}

/* Keep room for the icon on the right; !important to beat the base padding rule. */
.bc-search-wrap--button .relevanssi-search-form input[type="search"] {
	padding-right: 2.8em !important;
}

.bc-search-wrap--button .search-icon-button {
	position: absolute;
	right: 1.5em;
	top: 50%;
	transform: translateY(-50%);
	display: inline-flex;
	align-items: center;
	padding: 0;
	border: none;
	background: none;
	cursor: pointer;
	color: var(--bc-search-text, #33355e);
}

.bc-search-wrap--button .search-icon-button svg {
	display: block;
}
