/* ===========================================================================
   EPOREX — Google Reviews section
   ---------------------------------------------------------------------------
   Every selector is prefixed `google-reviews-` so nothing here can collide
   with the Manrox theme. Theme custom properties are referenced with
   fallbacks, so the section still looks right if style.css ever changes.
   Load this AFTER style.css.
   =========================================================================== */

.google-reviews-section {
  --gr-accent: var(--theme-color, #fe712b);
  --gr-dark: var(--color-dark, #0d403e);
  --gr-body: var(--body-text-color, #757f95);
  --gr-star: #fbbc04;          /* Google's own star yellow */
  --gr-line: rgba(13, 64, 62, 0.1);
  --gr-card: #ffffff;
  --gr-radius: 14px;

  padding: 100px 0;
  background: var(--theme-bg-light, #f6f6f6);
}

/* ---- Summary header ------------------------------------------------------ */
.google-reviews-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  background: var(--gr-card);
  border: 1px solid var(--gr-line);
  border-radius: var(--gr-radius);
  padding: 32px 36px;
  margin-bottom: 34px;
}

.google-reviews-summary-main {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}

.google-reviews-glyph {
  width: 52px;
  height: 52px;
  flex: none;
}

.google-reviews-score {
  font-family: var(--heading-font, "Sora", sans-serif);
  font-size: 44px;
  font-weight: 700;
  line-height: 1;
  color: var(--gr-dark);
}

.google-reviews-summary-text {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.google-reviews-summary-title {
  font-family: var(--heading-font, "Sora", sans-serif);
  font-size: 19px;
  font-weight: 600;
  color: var(--gr-dark);
  margin: 0;
  line-height: 1.2;
}

.google-reviews-count {
  font-size: 14.5px;
  color: var(--gr-body);
  margin: 0;
}

.google-reviews-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* Buttons are self-contained so they don't inherit .theme-btn quirks. */
.google-reviews-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--heading-font, "Sora", sans-serif);
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1;
  padding: 15px 26px;
  border-radius: 40px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s ease-in-out;
}

.google-reviews-btn-primary {
  background: var(--gr-accent);
  color: #fff;
}
.google-reviews-btn-primary:hover {
  background: var(--gr-dark);
  color: #fff;
}

.google-reviews-btn-ghost {
  background: transparent;
  color: var(--gr-dark);
  border-color: var(--gr-line);
}
.google-reviews-btn-ghost:hover {
  background: var(--gr-dark);
  border-color: var(--gr-dark);
  color: #fff;
}

/* ---- Stars --------------------------------------------------------------- */
.google-reviews-stars {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  line-height: 1;
}

.google-reviews-star {
  width: 18px;
  height: 18px;
  flex: none;
}
.google-reviews-star-full { fill: var(--gr-star); }
.google-reviews-star-empty { fill: #dadce0; }

/* Half star: a full star clipped to its left half over an empty one. */
.google-reviews-star-half-wrap {
  position: relative;
  width: 18px;
  height: 18px;
  flex: none;
}
.google-reviews-star-half-wrap svg {
  position: absolute;
  inset: 0;
}
.google-reviews-star-half-fill {
  clip-path: inset(0 50% 0 0);
}

.google-reviews-summary .google-reviews-star,
.google-reviews-summary .google-reviews-star-half-wrap {
  width: 22px;
  height: 22px;
}

/* ---- Grid ---------------------------------------------------------------- */
.google-reviews-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

/* ---- Card ---------------------------------------------------------------- */
.google-reviews-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--gr-card);
  border: 1px solid var(--gr-line);
  border-radius: var(--gr-radius);
  padding: 26px 26px 22px;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}
.google-reviews-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--box-shadow, 0 0 40px 5px rgba(0, 0, 0, 0.05));
}

.google-reviews-card-head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.google-reviews-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
  background: #eef1f4;
}

/* Initial-letter fallback when the reviewer has no photo, or it 404s. */
.google-reviews-avatar-fallback {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--heading-font, "Sora", sans-serif);
  font-size: 19px;
  font-weight: 600;
  color: #fff;
  background: var(--gr-dark);
  text-transform: uppercase;
}

.google-reviews-author {
  min-width: 0;
}

.google-reviews-name {
  font-family: var(--heading-font, "Sora", sans-serif);
  font-size: 16px;
  font-weight: 600;
  color: var(--gr-dark);
  margin: 0 0 3px;
  line-height: 1.25;
  word-break: break-word;
}
a.google-reviews-name:hover {
  color: var(--gr-accent);
  text-decoration: underline;
}

