/* ==========================================================================
   Autofamily · Carrusel de reseñas de Google
   3 tarjetas por vista en escritorio, 1 en móvil.
   Flechas verdes a los laterales y bullets con el estilo del hero slider.
   ========================================================================== */

.af-reviews {
	--af-reviews-gap: 20px;
	--af-reviews-por-vista: 3;
	--af-reviews-gutter: 64px;
	--af-reviews-radio: 16px;
	--af-reviews-card-bg: var(--negro, #000000);
	--af-reviews-card-borde: #1E1E1E;
	--af-reviews-acento: var(--verde, #79d100);
	--af-reviews-texto: var(--blanco, #F8F8F6);
	--af-reviews-muted: #9A9A94;
	--af-reviews-arrow-size: 44px;
	--af-reviews-arrow-bg: var(--verde, #79d100);
	--af-reviews-arrow-color: var(--negro, #000000);
	--af-reviews-dot: #D9D9D9;
	--af-reviews-dot-active: var(--verde, #79d100);
	--af-reviews-dot-bg: #1A1A1A;
	width: 100%;
	max-width: 100%;
}

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

.af-reviews__viewport {
	position: relative;
	padding: 0 var(--af-reviews-gutter);
}

.af-reviews__track {
	display: flex;
	gap: var(--af-reviews-gap);
	align-items: stretch;
	min-width: 0;
	max-width: 100%;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
}

.af-reviews__track::-webkit-scrollbar {
	display: none;
}

.af-reviews__card {
	flex: 0 0 calc((100% - (var(--af-reviews-por-vista) - 1) * var(--af-reviews-gap)) / var(--af-reviews-por-vista));
	min-width: 0;
	scroll-snap-align: start;
	display: flex;
	flex-direction: column;
	gap: 14px;
	padding: 24px;
	border: 1px solid var(--af-reviews-card-borde);
	border-radius: var(--af-reviews-radio);
	background: var(--af-reviews-card-bg);
	color: var(--af-reviews-texto);
	text-decoration: none;
	transition: border-color 0.2s ease;
}

a.af-reviews__card:hover,
a.af-reviews__card:focus-visible {
	border-color: var(--af-reviews-acento);
}

.af-reviews__header {
	display: flex;
	align-items: center;
	gap: 12px;
}

.af-reviews__avatar {
	flex: none;
	width: 48px;
	height: 48px;
	border-radius: 50%;
	border: 2px solid var(--af-reviews-acento);
	object-fit: cover;
}

.af-reviews__avatar--inicial {
	display: flex;
	align-items: center;
	justify-content: center;
	background: #111111;
	color: var(--af-reviews-acento);
	font-family: 'Montserrat', sans-serif;
	font-weight: 700;
	font-size: 18px;
	line-height: 1;
}

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

.af-reviews__author {
	font-family: 'Montserrat', sans-serif;
	font-weight: 700;
	font-size: 16px;
	line-height: 1.2;
	color: var(--af-reviews-acento);
}

.af-reviews__time {
	font-family: 'DM Sans', sans-serif;
	font-size: 13px;
	color: var(--af-reviews-muted);
}

.af-reviews__text {
	margin: 0;
	font-family: 'DM Sans', sans-serif;
	font-size: 15px;
	line-height: 1.6;
	color: var(--af-reviews-texto);
	display: -webkit-box;
	-webkit-line-clamp: 5;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.af-reviews__stars {
	margin-top: auto;
	display: flex;
	gap: 4px;
	font-size: 17px;
	line-height: 1;
	color: var(--af-reviews-acento);
}

.af-reviews__star--vacia {
	opacity: 0.35;
}

/* ---------- Resumen general ---------- */
.af-reviews__resumen {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	margin-bottom: 24px;
	color: var(--af-reviews-texto);
	text-decoration: none;
}

.af-reviews__resumen-nota {
	font-family: 'Montserrat', sans-serif;
	font-size: 28px;
	font-weight: 700;
	line-height: 1;
}

/* Las estrellas se rellenan por porcentaje: 4,7 deja la quinta a medias. */
.af-reviews__resumen-estrellas {
	position: relative;
	display: inline-block;
	font-size: 20px;
	line-height: 1;
	letter-spacing: 2px;
	white-space: nowrap;
	color: var(--af-reviews-muted);
}

.af-reviews__resumen-relleno {
	position: absolute;
	top: 0;
	left: 0;
	width: var(--af-reviews-pct, 0%);
	overflow: hidden;
	color: var(--af-reviews-acento);
}

.af-reviews__resumen-total {
	font-size: 15px;
	color: var(--af-reviews-muted);
	transition: color 0.2s ease;
}

a.af-reviews__resumen:hover .af-reviews__resumen-total,
a.af-reviews__resumen:focus-visible .af-reviews__resumen-total {
	color: var(--af-reviews-acento);
}

@media (max-width: 720px) {
	.af-reviews__resumen {
		flex-wrap: wrap;
		gap: 8px;
		margin-bottom: 16px;
	}

	.af-reviews__resumen-nota {
		font-size: 24px;
	}
}

/* ---------- Flechas ---------- */
.af-reviews__arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 2;
	width: var(--af-reviews-arrow-size);
	height: var(--af-reviews-arrow-size);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--af-reviews-arrow-bg);
	color: var(--af-reviews-arrow-color);
	cursor: pointer;
}

.af-reviews__arrow svg {
	width: 45%;
	height: 45%;
}

.af-reviews__arrow--prev {
	left: 0;
}

.af-reviews__arrow--next {
	right: 0;
}

/* ---------- Bullets ---------- */
.af-reviews__dots {
	width: fit-content;
	margin: 24px auto 0;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 10px;
	border-radius: 999px;
	background: var(--af-reviews-dot-bg);
}

.af-reviews__dot {
	width: 8px;
	height: 8px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: var(--af-reviews-dot);
	cursor: pointer;
	transition: width 0.2s ease, background-color 0.2s ease;
}

.af-reviews__dot.is-active {
	width: 24px;
	background: var(--af-reviews-dot-active);
}

.af-reviews--sin-controles .af-reviews__arrow,
.af-reviews--sin-controles .af-reviews__dots {
	display: none;
}

.af-reviews-aviso {
	margin: 0;
	padding: 12px 16px;
	border: 1px solid #1E1E1E;
	border-radius: 8px;
	font-family: 'DM Sans', sans-serif;
	font-size: 14px;
}

@media (max-width: 720px) {
	.af-reviews {
		--af-reviews-por-vista: 1;
		--af-reviews-gap: 12px;
		--af-reviews-gutter: 44px;
		--af-reviews-arrow-size: 34px;
	}

	.af-reviews__card {
		padding: 20px;
	}

	.af-reviews__dots {
		margin-top: 20px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.af-reviews__track {
		scroll-behavior: auto;
	}

	.af-reviews__card,
	.af-reviews__dot {
		transition: none;
	}
}
