/* NB4 Google Reviews — stili base, tutti sovrascrivibili dai controlli di Elementor */

.nb4gr {
	--nb4gr-star: #fbbc04;
	--nb4gr-star-empty: #dadce0;
	position: relative;
}

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

/* ------------------------------------------------- Protezione dal tema
   Temi e Kit di Elementor applicano stili a tutti i <button> (padding, sfondo,
   larghezza minima, maiuscole…). Qui si azzerano solo per i pulsanti del widget;
   i controlli di stile del widget restano più forti di queste regole. */

.nb4gr button.nb4gr-arrow,
.nb4gr button.nb4gr-card__more,
.nb4gr button.nb4gr-dialog__close {
	-webkit-appearance: none;
	appearance: none;
	min-width: 0;
	min-height: 0;
	max-width: none;
	margin: 0;
	font-family: inherit;
	text-transform: none;
	letter-spacing: normal;
	text-shadow: none;
	white-space: normal;
}

.nb4gr button.nb4gr-arrow,
.nb4gr button.nb4gr-dialog__close {
	line-height: 1;
}

/* ---------------------------------------------------------------- Stelle */

.nb4gr-stars {
	display: inline-flex;
	gap: 0.12em;
	font-size: 16px;
	line-height: 1;
	vertical-align: middle;
}