.google-reviews-date {
  font-size: 13px;
  color: var(--gr-body);
  margin: 0;
}

.google-reviews-card-rating {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.google-reviews-badge {
  width: 18px;
  height: 18px;
  flex: none;
  opacity: 0.9;
}

.google-reviews-text {
  font-size: 15px;
  line-height: 1.75;
  color: var(--gr-body);
  margin: 0 0 16px;
  white-space: pre-line;   /* keep the reviewer's own line breaks */
}

/* Collapsed by default; the FULL text is always in the DOM (never truncated
   server-side) so Google's "display reviews as written" rule holds. */
.google-reviews-text.is-clamped {
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.google-reviews-readmore {
  align-self: flex-start;
  background: none;
  border: 0;
  padding: 0;
  margin: -8px 0 16px;
  font-family: var(--heading-font, "Sora", sans-serif);
  font-size: 13.5px;
  font-weight: 600;
  color: var(--gr-accent);
  cursor: pointer;
}
.google-reviews-readmore:hover { text-decoration: underline; }

.google-reviews-card-foot {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--gr-line);
}

.google-reviews-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  font-weight: 600;
  font-family: var(--heading-font, "Sora", sans-serif);
  color: var(--gr-dark);
  text-decoration: none;
  transition: color 0.25s ease, gap 0.25s ease;
}
.google-reviews-link:hover {
  color: var(--gr-accent);
  gap: 11px;
}

/* ---- Show-more ----------------------------------------------------------- */
.google-reviews-more {
  text-align: center;
  margin-top: 32px;
}

/* ---- States -------------------------------------------------------------- */
.google-reviews-status {
  text-align: center;
  padding: 44px 20px;
  border: 1px dashed var(--gr-line);
  border-radius: var(--gr-radius);
  background: var(--gr-card);
}
.google-reviews-status p {
  margin: 0 0 6px;
  color: var(--gr-body);
  font-size: 15px;
}
.google-reviews-status-title {
  font-family: var(--heading-font, "Sora", sans-serif);
  font-size: 18px;
  font-weight: 600;
  color: var(--gr-dark);
  margin: 0 0 8px;
}

/* Skeletons — shown while loading, never populated with fake content. */
.google-reviews-skeleton {
  background: var(--gr-card);
  border: 1px solid var(--gr-line);
  border-radius: var(--gr-radius);
  padding: 26px;
}
.google-reviews-sk-line {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, #eef1f4 25%, #e2e7ec 37%, #eef1f4 63%);
  background-size: 400% 100%;
  animation: google-reviews-shimmer 1.4s ease infinite;
  margin-bottom: 11px;
}
.google-reviews-sk-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(90deg, #eef1f4 25%, #e2e7ec 37%, #eef1f4 63%);
  background-size: 400% 100%;
  animation: google-reviews-shimmer 1.4s ease infinite;
  margin-bottom: 16px;
}
.google-reviews-sk-line.w40 { width: 40%; }
.google-reviews-sk-line.w60 { width: 60%; }
.google-reviews-sk-line.w85 { width: 85%; }

@keyframes google-reviews-shimmer {
  0%   { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

.google-reviews-hidden { display: none !important; }

/* ---- Responsive ---------------------------------------------------------- */
@media (max-width: 1199px) {
  .google-reviews-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 991px) {
  .google-reviews-section { padding: 80px 0; }
  .google-reviews-summary { padding: 26px 24px; }
  .google-reviews-score { font-size: 38px; }
}

@media (max-width: 767px) {
  .google-reviews-section { padding: 60px 0; }
  .google-reviews-grid { grid-template-columns: minmax(0, 1fr); }
  .google-reviews-summary {
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    padding: 24px 20px;
  }
  .google-reviews-actions { width: 100%; }
  .google-reviews-btn {
    flex: 1 1 auto;
    justify-content: center;
    padding: 14px 18px;
  }
  .google-reviews-card { padding: 22px 20px 18px; }
}

@media (max-width: 420px) {
  .google-reviews-summary-main { gap: 14px; }
  .google-reviews-score { font-size: 34px; }
  .google-reviews-glyph { width: 42px; height: 42px; }
  .google-reviews-actions { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  .google-reviews-card,
  .google-reviews-link,
  .google-reviews-btn { transition: none; }
  .google-reviews-sk-line,
  .google-reviews-sk-avatar { animation: none; }
}
