/* =============================================================
   Google Reviews Widget — scoped styles (prefix .grw-*)
   Il widget è sempre montato su sfondo bianco.
   Nessun container/wrapper con margini o max-width imposti,
   solo stili interni ai componenti.
   ============================================================= */

.grw-root {
  --grw-background: #fff;
  --grw-gold: #fbbc05;
  --grw-gray: #e0e0e0;
  --grw-blue-light: #7fcff2;
  --grw-blue: #00A0e6;
  --grw-blue-dark: #193755;
  --grw-placeholder-bg: #e8eaed;
  --grw-placeholder-fg: #9aa0a6;

  --font-regular: Halcyon-Regular;
  --font-semibold: Halcyon-SemiBold;
  --font-bold: Halcyon-Bold;

  box-sizing: border-box;
  font-family: var(--font-regular);
  color: var(--grw-blue-dark);
  position: relative;
  background-color: var(--grw-background);
  padding: 2rem;
  border-radius: 1.25rem;
}

.grw-root *,
.grw-root *::before,
.grw-root *::after {
  box-sizing: border-box;
}

/* ---------- Stelle valutazione ---------- */
.grw-stars {
  position: relative;
  display: inline-block;
  line-height: 1;
  font-size: 2.5rem;
  white-space: nowrap;
}

@media (max-width: 639px) {
  .grw-stars {
    font-size: 1.75rem;
  }
}

.grw-stars__base,
.grw-stars__fill {
  letter-spacing: -0.0625rem;
}

.grw-stars__base {
  color: var(--grw-gray);
}

.grw-stars__fill {
  color: var(--grw-gold);
  position: absolute;
  top: 0;
  left: 0;
  overflow: hidden;
  width: 0;
}

/* ---------- Stati loading / errore / vuoto ---------- */
.grw-state {
  padding: 1.5rem 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  color: var(--grw-blue-dark);
  font-size: 0.9375rem;
}

.grw-spinner {
  display: inline-block;
  width: 1.75rem;
  height: 1.75rem;
  border: 0.1875rem solid var(--grw-gray);
  border-top-color: var(--grw-blue);
  border-radius: 50%;
  animation: grw-spin 0.8s linear infinite;
}

@keyframes grw-spin {
  to { transform: rotate(360deg); }
}

/* ---------- Slider ---------- */
.grw-slider-wrap {
  position: relative;
  padding: 0;
}

.grw-slider {
  display: flex;
}

.grw-slider:not(.tns-slider) > .grw-card:nth-child(n + 2) {
  display: none;
}

.grw-card {
  padding: 0;
}

.grw-card__inner {
  height: 100%;
}

.grw-card__head {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.grw-card__avatar {
  flex: 0 0 auto;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  object-fit: cover;
  background-color: var(--grw-placeholder-bg);
}

.grw-card__avatar--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--grw-placeholder-fg);
}

.grw-card__avatar--placeholder svg {
  width: 1.75rem;
  height: 1.75rem;
  fill: currentColor;
}

.grw-card__meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.grw-card__name {
  font-family: var(--font-bold);
  font-size: 0.9375rem;
  color: var(--grw-blue-dark);
  line-height: 1.2;
}

.grw-card__date {
  font-size: 0.8125rem;
  color: var(--grw-blue-dark);
  margin-top: 0.125rem;
}

.grw-card__stars {
  margin-bottom: 0.5rem;
}

.grw-card__text {
  font-size: 0.875rem;
  line-height: 1.375;
  color: var(--grw-blue-dark);
  margin: 0;
}

.grw-readmore {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  font-family: var(--font-bold);
  color: var(--grw-blue);
  text-decoration: underline;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

.grw-readmore:hover,
.grw-readmore:focus-visible {
  color: #1558b0;
}

/* ---------- Frecce ---------- */
.grw-arrows {
  pointer-events: none;
}

.grw-arrow {
  pointer-events: auto;
  position: absolute;
  top: 45%;
  transform: translateY(-50%);
  z-index: 2;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 0;
  background: #fff;
  color: var(--grw-blue);
  box-shadow: 0 0.125rem 0.5rem rgba(60, 64, 67, 0.25);
  cursor: pointer;
  transition: box-shadow 0.2s ease, opacity 0.2s ease;
}

.grw-arrow svg {
  width: 1.125rem;
  height: 1.125rem;
  fill: currentColor;
}

.grw-arrow:hover {
  box-shadow: 0 0.25rem 0.75rem rgba(60, 64, 67, 0.35);
}

.grw-arrow--prev {
  left: -1.25rem;
}

.grw-arrow--next {
  right: -1.25rem;
}

.grw-arrow:disabled,
.grw-arrow[disabled],
.grw-arrow.grw-arrow--hidden {
  opacity: 0;
  pointer-events: none;
}

@media (max-width: 639px) {
  .grw-arrow--prev {
    left: -2.75rem;
  }

  .grw-arrow--next {
    right: -2.75rem;
  }
}

/* ---------- Pallini navigazione ---------- */
.grw-dots.tns-nav,
.grw-dots {
  display: flex;
  justify-content: start;
  gap: 0.375rem;
  margin-top: 1rem;
  margin-bottom: 1rem;
  padding: 0;
}

.grw-dots.tns-nav button,
.grw-dots > button,
.grw-dot {
  width: 0.5rem;
  height: 0.5rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--grw-blue-light);
  cursor: pointer;
  transition: width 0.2s ease, background 0.2s ease;
}

