/**
 * Negreiros Reseñas de Google — estilos del carrusel.
 * Todas las reglas viven bajo .ngr para no invadir el tema.
 *
 * Los colores neutros leen primero las variables del tema de boterianegreiros.com
 * (--bn-tinta, --bn-crema, --bn-f-titulo…). Si el tema cambia su paleta, el
 * carrusel la sigue; si el plugin se usa en otro sitio, caen los valores de respaldo.
 */

.ngr {
	--ngr-accent: #b85c1e;
	--ngr-star: #c9a84c;
	--ngr-radius: 4px;
	--ngr-cols-d: 3;
	--ngr-cols-t: 2;
	--ngr-cols-m: 1;
	--ngr-cols: var(--ngr-cols-d);

	--ngr-ink: var(--bn-tinta, #241c18);
	--ngr-muted: var(--bn-tinta-60, #5c514a);
	--ngr-surface: #ffffff;
	--ngr-bg: transparent;
	--ngr-field-bg: #ffffff;
	--ngr-line: var(--bn-linea, rgba(36, 28, 24, 0.12));
	--ngr-line-strong: rgba(36, 28, 24, 0.22);
	--ngr-shadow: 0 1px 2px rgba(36, 28, 24, 0.05), 0 14px 30px -20px rgba(36, 28, 24, 0.4);
	--ngr-gap: 20px;
	--ngr-error: #a8322a;

	/* Acento para texto: más oscuro que el de fondo para cumplir contraste AA sobre crema. */
	--ngr-accent-ink: color-mix(in srgb, var(--ngr-accent) 80%, #000);
	--ngr-accent-hover: color-mix(in srgb, var(--ngr-accent) 80%, #000);

	--ngr-f-title: var(--bn-f-titulo, inherit);
	--ngr-f-button: var(--bn-f-boton, inherit);
	--ngr-ease: var(--bn-transicion, 0.28s cubic-bezier(0.2, 0.6, 0.2, 1));

	position: relative;
	box-sizing: border-box;
	padding: clamp(4px, 2vw, 8px) 0;
	color: var(--ngr-ink);
	background: var(--ngr-bg);
	font-family: inherit;
	container-type: inline-size;
}

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

/* Crema: el bloque trae su propio fondo, como las tarjetas .bn-card del tema. */
.ngr--soft {
	--ngr-bg: var(--bn-crema, #f0e7d9);
	--ngr-surface: var(--bn-crema-suave, #faf6f0);
	--ngr-field-bg: #ffffff;
	padding: clamp(24px, 4vw, 48px);
	border-radius: var(--ngr-radius);
}

/* Cuero oscuro: fondo tinta con tarjetas marrón profundo. */
.ngr--dark {
	--ngr-ink: #f4ede2;
	--ngr-muted: #cdbfae;
	--ngr-surface: #2f2520;
	--ngr-bg: var(--bn-tinta, #241c18);
	--ngr-field-bg: #241c18;
	--ngr-line: rgba(244, 237, 226, 0.14);
	--ngr-line-strong: rgba(244, 237, 226, 0.3);
	--ngr-shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 16px 32px -20px rgba(0, 0, 0, 0.9);
	--ngr-accent-ink: #d8b98c;
	--ngr-error: #f2a7a0;
	padding: clamp(24px, 4vw, 48px);
	border-radius: var(--ngr-radius);
}

/* Cristal: para colocarlo sobre una foto con capa oscura (sección .bn-testimonios del tema). */
.ngr--glass {
	--ngr-ink: #ffffff;
	--ngr-muted: rgba(255, 255, 255, 0.82);
	--ngr-surface: rgba(255, 255, 255, 0.07);
	--ngr-bg: transparent;
	--ngr-field-bg: rgba(255, 255, 255, 0.08);
	--ngr-line: rgba(255, 255, 255, 0.18);
	--ngr-line-strong: rgba(255, 255, 255, 0.38);
	--ngr-shadow: none;
	--ngr-accent-ink: #d8b98c;
	--ngr-error: #f2a7a0;
}

/* ---------- Cabecera ---------- */

.ngr__header {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 16px 24px;
	margin-bottom: clamp(20px, 3vw, 32px);
}

.ngr__title {
	margin: 0 0 12px;
	font-family: var(--ngr-f-title);
	font-size: clamp(1.4rem, 1.1rem + 1.1vw, 2rem);
	line-height: 1.2;
	font-weight: 600;
	letter-spacing: -0.01em;
	color: inherit;
}

.ngr__score {
	display: flex;
	align-items: center;
	gap: 14px;
}

.ngr__score-number {
	font-family: var(--ngr-f-title);
	font-size: clamp(2.4rem, 2rem + 2vw, 3.4rem);
	line-height: 0.9;
	font-weight: 600;
	letter-spacing: -0.02em;
	font-variant-numeric: tabular-nums;
	color: var(--ngr-ink);
}

.ngr__score-meta {
	display: flex;
	flex-direction: column;
	gap: 5px;
}

.ngr__score-link {
	color: var(--ngr-muted);
	font-size: 0.875rem;
	text-decoration: none;
	border-bottom: 1px solid transparent;
	transition: border-color 0.15s ease, color 0.15s ease;
}

.ngr__score-link:hover,
.ngr__score-link:focus-visible {
	color: var(--ngr-ink);
	border-bottom-color: currentColor;
}

/* Botón con la forma de .bn-btn--primary del tema: casi recto, tipografía de botón y tracking. */
.ngr__cta,
.ngr-form__submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 14px 30px;
	border: 1px solid var(--ngr-accent);
	border-radius: calc(var(--ngr-radius) / 2);
	background: var(--ngr-accent);
	color: #fff;
	font-family: var(--ngr-f-button);
	font-size: 0.95rem;
	font-weight: 500;
	letter-spacing: 0.06em;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition: transform 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}

.ngr__cta:hover,
.ngr__cta:focus-visible,
.ngr-form__submit:hover:not(:disabled) {
	background: var(--ngr-accent-hover);
	border-color: var(--ngr-accent-hover);
	color: #fff;
	transform: translateY(-2px);
}

.ngr__cta:focus-visible,
.ngr-form__submit:focus-visible {
	outline: 2px solid var(--bn-arena, #d8b98c);
	outline-offset: 3px;
}

/* ---------- Estrellas ---------- */

.ngr-stars {
	display: inline-flex;
	gap: 2px;
	line-height: 0;
}

.ngr-star {
	width: 16px;
	height: 16px;
	flex: 0 0 auto;
}

.ngr-star.is-on {
	fill: var(--ngr-star);
}

.ngr-star.is-off {
	fill: currentColor;
	opacity: 0.22;
}

/* ---------- Pista ---------- */

.ngr__viewport {
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	scrollbar-width: none;
	-ms-overflow-style: none;
	margin: 0 -2px;
	padding: 4px 2px 10px;
	border-radius: var(--ngr-radius);
}

.ngr__viewport::-webkit-scrollbar {
	display: none;
}

.ngr__viewport:focus-visible {
	outline: 2px solid var(--ngr-accent);
	outline-offset: 4px;
}

.ngr__track {
	display: flex;
	align-items: stretch;
	gap: var(--ngr-gap);
	margin: 0;
	padding: 0;
	list-style: none;
}

.ngr__slide {
	flex: 0 0 calc((100% - (var(--ngr-cols) - 1) * var(--ngr-gap)) / var(--ngr-cols));
	/* Sin esto, un nombre largo ensancha su tarjeta y las columnas quedan desiguales. */
	min-width: 0;
	scroll-snap-align: start;
	display: flex;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ngr__slide::before,
.ngr__slide::marker {
	content: none;
}

/* ---------- Tarjeta ---------- */

.ngr-card {
	display: flex;
	flex-direction: column;
	gap: 14px;
	width: 100%;
	min-width: 0;
	padding: clamp(20px, 2.2vw, 30px);
	border: 1px solid var(--ngr-line);
	border-radius: var(--ngr-radius);
	background: var(--ngr-surface);
	box-shadow: var(--ngr-shadow);
}

.ngr-card__head {
	display: flex;
	align-items: center;
	gap: 12px;
}

.ngr-card__avatar {
	width: 44px;
	height: 44px;
	flex: 0 0 44px;
	border-radius: 50%;
	object-fit: cover;
	background: color-mix(in srgb, var(--ngr-accent) 12%, transparent);
}

.ngr-card__avatar--initial {
	display: grid;
	place-items: center;
	background: var(--ngr-accent);
	color: #fff;
	font-family: var(--ngr-f-title);
	font-size: 1.125rem;
	font-weight: 600;
	line-height: 1;
}

.ngr-card__id {
	min-width: 0;
	flex: 1 1 auto;
}

.ngr-card__author {
	margin: 0;
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: 1.3;
	color: var(--ngr-ink);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.ngr-card__date {
	margin: 2px 0 0;
	font-size: 0.8125rem;
	line-height: 1.3;
	color: var(--ngr-muted);
}

.ngr-card__source {
	flex: 0 0 auto;
	line-height: 0;
	opacity: 0.9;
}

.ngr-card__text {
	position: relative;
	margin: 0;
	padding: 0;
	border: 0;
	font-size: 0.9375rem;
	line-height: 1.65;
	color: var(--ngr-muted);
	quotes: none;
}

.ngr-card__text::before,
.ngr-card__text::after {
	content: none;
}

.ngr-card__more {
	display: inline;
	margin-left: 4px;
	padding: 0;
	border: 0;
	background: none;
	color: var(--ngr-accent-ink);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.ngr-card__more:focus-visible {
	outline: 2px solid var(--ngr-accent);
	outline-offset: 2px;
	border-radius: 2px;
}

/* ---------- Controles ---------- */

.ngr__controls {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-top: 18px;
}

.ngr__dots {
	display: flex;
	align-items: center;
	gap: 6px;
}

/* Barras finas en vez de puntos: más sobrias. El área táctil sigue siendo de 24 px de alto. */
.ngr__dot {
	position: relative;
	width: 22px;
	height: 24px;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
	transition: width 0.35s ease;
}

.ngr__dot::before,
.ngr__dot[aria-selected="true"]::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 0;
	height: 3px;
	margin-top: -1.5px;
}

.ngr__dot::before {
	right: 0;
	background: var(--ngr-line-strong);
	transition: background-color 0.2s ease;
}

.ngr__dot[aria-selected="true"] {
	width: 44px;
}

.ngr__dot[aria-selected="true"]::before {
	background: color-mix(in srgb, var(--ngr-accent) 28%, transparent);
}

/* La barra activa avanza al ritmo del autoplay: indica cuánto falta. */
.ngr__dot[aria-selected="true"]::after {
	width: var(--ngr-progress, 0%);
	background: var(--ngr-accent);
}

/* Sin autoplay no hay progreso que mostrar: la barra activa va llena. */
.ngr[data-autoplay="0"] .ngr__dot[aria-selected="true"]::after {
	width: 100%;
}

.ngr__dot:hover::before {
	background: color-mix(in srgb, var(--ngr-accent) 45%, transparent);
}

.ngr__dot:focus-visible {
	outline: 2px solid var(--ngr-accent);
	outline-offset: 2px;
}

.ngr__arrows {
	display: flex;
	gap: 8px;
	margin-left: auto;
}

.ngr__arrow {
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 1px solid var(--ngr-line-strong);
	border-radius: var(--ngr-radius);
	background: var(--ngr-surface);
	color: var(--ngr-ink);
	cursor: pointer;
	transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease;
}

.ngr__arrow svg {
	width: 20px;
	height: 20px;
}

.ngr__arrow:hover:not(:disabled) {
	border-color: var(--ngr-accent);
	color: var(--ngr-accent-ink);
}

.ngr__arrow:focus-visible {
	outline: 2px solid var(--ngr-accent);
	outline-offset: 2px;
}

.ngr__arrow:disabled {
	opacity: 0.35;
	cursor: default;
}

/* ---------- Atribución ---------- */

.ngr__attribution {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 16px 0 0;
	font-size: 0.8125rem;
	color: var(--ngr-muted);
}

.ngr__attribution a {
	color: inherit;
	text-decoration: none;
	border-bottom: 1px solid var(--ngr-line-strong);
}

.ngr__attribution a:hover,
.ngr__attribution a:focus-visible {
	color: var(--ngr-ink);
	border-bottom-color: currentColor;
}

/* ---------- Formulario ---------- */

.ngr-form {
	margin-top: clamp(24px, 4vw, 40px);
	padding: clamp(20px, 3vw, 32px);
	border: 1px solid var(--ngr-line);
	border-radius: var(--ngr-radius);
	background: var(--ngr-surface);
}

.ngr-form__title {
	margin: 0 0 6px;
	font-family: var(--ngr-f-title);
	font-size: 1.2rem;
	font-weight: 600;
	color: var(--ngr-ink);
}

.ngr-form__lede {
	margin: 0 0 20px;
	font-size: 0.9375rem;
	color: var(--ngr-muted);
}

.ngr-form__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 16px;
}

.ngr-field {
	display: block;
	margin-bottom: 16px;
}

.ngr-field > span,
.ngr-field legend {
	display: block;
	margin-bottom: 6px;
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--ngr-ink);
}

.ngr-field input[type="text"],
.ngr-field input[type="email"],
.ngr-field textarea {
	width: 100%;
	padding: 12px 14px;
	border: 1px solid var(--ngr-line-strong);
	border-radius: calc(var(--ngr-radius) / 2);
	background: var(--ngr-field-bg);
	color: var(--ngr-ink);
	font: inherit;
	font-size: 0.9375rem;
}

.ngr-field input:focus-visible,
.ngr-field textarea:focus-visible {
	outline: 2px solid var(--ngr-accent);
	outline-offset: 1px;
	border-color: transparent;
}

.ngr-field--check {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	font-size: 0.875rem;
	color: var(--ngr-muted);
}

.ngr-field--check span {
	margin: 0;
	font-weight: 400;
	color: var(--ngr-muted);
}

.ngr-rating {
	margin: 0 0 16px;
	padding: 0;
	border: 0;
}

.ngr-rating__row {
	display: flex;
	gap: 4px;
}

.ngr-rating__item {
	cursor: pointer;
	line-height: 0;
}

.ngr-rating__item input {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
}

.ngr-rating__item svg {
	width: 28px;
	height: 28px;
	fill: currentColor;
	opacity: 0.22;
	transition: opacity 0.12s ease, fill 0.12s ease;
}

/* Se colorean la estrella marcada y todas las anteriores. */
.ngr-rating__item:has(input:checked) svg,
.ngr-rating__item:has(~ .ngr-rating__item input:checked) svg {
	opacity: 1;
	fill: var(--ngr-star);
}

.ngr-rating__item input:focus-visible + span + svg {
	outline: 2px solid var(--ngr-accent);
	outline-offset: 2px;
}

.ngr-form__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 18px;
	margin-top: 4px;
}

.ngr-form__submit:disabled {
	opacity: 0.6;
	cursor: progress;
}

.ngr-form__alt {
	color: var(--ngr-accent-ink);
	font-size: 0.9375rem;
	font-weight: 600;
	text-decoration: none;
	border-bottom: 1px solid currentColor;
}

.ngr-form__msg {
	margin: 14px 0 0;
	font-size: 0.9375rem;
	min-height: 1.4em;
}

.ngr-form__msg.is-ok {
	color: var(--ngr-accent-ink);
}

.ngr-form__msg.is-error {
	color: var(--ngr-error);
}

/* Honeypot: fuera de la vista pero presente en el DOM. */
.ngr-hp {
	position: absolute !important;
	left: -9999px !important;
	top: auto !important;
	width: 1px !important;
	height: 1px !important;
	overflow: hidden !important;
}

.ngr .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.ngr-empty {
	padding: 16px 20px;
	border: 1px dashed rgba(36, 28, 24, 0.3);
	border-radius: 4px;
	background: #faf6f0;
	color: #5c514a;
	font-size: 0.9375rem;
}

/* ---------- Responsive ---------- */

@media (max-width: 1024px) {
	.ngr {
		--ngr-cols: var(--ngr-cols-t);
		--ngr-gap: 16px;
	}
}

@media (max-width: 680px) {
	.ngr {
		--ngr-cols: var(--ngr-cols-m);
		--ngr-gap: 14px;
	}

	.ngr__header {
		align-items: flex-start;
		flex-direction: column;
	}

	.ngr__cta {
		width: 100%;
	}

	.ngr__controls {
		justify-content: center;
	}

	.ngr__arrows {
		margin-left: 0;
	}
}

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

	.ngr__dot[aria-selected="true"]::after {
		width: 100%;
	}

	.ngr *,
	.ngr *::before,
	.ngr *::after {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
	}
}
