/* ==========================================================================
   Testimonials Widget — Modern Design System
   ========================================================================== */

/* ───────── Reset & Variables ───────── */
:root {
	--tst-accent: #6366f1;
	--tst-text: #555;
	--tst-name: #1a1a2e;
	--tst-phone: #888;
	--tst-bg: #ffffff;
	--tst-border: #e5e7eb;
	--tst-radius: 16px;
	--tst-shadow-soft: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
	--tst-shadow-medium: 0 4px 24px rgba(0,0,0,.08);
	--tst-shadow-strong: 0 8px 40px rgba(0,0,0,.12);
	--tst-transition: 0.3s cubic-bezier(.4,0,.2,1);
}

/* ───────── Card (shared) ───────── */
.tst-card {
	position: relative;
	font-family: inherit;
	direction: rtl;
	text-align: right;
	overflow: hidden;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	min-height: 220px;
	height: 100%;
	width: 100%;
	max-width: 360px;
	margin: 0 auto;
	background: #ffffff;
	border: 1px solid rgba(99, 102, 241, 0.10);
	border-radius: 16px;
	box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
	/* hover حذف شد */
}

.tst-card-inner {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	flex: 1;
	min-height: 100%;
	padding: 22px 24px 20px; /* فاصله استاندارد از لبه‌ها */
}

.tst-content-wrap {
	display: flex;
	gap: 14px;
	align-items: flex-start;
}

.tst-content {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
}

/* Accent bar */
.tst-accent {
	position: absolute;
	background: var(--tst-accent);
	transition: background-color 0.25s ease;
}

.tst-accent-top {
	top: 0; left: 0; right: 0;
	height: 4px;
	border-radius: 16px 16px 0 0;
}

.tst-accent-bottom {
	bottom: 0; left: 0; right: 0;
	height: 4px;
	border-radius: 0 0 16px 16px;
}

.tst-accent-right {
	top: 0; right: 0; bottom: 0;
	width: 4px;
	border-radius: 0 16px 16px 0;
}

.tst-accent-left {
	top: 0; left: 0; bottom: 0;
	width: 4px;
	border-radius: 16px 0 0 16px;
}

/* Quote icon */
.tst-quote-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	margin-bottom: 14px;
	border-radius: 12px;
	background: rgba(99, 102, 241, 0.10);
	color: var(--tst-accent);
	line-height: 1;
}

.tst-quote-fallback {
	background: linear-gradient(135deg, rgba(99,102,241,0.12), rgba(129,140,248,0.18));
}

/* Avatar */
.tst-avatar {
	flex-shrink: 0;
	margin-top: 2px;
}

.tst-avatar img {
	width: 56px;
	height: 56px;
	border-radius: 14px;
	object-fit: cover;
	border: 2px solid rgba(99, 102, 241, 0.12);
}

.tst-avatar-placeholder {
	width: 56px;
	height: 56px;
	border-radius: 14px;
	background: linear-gradient(135deg, #e5e7eb, #d1d5db);
	flex-shrink: 0;
}

/* Name */
.tst-name {
	font-family: inherit;
	margin: 0 0 8px;
	font-size: 1.05em;
	font-weight: 700;
	color: var(--tst-name);
	line-height: 1.4;
}

/* Text + Read More */
.tst-text-wrap {
	display: flex;
	flex-direction: column;
	flex: 1;
	min-height: 0;
}

.tst-text {
	font-family: inherit;
	line-height: 1.75;
	margin-bottom: 10px;
	color: var(--tst-text);
	max-height: 78px;
	overflow: hidden;
	position: relative;
	transition: max-height 0.3s ease;
}

.tst-text::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 36px;
	background: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.97) 100%);
	pointer-events: none;
}

.tst-text.is-expanded {
	max-height: none;
}

.tst-text.is-expanded::after {
	display: none;
}

