/* ==========================================================================
   Google Reviews Widget — Frontend Styles
   ========================================================================== */

/* ── Variables ────────────────────────────────────────────────────────────── */
.grw-reviews-wrapper {
  --grw-star-color: #F5A623;
  --grw-star-empty: #e0e0e0;
  --grw-card-bg: #ffffff;
  --grw-card-radius: 16px;
  --grw-card-shadow: 0 2px 12px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.04);
  --grw-card-shadow-hover: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
  --grw-text-primary: #1a1a2e;
  --grw-text-secondary: #6b7280;
  --grw-gap: 1.5rem;
  --grw-avatar-size: 48px;
  --grw-transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);

  font-family: inherit;
}

/* ── Résumé global ────────────────────────────────────────────────────────── */
.grw-summary {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 1.5rem;
  background: var(--grw-card-bg);
  border-radius: var(--grw-card-radius);
  box-shadow: var(--grw-card-shadow);
  margin-bottom: var(--grw-gap);
  width: fit-content;
}

.grw-summary--link {
  color: inherit;
  text-decoration: none;
  transition: transform var(--grw-transition), box-shadow var(--grw-transition);
}

.grw-summary--link:hover {
  transform: translateY(-2px);
  box-shadow: var(--grw-card-shadow-hover);
}

.grw-summary__logo {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
}

.grw-summary__logo svg {
  width: 100%;
  height: 100%;
}

.grw-summary__info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.grw-summary__name {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--grw-text-primary);
}

.grw-summary__rating {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.grw-summary__score {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--grw-text-primary);
  line-height: 1;
}

.grw-summary__total {
  font-size: 0.8125rem;
  color: var(--grw-text-secondary);
}

/* ── Étoiles ──────────────────────────────────────────────────────────────── */
.grw-stars {
  display: flex;
  gap: 1px;
  line-height: 1;
}

.grw-stars--lg .grw-star {
  font-size: 1.25rem;
}

.grw-star {
  font-size: 0.875rem;
  color: var(--grw-star-empty);
  transition: color var(--grw-transition);
}

.grw-star--filled {
  color: var(--grw-star-color);
}

.grw-star--half {
  color: var(--grw-star-color);
  opacity: 0.6;
}

/* ── Grilles ──────────────────────────────────────────────────────────────── */
.grw-reviews-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--grw-gap);
}

.grw-reviews-grid--list {
  grid-template-columns: 1fr;
  max-width: 680px;
}

.grw-reviews-grid--masonry {
  grid-template-columns: repeat(3, 1fr);
  align-items: start;
}

/* Slider */
.grw-reviews-grid--slider {
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  gap: var(--grw-gap);
  scrollbar-width: none;
  touch-action: pan-x;
}

.grw-reviews-grid--slider::-webkit-scrollbar {
  display: none;
}

.grw-reviews-grid--slider .grw-review-card {
  flex: 0 0 calc(33.333% - var(--grw-gap));
  scroll-snap-align: start;
}

@media (max-width: 1024px) {
  .grw-reviews-grid--slider .grw-review-card {
    flex: 0 0 calc(50% - var(--grw-gap));
  }
}

@media (max-width: 640px) {
  .grw-reviews-grid--slider .grw-review-card {
    flex: 0 0 100%;
  }
}

/* ── Navigation Slider ───────────────────────────────────────────────────── */
.grw-slider-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.25rem;
}

.grw-slider-nav__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid #e5e7eb;
  background: #fff;
  cursor: pointer;
  font-size: 1rem;
  color: var(--grw-text-primary);
  transition: all var(--grw-transition);
  line-height: 1;
}

.grw-slider-nav__btn:hover {
  border-color: var(--grw-star-color);
  color: var(--grw-star-color);
}

.grw-slider-nav__dots {
  display: flex;
  gap: 6px;
}

.grw-slider-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e5e7eb;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: background var(--grw-transition);
}

.grw-slider-dot--active {
  background: var(--grw-star-color);
  width: 24px;
  border-radius: 4px;
}

