/**
 * RTD Client Testimonial — front-end styles.
 */

.rtd {
	--rtd-accent: #1a5088;
	--rtd-star: #f5a623;
	--rtd-quote: #d7dfe9;
	--rtd-card-bg: #fff;
	--rtd-radius: 14px;
	--rtd-font-size: 16px;
	--rtd-avatar: 56px;
	--rtd-gap: 24px;
	--rtd-text: #334155;
	--rtd-heading: #0f172a;
	--rtd-muted: #64748b;
	--rtd-border: rgba(15, 23, 42, 0.08);
	box-sizing: border-box;
	color: inherit;
	font-size: var(--rtd-font-size);
}

.rtd *,
.rtd *::before,
.rtd *::after {
	box-sizing: border-box;
}

.rtd__heading {
	margin: 0 0 1.5em;
	color: inherit;
	line-height: 1.2;
	text-align: center;
}

/* -------------------------------------------------------------------------
 * Grid / masonry / list wrappers
 * ---------------------------------------------------------------------- */

.rtd__grid {
	display: grid;
	grid-template-columns: repeat(var(--rtd-cols, 3), minmax(0, 1fr));
	gap: var(--rtd-gap);
}

.rtd-cols-1 { --rtd-cols: 1; }
.rtd-cols-2 { --rtd-cols: 2; }
.rtd-cols-3 { --rtd-cols: 3; }
.rtd-cols-4 { --rtd-cols: 4; }

.rtd--masonry .rtd__grid {
	display: block;
	column-count: var(--rtd-cols, 3);
	column-gap: var(--rtd-gap);
}

.rtd--masonry .rtd-card {
	break-inside: avoid;
	margin-bottom: var(--rtd-gap);
}

.rtd--list .rtd__grid {
	display: flex;
	flex-direction: column;
	gap: var(--rtd-gap);
}

.rtd--list .rtd-card {
	flex-direction: row;
	align-items: stretch;
}

.rtd--list .rtd-card__media {
	flex: 0 0 38%;
	max-width: 38%;
}

.rtd--list .rtd-card__body {
	flex: 1 1 auto;
}

@media (max-width: 1024px) {
	.rtd__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.rtd-cols-1 .rtd__grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.rtd--masonry .rtd__grid {
		column-count: 2;
	}

	.rtd-cols-1.rtd--masonry .rtd__grid {
		column-count: 1;
	}
}

@media (max-width: 640px) {
	.rtd__grid,
	.rtd-cols-1 .rtd__grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.rtd--masonry .rtd__grid,
	.rtd-cols-1.rtd--masonry .rtd__grid {
		column-count: 1;
	}

	.rtd--list .rtd-card {
		flex-direction: column;
	}

	.rtd--list .rtd-card__media {
		flex: 1 1 auto;
		max-width: 100%;
	}
}

/* -------------------------------------------------------------------------
 * Card
 * ---------------------------------------------------------------------- */

.rtd-card {
	display: flex;
	flex-direction: column;
	height: 100%;
	overflow: hidden;
	background: var(--rtd-card-bg);
	border: 1px solid var(--rtd-border);
	border-radius: var(--rtd-radius);
	box-shadow: var(--rtd-shadow);
	color: var(--rtd-text);
	text-align: left;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.rtd-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 16px 40px rgba(15, 23, 42, 0.12);
}

.rtd-card--video {
	border: 0;
}

.rtd-card__body {
	display: flex;
	flex-direction: column;
	gap: 14px;
	flex: 1 1 auto;
	padding: 28px;
}

.rtd-card__top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.rtd-card__quote {
	color: var(--rtd-quote);
	font-size: 28px;
	line-height: 1;
}

.rtd-card__content {
	flex: 1 1 auto;
	overflow-wrap: anywhere;
}

.rtd-card__content > :first-child {
	margin-top: 0;
}

.rtd-card__content > :last-child {
	margin-bottom: 0;
}

.rtd-card__content p {
	margin: 0 0 0.9em;
	font-size: var(--rtd-font-size);
	line-height: 1.65;
}

.rtd-card__more {
	display: inline-block;
	margin-top: 0.4em;
	color: var(--rtd-accent);
	font-weight: 600;
	text-decoration: none;
}