.tst-read-more {
	display: inline-flex;
	align-self: flex-start;
	align-items: center;
	gap: 6px;
	margin-top: 4px;
	padding: 7px 14px;
	border: none;
	background: rgba(99, 102, 241, 0.09);
	color: var(--tst-accent);
	border-radius: 999px;
	font-family: inherit;
	font-size: 0.88em;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.tst-read-more:hover,
.tst-read-more.is-active {
	background: var(--tst-accent);
	color: #fff;
}

.tst-text p { margin: 0 0 6px; }
.tst-text p:last-child { margin-bottom: 0; }

/* Phone */
.tst-phone {
	font-family: inherit;
	font-size: 0.85em;
	color: var(--tst-phone);
	direction: ltr;
	text-align: right;
	margin-top: 12px;
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 7px 12px;
	border-radius: 999px;
	background: rgba(99, 102, 241, 0.06);
	font-weight: 500;
}

.tst-phone-icon {
	flex-shrink: 0;
	opacity: 0.55;
}

/* Card Styles (بدون hover) */
.tst-style-modern {
	background: #ffffff;
	box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
}

.tst-style-boxed {
	background: #ffffff;
	border: 1px solid #e5e7eb;
	box-shadow: 0 2px 10px rgba(0,0,0,.04);
}

.tst-style-glass {
	background: rgba(255, 255, 255, 0.65);
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
	border: 1px solid rgba(255, 255, 255, 0.35);
	box-shadow: 0 6px 24px rgba(15, 23, 42, 0.07);
}

.tst-style-minimal {
	background: transparent;
	border: none;
	box-shadow: none;
}

.tst-no-posts {
	text-align: center;
	padding: 48px 24px;
	color: #aaa;
	font-family: inherit;
	font-size: 1.05em;
}

/* ==========================================================================
   GRID
   ========================================================================== */

.tst-grid {
	display: grid;
	gap: 24px;
	direction: rtl;
	text-align: right;
}

.tst-grid-cols-1 { grid-template-columns: 1fr; }
.tst-grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.tst-grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.tst-grid-cols-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 1024px) {
	.tst-grid-cols-3,
	.tst-grid-cols-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 767px) {
	.tst-grid-cols-2,
	.tst-grid-cols-3,
	.tst-grid-cols-4 { grid-template-columns: 1fr; }
}

/* ───────── Pagination ───────── */

.tst-pagination {
	display: flex;
	justify-content: center;
	gap: 8px;
	margin-top: 40px;
	flex-wrap: wrap;
	direction: rtl;
}

.tst-pagination a,
.tst-pagination span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	height: 44px;
	padding: 0 14px;
	border-radius: 12px;
	font-family: inherit;
	font-size: 0.95em;
	text-decoration: none;
	transition: all var(--tst-transition);
	box-sizing: border-box;
	border: 2px solid transparent;
}

.tst-pagination a {
	background: #f3f4f6;
	color: #374151;
}

.tst-pagination a:hover {
	background: #e5e7eb;
	transform: translateY(-1px);
}

.tst-pagination .current {
	background: var(--tst-accent);
	color: #fff;
	border-color: var(--tst-accent);
	font-weight: 600;
	cursor: default;
}

/* Load More */
.tst-loadmore-wrap {
	text-align: center;
	margin-top: 40px;
}

.tst-loadmore-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 14px 40px;
	background: var(--tst-accent);
	color: #fff;
	border: none;
	border-radius: 12px;
	font-family: inherit;
	font-size: 1em;
	font-weight: 600;
	cursor: pointer;
	transition: all var(--tst-transition);
}

.tst-loadmore-btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 20px rgba(99, 102, 241, 0.35);
}

.tst-loadmore-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
	transform: none;
	box-shadow: none;
}

/* Spinner */
.tst-loading {
	padding: 32px;
	text-align: center;
}

.tst-spinner {
	display: inline-block;
	width: 32px;
	height: 32px;
	border: 3px solid #e5e7eb;
	border-top-color: var(--tst-accent);
	border-radius: 50%;
	animation: tst-spin 0.7s linear infinite;
}

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

.tst-ajax-wrap {
	transition: opacity 0.3s ease;
}

/* ==========================================================================
   SLIDER
   ========================================================================== */

.tst-slider {
	position: relative;
	direction: rtl;
	overflow: hidden;
	padding: 8px 64px 28px;
}

.tst-track {
	display: flex;
	will-change: transform;
	gap: 0;
	transition: transform 0.55s cubic-bezier(.22,1,.36,1);
}

.tst-slide {
	flex: 0 0 auto;
	box-sizing: border-box;
	padding: 0 12px;
	display: flex;
}

.tst-slide .tst-card {
	width: 100%;
	height: 100%;
	min-height: 220px;
	box-sizing: border-box;
}