/* ── Carte d'avis ─────────────────────────────────────────────────────────── */
.grw-review-card {
  background: var(--grw-card-bg);
  border-radius: var(--grw-card-radius);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  transition: transform var(--grw-transition), box-shadow var(--grw-transition);
  position: relative;
  overflow: hidden;
}

.grw-review-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, #4285F4, #34A853, #FBBC05, #EA4335);
  opacity: 0;
  transition: opacity var(--grw-transition);
}

.grw-review-card--shadow {
  box-shadow: var(--grw-card-shadow);
}

.grw-review-card--shadow:hover {
  transform: translateY(-4px);
  box-shadow: var(--grw-card-shadow-hover);
}

.grw-review-card--shadow:hover::before {
  opacity: 1;
}

.grw-review-card--clickable {
  cursor: pointer;
}

/* Header de la carte */
.grw-review-card__header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Avatar */
.grw-review-card__avatar {
  flex-shrink: 0;
  width: var(--grw-avatar-size);
  height: var(--grw-avatar-size);
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.grw-review-card__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.grw-review-card__avatar-initials {
  color: #ffffff;
  font-size: 1.125rem;
  font-weight: 700;
  text-transform: uppercase;
  line-height: 1;
  user-select: none;
}

/* Meta (nom + date) */
.grw-review-card__meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.grw-review-card__author-name {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--grw-text-primary);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color var(--grw-transition);
}

.grw-review-card__author-name:hover {
  color: #4285F4;
}

.grw-review-card__time {
  font-size: 0.75rem;
  color: var(--grw-text-secondary);
}

/* Icône Google (en haut à droite) */
.grw-review-card__google-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-left: auto;
  opacity: 0.6;
  transition: opacity var(--grw-transition);
}

.grw-review-card:hover .grw-review-card__google-icon {
  opacity: 1;
}

.grw-review-card__google-icon svg {
  width: 100%;
  height: 100%;
}

/* Texte de l'avis */
.grw-review-card__text {
  flex: 1;
}

.grw-review-card__text-short,
.grw-review-card__text-full {
  font-size: 0.9rem;
  color: var(--grw-text-secondary, #444);
  line-height: 1.7;
  margin: 0;
}

.grw-review-card__read-more {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #4285F4;
  margin-top: 0.375rem;
  display: inline-block;
  transition: color var(--grw-transition);
}

.grw-review-card__read-more:hover {
  color: #2563eb;
  text-decoration: underline;
}

/* ── Message vide ─────────────────────────────────────────────────────────── */
.grw-no-reviews {
  color: var(--grw-text-secondary);
  font-style: italic;
  text-align: center;
  padding: 2rem;
}

/* ── Éditeur Elementor placeholder ───────────────────────────────────────── */
.grw-editor-placeholder {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1.5rem;
  background: #fff8e1;
  border: 2px dashed #FBBC05;
  border-radius: 12px;
  color: #b45309;
  font-size: 0.875rem;
}

.grw-editor-placeholder--error {
  background: #fef2f2;
  border-color: #EA4335;
  color: #b91c1c;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .grw-reviews-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .grw-reviews-grid--masonry {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {
  .grw-reviews-wrapper {
    --grw-gap: 1rem;
  }

  .grw-reviews-grid {
    grid-template-columns: 1fr;
  }

  .grw-reviews-grid--masonry {
    grid-template-columns: 1fr;
  }

  .grw-summary {
    width: 100%;
  }
}

/* ── Animation d'entrée ───────────────────────────────────────────────────── */
@keyframes grw-fade-up {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.grw-review-card {
  animation: grw-fade-up 0.4s ease both;
}

.grw-reviews-grid .grw-review-card:nth-child(1) { animation-delay: 0.05s; }
.grw-reviews-grid .grw-review-card:nth-child(2) { animation-delay: 0.10s; }
.grw-reviews-grid .grw-review-card:nth-child(3) { animation-delay: 0.15s; }
.grw-reviews-grid .grw-review-card:nth-child(4) { animation-delay: 0.20s; }
.grw-reviews-grid .grw-review-card:nth-child(5) { animation-delay: 0.25s; }
.grw-reviews-grid .grw-review-card:nth-child(6) { animation-delay: 0.30s; }