.rtd-card__more:hover,
.rtd-card__more:focus {
	text-decoration: underline;
}

/* -------------------------------------------------------------------------
 * Stars
 * ---------------------------------------------------------------------- */

.rtd-stars {
	display: inline-flex;
	align-items: center;
	gap: 3px;
	color: var(--rtd-star);
	font-size: 0.95em;
	line-height: 1;
}

.rtd-stars i {
	color: var(--rtd-star);
	font-size: 1em;
}

.rtd-stars .rtd-star--off {
	opacity: 0.25;
}

/* -------------------------------------------------------------------------
 * Footer: avatar, identity, logo
 * ---------------------------------------------------------------------- */

.rtd-card__footer {
	display: flex;
	align-items: center;
	gap: 14px;
	padding-top: 16px;
	border-top: 1px solid var(--rtd-border);
}

.rtd-avatar {
	flex: 0 0 auto;
	width: var(--rtd-avatar);
	height: var(--rtd-avatar);
	overflow: hidden;
	border-radius: 50%;
	background: rgba(26, 80, 136, 0.12);
}

.rtd-avatar__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.rtd-avatar__initials {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	color: var(--rtd-accent);
	font-weight: 700;
	font-size: calc(var(--rtd-avatar) * 0.36);
	line-height: 1;
}

.rtd-card__identity {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.rtd-card__name {
	color: var(--rtd-heading);
	font-weight: 700;
	font-size: 1em;
	line-height: 1.3;
}

.rtd-card__designation,
.rtd-card__company {
	color: var(--rtd-muted);
	font-size: 0.85em;
	line-height: 1.4;
}

.rtd-card__logo {
	flex: 0 0 auto;
	margin-left: auto;
}

.rtd-card__logo-img {
	display: block;
	max-width: 96px;
	max-height: 44px;
	width: auto;
	height: auto;
	object-fit: contain;
}

/* -------------------------------------------------------------------------
 * Meta row: date, website, socials, product
 * ---------------------------------------------------------------------- */

.rtd-card__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 14px;
	margin-top: auto;
	padding-top: 12px;
	color: var(--rtd-muted);
	font-size: 0.82em;
}

.rtd-card__meta a,
.rtd-card__date {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--rtd-muted);
	text-decoration: none;
}

.rtd-card__meta a:hover,
.rtd-card__meta a:focus {
	color: var(--rtd-accent);
	text-decoration: underline;
}

.rtd-social {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: rgba(26, 80, 136, 0.08);
	color: var(--rtd-accent) !important;
	font-size: 13px;
	text-decoration: none !important;
	transition: background 0.2s ease, color 0.2s ease;
}

.rtd-social:hover,
.rtd-social:focus {
	background: var(--rtd-accent);
	color: #fff !important;
}

.rtd-card__product {
	font-weight: 600;
}

/* -------------------------------------------------------------------------
 * Video testimonial
 * ---------------------------------------------------------------------- */

.rtd-card__media {
	position: relative;
	flex: 0 0 auto;
	overflow: hidden;
	background: #0f172a;
	border-radius: var(--rtd-radius) var(--rtd-radius) 0 0;
}

.rtd--list .rtd-card__media {
	border-radius: var(--rtd-radius) 0 0 var(--rtd-radius);
}

.rtd-video {
	position: relative;
	display: block;
	width: 100%;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
	line-height: 0;
	aspect-ratio: 16 / 9;
	overflow: hidden;
}

.rtd-video__poster {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: inherit;
	transition: transform 0.3s ease, opacity 0.3s ease;
}

.rtd-video__poster--empty {
	background: linear-gradient(135deg, #1e293b, #0f172a);
}

.rtd-video:hover .rtd-video__poster,
.rtd-video:focus-visible .rtd-video__poster {
	transform: scale(1.03);
	opacity: 0.85;
}

.rtd-video__play {
	position: absolute;
	top: 50%;
	left: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 62px;
	height: 62px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.95);
	color: #0f172a;
	font-size: 20px;
	line-height: 1;
	transform: translate(-50%, -50%);
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
	transition: transform 0.2s ease;
}

.rtd-video__play i {
	margin-left: 3px;
}

