/*
 * CG Insumos Testimonios
 * Visual base: carrusel-testimonios/index.html
 * Todo queda scopeado al wrapper para convivir con Elementor y el tema activo.
 */

.cg-testimonios {
	--cg-superficie: #ffffff;
	--cg-tinta: #2e242b;
	--cg-tinta-suave: #6d5c66;
	--cg-tinta-apagada: #8a7883;
	--cg-linea: #f3e6ec;
	--cg-comilla: #f6e3eb;
	--cg-punto: #e9d4de;
	--cg-acento: #c14e78;
	--cg-acento-suave: rgb(193 78 120 / 10%);
	--cg-sombra: 0 30px 60px -38px rgb(150 60 95 / 28%);
	--cg-radio-superficie: 24px;
	--cg-radio-interior: 16px;
	--cg-ease: cubic-bezier(0.16, 1, 0.3, 1);

	box-sizing: border-box;
	width: 100%;
	padding-block: clamp(4.5rem, 9vw, 7.5rem);
	background: transparent;
	color: var(--cg-tinta);
	font-family: "Avenir Next", Avenir, system-ui, sans-serif;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
	color-scheme: light;
}

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

.cg-testimonios :focus-visible {
	outline: 2px solid var(--cg-acento);
	outline-offset: 3px;
	border-radius: 4px;
}

.cg-testimonios__marco {
	max-width: 1160px;
	margin-inline: auto;
	padding-inline: clamp(1rem, 4vw, 2rem);
}

.cg-testimonios__cabecera {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 1rem 1.5rem;
	width: 100%;
	margin-bottom: 40px;
	padding-inline: clamp(1rem, 4vw, 2rem);
}

.cg-testimonios__titulo {
	margin: 0;
	color: var(--cg-tinta);
	font-family: "Playfair Display", Georgia, serif;
	font-size: 29px;
	font-weight: 500;
	letter-spacing: -0.02em;
	line-height: 1.12;
}

.cg-testimonios__nav {
	display: flex;
	flex-shrink: 0;
	gap: 8px;
}

/*
 * Flechas replicadas del encabezado de elementor-product-carousel (2).zip:
 * círculos blancos de 36px, borde gris fino y chevrón dibujado con bordes.
 * Se mantienen scopeadas para que el shortcode no dependa del plugin fuente.
 */