.grw-dots > button.tns-nav-active,
.grw-dot--active {
  width: 1.5rem;
  background: var(--grw-blue);
}

/* ---------- Sommario ---------- */
.grw-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  padding-top: 1rem;
  border-top: 0.0625rem solid var(--grw-gray);
  margin-top: 1rem;
}

.grw-summary__brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1 1 auto;
}

.grw-summary__logo {
  height: 2rem;
  width: auto;
  flex: 0 0 auto;
  transform: translateY(0.1125rem);
}

.grw-summary__rating {
  font-size: 1.5rem;
  font-family: var(--font-bold);
  color: var(--grw-blue-dark);
}

.grw-summary__count {
  font-size: 1.5rem;
  font-family: var(--font-bold);
  color: var(--grw-blue-dark);
}

.grw-summary__divider {
  color: var(--grw-gray);
}

.grw-summary__link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.9375rem;
  font-family: var(--font-bold);
  color: var(--grw-blue);
  text-decoration: underline;
  margin-left: auto;
}

.grw-summary__link svg {
  width: 0.875rem;
  height: 0.875rem;
  fill: currentColor;
  transform: translateY(0.125rem);
}

@media (max-width: 639px) {
  .grw-summary {
    flex-direction: column;
    align-items: flex-start;
  }

  .grw-summary__brand {
    flex-wrap: wrap;
  }

  .grw-summary__logo {
    flex: 0 0 100%;
    height: 1.75rem;
  }

  .grw-summary__rating {
    font-size: 1.125rem;
  }

  .grw-summary__count {
    font-size: 1.125rem;
  }

  .grw-summary__link {
    margin-inline: auto;
  }
}

/* ---------- Modale ---------- */
.grw-modal {
  display: none;
}

.grw-modal.is-open {
  display: block;
}

.grw-modal__overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(32, 33, 36, 0.7);
  z-index: 999999;
}

.grw-modal__container {
  position: relative;
  width: 100%;
  max-width: 43.75rem;
  max-height: 85vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 1.25rem;
  padding: 1.75rem;
  box-sizing: border-box;
  font-family: var(--font-regular);
  animation: grw-modal-in 0.25s ease;
}

@keyframes grw-modal-in {
  from { opacity: 0; transform: translateY(0.5rem); }
  to { opacity: 1; transform: translateY(0); }
}

.grw-modal__close {
  position: absolute;
  top: 1.25rem;
  right: 1.25rem;
  width: 2.5rem;
  height: 2.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 0.0625rem solid var(--grw-blue);
  background: #fff;
  color: var(--grw-blue);
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.grw-modal__close svg {
  width: 1.125rem;
  height: 1.125rem;
  fill: currentColor;
}

.grw-modal__close:hover {
  background: var(--grw-blue);
  color: #fff;
}

.grw-modal__head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
  padding-right: 3rem;
}

.grw-modal__avatar {
  flex: 0 0 auto;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 50%;
  object-fit: cover;
  background-color: var(--grw-placeholder-bg);
}

.grw-modal__meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.grw-modal__avatar--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--grw-placeholder-fg);
}

.grw-modal__avatar--placeholder svg {
  width: 1.75rem;
  height: 1.75rem;
  fill: currentColor;
}

.grw-modal__name {
  font-family: var(--font-bold);
  font-size: 0.9375rem;
  color: var(--grw-blue-dark);
  line-height: 1.2;
}

.grw-modal__date {
  font-size: 0.8125rem;
  color: var(--grw-blue-dark);
  margin-top: 0.125rem;
}

.grw-modal__stars {
  margin-bottom: 0.75rem;
}

.grw-modal__text {
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--grw-blue-dark);
  margin: 0;
  white-space: pre-line;
}
