/**
 * NexaShop Product Q&A Styles - Digikala UI/UX
 * Matches screenshots:
 * 1. On-page preview horizontal track with bubble cards & prompt bar (media_1791034058560.png)
 * 2. Question submission Bottom Sheet with character count & state change (media_1791034075307.png & media_1791034097514.png)
 * 3. Full Q&A Drawer with top bar, questions list & floating red FAB (media_1791034086898.png)
 * 4. Sort Bottom Sheet with active checkmark (media_1791034132507.png)
 */

.nexashop-qa-widget-wrap {
	direction: rtl;
	font-family: inherit;
	color: #0f172a;
	margin: 28px 0;
	position: relative;
	box-sizing: border-box;
}

.nexashop-qa-widget-wrap *,
.nexashop-qa-widget-wrap *::before,
.nexashop-qa-widget-wrap *::after {
	box-sizing: border-box;
}

/* ==========================================================================
   1. ON-PAGE PREVIEW SECTION (Screenshot 1 - media_1791034058560.png)
   ========================================================================== */

.nexashop-qa-preview-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding-bottom: 14px;
	margin-bottom: 12px;
}

.nexashop-qa-section-title {
	font-size: 16px;
	font-weight: 700;
	color: #0f172a;
	margin: 0;
	letter-spacing: -0.3px;
}

/* Header Action Group: "ثبت پرسش" Button & "مشاهده پرسش‌ها" Link */
.nexashop-qa-header-actions {
	display: inline-flex;
	align-items: center;
	gap: 12px;
}

.nexashop-qa-header-ask-btn {
	background-color: #ef4056;
	color: #ffffff;
	border: 1px solid transparent;
	border-radius: 8px;
	padding: 7px 16px;
	font-size: 13px;
	font-weight: 700;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	font-family: inherit;
	transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
	outline: none;
	text-decoration: none;
	line-height: 1.3;
	box-shadow: 0 2px 8px rgba(239, 64, 86, 0.25);
	box-sizing: border-box;
}

.nexashop-qa-header-ask-btn:hover {
	background-color: #e02840;
	color: #ffffff;
	transform: translateY(-1px);
	box-shadow: 0 4px 14px rgba(239, 64, 86, 0.35);
}

.nexashop-qa-header-ask-btn svg {
	width: 15px;
	height: 15px;
	stroke: currentColor;
	flex-shrink: 0;
	transition: transform 0.2s ease;
}

.nexashop-qa-header-ask-btn:hover svg {
	transform: scale(1.08);
}

.nexashop-qa-view-all-link {
	background: none;
	border: none;
	color: #3f4064;
	font-size: 12.5px;
	font-weight: 600;
	cursor: pointer;
	padding: 4px 0;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	transition: color 0.2s ease;
	font-family: inherit;
}

.nexashop-qa-view-all-link:hover {
	color: #ef4056;
}

/* Horizontal Track of Cards */
.nexashop-qa-preview-track-wrap {
	width: 100%;
	position: relative;
	margin: 0 -12px;
	padding: 0 12px;
	overflow: hidden;
}

.nexashop-qa-preview-track {
	display: flex;
	gap: 12px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	-webkit-overflow-scrolling: touch;
	padding: 4px 2px 14px 2px;
	scrollbar-width: none;
}

.nexashop-qa-preview-track::-webkit-scrollbar {
	display: none;
}

