/* ============================================================
   Badge Avis Google My Business – Service Gagnant 63
   ============================================================ */

#sg-reviews-badge {
  position: fixed;
  bottom: 24px;
  right: 20px;
  z-index: 9999;
  width: 300px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, .18);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  overflow: hidden;
  transition: box-shadow .25s ease;
}

#sg-reviews-badge:hover {
  box-shadow: 0 6px 30px rgba(0, 0, 0, .22);
}

/* ----- Bouton fermer ----- */
.sg-badge__close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, .08);
  border: none;
  border-radius: 50%;
  cursor: pointer;
  color: #555;
  padding: 0;
  line-height: 1;
  transition: background .2s;
  z-index: 1;
}

.sg-badge__close:hover {
  background: rgba(0, 0, 0, .18);
  color: #111;
}

/* ----- En-tête (note globale) ----- */
.sg-badge__header {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 14px 38px 14px 14px;
  background: #fff;
  border: none;
  cursor: pointer;
  text-align: left;
}

.sg-badge__header:focus-visible {
  outline: 2px solid #4285F4;
  outline-offset: -2px;
}

.sg-badge__google-logo {
  flex-shrink: 0;
}

.sg-badge__score-block {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sg-badge__score {
  font-size: 22px;
  font-weight: 700;
  color: #202124;
  line-height: 1;
}

/* ----- Étoiles (technique overlay) ----- */
.sg-badge__stars,
.sg-badge__review-stars {
  position: relative;
  display: inline-block;
  color: #dadce0;
  font-size: 15px;
  line-height: 1;
  white-space: nowrap;
}

.sg-badge__stars-fill {
  position: absolute;
  top: 0;
  left: 0;
  overflow: hidden;
  color: #fbbc04;
  white-space: nowrap;
}

.sg-badge__stars-bg {
  display: inline-block;
}

.sg-badge__review-stars {
  font-size: 13px;
}

.sg-badge__count {
  font-size: 11px;
  color: #70757a;
  margin-top: 1px;
}

/* ----- Séparateur entre header et liste ----- */
.sg-badge__reviews {
  max-height: 0;
  overflow: hidden;
  transition: max-height .35s ease;
  border-top: 0 solid #e8eaed;
}

.sg-badge__reviews.is-open {
  max-height: 420px;
  border-top-width: 1px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* ----- Scrollbar discrète ----- */
.sg-badge__reviews::-webkit-scrollbar { width: 4px; }
.sg-badge__reviews::-webkit-scrollbar-track { background: transparent; }
.sg-badge__reviews::-webkit-scrollbar-thumb { background: #dadce0; border-radius: 4px; }

/* ----- Chaque avis ----- */
.sg-badge__review-item {
  padding: 12px 14px;
  border-bottom: 1px solid #f1f3f4;
}

.sg-badge__review-item:last-of-type {
  border-bottom: none;
}

.sg-badge__reviewer {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 6px;
}

.sg-badge__avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.sg-badge__avatar--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #4285F4;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  flex-shrink: 0;
}

.sg-badge__reviewer-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}

.sg-badge__reviewer-name {
  font-size: 13px;
  font-weight: 600;
  color: #202124;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sg-badge__review-date {
  font-size: 11px;
  color: #70757a;
  margin-left: auto;
  white-space: nowrap;
  padding-top: 2px;
}

.sg-badge__review-text {
  font-size: 12px;
  color: #3c4043;
  line-height: 1.5;
  margin: 0;
  word-break: break-word;
}

/* ----- CTA « Voir tous les avis » ----- */
.sg-badge__cta {
  display: block;
  text-align: center;
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #4285F4;
  text-decoration: none;
  border-top: 1px solid #e8eaed;
  transition: background .2s;
}

.sg-badge__cta:hover {
  background: #f8f9fa;
  color: #1a73e8;
  text-decoration: none;
}

/* ============================================================
   État masqué (via JS après clic sur ×)
   ============================================================ */
#sg-reviews-badge.sg-badge--hidden {
  display: none !important;
}

/* ============================================================
   RESPONSIVE MOBILE
   ============================================================ */
@media (max-width: 600px) {
  #sg-reviews-badge {
    bottom: 16px;
    right: 12px;
    left: auto;
    width: 250px;
  }

  .sg-badge__reviews.is-open {
    max-height: 60vh;
  }

  .sg-badge__score {
    font-size: 19px;
  }

  .sg-badge__count {
    font-size: 10px;
  }
}