.nb4gr-star {
	display: inline-block;
	width: 1em;
	height: 1em;
	background: linear-gradient(90deg, var(--nb4gr-star) var(--nb4gr-fill, 100%), var(--nb4gr-star-empty) 0);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.5l2.94 6.06 6.56.92-4.78 4.58 1.17 6.53L12 17.5l-5.89 3.09 1.17-6.53L2.5 9.48l6.56-.92z'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2.5l2.94 6.06 6.56.92-4.78 4.58 1.17 6.53L12 17.5l-5.89 3.09 1.17-6.53L2.5 9.48l6.56-.92z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* ---------------------------------------------------------- Intestazione */

.nb4gr-header {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-start;
	gap: 16px 32px;
	margin-bottom: 32px;
}

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

.nb4gr-header__logo {
	width: 36px;
	height: 36px;
	flex-shrink: 0;
}

.nb4gr-header__score {
	font-size: 2.6em;
	font-weight: 700;
	line-height: 1;
	font-variant-numeric: tabular-nums;
}

.nb4gr-header__meta {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.nb4gr-header .nb4gr-stars {
	font-size: 20px;
}

.nb4gr-header__count {
	font-size: 0.9em;
	opacity: 0.75;
}

.nb4gr-header__button {
	display: inline-flex;
	align-items: center;
	padding: 10px 22px;
	border: 1px solid currentColor;
	border-radius: 999px;
	color: inherit;
	text-decoration: none;
	font-weight: 600;
	transition: background-color 0.2s, color 0.2s;
}

/* ------------------------------------------------------------- Carosello */

.nb4gr-carousel {
	position: relative;
}

.nb4gr-swiper {
	position: relative;
	overflow: hidden;
	/* spazio per l'ombra delle schede, che altrimenti verrebbe tagliata */
	padding: 6px 2px 10px;
	margin: -6px -2px -10px;
}

.nb4gr-swiper .swiper-wrapper {
	display: flex;
	position: relative;
	width: 100%;
	box-sizing: content-box;
	transition-property: transform;
}

.nb4gr-swiper .swiper-slide {
	flex-shrink: 0;
	position: relative;
	height: auto; /* tutte le schede alte uguali */
}

/* Prima che il carosello parta: stessa disposizione, niente salti di layout */
.nb4gr-swiper:not(.swiper-initialized):not(.swiper-container-initialized) .swiper-wrapper {
	gap: var(--nb4gr-gap, 24px);
}

.nb4gr-swiper:not(.swiper-initialized):not(.swiper-container-initialized) .swiper-slide {
	width: calc((100% - (var(--nb4gr-pv, 3) - 1) * var(--nb4gr-gap, 24px)) / var(--nb4gr-pv, 3));
}

@media (max-width: 1024px) {
	.nb4gr-swiper:not(.swiper-initialized):not(.swiper-container-initialized) .swiper-slide {
		width: calc((100% - (var(--nb4gr-pv-t, 2) - 1) * var(--nb4gr-gap, 24px)) / var(--nb4gr-pv-t, 2));
	}
}

@media (max-width: 767px) {
	.nb4gr-swiper:not(.swiper-initialized):not(.swiper-container-initialized) .swiper-slide {
		width: calc((100% - (var(--nb4gr-pv-m, 1) - 1) * var(--nb4gr-gap, 24px)) / var(--nb4gr-pv-m, 1));
	}
}

/* ---------------------------------------------------------------- Scheda */

.nb4gr-card {
	display: flex;
	flex-direction: column;
	height: 100%;
	padding: 24px;
	background: #fff;
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: 14px;
}

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

.nb4gr-card__avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	flex-shrink: 0;
	object-fit: cover;
}

.nb4gr-card__avatar--initial {
	display: grid;
	place-items: center;
	background: var(--nb4gr-avatar-bg, #1a73e8);
	color: #fff;
	font-size: 18px;
	font-weight: 600;
	line-height: 1;
}

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

.nb4gr-card__name {
	font-weight: 600;
	line-height: 1.3;
	overflow-wrap: anywhere;
}

.nb4gr-card__date {
	font-size: 0.85em;
	opacity: 0.65;
}

.nb4gr-card__logo {
	width: 20px;
	height: 20px;
	margin-left: auto;
	flex-shrink: 0;
	align-self: flex-start;
}

.nb4gr-card .nb4gr-stars {
	margin: 14px 0 10px;
}

.nb4gr-card__text {
	line-height: 1.6;
	overflow-wrap: anywhere;
}

.nb4gr button.nb4gr-card__more {
	align-self: flex-start;
	margin-top: 10px;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}

.nb4gr button.nb4gr-card__more:hover,
.nb4gr button.nb4gr-card__more:focus {
	background: none;
	color: inherit;
	border: 0;
	box-shadow: none;
	text-decoration: underline;
	text-decoration-thickness: 2px;
}

/* ---------------------------------------------------------------- Frecce */

.nb4gr button.nb4gr-arrow {
	position: absolute;
	top: 50%;
	z-index: 2;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #fff;
	color: #202124;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2), 0 2px 8px rgba(0, 0, 0, 0.08);
	transform: translateY(-50%);
	cursor: pointer;
	transition: background-color 0.2s, color 0.2s, opacity 0.2s;
}

.nb4gr-arrow--prev { left: -22px; }
.nb4gr-arrow--next { right: -22px; }

.nb4gr button.nb4gr-arrow:hover,
.nb4gr button.nb4gr-arrow:focus {
	background: #fff;
	color: #202124;
	border: 0;
}

.nb4gr .nb4gr-arrow svg {
	display: block;
	width: 45%;
	height: 45%;
}

.nb4gr-arrow--prev svg {
	transform: rotate(180deg);
}

.nb4gr-arrow.swiper-button-disabled {
	opacity: 0.35;
	cursor: default;
}

.nb4gr-arrow.swiper-button-lock {
	display: none;
}

@media (max-width: 767px) {
	.nb4gr-arrow--prev { left: 4px; }
	.nb4gr-arrow--next { right: 4px; }
	.nb4gr:not(.nb4gr--mobile-arrows) .nb4gr-arrow { display: none; }
}

/* --------------------------------------------------------------- Pallini */

.nb4gr-dots {
	position: relative;
	margin: 22px auto 0;
	overflow: hidden;
	white-space: nowrap;
	text-align: center;
	font-size: 0;
	line-height: 0;
}

/* Swiper centra i pallini con left:50%; qui il contenitore è già centrato */
.nb4gr .nb4gr-dots.swiper-pagination-horizontal.swiper-pagination-bullets-dynamic {
	left: auto;
	transform: none;
}

.nb4gr .nb4gr-dot {
	display: inline-block;
	box-sizing: content-box;
	opacity: 1;
	position: relative;
	width: 8px;
	height: 8px;
	margin: 0 4px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background-color: #c4c7c5;
	cursor: pointer;
	transform: scale(0.33);
	transition: transform 0.2s, left 0.2s, background-color 0.2s;
}

.nb4gr-dot.is-active-main { transform: scale(1); }
.nb4gr-dot.is-active-prev,
.nb4gr-dot.is-active-next { transform: scale(0.66); }
.nb4gr-dot.is-active-prev-prev,
.nb4gr-dot.is-active-next-next { transform: scale(0.33); }

.nb4gr-dot.is-active {
	background-color: #5f6368;
}

/* ------------------------------------------------- Finestra "Leggi tutto" */

.nb4gr-dialog {
	color: inherit;
	width: min(560px, calc(100vw - 32px));
	max-width: none;
	max-height: calc(100vh - 48px);
	padding: 0;
	border: 0;
	background: transparent;
	overflow: visible;
}

.nb4gr-dialog::backdrop {
	background: rgba(0, 0, 0, 0.55);
}

.nb4gr-dialog .nb4gr-card {
	max-height: calc(100vh - 48px);
	overflow-y: auto;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.nb4gr-dialog .nb4gr-card__logo {
	margin-right: 36px;
}

.nb4gr button.nb4gr-dialog__close {
	position: absolute;
	top: 16px;
	right: 16px;
	z-index: 1;
	display: grid;
	place-items: center;
	width: 32px;
	height: 32px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.06);
	color: inherit;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
}

/* ------------------------------------------------------------ Accessibilità */

.nb4gr-arrow:focus-visible,
.nb4gr-dot:focus-visible,
.nb4gr-card__more:focus-visible,
.nb4gr-header__button:focus-visible,
.nb4gr-dialog__close:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
	.nb4gr-dot,
	.nb4gr-arrow,
	.nb4gr-header__button {
		transition: none;
	}
}

/* ---------------------------------------------------------------- Editor */

.nb4gr-empty {
	padding: 24px;
	border: 1px dashed rgba(0, 0, 0, 0.25);
	border-radius: 8px;
	text-align: center;
	font-size: 14px;
}