/* Single Preview Card */
.nexashop-qa-preview-card {
	flex: 0 0 310px;
	max-width: 85vw;
	scroll-snap-align: start;
	background: #ffffff;
	border: 1px solid #e0e0e2;
	border-radius: 16px;
	padding: 16px;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.nexashop-qa-preview-card:hover {
	border-color: #cbd5e1;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}

.nexashop-qa-preview-question {
	font-size: 14px;
	font-weight: 700;
	color: #232933;
	line-height: 1.6;
	margin-bottom: 12px;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	min-height: 44px;
}

/* Inner Gray Bubble */
.nexashop-qa-bubble {
	background-color: #f7f7f8;
	border-radius: 12px;
	padding: 12px 14px;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.nexashop-qa-bubble-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.nexashop-qa-author-info {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.nexashop-qa-avatar {
	width: 32px;
	height: 32px;
	border-radius: 50%;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	overflow: hidden;
}

.nexashop-qa-avatar svg {
	width: 100%;
	height: 100%;
	display: block;
}

.nexashop-qa-author-name {
	font-size: 12px;
	font-weight: 600;
	color: #3f4064;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	max-width: 120px;
}

.nexashop-qa-dot {
	color: #9ca3af;
	font-size: 12px;
}

.nexashop-qa-badge-buyer {
	background-color: #f0fdf4;
	color: #16a34a;
	font-size: 11px;
	font-weight: 600;
	padding: 2px 8px;
	border-radius: 10px;
	display: inline-block;
}

.nexashop-qa-bubble-content {
	font-size: 12.5px;
	line-height: 1.7;
	color: #3f4064;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	min-height: 42px;
}

.nexashop-qa-bubble-bottom {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding-top: 4px;
}

.nexashop-qa-date {
	font-size: 11px;
	color: #94a3b8;
	font-weight: 500;
}

.nexashop-qa-reactions {
	display: inline-flex;
	align-items: center;
	gap: 14px;
}

.nexashop-qa-vote-btn {
	background: none;
	border: none;
	padding: 0;
	margin: 0;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 5px;
	color: #81858b;
	font-size: 12px;
	font-weight: 600;
	font-family: inherit;
	transition: all 0.2s ease;
}

.nexashop-qa-vote-btn:hover {
	color: #232933;
}

.nexashop-qa-vote-btn.is-voted {
	color: #ef4056;
	transform: scale(1.08);
}

.nexashop-qa-vote-btn svg {
	width: 15px;
	height: 15px;
	stroke-width: 1.8;
}

/* Bottom Ask Prompt Bar (media_1791034058560.png) */
.nexashop-qa-ask-prompt-bar {
	background: #ffffff;
	border: 1px solid #e0e0e2;
	border-radius: 12px;
	padding: 12px 16px;
	margin-top: 14px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	cursor: pointer;
	transition: all 0.2s ease;
}

.nexashop-qa-ask-prompt-bar:hover {
	border-color: #cbd5e1;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.nexashop-qa-prompt-right {
	display: flex;
	align-items: center;
	gap: 12px;
}

.nexashop-qa-prompt-icon {
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: #f1f2f4;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #3f4064;
	flex-shrink: 0;
}

.nexashop-qa-prompt-label {
	font-size: 13.5px;
	font-weight: 700;
	color: #3f4064;
}

.nexashop-qa-prompt-chevron {
	color: #81858b;
	display: flex;
	align-items: center;
}

/* ==========================================================================
   2. FULL Q&A DRAWER (Screenshot 3 - media_1791034086898.png)
   ========================================================================== */

.nexashop-qa-drawer {
	position: fixed;
	inset: 0;
	background: #ffffff;
	z-index: 99998;
	display: flex;
	flex-direction: column;
	opacity: 0;
	visibility: hidden;
	transform: translateX(-100%);
	transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease, visibility 0.25s;
	direction: rtl;
}

.nexashop-qa-drawer.is-open {
	opacity: 1;
	visibility: visible;
	transform: translateX(0);
}

.nexashop-qa-drawer-topbar {
	height: 56px;
	min-height: 56px;
	padding: 0 16px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	border-bottom: 1px solid #f1f2f4;
	background: #ffffff;
	position: sticky;
	top: 0;
	z-index: 10;
}

.nexashop-qa-drawer-topbar-right {
	display: flex;
	align-items: center;
	gap: 14px;
}

.nexashop-qa-drawer-btn-back {
	background: none;
	border: none;
	padding: 6px;
	cursor: pointer;
	color: #3f4064;
	display: flex;
	align-items: center;
	border-radius: 50%;
	transition: background-color 0.15s ease;
}

.nexashop-qa-drawer-btn-back:hover {
	background-color: #f1f2f4;
}

.nexashop-qa-drawer-title {
	font-size: 16px;
	font-weight: 700;
	color: #0f172a;
	margin: 0;
}

.nexashop-qa-drawer-btn-sort {
	background: none;
	border: none;
	padding: 6px;
	cursor: pointer;
	color: #3f4064;
	display: flex;
	align-items: center;
	border-radius: 50%;
	transition: background-color 0.15s ease;
}

.nexashop-qa-drawer-btn-sort:hover {
	background-color: #f1f2f4;
}

.nexashop-qa-drawer-body {
	flex: 1;
	overflow-y: auto;
	padding: 16px 20px 90px;
	-webkit-overflow-scrolling: touch;
}

/* Full Question Item */
.nexashop-qa-full-item {
	padding: 20px 0;
	border-bottom: 1px solid #f1f2f4;
}

.nexashop-qa-full-item:first-child {
	padding-top: 4px;
}

.nexashop-qa-full-item:last-child {
	border-bottom: none;
}

.nexashop-qa-full-question {
	font-size: 15px;
	font-weight: 700;
	color: #232933;
	line-height: 1.6;
	margin-bottom: 14px;
}

.nexashop-qa-full-author-row {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 10px;
}

.nexashop-qa-full-answer-text {
	font-size: 13.5px;
	line-height: 1.8;
	color: #3f4064;
	margin-bottom: 14px;
}

.nexashop-qa-full-footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 12px;
}

.nexashop-qa-more-answers-row {
	display: flex;
	align-items: center;
}

.nexashop-qa-btn-toggle-answers {
	background: none;
	border: none;
	padding: 0;
	cursor: pointer;
	color: #19bfd3;
	font-size: 12.5px;
	font-weight: 600;
	font-family: inherit;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	transition: opacity 0.2s ease;
}

.nexashop-qa-btn-toggle-answers:hover {
	opacity: 0.8;
}

/* Floating Action Button (FAB) at bottom left */
.nexashop-qa-fab-btn {
	position: fixed;
	bottom: 24px;
	left: 20px;
	z-index: 99999;
	background-color: #ef4056;
	color: #ffffff;
	border: none;
	border-radius: 9999px;
	padding: 10px 18px;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 13.5px;
	font-weight: 700;
	font-family: inherit;
	cursor: pointer;
	box-shadow: 0 4px 16px rgba(239, 64, 86, 0.4);
	transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.nexashop-qa-fab-btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 20px rgba(239, 64, 86, 0.5);
}

.nexashop-qa-fab-btn .icon {
	display: flex;
	align-items: center;
}

/* ==========================================================================
   3. QUESTION SUBMISSION BOTTOM SHEET (Screenshots 2 & 4)
   ========================================================================== */

.nexashop-qa-bottomsheet-wrap {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.25s ease, visibility 0.25s;
	direction: rtl;
}

.nexashop-qa-bottomsheet-wrap.is-active {
	opacity: 1;
	visibility: visible;
}

.nexashop-qa-sheet-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
	backdrop-filter: blur(2px);
	-webkit-backdrop-filter: blur(2px);
}

.nexashop-qa-sheet-card {
	position: relative;
	width: 100%;
	background: #ffffff;
	border-radius: 16px 16px 0 0;
	padding: 12px 20px 24px;
	box-sizing: border-box;
	transform: translateY(100%);
	transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
	max-height: 90vh;
	overflow-y: auto;
}

.nexashop-qa-bottomsheet-wrap.is-active .nexashop-qa-sheet-card {
	transform: translateY(0);
}

.nexashop-qa-sheet-handle {
	width: 36px;
	height: 4px;
	background: #e0e0e2;
	border-radius: 2px;
	margin: 0 auto 12px;
}

.nexashop-qa-sheet-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding-bottom: 12px;
	border-bottom: 1px solid #f1f2f4;
	margin-bottom: 16px;
}

.nexashop-qa-sheet-title {
	font-size: 15px;
	font-weight: 700;
	color: #0f172a;
	margin: 0;
}

.nexashop-qa-sheet-close {
	background: none;
	border: none;
	padding: 4px;
	cursor: pointer;
	color: #64748b;
	display: flex;
	align-items: center;
	border-radius: 50%;
}

.nexashop-qa-sheet-close:hover {
	color: #0f172a;
}

.nexashop-qa-sheet-prompt {
	font-size: 13.5px;
	font-weight: 700;
	color: #1e293b;
	margin: 0 0 12px 0;
}

.nexashop-qa-textarea-container {
	position: relative;
	border: 1px solid #e0e0e2;
	border-radius: 8px;
	padding: 12px;
	background: #ffffff;
	transition: border-color 0.2s ease;
}

.nexashop-qa-textarea-container:focus-within {
	border-color: #ef4056;
}

.nexashop-qa-textarea {
	width: 100%;
	border: none;
	outline: none;
	resize: none;
	font-family: inherit;
	font-size: 13px;
	color: #1e293b;
	line-height: 1.8;
	padding: 0;
	margin-bottom: 24px;
	min-height: 90px;
}

.nexashop-qa-textarea::placeholder {
	color: #9ca3af;
}

.nexashop-qa-char-counter {
	position: absolute;
	bottom: 8px;
	left: 12px;
	font-size: 11.5px;
	color: #9ca3af;
	font-family: inherit;
	direction: ltr;
}

.nexashop-qa-anon-row {
	margin-top: 12px;
	display: flex;
	align-items: center;
}

.nexashop-qa-checkbox-label {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 12.5px;
	color: #64748b;
	cursor: pointer;
}

.nexashop-qa-sheet-footer {
	margin-top: 20px;
}

.nexashop-qa-btn-submit-question {
	width: 100%;
	height: 48px;
	border-radius: 8px;
	border: none;
	font-size: 14px;
	font-weight: 700;
	font-family: inherit;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.2s ease;
	background-color: #ef4056;
	color: #ffffff;
}

.nexashop-qa-btn-submit-question.is-disabled {
	background-color: #e0e0e2 !important;
	color: #ffffff !important;
	cursor: not-allowed;
	pointer-events: none;
}

.nexashop-qa-terms-notice {
	text-align: center;
	font-size: 11.5px;
	color: #3f4064;
	margin: 12px 0 0 0;
	line-height: 1.6;
}

.nexashop-qa-terms-link {
	color: #19bfd3;
	text-decoration: none;
	font-weight: 600;
}

.nexashop-qa-terms-link:hover {
	text-decoration: underline;
}

/* ==========================================================================
   4. SORT BOTTOM SHEET (Screenshot 5 - media_1791034132507.png)
   ========================================================================== */

.nexashop-qa-sort-card {
	padding-bottom: 28px;
}

.nexashop-qa-sort-options {
	display: flex;
	flex-direction: column;
}

.nexashop-qa-sort-item {
	background: none;
	border: none;
	width: 100%;
	padding: 14px 4px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	cursor: pointer;
	font-size: 14px;
	font-weight: 600;
	color: #3f4064;
	font-family: inherit;
	text-align: right;
	transition: color 0.15s ease;
	border-bottom: 1px solid #f8fafc;
}

.nexashop-qa-sort-item:last-child {
	border-bottom: none;
}

.nexashop-qa-sort-item .check-icon {
	opacity: 0;
	visibility: hidden;
	color: #0f172a;
	display: flex;
	align-items: center;
}

.nexashop-qa-sort-item.is-selected {
	color: #0f172a;
	font-weight: 700;
}

.nexashop-qa-sort-item.is-selected .check-icon {
	opacity: 1;
	visibility: visible;
}

/* ==========================================================================
   5. ANSWER SUBMISSION & HELPER STYLES
   ========================================================================== */

.nexashop-quoted-question-box {
	background: #f8fafc;
	border-right: 3px solid #ef4056;
	padding: 10px 14px;
	border-radius: 6px;
	margin-bottom: 14px;
}

.nexashop-quoted-question-box .label {
	font-size: 11.5px;
	color: #64748b;
	font-weight: 600;
	display: block;
	margin-bottom: 4px;
}

.nexashop-quoted-question-box p {
	margin: 0;
	font-size: 13px;
	font-weight: 600;
	color: #1e293b;
	line-height: 1.6;
}

/* On-Page Preview Empty State */
.nexashop-qa-preview-empty {
	display: flex;
	align-items: center;
	justify-content: space-between;
	background: #f8fafc;
	border: 1px dashed #cbd5e1;
	border-radius: 14px;
	padding: 16px 20px;
	margin: 8px 0 14px;
	gap: 16px;
	box-sizing: border-box;
}

.nexashop-qa-empty-icon {
	width: 44px;
	height: 44px;
	border-radius: 12px;
	background: #ffffff;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #64748b;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
	flex-shrink: 0;
}

.nexashop-qa-empty-content {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 3px;
	text-align: right;
}

.nexashop-qa-empty-title {
	font-size: 13.5px;
	font-weight: 700;
	color: #1e293b;
	margin: 0;
}

.nexashop-qa-empty-desc {
	font-size: 12px;
	color: #64748b;
	margin: 0;
}

.nexashop-qa-empty-btn {
	background-color: #ef4056;
	color: #ffffff;
	border: none;
	border-radius: 8px;
	padding: 8px 16px;
	font-size: 12.5px;
	font-weight: 700;
	cursor: pointer;
	font-family: inherit;
	transition: background-color 0.2s ease;
	flex-shrink: 0;
}

.nexashop-qa-empty-btn:hover {
	background-color: #e02840;
}

/* Full Drawer Empty State */
.nexashop-empty-qa {
	text-align: center;
	padding: 60px 20px;
	color: #64748b;
	font-size: 13.5px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
}

.nexashop-empty-qa .nexashop-empty-qa-icon {
	width: 72px;
	height: 72px;
	border-radius: 50%;
	background: #f1f5f9;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #94a3b8;
	margin-bottom: 16px;
}

.nexashop-empty-qa .nexashop-empty-title {
	font-size: 15px;
	font-weight: 700;
	color: #0f172a;
	margin: 0 0 6px 0;
}

.nexashop-empty-qa .nexashop-empty-subtitle {
	font-size: 13px;
	color: #64748b;
	margin: 0 0 20px 0;
	max-width: 300px;
	line-height: 1.6;
}

.nexashop-empty-qa .nexashop-empty-ask-btn {
	background-color: #ef4056;
	color: #ffffff;
	border: none;
	border-radius: 10px;
	padding: 10px 24px;
	font-size: 13.5px;
	font-weight: 700;
	cursor: pointer;
	font-family: inherit;
	transition: background-color 0.2s ease, transform 0.2s ease;
}

.nexashop-empty-qa .nexashop-empty-ask-btn:hover {
	background-color: #e02840;
	transform: translateY(-1px);
}


/* Spinner */
.nexashop-qa-btn-submit-question .spinner {
	width: 18px;
	height: 18px;
	border: 2px solid rgba(255, 255, 255, 0.4);
	border-top-color: #ffffff;
	border-radius: 50%;
	animation: nexashop-qa-spin 0.6s linear infinite;
	margin-right: 8px;
}

@keyframes nexashop-qa-spin {
	to { transform: rotate(360deg); }
}

/* ==========================================================================
   6. RESPONSIVE ADAPTATIONS (Desktop & Tablets)
   ========================================================================== */

@media (min-width: 769px) {
	/* Bottom sheets become centered elegant dialogs on Desktop */
	.nexashop-qa-bottomsheet-wrap {
		justify-content: center;
		align-items: center;
	}

	.nexashop-qa-sheet-card {
		width: 480px;
		max-width: 90vw;
		border-radius: 16px;
		transform: scale(0.95);
		transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
		padding: 20px 24px 24px;
	}

	.nexashop-qa-bottomsheet-wrap.is-active .nexashop-qa-sheet-card {
		transform: scale(1);
	}

	.nexashop-qa-sheet-handle {
		display: none;
	}

	/* On desktop, drawer can appear as a clean overlay side sheet */
	.nexashop-qa-drawer {
		max-width: 560px;
		right: 0;
		left: auto;
		box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
		transform: translateX(100%);
	}

	.nexashop-qa-drawer.is-open {
		transform: translateX(0);
	}
}

@media (max-width: 480px) {
	.nexashop-qa-preview-header {
		flex-wrap: wrap;
		gap: 10px;
	}

	.nexashop-qa-header-actions {
		gap: 8px;
	}

	.nexashop-qa-header-ask-btn {
		padding: 6px 12px;
		font-size: 12px;
	}
}