/* Arrows */
.tst-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 12;
	background: #ffffff;
	color: var(--tst-accent);
	border: 1px solid rgba(99, 102, 241, 0.15);
	border-radius: 50%;
	width: 44px;
	height: 44px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
	box-shadow: 0 8px 24px rgba(15, 23, 42, 0.10);
	padding: 0;
}

.tst-arrow svg {
	stroke: currentColor;
}

.tst-arrow:hover {
	background: var(--tst-accent);
	color: #fff;
	box-shadow: 0 10px 28px rgba(99, 102, 241, 0.25);
}

.tst-arrow:active {
	transform: translateY(-50%) scale(0.96);
}

.tst-arrow-prev { left: 12px; }
.tst-arrow-next { right: 12px; }

html[dir="rtl"] .tst-arrow-prev,
.tst-slider[data-rtl="true"] .tst-arrow-prev {
	left: auto;
	right: 12px;
}
html[dir="rtl"] .tst-arrow-next,
.tst-slider[data-rtl="true"] .tst-arrow-next {
	right: auto;
	left: 12px;
}

/* Dots */
.tst-dots {
	display: flex;
	justify-content: center;
	gap: 8px;
	margin-top: 22px;
}

.tst-dot {
	width: 9px;
	height: 9px;
	border-radius: 999px;
	background: #cbd5e1;
	border: none;
	cursor: pointer;
	transition: all 0.2s ease;
	padding: 0;
	opacity: 0.85;
}

.tst-dot.active {
	background: var(--tst-accent);
	width: 26px;
}

.tst-dot:hover:not(.active) {
	background: #94a3b8;
}

/* Progress */
.tst-progress {
	margin-top: 16px;
	height: 3px;
	background: #e5e7eb;
	border-radius: 3px;
	overflow: hidden;
}

.tst-progress-bar {
	height: 100%;
	background: var(--tst-accent);
	border-radius: 3px;
	transform: scaleX(0);
	transform-origin: left;
}

/* Responsive */
@media (max-width: 767px) {
	.tst-slider {
		padding: 8px 52px 22px;
	}
	.tst-arrow {
		width: 40px;
		height: 40px;
	}
	.tst-card-inner {
		padding: 18px 18px 16px;
	}
	.tst-content-wrap {
		flex-direction: column;
		gap: 12px;
	}
}
/* ───────── Review Form ───────── */
.tst-review-form-wrapper {
	direction: rtl;
	text-align: right;
	margin: 24px 0;
}

.tst-review-form {
	background: var(--tst-bg);
	border: 1px solid var(--tst-border);
	border-radius: var(--tst-radius);
	padding: 24px;
	box-shadow: var(--tst-shadow-soft);
}

.tst-review-form-title {
	margin: 0 0 8px;
	font-size: 1.2em;
	font-weight: 700;
	color: var(--tst-name);
}

.tst-review-form-description {
	margin: 0 0 20px;
	color: var(--tst-text);
	line-height: 1.8;
}

.tst-review-form-form {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.tst-review-form-field {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.tst-review-form-field label {
	font-weight: 600;
	color: var(--tst-name);
}

.tst-review-form-required {
	color: #ef4444;
}

.tst-review-form-field input,
.tst-review-form-field textarea {
	width: 100%;
	padding: 12px 14px;
	border: 1px solid var(--tst-border);
	border-radius: 12px;
	font-family: inherit;
	font-size: 1em;
	background: #fff;
	box-sizing: border-box;
	direction: rtl;
}

.tst-review-form-field input:focus,
.tst-review-form-field textarea:focus {
	outline: none;
	border-color: var(--tst-accent);
	box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.tst-review-form-submit {
	align-self: flex-start;
	padding: 12px 24px;
	border: none;
	border-radius: 999px;
	background: var(--tst-accent);
	color: #fff;
	font-family: inherit;
	font-weight: 700;
	cursor: pointer;
	transition: transform var(--tst-transition), box-shadow var(--tst-transition);
}

.tst-review-form-submit:hover {
	transform: translateY(-2px);
	box-shadow: 0 8px 20px rgba(99, 102, 241, 0.25);
}

.tst-review-form-submit:disabled {
	opacity: 0.7;
	cursor: wait;
}

.tst-review-form-message {
	min-height: 24px;
	font-weight: 600;
	margin-top: 4px;
}

.tst-review-form-success {
	color: #15803d;
}

.tst-review-form-error {
	color: #dc2626;
}
