/* ==========================================================================
   Google Reviews Widget — Scoped Styles (.grw-*)
   All classes prefixed to avoid host-page conflicts.
   ========================================================================== */

/* ---------- Reset / container ---------- */
.grw-root {
  --grw-star-filled: #F4B400;
  --grw-star-empty: #E0E0E0;
  --grw-green: #0F9D58;
  --grw-green-hover: #0b8043;
  --grw-text: #202124;
  --grw-text-secondary: #5f6368;
  --grw-bg: #f8f9fa;
  --grw-card-bg: #ffffff;
  --grw-card-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  --grw-card-shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.12);
  --grw-radius: 12px;
  --grw-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  font-family: var(--grw-font);
  color: var(--grw-text);
  line-height: 1.5;
  box-sizing: border-box;
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 16px;
}

.grw-root *, .grw-root *::before, .grw-root *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ---------- Header ---------- */
.grw-header {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
  padding: 20px 24px;
  background: var(--grw-card-bg);
  border-radius: var(--grw-radius);
  box-shadow: var(--grw-card-shadow);
}

.grw-header-logo {
  display: flex;
  align-items: center;
  gap: 10px;
}

.grw-header-logo svg {
  flex-shrink: 0;
}

.grw-header-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--grw-text);
}

.grw-header-rating {
  display: flex;
  align-items: center;
  gap: 8px;
}

.grw-header-rating-number {
  font-size: 28px;
  font-weight: 700;
  color: var(--grw-text);
  line-height: 1;
}

.grw-header-stars {
  display: flex;
  gap: 2px;
}

.grw-header-count {
  font-size: 14px;
  color: var(--grw-text-secondary);
  white-space: nowrap;
}

.grw-header-spacer {
  flex: 1;
}

.grw-header-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: var(--grw-green);
  color: #fff;
  border: none;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--grw-font);
  text-decoration: none;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  white-space: nowrap;
}

.grw-header-cta:hover {
  background: var(--grw-green-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 157, 88, 0.35);
}

.grw-header-cta:active {
  transform: translateY(0);
}

.grw-header-cta svg {
  flex-shrink: 0;
}

/* ---------- Main grid ---------- */
.grw-grid {
  display: grid;
  grid-template-columns: 1fr 3fr;
  gap: 20px;
  align-items: start;
}

/* ---------- Summary card ---------- */
.grw-summary {
  background: var(--grw-card-bg);
  border-radius: var(--grw-radius);
  box-shadow: var(--grw-card-shadow);
  padding: 24px;
  animation: grw-fadeInUp 0.5s ease both;
}

.grw-summary-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--grw-text);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.grw-summary-title svg {
  flex-shrink: 0;
}

.grw-summary-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.grw-summary-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  color: var(--grw-text-secondary);
  line-height: 1.5;
}

.grw-summary-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #e8f5e9;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

.grw-summary-icon svg {
  width: 12px;
  height: 12px;
}

/* ---------- Reviews grid ---------- */
.grw-reviews {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

/* ---------- Review card ---------- */
.grw-card {
  background: var(--grw-card-bg);
  border-radius: var(--grw-radius);
  box-shadow: var(--grw-card-shadow);
  padding: 20px;
  transition: box-shadow 0.25s, transform 0.25s;
  opacity: 0;
  animation: grw-fadeInUp 0.5s ease both;
}

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

.grw-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

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

.grw-avatar-letter {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 600;
  color: #fff;
  flex-shrink: 0;
  text-transform: uppercase;
}

.grw-card-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.grw-card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--grw-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.grw-card-google-icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
}

.grw-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.grw-card-stars {
  display: flex;
  gap: 1px;
}

.grw-card-time {
  font-size: 12px;
  color: var(--grw-text-secondary);
}

.grw-card-text {
  font-size: 14px;
  color: var(--grw-text-secondary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.grw-card-text.grw-expanded {
  display: block;
  -webkit-line-clamp: unset;
}

.grw-card-readmore {
  display: inline-block;
  margin-top: 6px;
  font-size: 13px;
  color: #1a73e8;
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
  font-family: var(--grw-font);
  text-decoration: none;
}

.grw-card-readmore:hover {
  text-decoration: underline;
}

/* ---------- Reply ---------- */
.grw-card-reply {
  margin-top: 12px;
  padding: 12px;
  background: #f1f3f4;
  border-radius: 8px;
  font-size: 13px;
  color: var(--grw-text-secondary);
  line-height: 1.5;
}

.grw-card-reply-label {
  font-weight: 600;
  color: var(--grw-text);
  margin-bottom: 4px;
  font-size: 12px;
}

/* ---------- Skeleton loading ---------- */
.grw-skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: grw-shimmer 1.5s ease-in-out infinite;
  border-radius: 6px;
}

.grw-skeleton-card {
  background: var(--grw-card-bg);
  border-radius: var(--grw-radius);
  box-shadow: var(--grw-card-shadow);
  padding: 20px;
}

.grw-skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

.grw-skeleton-line {
  height: 14px;
  margin-bottom: 8px;
}

.grw-skeleton-line-short {
  width: 60%;
}

.grw-skeleton-line-medium {
  width: 80%;
}

.grw-skeleton-stars {
  width: 100px;
  height: 16px;
  margin-bottom: 12px;
}

.grw-skeleton-text {
  height: 60px;
}

/* ---------- Error state ---------- */
.grw-error {
  text-align: center;
  padding: 48px 24px;
  background: var(--grw-card-bg);
  border-radius: var(--grw-radius);
  box-shadow: var(--grw-card-shadow);
}

.grw-error-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.grw-error-text {
  font-size: 16px;
  color: var(--grw-text-secondary);
  margin-bottom: 16px;
}

.grw-error-retry {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 24px;
  background: var(--grw-green);
  color: #fff;
  border: none;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--grw-font);
  cursor: pointer;
  transition: background 0.2s;
}

.grw-error-retry:hover {
  background: var(--grw-green-hover);
}

/* ---------- Animations ---------- */
@keyframes grw-fadeInUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes grw-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .grw-grid {
    grid-template-columns: 1fr;
  }

  .grw-reviews {
    grid-template-columns: repeat(2, 1fr);
  }

  .grw-summary {
    order: -1;
  }
}

@media (max-width: 768px) {
  .grw-header {
    padding: 16px;
    gap: 10px;
  }

  .grw-header-rating-number {
    font-size: 24px;
  }

  .grw-header-title {
    font-size: 18px;
  }

  .grw-header-spacer {
    display: none;
  }

  .grw-header-cta {
    width: 100%;
    justify-content: center;
    margin-top: 4px;
  }
}

@media (max-width: 640px) {
  .grw-root {
    padding: 12px 8px;
  }

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

  .grw-card {
    padding: 16px;
  }
}

/* ---------- Show More Button ---------- */
.grw-show-more-wrap {
  display: flex;
  justify-content: center;
  padding: 24px 0 8px;
}

.grw-show-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  border: 2px solid #e0e0e0;
  border-radius: 50px;
  background: #fff;
  color: #333;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.grw-show-more-btn:hover {
  border-color: var(--grw-green, #0F9D58);
  color: var(--grw-green, #0F9D58);
  box-shadow: 0 2px 8px rgba(15, 157, 88, 0.15);
}

.grw-show-more-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--grw-green, #0F9D58);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
}
