/* Site-wide floating FAQ search widget. See inc/faq-widget.php for what
   this is. */

.selm-faq-widget {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 999999;
	font-family: inherit;
}

.selm-faq-widget-toggle {
	display: flex;
	align-items: center;
	gap: 8px;
	background: #0f3d38;
	color: #fff;
	border: none;
	border-radius: 999px;
	padding: 12px 18px 12px 14px;
	box-shadow: 0 4px 16px rgba(15, 33, 29, 0.28);
	cursor: pointer;
	font-size: 14px;
	font-weight: 600;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.selm-faq-widget-toggle:hover {
	transform: translateY(-1px);
	box-shadow: 0 6px 20px rgba(15, 33, 29, 0.34);
}
.selm-faq-widget-toggle-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: #e7c89b;
	color: #0f211d;
	font-weight: 800;
	font-size: 14px;
	flex-shrink: 0;
}

.selm-faq-widget-panel {
	position: absolute;
	right: 0;
	bottom: 64px;
	width: 360px;
	max-width: calc(100vw - 40px);
	max-height: min(520px, calc(100vh - 120px));
	display: flex;
	flex-direction: column;
	background: #fff;
	border-radius: 14px;
	box-shadow: 0 12px 40px rgba(15, 33, 29, 0.24);
	overflow: hidden;
}

.selm-faq-widget-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	background: linear-gradient(135deg, #0f3d38 0%, #0f211d 100%);
	color: #fff;
	padding: 16px;
	flex-shrink: 0;
}
.selm-faq-widget-header-title {
	display: block;
	font-weight: 700;
	font-size: 15.5px;
}
.selm-faq-widget-header-sub {
	display: block;
	font-weight: 400;
	font-size: 12px;
	color: rgba(255, 255, 255, 0.7);
	margin-top: 2px;
}
.selm-faq-widget-close {
	background: none;
	border: none;
	color: #fff;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	padding: 0;
	opacity: 0.8;
	flex-shrink: 0;
}
.selm-faq-widget-close:hover { opacity: 1; }

#selm-faq-widget-search-view,
#selm-faq-widget-message-view {
	display: flex;
	flex-direction: column;
	flex: 1;
	min-height: 0;
}

.selm-faq-widget-search-row {
	padding: 12px 14px;
	border-bottom: 1px solid #e7e0d4;
	flex-shrink: 0;
}
.selm-faq-widget-input {
	width: 100%;
	padding: 10px 12px;
	font-size: 14px;
	border: 1px solid #e7e0d4;
	border-radius: 8px;
	box-sizing: border-box;
}
.selm-faq-widget-input:focus {
	outline: none;
	border-color: #0f3d38;
}

.selm-faq-widget-results {
	overflow-y: auto;
	flex: 1;
	padding: 4px 0;
}

.selm-faq-widget-result {
	border-bottom: 1px solid #f3eee2;
}
.selm-faq-widget-result:last-child { border-bottom: none; }

.selm-faq-widget-question {
	width: 100%;
	text-align: left;
	background: none;
	border: none;
	padding: 12px 16px;
	font-size: 13.5px;
	font-weight: 600;
	color: #17231f;
	cursor: pointer;
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 10px;
}
.selm-faq-widget-question:hover { background: #faf7f1; }
.selm-faq-widget-question-chevron {
	flex-shrink: 0;
	font-weight: 700;
	color: #0f3d38;
}

.selm-faq-widget-answer {
	padding: 0 16px 14px;
	font-size: 13px;
	color: #5b5750;
	line-height: 1.5;
}

.selm-faq-widget-category {
	display: inline-block;
	font-size: 10.5px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: #0f3d38;
	background: #f3eee2;
	border-radius: 5px;
	padding: 2px 7px;
	margin: 0 16px 8px;
}

.selm-faq-widget-empty,
.selm-faq-widget-hint {
	padding: 24px 18px;
	text-align: center;
	color: #8c8272;
	font-size: 13px;
	line-height: 1.6;
}
.selm-faq-widget-empty a { color: #0f3d38; font-weight: 600; }

.selm-faq-widget-footer {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 12px 16px;
	border-top: 1px solid #e7e0d4;
	flex-shrink: 0;
	background: #fffefb;
}
.selm-faq-widget-chat-btn {
	width: 100%;
	background: #e7c89b;
	color: #0f211d;
	border: none;
	border-radius: 999px;
	padding: 10px 16px;
	font-size: 13px;
	font-weight: 700;
	cursor: pointer;
	white-space: nowrap;
}
.selm-faq-widget-chat-btn:hover { background: #16a34a; color: #fff; }

/* Message ("contact us") view */
.selm-faq-widget-message-form {
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 10px;
	flex: 1;
	min-height: 0;
	overflow-y: auto;
}
.selm-faq-widget-back {
	align-self: flex-start;
	background: none;
	border: none;
	color: #0f3d38;
	font-size: 12.5px;
	font-weight: 600;
	cursor: pointer;
	padding: 0;
	margin-bottom: 2px;
}
.selm-faq-widget-back:hover { text-decoration: underline; }
.selm-faq-widget-message-intro {
	font-size: 13px;
	color: #5b5750;
	margin: 0 0 4px;
	line-height: 1.5;
}
.selm-faq-widget-textarea {
	width: 100%;
	padding: 10px 12px;
	font-size: 14px;
	border: 1px solid #e7e0d4;
	border-radius: 8px;
	box-sizing: border-box;
	font-family: inherit;
	resize: vertical;
}
.selm-faq-widget-textarea:focus,
.selm-faq-widget-message-form .selm-faq-widget-input:focus {
	outline: none;
	border-color: #0f3d38;
}
.selm-faq-widget-honeypot {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	opacity: 0;
}
.selm-faq-widget-submit-btn {
	background: #0f3d38;
	color: #fff;
	border: none;
	border-radius: 8px;
	padding: 11px 16px;
	font-size: 14px;
	font-weight: 700;
	cursor: pointer;
}
.selm-faq-widget-submit-btn:hover { background: #0a2622; }
.selm-faq-widget-submit-btn:disabled { opacity: 0.6; cursor: default; }
.selm-faq-widget-message-status {
	font-size: 12.5px;
	line-height: 1.5;
	margin: 0;
	padding: 8px 10px;
	border-radius: 6px;
}
.selm-faq-widget-message-status-pending { color: #5b5750; }
.selm-faq-widget-message-status-success { color: #16a34a; background: #f0fdf4; }
.selm-faq-widget-message-status-error { color: #dc2626; background: #fef2f2; }

@media (max-width: 480px) {
	.selm-faq-widget { right: 12px; bottom: 12px; }
	.selm-faq-widget-panel { width: calc(100vw - 24px); bottom: 60px; }
	.selm-faq-widget-toggle-label { display: none; }
	.selm-faq-widget-toggle { padding: 12px; }
}

/* The panel's two views swap with the hidden attribute; make sure no other rule overrides it. */
.selm-faq-widget [hidden],
.selm-faq-widget[hidden] {
	display: none !important;
}
