/* =========================
   Testimonials (mobile-first)
   ========================= */

/* Container + header */
.testimonials {
  background: #fafafa;
  padding: 2rem 1rem;
  border-radius: 12px;
  max-width: 1100px;
  margin: 0 auto;
}

.testimonials__head {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: .75rem;
  margin-bottom: 1rem;
}

.testimonials__title {
  margin: 0;
  font-size: clamp(1.6rem, 1.1rem + 2.2vw, 2.4rem);
  color: var(--primary);
}

.testimonials__meta {
  margin: 0;
  color: var(--text-muted, #5b6673);
  font-size: .95rem;
}

/* Rating badge (optional) */
.rating-badge {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .4rem .7rem;
  border: 1px solid rgba(0,0,0,.08);
  border-radius: 999px;
  background: #fff;
  font-weight: 600;
}
.rating-badge .stars { margin-left: .25rem; }

/* ======================================
   Reviews list
   - Mobile: horizontal carousel w/ pips
   - ≥ 768px: 2-column grid (no overflow)
   ====================================== */

/* Mobile carousel */
.reviews-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 88%;
  gap: .75rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: .25rem;
  /* hide scrollbar but keep scrollability */
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.reviews-grid::-webkit-scrollbar { display: none; }

.review-card { scroll-snap-align: start; }

/* Two-column from tablet up */
@media (min-width: 768px) {
  .reviews-grid {
    overflow: visible;
    scroll-snap-type: none;
    display: grid;
    grid-auto-flow: initial;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
  }
  .review-card { scroll-snap-align: unset; }
}

/* Three-column option on very wide screens */
@media (min-width: 1100px) {
  .reviews-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Review card */
.review-card {
  border: 1px solid rgba(0,0,0,.1);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
  overflow: hidden;
  display: grid;
  gap: .75rem;
}

.review-media {
  width: 100%;
  aspect-ratio: 16/9;
  background: #f4f6f8;
  overflow: hidden;
}
.review-media img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}

.review-body { padding: 1rem; display: grid; gap: .5rem; }

/* Header row */
.review-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: .75rem;
  align-items: center;
}
.review-author { font-weight: 700; line-height: 1.2; }
.source-badge {
  display: inline-flex; align-items: center; gap: .25rem;
  color: var(--text-muted, #5b6673);
  font-size: .85rem; white-space: nowrap;
}
.source-badge svg { width: 16px; height: 16px; }

/* Content + footer */
.review-text { color: var(--text, #222); line-height: 1.6; }
.review-footer { color: var(--text-muted, #5b6673); font-size: .9rem; }

/* Stars */
.stars { display: inline-flex; gap: 2px; }
.star { width: 16px; height: 16px; display: inline-block; }

/* Skeleton */
.review-card.skeleton {
  min-height: 220px; position: relative; overflow: hidden; border: 0;
  background: linear-gradient(90deg, #eee 25%, #f6f6f6 37%, #eee 63%);
  background-size: 400% 100%; animation: shimmer 1.25s infinite;
  border-radius: 16px;
}
@keyframes shimmer { 0% {background-position: 100% 0} 100% {background-position: -100% 0} }

/* Optional gallery variant */
.testimonials[data-variant="gallery"] .reviews-grid { grid-template-columns: 1fr; }
.testimonials[data-variant="gallery"] .review-card { display: grid; grid-template-columns: 1.2fr 1fr; }
@media (max-width: 800px) {
  .testimonials[data-variant="gallery"] .review-card { grid-template-columns: 1fr; }
}

/* Google CTA */
.review-google { margin-top: 1rem; text-align: center; }
.btn-google {
  display: inline-block;
  padding: 0.65rem 1.25rem;
  border-radius: 999px;
  background: #4285F4;
  color: #fff; text-decoration: none; font-weight: 600;
  transition: background .2s ease;
}
.btn-google:hover { background: #3367D6; }
.btn-google svg { width: 18px; height: 18px; margin-right: .4rem; vertical-align: middle; }

/* Center when there are 1–2 reviews on desktop */
@media (min-width: 768px) {
  .reviews-grid:has(.review-card:nth-child(1):last-child),
  .reviews-grid:has(.review-card:nth-child(2):last-child) {
    justify-items: center;
  }
  .reviews-grid:has(.review-card:nth-child(1):last-child) .review-card { max-width: 520px; width: 100%; }
}

/* === Carousel Style Grid: one row, two cards per view, scrollable === */
.reviews-grid.carousel-track {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  gap: 1rem;
  padding-bottom: 0.5rem;
  scrollbar-width: none;
}
.reviews-grid.carousel-track::-webkit-scrollbar {
  display: none;
}

.review-card {
  flex: 0 0 50%;
  scroll-snap-align: start;
  border: 1px solid rgba(0,0,0,.1);
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,.05);
  overflow: hidden;
  display: grid;
  gap: .75rem;
}

/* Remove old grid-based responsive overrides */
@media (min-width: 768px) {
  .reviews-grid {
    display: flex !important;
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
  }
}

/* === Pips (dots) === */
.review-pips {
  display: flex;
  justify-content: center;
  gap: .5rem;
  margin-top: 1rem;
}
.review-pips button {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid #999;
  background: #fff;
  transition: all 0.2s ease;
  padding: 0;
  cursor: pointer;
}
.review-pips button.is-active {
  background: #333;
  border-color: #333;
}

/* === Carousel navigation (if you add arrows later) === */
.carousel-nav {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1rem;
}
.carousel-nav button {
  background: #fff;
  border: 1px solid rgba(0,0,0,.2);
  padding: 0.5rem 1.25rem;
  border-radius: 999px;
  cursor: pointer;
  font-size: 1.25rem;
  font-weight: bold;
}
.carousel-nav button:disabled {
  opacity: 0.4;
  cursor: default;
}

.carousel-page-wrapper {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

