/* ==========================================================================
   RotasSul Transfer — modal de avaliações do Google (Fase 11 · Gate B)

   Duas partes:
     1. o botão "Ver avaliações atualizadas no Google", na seção de avaliações;
     2. o modal que hospeda o componente oficial do Google.

   O componente tem largura recomendada de 250–400px pela documentação do
   Google, então a caixa do modal é dimensionada para ele — e não o contrário.
   Nada aqui mexe no que o Google renderiza por dentro: só nas variáveis
   --gmp-* que a documentação expõe.
   ========================================================================== */

/* ---------- botão que abre ---------- */
.testimonials-footer .gr-open {
  -webkit-appearance: none;
  appearance: none;
  align-items: center;
  background: transparent;
  border: 1px solid #10253630;
  border-radius: 100px;
  color: var(--color-2, #102536);
  cursor: pointer;
  display: inline-flex;
  font-family: Epilogue, sans-serif;
  font-size: 13.5px;
  font-weight: 700;
  gap: 8px;
  letter-spacing: -.01em;
  line-height: 1.2;
  margin: 18px 0 0;
  padding: 11px 20px;
  transition: background .2s, border-color .2s;
}

.testimonials-footer .gr-open:hover {
  background: #1025360a;
  border-color: #10253647;
}

.testimonials-footer .gr-open:focus-visible {
  outline: 3px solid #2f7bb6;
  outline-offset: 3px;
}

.testimonials-footer .gr-open svg { flex-shrink: 0; height: 15px; width: 15px; }

/* ---------- modal ---------- */
/* Acima de tudo o que a home empilha: header sticky (99999999) e botão
   flutuante do WhatsApp (9999990). */
.gr-modal {
  align-items: center;
  background: #102536a8;
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 24px 16px;
  position: fixed;
  z-index: 999999999;
}

.gr-modal[hidden] { display: none; }

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

.gr-modal__dialog {
  background: var(--color-1, #fff);
  border-radius: 22px;
  box-shadow: 0 24px 70px #10253659;
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 48px);
  max-width: 460px;
  overflow: hidden;
  width: 100%;
}

.gr-modal__head {
  align-items: flex-start;
  flex: 0 0 auto;
  border-bottom: 1px solid #1025361a;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 20px 22px 16px;
}

.gr-modal__title {
  color: var(--color-2, #102536);
  font-family: Epilogue, sans-serif;
  font-size: 18px;
  font-weight: 900;
  letter-spacing: -.02em;
  line-height: 1.2;
  margin: 0 0 4px;
  padding: 0;
  text-transform: none;
}

.gr-modal__subtitle {
  color: #102536a8;
  font-size: 13px;
  line-height: 1.45;
  margin: 0;
}

.gr-modal__close {
  -webkit-appearance: none;
  appearance: none;
  align-items: center;
  background: #1025360f;
  border: 0;
  border-radius: 50%;
  color: var(--color-2, #102536);
  cursor: pointer;
  display: inline-flex;
  flex-shrink: 0;
  height: 34px;
  justify-content: center;
  transition: background .2s;
  width: 34px;
}

.gr-modal__close:hover { background: #1025361f; }
.gr-modal__close:focus-visible { outline: 3px solid #2f7bb6; outline-offset: 2px; }
.gr-modal__close svg { height: 16px; width: 16px; }

.gr-modal__body {
  align-items: flex-start;
  display: flex;
  /* `min-height: 0` é o que permite este item encolher dentro do flex column
     e, com isso, rolar. Sem ele a caixa cresce além do max-height e o
     cabeçalho do modal sai da tela. */
  flex: 1 1 auto;
  justify-content: center;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 22px 22px;
}

.gr-modal__status { padding: 26px 22px 30px; text-align: center; }
.gr-modal__status[hidden] { display: none; }

.gr-modal__status-text {
  color: #102536c7;
  font-size: 14.5px;
  line-height: 1.5;
  margin: 0;
}

.gr-modal__status-link {
  color: #1f5f91;
  display: inline-block;
  font-family: Epilogue, sans-serif;
  font-size: 14px;
  font-weight: 700;
  margin-top: 12px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- componente oficial ---------- */
.gr-modal gmp-place-details {
  /* 400px é o teto recomendado; abaixo de 250px o Google não garante o
     funcionamento. A caixa do modal se ajusta a ele. */
  width: min(400px, 100%);

  /* A seção é clara: sem isto o componente seguiria o dark mode do sistema
     operacional do visitante. */
  color-scheme: light;

  --gmp-mat-color-surface: #ffffff;
  --gmp-mat-color-on-surface: #102536;
  --gmp-mat-color-on-surface-variant: #102536c7;
  --gmp-mat-color-primary: #1f5f91;
  --gmp-mat-color-outline-decorative: #1025361f;
  --gmp-mat-color-secondary-container: #f4c84b29;
  --gmp-mat-color-on-secondary-container: #102536;
  --gmp-mat-font-family: Epilogue, sans-serif;

  border: 1px solid #10253614;
  border-radius: 16px;
}

/* ---------- celular: o modal ocupa a tela ---------- */
@media (max-width: 640px) {
  .gr-modal { padding: 0; }

  .gr-modal__dialog {
    border-radius: 18px 18px 0 0;
    margin-top: auto;
    max-height: 92vh;
    max-width: 100%;
  }

  .gr-modal__head { padding: 18px 18px 14px; }
  .gr-modal__body { padding: 16px 14px 20px; }
  .gr-modal gmp-place-details { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .testimonials-footer .gr-open,
  .gr-modal__close { transition: none; }
}