.rtd-video:hover .rtd-video__play,
.rtd-video:focus-visible .rtd-video__play {
	transform: translate(-50%, -50%) scale(1.08);
}

/* -------------------------------------------------------------------------
 * Swiper
 * ---------------------------------------------------------------------- */

.rtd__slider {
	position: relative;
}

.rtd__swiper {
	position: relative;
}

.rtd__swiper .swiper-slide {
	height: auto;
}

.rtd__swiper .swiper-slide > .rtd-card {
	height: 100%;
}

.rtd-swiper__nav {
	position: absolute;
	top: 50%;
	z-index: 5;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--rtd-card-bg);
	color: var(--rtd-accent);
	font-size: 15px;
	cursor: pointer;
	transform: translateY(-50%);
	box-shadow: 0 4px 16px rgba(15, 23, 42, 0.18);
	transition: background 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.rtd-swiper__prev { left: -12px; }
.rtd-swiper__next { right: -12px; }

.rtd-swiper__nav:hover,
.rtd-swiper__nav:focus-visible {
	background: var(--rtd-accent);
	color: #fff;
}

.rtd-swiper__nav.swiper-button-disabled {
	opacity: 0.35;
	cursor: default;
}

.rtd-swiper__pagination {
	position: static;
	display: flex;
	justify-content: center;
	gap: 6px;
	margin-top: 18px;
}

.rtd-swiper__pagination .swiper-pagination-bullet {
	width: 8px;
	height: 8px;
	margin: 0 !important;
	background: var(--rtd-accent);
	opacity: 0.25;
	transition: opacity 0.2s ease, width 0.2s ease;
}

.rtd-swiper__pagination .swiper-pagination-bullet-active {
	width: 20px;
	border-radius: 8px;
	opacity: 1;
}

@media (max-width: 640px) {
	.rtd-swiper__prev { left: 4px; }
	.rtd-swiper__next { right: 4px; }

	.rtd-swiper__nav {
		width: 36px;
		height: 36px;
	}

	.rtd-card__body {
		padding: 22px;
	}
}

/* -------------------------------------------------------------------------
 * Average rating / count shortcodes
 * ---------------------------------------------------------------------- */

.rtd-average {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: 1em;
}

.rtd-average__value {
	color: var(--rtd-heading);
	font-weight: 700;
}

.rtd-average__out {
	color: var(--rtd-muted);
	font-size: 0.85em;
}

/* -------------------------------------------------------------------------
 * Themes
 * ---------------------------------------------------------------------- */

.rtd.rtd-theme-dark {
	--rtd-card-bg: #111827;
	--rtd-text: #cbd5e1;
	--rtd-heading: #f8fafc;
	--rtd-muted: #94a3b8;
	--rtd-border: rgba(255, 255, 255, 0.1);
}

.rtd-theme-dark .rtd-card {
	background: var(--rtd-card-bg);
}

.rtd-theme-dark .rtd-swiper__nav {
	background: #1f2937;
	color: #f8fafc;
}

.rtd.rtd-theme-plain {
	--rtd-card-bg: transparent;
}

.rtd-theme-plain .rtd-card {
	background: var(--rtd-card-bg);
	border: 0;
	box-shadow: none;
}

.rtd-theme-plain .rtd-card:hover {
	transform: none;
	box-shadow: none;
}

/* -------------------------------------------------------------------------
 * Inline video
 * ---------------------------------------------------------------------- */

.rtd-card__media iframe,
.rtd-card__media video,
.rtd-video__frame {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
	border: 0;
	background: #000;
}

.rtd-video--playing {
	background: #000;
}

/* -------------------------------------------------------------------------
 * Front-end submission form
 * ---------------------------------------------------------------------- */

.rtd-form-wrap {
	max-width: 900px;
	margin: 0 auto;
}

