/* google-reviews-widget styles
   https://github.com/Treefella/google-reviews-widget */

/* ── Root ── */
.grw-root {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  box-sizing: border-box;
  color: var(--grw-text);
}
.grw-root *,
.grw-root *::before,
.grw-root *::after {
  box-sizing: inherit;
}

/* ── Light theme (default) ── */
.grw-theme-light {
  --grw-bg:          #ffffff;
  --grw-surface:     #f5f6f7;
  --grw-surface-2:   #ebedef;
  --grw-border:      #e4e6e8;
  --grw-text:        #202124;
  --grw-text-muted:  #5f6368;
  --grw-star:        #fbbc04;
  --grw-star-empty:  #dadce0;
  --grw-accent:      #1a73e8;
  --grw-accent-text: #ffffff;
  --grw-radius:      12px;
  --grw-gap:         20px;
  --grw-clamp:       3;
  --grw-shadow:      0 1px 3px rgba(0,0,0,0.10);
  --grw-shadow-lg:   0 12px 40px rgba(0,0,0,0.22);
}

/* ── Dark theme ── */
.grw-theme-dark {
  --grw-bg:          #0f172a;
  --grw-surface:     #1e293b;
  --grw-surface-2:   #273449;
  --grw-border:      #334155;
  --grw-text:        #f1f5f9;
  --grw-text-muted:  #94a3b8;
  --grw-star:        #fbbf24;
  --grw-star-empty:  #475569;
  --grw-accent:      #3b82f6;
  --grw-accent-text: #ffffff;
  --grw-radius:      12px;
  --grw-gap:         20px;
  --grw-clamp:       3;
  --grw-shadow:      0 1px 3px rgba(0,0,0,0.40);
  --grw-shadow-lg:   0 12px 40px rgba(0,0,0,0.60);
}

/* ── Shared bits ── */
.grw-wordmark {
  font-size: 1.35rem;
  font-weight: 500;
  letter-spacing: -0.5px;
}
.grw-stars {
  position: relative;
  display: inline-block;
  white-space: nowrap;
  font-size: 1rem;
  line-height: 1;
  letter-spacing: 1px;
  vertical-align: middle;
}
.grw-stars-bg { color: var(--grw-star-empty); }
.grw-stars-fg {
  position: absolute;
  top: 0; left: 0;
  overflow: hidden;
  color: var(--grw-star);
}
.grw-stars-lg { font-size: 1.25rem; }

.grw-verified {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
  align-self: center;
}

.grw-cta {
  display: inline-block;
  padding: 12px 22px;
  background: var(--grw-accent);
  color: var(--grw-accent-text);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  border-radius: 8px;
  white-space: nowrap;
  transition: filter 0.2s ease;
}
.grw-cta:hover { filter: brightness(0.92); }

/* ── Header bar ── */
.grw-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding: 20px 24px;
  margin-bottom: 24px;
  background: var(--grw-surface);
  border-radius: var(--grw-radius);
}
.grw-head[hidden] { display: none; }
.grw-head-title {
  display: flex;
  align-items: baseline;
  gap: 7px;
  font-size: 1.25rem;
  font-weight: 700;
}
.grw-head-rating {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}
.grw-head-rating strong { font-size: 1.3rem; }
.grw-head-count {
  font-size: 0.8rem;
  color: var(--grw-text-muted);
}

/* ── Static grid (carousel: false) ── */
.grw-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--grw-gap);
  align-items: start;
}
@media (max-width: 1200px) { .grw-list { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px)  { .grw-list { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px)  { .grw-list { grid-template-columns: 1fr; } }

/* ── Carousel ── */
.grw-carousel { position: relative; }

.grw-track {
  /* overwritten inline by the script from the perView breakpoints */
  --grw-per-view: 1;
  display: flex;
  gap: var(--grw-gap);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 4px 0 14px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.grw-track::-webkit-scrollbar { display: none; }
.grw-track:focus-visible {
  outline: 2px solid var(--grw-accent);
  outline-offset: 4px;
  border-radius: var(--grw-radius);
}
.grw-carousel .grw-card {
  flex: 0 0 calc((100% - (var(--grw-per-view) - 1) * var(--grw-gap)) / var(--grw-per-view));
  min-width: 0;
  scroll-snap-align: start;
}

.grw-nav {
  position: absolute;
  top: calc(50% - 24px);
  transform: translateY(-50%);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  cursor: pointer;
  background: var(--grw-bg);
  color: var(--grw-text);
  border: 1px solid var(--grw-border);
  border-radius: 50%;
  box-shadow: var(--grw-shadow);
  transition: background 0.2s ease, opacity 0.2s ease;
}
.grw-nav svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.grw-nav:hover:not(:disabled) { background: var(--grw-surface-2); }
.grw-nav:disabled { opacity: 0.35; cursor: default; }
.grw-nav[hidden] { display: none; }
.grw-prev { left: -19px; }
.grw-next { right: -19px; }
@media (max-width: 1180px) {
  .grw-prev { left: -12px; }
  .grw-next { right: -12px; }
}

.grw-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 4px;
}
.grw-dot {
  width: 9px;
  height: 9px;
  padding: 0;
  cursor: pointer;
  border: 0;
  border-radius: 50%;
  background: var(--grw-surface-2);
  transition: background 0.2s ease, width 0.2s ease;
}
.grw-dot:hover { background: var(--grw-text-muted); }
.grw-dot.is-active {
  width: 26px;
  border-radius: 999px;
  background: var(--grw-star);
}
.grw-carousel.grw-static .grw-dots { display: none; }

/* ── Review card ── */
.grw-card {
  display: flex;
  flex-direction: column;
  padding: 20px;
  background: var(--grw-surface);
  border-radius: var(--grw-radius);
  transition: background 0.2s ease;
}
.grw-card:hover { background: var(--grw-surface-2); }

.grw-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.grw-avatar {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--grw-accent);
  overflow: visible;
}
.grw-avatar img:not(.grw-avatar-g) {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}
.grw-avatar-initial {
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1;
}
.grw-avatar-g {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 16px;
  height: 16px;
  padding: 1px;
  background: var(--grw-bg);
  border-radius: 50%;
}
.grw-meta {
  flex: 1;
  min-width: 0;
}
.grw-author {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.25;
}
.grw-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.grw-time {
  font-size: 0.78rem;
  color: var(--grw-text-muted);
  margin-top: 2px;
}

.grw-text {
  display: -webkit-box;
  -webkit-line-clamp: var(--grw-clamp, 3);
  line-clamp: var(--grw-clamp, 3);
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 12px 0 0;
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--grw-text);
}
.grw-text.is-open {
  display: block;
  -webkit-line-clamp: unset;
  line-clamp: unset;
}