.cg-testimonios__boton {
	position: static;
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	margin: 0;
	padding: 0;
	border: 1px solid #e5e7eb;
	border-radius: 50%;
	background: #fff;
	box-shadow: none;
	cursor: pointer;
	transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

.cg-testimonios__boton::after {
	content: "";
	display: block;
	width: 8px;
	height: 8px;
	border-top: 1.5px solid #4b5563;
	border-right: 1.5px solid #4b5563;
	border-radius: 1px;
	font-size: 0;
}

.cg-testimonios__boton--anterior::after {
	transform: rotate(-135deg);
	margin-right: -3px;
}

.cg-testimonios__boton--siguiente::after {
	transform: rotate(45deg);
	margin-left: -3px;
}

.cg-testimonios__boton:hover:not(:disabled) {
	border-color: #9ca3af;
	background: #f9fafb;
	box-shadow: none;
	transform: none;
}

.cg-testimonios__boton:focus-visible {
	/* Igual que el anillo visible del componente fuente al tomar foco. */
	outline: 2px solid #111827;
	outline-offset: 3px;
	border-radius: 50%;
}

.cg-testimonios__boton:disabled {
	opacity: 0.4;
	cursor: default;
	pointer-events: none;
}

@media (max-width: 600px) {
	.cg-testimonios__boton {
		width: 32px;
		height: 32px;
	}
}

.cg-testimonios__ventana {
	overflow: hidden;
	touch-action: pan-y;
	cursor: grab;
}

.cg-testimonios__ventana.is-dragging {
	cursor: grabbing;
}

.cg-testimonios__pista {
	display: flex;
	margin: 0;
	padding: 0;
	list-style: none;
	transform: translate3d(0, 0, 0);
	will-change: transform;
	transition: transform 0.7s var(--cg-ease);
}

.cg-testimonios__diapositiva {
	flex: 0 0 100%;
	min-width: 0;
	padding-inline: 3px;
}

.cg-testimonios__tarjeta {
	display: grid;
	grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
	gap: clamp(1.5rem, 3.5vw, 3rem);
	min-height: 460px;
	padding: clamp(1.1rem, 2.5vw, 2rem);
	border: 1px solid var(--cg-linea);
	border-radius: var(--cg-radio-superficie);
	background: var(--cg-superficie);
	box-shadow: var(--cg-sombra);
}

.cg-testimonios__foto {
	position: relative;
	min-height: 0;
	margin: 0;
	overflow: hidden;
	border-radius: var(--cg-radio-interior);
	background: var(--cg-acento-suave);
}

.cg-testimonios__foto img {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	padding: clamp(1.25rem, 2.5vw, 1.75rem);
	object-fit: contain;
	-webkit-user-drag: none;
	user-select: none;
}

.cg-testimonios__opinion {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: clamp(1.5rem, 3vw, 2.5rem) clamp(0.25rem, 2vw, 1.5rem)
		clamp(0.5rem, 1.5vw, 1rem);
}

.cg-testimonios__comilla {
	position: absolute;
	top: clamp(0.5rem, 2vw, 1.75rem);
	left: clamp(0.25rem, 2vw, 1.5rem);
	color: var(--cg-comilla);
	font-size: clamp(5.5rem, 9vw, 8rem);
	font-weight: 900;
	line-height: 1;
	pointer-events: none;
	user-select: none;
}

.cg-testimonios__estrellas {
	position: relative;
	display: inline-flex;
	gap: 0.15rem;
	color: var(--cg-acento);
	font-size: 1.35rem;
	line-height: 1;
}

.cg-testimonios__cita {
	position: relative;
	margin: 0;
}

.cg-testimonios__cita p {
	max-width: 34ch;
	margin: 1.1rem 0 0;
	color: var(--cg-tinta);
	font-family: "Playfair Display", Georgia, serif;
	font-size: clamp(1.3rem, 2.4vw, 1.8rem);
	font-weight: 400;
	letter-spacing: -0.01em;
	line-height: 1.35;
}

.cg-testimonios__pie {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	flex-wrap: wrap;
	gap: 0.75rem 1.5rem;
	margin-top: clamp(1.5rem, 3vw, 2.25rem);
	padding-top: 1.25rem;
	border-top: 1px solid var(--cg-linea);
}

.cg-testimonios__fuente {
	color: var(--cg-tinta-suave);
	font-size: 0.9rem;
	font-weight: 500;
	text-decoration: none;
	text-underline-offset: 5px;
	transition: color 0.25s var(--cg-ease), text-decoration-color 0.25s var(--cg-ease);
}

a.cg-testimonios__fuente:hover {
	color: var(--cg-acento);
	text-decoration: underline;
	text-decoration-color: var(--cg-acento);
}

.cg-testimonios__contenido-anim {
	opacity: 0;
	transform: translateY(16px);
	transition: opacity 0.6s var(--cg-ease), transform 0.6s var(--cg-ease);
}

.cg-testimonios__estrellas.cg-testimonios__contenido-anim {
	transition-delay: 0.05s;
}

.cg-testimonios__cita.cg-testimonios__contenido-anim {
	transition-delay: 0.12s;
}

.cg-testimonios__pie.cg-testimonios__contenido-anim {
	transition-delay: 0.2s;
}

.cg-testimonios__diapositiva.is-active .cg-testimonios__contenido-anim {
	opacity: 1;
	transform: none;
}

.cg-testimonios__puntos {
	display: flex;
	justify-content: center;
	gap: 0.35rem;
	margin-top: clamp(1.75rem, 3.5vw, 2.5rem);
}

.cg-testimonios__punto {
	display: grid;
	place-items: center;
	width: 26px;
	height: 26px;
	padding: 0;
	border: 0;
	background: transparent;
	box-shadow: none;
	cursor: pointer;
	appearance: none;
}

.cg-testimonios__punto::before {
	content: "";
	display: block;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--cg-punto);
	transition: width 0.35s var(--cg-ease), background 0.35s var(--cg-ease);
}

.cg-testimonios__punto[aria-current="true"]::before {
	width: 24px;
	border-radius: 999px;
	background: var(--cg-acento);
}

.cg-testimonios__punto:hover::before {
	background: var(--cg-tinta-apagada);
}

.cg-testimonios__punto[aria-current="true"]:hover::before {
	background: var(--cg-acento);
}

@media (max-width: 820px) {
	.cg-testimonios__tarjeta {
		grid-template-columns: 1fr;
		min-height: 0;
		gap: 1.25rem;
		padding: 1rem 1rem 1.5rem;
	}

	.cg-testimonios__foto {
		aspect-ratio: 4 / 3;
	}

	.cg-testimonios__opinion {
		padding: 0.5rem 0.75rem 0;
	}

	.cg-testimonios__comilla {
		display: none;
	}

	.cg-testimonios__cita p {
		max-width: none;
		margin-top: 0.75rem;
	}

	.cg-testimonios__pie {
		align-items: flex-start;
		flex-direction: column;
		gap: 0.6rem;
	}
}

@media (max-width: 420px) {
	.cg-testimonios__cabecera {
		gap: 0.75rem 1rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.cg-testimonios__pista,
	.cg-testimonios__contenido-anim,
	.cg-testimonios__punto::before,
	.cg-testimonios__boton,
	.cg-testimonios__fuente {
		transition: none;
	}

	.cg-testimonios__contenido-anim {
		opacity: 1;
		transform: none;
	}
}
