/* ==========================================================================
   Baan Khanitha - Google Reviews 5-Star Module (A3)
   Design System: Royal Navy (#272B64), Luxury Gold (#D48C2B), Serif Typography
   100% Bilingual, Touch-Swipeable, Zero External Library Dependencies
   ========================================================================== */

.reviews-section {
  position: relative;
  padding: 80px 20px;
  background: linear-gradient(180deg, #FBF9F5 0%, #F5EFEB 100%);
  color: #222222;
  overflow: hidden;
}

.reviews-section::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 3px;
}

.reviews-container {
  max-width: 1280px;
  margin: 0 auto;
  position: relative;
}

/* --------------------------------------------------------------------------
   Header & Aggregate Rating Score Badge
   -------------------------------------------------------------------------- */
.reviews-header {
  text-align: center;
  margin-bottom: 48px;
}

.reviews-subtitle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-serif, 'EB Garamond', serif);
  font-size: 0.95rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: #D48C2B;
  margin-bottom: 8px;
  font-weight: 600;
}

.reviews-title {
  font-family: var(--font-serif, 'EB Garamond', serif);
  font-size: clamp(2rem, 3.5vw, 2.75rem);
  font-weight: 600;
  color: #181B42;
  margin: 0 0 16px 0;
  letter-spacing: -0.01em;
}

.reviews-badge-wrapper {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  padding: 10px 22px;
  background: #FFFFFF;
  border-radius: 50px;
  box-shadow: 0 4px 20px rgba(39, 43, 100, 0.07);
  border: 1px solid rgba(212, 140, 43, 0.2);
}

.reviews-google-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #333333;
}

.reviews-google-icon {
  width: 20px;
  height: 20px;
}

.reviews-score-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.reviews-score-num {
  font-size: 1.15rem;
  font-weight: 700;
  color: #181B42;
}

.reviews-stars-summary {
  display: inline-flex;
  gap: 2px;
  color: #D48C2B;
}

.reviews-count-text {
  font-size: 0.85rem;
  color: #666666;
}

/* --------------------------------------------------------------------------
   Carousel Controls & Track
   -------------------------------------------------------------------------- */
.reviews-carousel-wrapper {
  position: relative;
  margin: 0 -10px;
}

.reviews-track {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: 16px 10px 32px 10px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
}

.reviews-track::-webkit-scrollbar {
  display: none; /* Chrome, Safari */
}

/* --------------------------------------------------------------------------
   Individual Review Card
   -------------------------------------------------------------------------- */
.review-card {
  flex: 0 0 calc(33.333% - 16px);
  min-width: 300px;
  scroll-snap-align: start;
  background: #FFFFFF;
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 10px 30px rgba(24, 27, 66, 0.05);
  border: 1px solid rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
  position: relative;
}

.review-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 16px 36px rgba(39, 43, 100, 0.12);
  border-color: rgba(212, 140, 43, 0.3);
}

.review-card-top {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}

/* Avatar Container (Image or Initials fallback) */
.review-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #272B64 0%, #181B42 100%);
  color: #FFFFFF;
  font-weight: 600;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
  border: 2px solid #D48C2B;
  user-select: none;
}

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

.review-meta {
  flex-grow: 1;
  min-width: 0;
}

.review-author {
  font-family: var(--font-serif, 'EB Garamond', serif);
  font-size: 1.15rem;
  font-weight: 600;
  color: #181B42;
  margin: 0 0 2px 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.review-branch-tag {
  display: block;
  font-size: 0.78rem;
  color: #D48C2B;
  font-weight: 500;
}

/* Rating Stars */
.review-stars {
  display: flex;
  gap: 3px;
  margin-bottom: 14px;
  color: #D48C2B;
}

.star-icon {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

/* Review Quote Body */
.review-body {
  font-size: 0.95rem;
  line-height: 1.65;
  color: #4A4A4A;
  margin: 0 0 20px 0;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  position: relative;
}

.review-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8rem;
  color: #888888;
  border-top: 1px solid #F0EAE4;
  padding-top: 14px;
}

.review-verified {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #2E7D32;
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   Navigation Arrows & Pagination Dots
   -------------------------------------------------------------------------- */
.reviews-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
  color: #181B42;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  transition: all 0.25s ease;
}

.reviews-nav-btn:hover {
  background: #272B64;
  color: #FFFFFF;
  border-color: #272B64;
  box-shadow: 0 6px 18px rgba(39, 43, 100, 0.25);
}

.reviews-nav-btn.prev {
  left: -20px;
}

.reviews-nav-btn.next {
  right: -20px;
}

.reviews-nav-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.reviews-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
}

.reviews-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #D8D2CA;
  border: none;
  padding: 0;
  cursor: pointer;
  transition: all 0.25s ease;
}

.reviews-dot.active {
  background: #D48C2B;
  width: 26px;
  border-radius: 5px;
}

/* --------------------------------------------------------------------------
   CTA Action to Google Maps
   -------------------------------------------------------------------------- */
.reviews-action-wrapper {
  text-align: center;
  margin-top: 36px;
}

.reviews-external-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: transparent;
  color: #272B64;
  border: 1.5px solid #272B64;
  border-radius: 50px;
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.25s ease;
}

.reviews-external-btn:hover {
  background: #272B64;
  color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(39, 43, 100, 0.2);
}

/* --------------------------------------------------------------------------
   Responsive Breakpoints
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .review-card {
    flex: 0 0 calc(50% - 12px);
    min-width: 280px;
  }
  .reviews-nav-btn.prev { left: -10px; }
  .reviews-nav-btn.next { right: -10px; }
}

@media (max-width: 640px) {
  .reviews-section {
    padding: 56px 16px;
  }
  .review-card {
    flex: 0 0 85%;
    min-width: 260px;
    padding: 22px;
  }
  .reviews-nav-btn {
    display: none; /* Mobile utilizes native touch scroll-snap */
  }
  .reviews-badge-wrapper {
    width: 100%;
    border-radius: 16px;
    padding: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reviews-track {
    scroll-behavior: auto;
  }
  .review-card {
    transition: none;
  }
}