.grw-more,
.grw-toggle {
  align-self: flex-start;
  margin-top: 6px;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
  color: var(--grw-accent);
  font-family: inherit;
  font-size: 0.88rem;
}
.grw-more:hover,
.grw-toggle:hover { text-decoration: underline; }
.grw-more[hidden],
.grw-toggle[hidden] { display: none; }

/* ── Modal ── */
.grw-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 32px 16px;
}
.grw-modal[hidden] { display: none; }
.grw-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
}
.grw-modal-dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 720px;
  max-height: calc(100vh - 64px);
  background: var(--grw-bg);
  border-radius: 14px;
  box-shadow: var(--grw-shadow-lg);
  overflow: hidden;
}
.grw-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  cursor: pointer;
  background: none;
  border: 0;
  border-radius: 50%;
  color: var(--grw-text-muted);
}
.grw-modal-close:hover { background: var(--grw-surface); }
.grw-modal-close svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}
.grw-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 26px 56px 20px 28px;
  border-bottom: 1px solid var(--grw-border);
  flex-shrink: 0;
}
.grw-modal-body {
  position: relative; /* offsetTop anchor for scroll-to-review */
  overflow-y: auto;
  padding: 0 28px;
  -webkit-overflow-scrolling: touch;
}

.grw-full {
  padding: 22px 0;
  border-bottom: 1px solid var(--grw-border);
  transition: background 0.3s ease;
}
.grw-full:last-child { border-bottom: 0; }
.grw-full.is-target {
  background: rgba(251, 188, 4, 0.14);
  box-shadow: 0 0 0 12px rgba(251, 188, 4, 0.14);
  border-radius: 4px;
}
.grw-full .grw-card-head { margin-bottom: 10px; }
.grw-full-text {
  margin-top: 12px;
  font-size: 0.94rem;
  line-height: 1.6;
}
.grw-full-text p { margin: 0 0 12px; }
.grw-full-text p:last-child { margin-bottom: 0; }
.grw-full-text.grw-clamped {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ── Owner reply ── */
.grw-reply {
  margin-top: 16px;
  padding: 14px 16px;
  background: var(--grw-surface);
  border-radius: 10px;
}
.grw-reply-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}
.grw-reply-logo {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 6px;
  object-fit: cover;
}
.grw-reply-logo-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--grw-accent);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
}
.grw-reply-name {
  font-size: 0.88rem;
  font-weight: 700;
}
.grw-chip {
  padding: 2px 6px;
  background: var(--grw-surface-2);
  border-radius: 4px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  color: var(--grw-text-muted);
}
.grw-reply-time {
  width: 100%;
  font-size: 0.75rem;
  color: var(--grw-text-muted);
}
.grw-reply-body {
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--grw-text);
}
.grw-reply-body p { margin: 0 0 10px; }
.grw-reply-body p:last-child { margin-bottom: 0; }
.grw-reply-body.grw-clamped {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (max-width: 560px) {
  .grw-head { padding: 18px; }
  .grw-cta { width: 100%; text-align: center; }
  .grw-modal { padding: 0; }
  .grw-modal-dialog { max-height: 100vh; border-radius: 0; }
  .grw-modal-head { padding: 22px 52px 18px 20px; }
  .grw-modal-body { padding: 0 20px; }
}

/* ── Empty / error state ── */
.grw-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--grw-text-muted);
  padding: 20px 0;
}

/* ── Reduced motion ── */
@media (prefers-reduced-motion: reduce) {
  .grw-track { scroll-behavior: auto; }
  .grw-card,
  .grw-nav,
  .grw-dot,
  .grw-full,
  .grw-cta { transition: none; }
}