.rtd-form {
	--rtd-form-border: #dbe3ec;
	--rtd-form-muted: #64748b;
	box-sizing: border-box;
	padding: 28px;
	background: var(--rtd-card-bg, #fff);
	border: 1px solid var(--rtd-border, rgba(15, 23, 42, 0.08));
	border-radius: var(--rtd-radius, 14px);
	box-shadow: var(--rtd-shadow, 0 10px 30px rgba(15, 23, 42, 0.08));
	color: var(--rtd-text, #334155);
	font-size: var(--rtd-font-size, 16px);
}

.rtd-form *,
.rtd-form *::before,
.rtd-form *::after {
	box-sizing: border-box;
}

.rtd-form__heading {
	margin: 0 0 20px;
	color: var(--rtd-heading, #0f172a);
	font-size: 1.6em;
	line-height: 1.2;
}

.rtd-form__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px 18px;
}

.rtd-form__field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	margin: 0;
	min-width: 0;
}

.rtd-form__field--full {
	grid-column: 1 / -1;
}

.rtd-form__field label,
.rtd-form__rating legend {
	color: var(--rtd-heading, #0f172a);
	font-size: 14px;
	font-weight: 600;
}

.rtd-form__required {
	color: #dc2626;
}

.rtd-form__field input[type="text"],
.rtd-form__field input[type="email"],
.rtd-form__field input[type="url"],
.rtd-form__field input[type="file"],
.rtd-form__field select,
.rtd-form__field textarea {
	width: 100%;
	padding: 10px 12px;
	background: #fff;
	border: 1px solid var(--rtd-form-border);
	border-radius: 8px;
	color: inherit;
	font: inherit;
	line-height: 1.4;
}

.rtd-form__field input[type="file"] {
	padding: 8px;
}

.rtd-form__field input:focus,
.rtd-form__field select:focus,
.rtd-form__field textarea:focus {
	border-color: var(--rtd-accent, #1a5088);
	outline: 2px solid var(--rtd-accent, #1a5088);
	outline-offset: 1px;
}

.rtd-form__field textarea {
	min-height: 150px;
	resize: vertical;
}

.rtd-form__hint {
	color: var(--rtd-form-muted);
	font-size: 12px;
	line-height: 1.4;
}

.rtd-form__rating {
	margin: 0;
	padding: 0;
	border: 0;
}

.rtd-form__rating legend {
	margin-bottom: 6px;
	padding: 0;
}

.rtd-form__stars {
	display: inline-flex;
	flex-direction: row-reverse;
	justify-content: flex-end;
	gap: 4px;
}

.rtd-form__stars input {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
}

.rtd-form__stars label {
	color: #d7dfe9;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	transition: color 0.15s ease;
}

.rtd-form__stars input:checked ~ label,
.rtd-form__stars label:hover,
.rtd-form__stars label:hover ~ label {
	color: var(--rtd-star, #f5a623);
}

.rtd-form__consent {
	margin: 18px 0 0;
	font-size: 14px;
}

.rtd-form__consent label {
	display: flex;
	align-items: flex-start;
	gap: 10px;
}

.rtd-form__consent input {
	margin-top: 3px;
}

.rtd-form__consent a {
	color: var(--rtd-accent, #1a5088);
}

.rtd-form__submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-top: 20px;
	padding: 12px 24px;
	background: var(--rtd-accent, #1a5088);
	border: 0;
	border-radius: 8px;
	color: #fff;
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	transition: opacity 0.15s ease, transform 0.15s ease;
}

.rtd-form__submit:hover,
.rtd-form__submit:focus-visible {
	opacity: 0.9;
	transform: translateY(-1px);
}

.rtd-form__submit:disabled {
	opacity: 0.6;
	cursor: wait;
	transform: none;
}

.rtd-form__message {
	display: none;
	margin: 16px 0 0;
	padding: 12px 14px;
	border-radius: 8px;
	font-size: 14px;
	line-height: 1.5;
}

.rtd-form__message.is-success {
	display: block;
	background: #ecfdf3;
	border: 1px solid #bbf7d0;
	color: #166534;
}

.rtd-form__message.is-error {
	display: block;
	background: #fef2f2;
	border: 1px solid #fecaca;
	color: #991b1b;
}

.rtd-form__hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

@media (max-width: 640px) {
	.rtd-form {
		padding: 20px;
	}

	.rtd-form__grid {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* -------------------------------------------------------------------------
 * RTL
 * ---------------------------------------------------------------------- */

.rtd[dir="rtl"] .rtd-card,
body.rtl .rtd-card {
	text-align: right;
}

.rtd[dir="rtl"] .rtd-card__logo,
body.rtl .rtd-card__logo {
	margin-right: auto;
	margin-left: 0;
}

/* -------------------------------------------------------------------------
 * Floating average rating badge
 * ---------------------------------------------------------------------- */

.rtd-float {
	position: fixed;
	z-index: 9990;
	display: inline-flex;
	align-items: center;
	gap: 10px;
	max-width: calc(100vw - (var(--rtd-float-x, 24px) * 2));
	padding: 10px 14px;
	border: 1px solid var(--rtd-border);
	border-radius: 999px;
	background: #fff;
	box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
	color: var(--rtd-text, #334155);
	line-height: 1.2;
	text-decoration: none;
}

.rtd-float--bottom-right {
	right: var(--rtd-float-x, 24px);
	bottom: var(--rtd-float-y, 24px);
}

.rtd-float--bottom-left {
	left: var(--rtd-float-x, 24px);
	bottom: var(--rtd-float-y, 24px);
}

.rtd-float--top-right {
	right: var(--rtd-float-x, 24px);
	top: var(--rtd-float-y, 24px);
}

.rtd-float--top-left {
	left: var(--rtd-float-x, 24px);
	top: var(--rtd-float-y, 24px);
}

.rtd-float--dark {
	background: #0f172a;
	border-color: rgba(255, 255, 255, 0.12);
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35);
	color: #e2e8f0;
	--rtd-heading: #f8fafc;
	--rtd-muted: #cbd5e1;
}

.rtd-float__value {
	color: var(--rtd-heading);
	font-size: 1.25em;
	font-weight: 700;
	line-height: 1;
}

.rtd-float__details {
	display: flex;
	flex-direction: column;
	gap: 3px;
	min-width: 0;
}

.rtd-float__stars {
	font-size: 0.8em;
}

.rtd-float__meta {
	color: var(--rtd-muted);
	font-size: 0.75em;
	white-space: nowrap;
}

@media (max-width: 480px) {
	.rtd-float {
		gap: 8px;
		padding: 8px 11px;
	}

	.rtd-float__value {
		font-size: 1.1em;
	}
}

@media print {
	.rtd-float {
		display: none !important;
	}
}

/* -------------------------------------------------------------------------
 * Theme / page-builder button reset
 *
 * Themes and Elementor often style every <button> globally. The video poster
 * button and the slider arrows are structural elements, not theme buttons, so
 * keep their borders and colours under plugin control.
 * ---------------------------------------------------------------------- */

.rtd .rtd-card--video,
.rtd .rtd-card--video:hover,
.rtd .rtd-card--video:focus,
.rtd .rtd-card--video:focus-visible {
	border: 0 !important;
	outline: 0 !important;
}

.rtd .rtd-video {
	border: 0 !important;
	border-radius: inherit;
	background: none;
	padding: 0;
	color: inherit;
	font: inherit;
	line-height: 0;
	text-transform: none;
	box-shadow: none;
}

.rtd .rtd-video:hover,
.rtd .rtd-video:focus,
.rtd .rtd-video:focus-visible {
	border: 0 !important;
	outline: 0;
	background: none;
	box-shadow: none;
}

.rtd .rtd-video:focus-visible .rtd-video__play {
	box-shadow:
		0 0 0 3px rgba(255, 255, 255, 0.9),
		0 6px 20px rgba(0, 0, 0, 0.35);
}

.rtd .rtd-swiper__nav {
	width: 42px;
	height: 42px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--rtd-card-bg);
	color: var(--rtd-accent);
	font-size: 15px;
	font-weight: 400;
	line-height: 1;
	text-transform: none;
	box-shadow: 0 4px 16px rgba(15, 23, 42, 0.18);
}

.rtd .rtd-swiper__nav:hover,
.rtd .rtd-swiper__nav:focus-visible {
	border: 0;
	background: var(--rtd-accent);
	color: #fff;
}

.rtd.rtd-theme-dark .rtd-swiper__nav {
	background: #1f2937;
	color: #f8fafc;
}

.rtd.rtd-theme-dark .rtd-swiper__nav:hover,
.rtd.rtd-theme-dark .rtd-swiper__nav:focus-visible {
	background: var(--rtd-accent);
	color: #fff;
}
