/**
 * Storefront — Testimonial Slider widget.
 *
 * Nilai visual ditranskrip persis dari `akunika-official-v2.html`
 * section #testimoni (spec §5) — JANGAN didesain ulang. Warna brand
 * dipakai dari CSS variable HALAMAN (`--p`, `--a`, dst, dengan fallback
 * di tiap `var()`) lewat variable widget sendiri `--stfr-ts-*` supaya
 * Tab Gaya Elementor bisa menimpa tanpa mengubah default kalau tidak
 * disentuh (spec §4 "Tab Style").
 *
 * Reset pakai `.stfr-ts *` (BUKAN daftar `.stfr-ts h3, .stfr-ts div,
 * ...`) — pelajaran dari widget lain di plugin ini: selector class+tag
 * punya spesifisitas lebih tinggi dari selector 1-class komponen,
 * sehingga reset-nya menang terlepas urutan di file.
 */

.stfr-ts {
	--stfr-ts-p: var( --p, #2D5A4D );
	--stfr-ts-a: var( --a, #D4B038 );
	--stfr-ts-a-d: var( --a-d, #A9872B );
	--stfr-ts-n2: var( --n2, #D8DEDB );
	--stfr-ts-n5: var( --n5, #8A9490 );
	--stfr-ts-n7: var( --n7, #4A5550 );
	--stfr-ts-n9: var( --n9, #1A1F1D );
	--stfr-ts-sage: var( --sage, #EAF0EC );
	--stfr-ts-radius: 20px;

	position: relative;
	font-family: 'Inter Tight', system-ui, sans-serif;
}

.stfr-ts * {
	box-sizing: border-box;
}

.stfr-ts button {
	font: inherit;
	color: inherit;
}

.stfr-ts--full {
	width: 100vw;
	margin-left: calc( 50% - 50vw );
}

.stfr-ts__track {
	position: relative;
	touch-action: pan-y;
	user-select: none;
	cursor: grab;
	outline: none;
	margin-bottom: -10px;
}

.stfr-ts__track.is-dragging {
	cursor: grabbing;
}

.stfr-ts__track:focus-visible {
	outline: 2px solid var( --stfr-ts-p );
	outline-offset: 4px;
}

.stfr-ts__card {
	position: absolute;
	left: 50%;
	top: 50%;
	display: flex;
	flex-direction: column;
	gap: 16px;
	padding: 26px;
	border-radius: var( --stfr-ts-radius );
	background: rgba( 255, 255, 255, .55 );
	border: 1px solid rgba( 216, 222, 219, .7 );
	color: var( --stfr-ts-n7 );
	filter: saturate( .25 );
	opacity: .7;
	z-index: 1;
	will-change: transform;
	contain: layout style;
}

/* Transisi HANYA aktif setelah `.ready` (spec §5.3) — supaya posisi
   awal kartu saat halaman dimuat tidak ikut beranimasi dari 0. */
.stfr-ts__track.ready .stfr-ts__card {
	transition: transform .55s cubic-bezier( .22, .8, .24, 1 ), width .55s cubic-bezier( .22, .8, .24, 1 ), opacity .45s, background .45s, border-color .45s, box-shadow .55s;
}

.stfr-ts__card.nt {
	transition: none !important;
}

.stfr-ts__card.far {
	opacity: 0;
	pointer-events: none;
}

.stfr-ts__card.act {
	background: #fff;
	border-color: var( --stfr-ts-p );
	box-shadow: 0 0 0 1px var( --stfr-ts-p ), 0 34px 70px -28px rgba( 29, 59, 50, .38 ), 0 12px 28px -14px rgba( 29, 59, 50, .18 );
	color: var( --stfr-ts-n9 );
	filter: none;
	opacity: 1;
	z-index: 2;
}

.stfr-ts__card[aria-hidden="true"] {
	/* klon infinite-loop — tetap dirender (buat posisi), tapi disembunyikan dari pembaca layar. */
}

.stfr-ts__top {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 4px 8px;
}

.stfr-ts__stars {
	color: var( --stfr-ts-a );
	letter-spacing: 1px;
	font-size: 16px;
	line-height: 1;
	white-space: nowrap;
	flex: none;
}

.stfr-ts__star.is-empty {
	opacity: .28;
}

.stfr-ts__card .stfr-ts__stars,
.stfr-ts__card .stfr-ts__pill,
.stfr-ts__card .stfr-ts__avatar {
	filter: inherit;
	opacity: inherit;
}

.stfr-ts__since {
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: .08em;
	color: var( --stfr-ts-n5 );
	white-space: nowrap;
}

.stfr-ts__card.act .stfr-ts__since {
	color: var( --stfr-ts-a-d );
}

/* !important pada align-items: lihat catatan sama di testimonial-grid-widget.css
   — tanpa ini ikon pill tidak center vertikal, ketimpa reset tema/Elementor lain. */
.stfr-ts__pill {
	--stfr-ts-pill-hue: 74, 85, 80;
	display: inline-flex;
	align-items: center !important;
	gap: 5px;
	align-self: flex-start;
	padding: 4px 12px;
	border-radius: 99px;
	font-size: 12px;
	font-weight: 500;
	white-space: nowrap;
	background: rgba( var( --stfr-ts-pill-hue ), .14 );
	color: rgb( var( --stfr-ts-pill-hue ) );
}

.stfr-ts__pill-icon {
	width: 13px;
	height: 13px;
	flex: none;
}

.stfr-ts__pill-icon svg {
	width: 100%;
	height: 100%;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* Nilai RGB tiap varian — dipakai sebagai teks (opaque) DAN warna latar
   (versi tipis, 14% opacity) dari hue yang sama, supaya teks & background
   selalu terasa satu keluarga warna (bukan kombinasi acak). */
.stfr-ts__pill--default {
	--stfr-ts-pill-hue: 74, 85, 80;
}

.stfr-ts__pill--sage {
	--stfr-ts-pill-hue: 45, 90, 77;
}

.stfr-ts__pill--gold {
	--stfr-ts-pill-hue: 169, 135, 43;
}

.stfr-ts__pill--dark {
	--stfr-ts-pill-hue: 29, 59, 50;
}

.stfr-ts__pill--purple {
	--stfr-ts-pill-hue: 109, 74, 175;
}

.stfr-ts__quote {
	margin: 0;
	font-size: 16px;
	line-height: 1.5;
	quotes: none;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
	overflow: hidden;
}

.stfr-ts__quote::before,
.stfr-ts__quote::after {
	content: none;
}

.stfr-ts__quote.is-open {
	-webkit-line-clamp: unset;
	overflow: visible;
}

/* !important pada border/background/padding: ini <button>, bukan <a> —
   reset tombol tema/kit Elementor bisa bocor masuk kalau tidak dikunci
   (pola sama dengan tombol lain di plugin ini), harus SELALU transparan. */
.stfr-ts__quote .stfr-ts__more {
	display: inline-block;
	margin-left: 4px;
	border: 0 !important;
	background: none !important;
	padding: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	font-size: 12px;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: .08em;
	white-space: nowrap;
	text-decoration: none;
	color: var( --stfr-ts-n5 );
	cursor: pointer;
}

.stfr-ts__quote .stfr-ts__more.is-less svg {
	transform: rotate( -90deg );
}

.stfr-ts__card.act .stfr-ts__quote .stfr-ts__more {
	color: var( --stfr-ts-a-d );
}

.stfr-ts__quote .stfr-ts__more svg {
	display: inline-block;
	vertical-align: -1px;
	width: 12px;
	height: 12px;
	margin-left: 2px;
	transition: transform .2s;
}

.stfr-ts__quote .stfr-ts__more:hover {
	background: none !important;
	text-decoration: underline;
}

.stfr-ts__quote .stfr-ts__more:hover svg {
	transform: translateX( 3px );
}

.stfr-ts__who {
	display: flex;
	align-items: center;
	gap: 12px;
	padding-top: 16px;
	border-top: 1px solid var( --stfr-ts-n2 );
	margin-top: auto;
}

.stfr-ts__avatar {
	flex: 0 0 auto;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	background: var( --stfr-ts-sage );
	color: var( --stfr-ts-p );
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 14px;
	font-weight: 600;
}

.stfr-ts__who-text {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.stfr-ts__name {
	font-size: 15px;
	font-weight: 500;
	color: inherit;
}

.stfr-ts__role {
	font-size: 13px;
	color: var( --stfr-ts-n5 );
}

/* "+ Keranjang" — HANYA muncul di kartu yang sedang aktif/tengah
   (spec: "cukup dimunculkan pada widget highlight yang aktif"). */
.stfr-ts__add-cart {
	display: none;
	margin-left: auto;
	flex: none;
	align-items: center;
	gap: 6px;
	white-space: nowrap;
	border: 1px solid var( --stfr-ts-p );
	border-radius: 99px;
	padding: 7px 14px;
	font-size: 12.5px;
	font-weight: 500;
	color: var( --stfr-ts-p );
	background: transparent;
	text-decoration: none;
	transition: background .15s, color .15s;
}

.stfr-ts__card.act .stfr-ts__add-cart {
	display: inline-flex;
}

.stfr-ts__add-cart:hover {
	background: var( --stfr-ts-p );
	color: #fff;
}

.stfr-ts__add-cart-icon {
	width: 15px;
	height: 15px;
	flex: none;
}

/* Mobile: jadi ikon saja, tanpa label (spec perbaikan terbaru) — teks
   tetap ada di markup untuk pembaca layar lewat `aria-label` pada <a>. */
@media ( max-width: 620px ) {
	.stfr-ts__add-cart {
		gap: 0;
		padding: 8px;
		border-radius: 50%;
	}

	.stfr-ts__add-cart span {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect( 0 0 0 0 );
		white-space: nowrap;
	}
}

/* ---- Navigasi ---- */

.stfr-ts__nav {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 16px;
	margin-top: 24px;
}

.stfr-ts__arrow {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	border: 1px solid var( --stfr-ts-n2 );
	background: #fff;
	color: var( --stfr-ts-n9 );
	cursor: pointer;
	transition: background .2s, color .2s, border-color .2s;
}

.stfr-ts__arrow:hover {
	background: var( --stfr-ts-p );
	border-color: var( --stfr-ts-p );
	color: #fff;
}

.stfr-ts__dots {
	display: flex;
	align-items: center;
	gap: 8px;
}

.stfr-ts__dot {
	width: 8px;
	height: 8px;
	border-radius: 99px;
	border: none;
	padding: 0;
	background: var( --stfr-ts-n2 );
	cursor: pointer;
	transition: width .3s, background .3s;
}

.stfr-ts__dot.is-on {
	width: 26px;
	background: var( --stfr-ts-a );
}

/* ---- Editor Elementor: label mode demo (spec §9) ---- */

.stfr-ts__demo-badge {
	position: absolute;
	top: 8px;
	left: 8px;
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .06em;
	background: #B3261E;
	color: #fff;
	padding: 2px 8px;
	border-radius: 999px;
	z-index: 3;
}

@media ( prefers-reduced-motion: reduce ) {
	.stfr-ts__card {
		transition: none !important;
	}
}

@media ( max-width: 620px ) {
	.stfr-ts__nav {
		margin-top: 16px;
	}
}
