/**
 * FAQ Frontend styles
 *
 * Covers three display contexts:
 *   1. Single product page (.sd-faq-section)
 *   2. Support page FAQ section (#sd-section-faq)
 *   3. Download detail page FAQ subsection
 *
 * Inherits spinner and empty-state styles from frontend.css (loaded first).
 * All selectors prefixed .sd-faq-* to avoid theme conflicts.
 */

/* ── Single product page wrapper ───────────────────────────────────────── */
.sd-faq-section {
	margin: 36px 0;
	padding: 24px;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 14px;
	line-height: 1.5;
	color: #374151;
}

.sd-faq-heading {
	font-size: 18px;
	font-weight: 700;
	color: #111827;
	margin: 0 0 20px;
	padding: 0 0 16px;
	border-bottom: 1px solid #e9ecef;
}

/* ── Accordion shared styles ───────────────────────────────────────────── */
.sd-faq-accordion {
	border: 1px solid #e5e7eb;
	border-radius: 6px;
	overflow: hidden;
}

.sd-faq-item {
	border-bottom: 1px solid #f3f4f6;
}

.sd-faq-item:last-child {
	border-bottom: none;
}

/* ── Question row ──────────────────────────────────────────────────────── */
.sd-faq-question {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 18px;
	cursor: pointer;
	user-select: none;
	outline: none;
	transition: background 0.12s;
}

.sd-faq-question:hover,
.sd-faq-question:focus-visible {
	background: #f8fafc;
}

.sd-faq-question:focus-visible {
	outline: 2px solid #3b82f6;
	outline-offset: -2px;
}

.sd-faq-q-text {
	font-size: 14px;
	font-weight: 600;
	color: #1f2937;
	flex: 1;
	line-height: 1.4;
}

.sd-faq-chevron {
	color: #9ca3af;
	font-size: 11px;
	flex-shrink: 0;
	width: 14px;
	text-align: center;
	transition: transform 0.15s;
}

/* ── Answer panel ──────────────────────────────────────────────────────── */
.sd-faq-answer {
	padding: 0 18px 18px;
	border-top: 1px solid #f3f4f6;
	animation: sd-faq-fade-in 0.15s ease both;
}

@keyframes sd-faq-fade-in {
	from { opacity: 0; transform: translateY(-4px); }
	to   { opacity: 1; transform: translateY(0);    }
}

.sd-faq-answer-body {
	padding-top: 14px;
	font-size: 14px;
	color: #374151;
	line-height: 1.65;
}

.sd-faq-answer-body p  { margin: 0 0 10px; }
.sd-faq-answer-body p:last-child { margin-bottom: 0; }
.sd-faq-answer-body ul,
.sd-faq-answer-body ol { margin: 0 0 10px 20px; padding: 0; }
.sd-faq-answer-body a  { color: #3b82f6; }
.sd-faq-answer-body a:hover { color: #1d4ed8; }

/* ── Related FAQs block ────────────────────────────────────────────────── */
.sd-faq-related {
	margin-top: 16px;
	padding-top: 14px;
	border-top: 1px dashed #e5e7eb;
}

.sd-faq-related-label {
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: #9ca3af;
	margin: 0 0 8px;
}

.sd-faq-related-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.sd-faq-related-btn {
	background: #f1f5f9;
	border: 1px solid #e2e8f0;
	border-radius: 4px;
	color: #374151;
	cursor: pointer;
	font-size: 12px;
	padding: 4px 10px;
	transition: background 0.12s, border-color 0.12s, color 0.12s;
}

.sd-faq-related-btn:hover {
	background: #eff6ff;
	border-color: #bfdbfe;
	color: #1d4ed8;
}

/* ── Category filter chips (support page) ──────────────────────────────── */
.sd-faq-filter-bar {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	flex-wrap: wrap;
	margin-bottom: 20px;
}

.sd-faq-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	flex: 1;
}

.sd-faq-chip {
	padding: 5px 14px;
	border: 1px solid #d1d5db;
	border-radius: 20px;
	background: #f9fafb;
	color: #374151;
	font-size: 12px;
	font-weight: 500;
	cursor: pointer;
	transition: background 0.12s, border-color 0.12s, color 0.12s;
	white-space: nowrap;
}

.sd-faq-chip:hover {
	background: #eff6ff;
	border-color: #93c5fd;
	color: #1d4ed8;
}

.sd-faq-chip.is-active {
	background: #3b82f6;
	border-color: #3b82f6;
	color: #fff;
}

.sd-faq-chip.is-active:hover {
	background: #2563eb;
	border-color: #2563eb;
	color: #fff;
}

/* ── Support page FAQ section ──────────────────────────────────────────── */
#sd-section-faq .sd-faq-accordion {
	margin-top: 0;
}

/* ── Download detail page FAQ subsection ──────────────────────────────── */
.sd-faq-subsection {
	margin-top: 32px;
	padding-top: 24px;
	border-top: 1px solid #e9ecef;
}

.sd-faq-subsection-heading {
	font-size: 15px;
	font-weight: 700;
	color: #111827;
	margin: 0 0 16px;
}

/* ── Empty state ───────────────────────────────────────────────────────── */
.sd-faq-empty {
	color: #9ca3af;
	font-size: 14px;
	text-align: center;
	padding: 24px;
	margin: 0;
}

/* ── Responsive ────────────────────────────────────────────────────────── */
@media screen and (max-width: 768px) {
	.sd-faq-section {
		padding: 16px;
	}

	.sd-faq-filter-bar {
		flex-direction: column;
	}

	.sd-faq-question {
		padding: 12px 14px;
	}

	.sd-faq-answer {
		padding: 0 14px 14px;
	}
}
