/* ============================================================
   Elementor Search Bar Widget — v1.1
   ============================================================ */

.esw-container { position: relative; width: 100%; }

.esw-wrapper {
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
}

.esw-input-wrap {
	position: relative;
	flex: 1 1 auto;
	min-width: 0;
}

/* Input */
.esw-input {
	display: block;
	width: 100%;
	box-sizing: border-box;
	padding: 14px 20px;
	font-size: 15px;
	font-family: inherit;
	color: #333;
	background-color: #fff;
	border: 1.5px solid #d0d9e8;
	border-radius: 50px;
	outline: none;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
	-webkit-appearance: none;
	appearance: none;
}
.esw-input:focus {
	border-color: #1a4f8a;
	box-shadow: 0 0 0 3px rgba(26,79,138,0.12);
}
.esw-input::placeholder { color: #aab4c4; }

/* Button */
.esw-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	flex-shrink: 0;
	padding: 14px 30px;
	font-size: 15px;
	font-family: inherit;
	font-weight: 600;
	color: #fff;
	background-color: #1a4f8a;
	border: none;
	border-radius: 50px;
	cursor: pointer;
	white-space: nowrap;
	transition: background-color 0.2s ease, transform 0.1s ease, box-shadow 0.2s ease;
	-webkit-appearance: none;
	appearance: none;
}
.esw-button:hover {
	background-color: #153f6e;
	box-shadow: 0 4px 14px rgba(26,79,138,0.3);
	transform: translateY(-1px);
}
.esw-button:active { transform: translateY(0); }

/* -------------------------------------------------------
   Dropdown
   ------------------------------------------------------- */
.esw-dropdown {
	display: none;
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	right: 0;
	background-color: #fff;
	border: 1.5px solid #d0d9e8;
	border-radius: 8px;
	box-shadow: 0 8px 30px rgba(0,0,0,0.1);
	z-index: 9999;
	overflow: hidden;
	animation: esw-fade-in 0.15s ease;
}
.esw-dropdown.is-open { display: block; }

@keyframes esw-fade-in {
	from { opacity: 0; transform: translateY(-6px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* Suggestions list */
.esw-suggestions-list {
	list-style: none;
	margin: 0;
	padding: 6px 0;
}

.esw-suggestion-item {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	padding: 10px 16px;
	cursor: pointer;
	gap: 10px;
	transition: background-color 0.12s ease;
}
.esw-suggestion-item + .esw-suggestion-item {
	border-top: 1px solid #f0f3f8;
}
.esw-suggestion-item:hover,
.esw-suggestion-item.is-active { background-color: #f5f8ff; }

/* Left column: title + excerpt */
.esw-suggestion-body {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.esw-suggestion-title {
	font-size: 14px;
	color: #1a4f8a;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	line-height: 1.4;
}

.esw-highlight {
	font-weight: 700;
	color: #1a4f8a;
}

/* Excerpt snippet */
.esw-suggestion-excerpt {
	font-size: 12px;
	color: #888;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	line-height: 1.4;
}
.esw-suggestion-excerpt .esw-highlight {
	font-weight: 600;
	color: #555;
}

/* Right column: zone badge + type badge */
.esw-suggestion-meta {
	flex-shrink: 0;
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 4px;
}

/* Type badge (Doctor, Post, Product…) */
.esw-suggestion-type {
	font-size: 11px;
	font-weight: 500;
	padding: 2px 8px;
	border-radius: 4px;
	background-color: #f0f4f8;
	color: #666;
	letter-spacing: 0.02em;
	border: 1px solid #e2e8f0;
	white-space: nowrap;
}

/* Match zone badge (Title, H2, H3, Content…) */
.esw-match-zone {
	font-size: 10px;
	font-weight: 600;
	padding: 2px 7px;
	border-radius: 4px;
	background-color: #e8f0fe;
	color: #1a4f8a;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	white-space: nowrap;
}

/* Zone colour variants */
.esw-match-zone[data-zone="title"]   { background-color: #fef9e7; color: #b7791f; }
.esw-match-zone[data-zone="h1"]      { background-color: #fef3c7; color: #92400e; }
.esw-match-zone[data-zone="h2"]      { background-color: #e8f0fe; color: #1a4f8a; }
.esw-match-zone[data-zone="h3"]      { background-color: #e6fffa; color: #065f46; }
.esw-match-zone[data-zone="h4"]      { background-color: #f3e8ff; color: #6b21a8; }
.esw-match-zone[data-zone="content"] { background-color: #f0fdf4; color: #15803d; }
.esw-match-zone[data-zone="meta"]    { background-color: #f1f5f9; color: #475569; }

/* Loading / empty states */
.esw-suggestion-loading,
.esw-suggestion-empty {
	padding: 12px 18px;
	font-size: 14px;
	color: #aab4c4;
	text-align: center;
}

/* Editor preview */
.elementor-editor-active .esw-dropdown { display: block; }
