/*==============================================================================
  Testimonials – Google Reviews widget
  ------------------------------------------------------------------------------
  Drop-in styles for the Google-Reviews style testimonials section + pop-up.

  INTEGRATION:
    Replace the existing "# Testimonials Section" block in
    Axis-pro/assets/css/main.css (lines 1969–2305, i.e. everything between the
    "# Testimonials Section" and "# Contact Section" comment banners) with this
    file, OR load this file AFTER main.css. It reuses the template's CSS variables
    (--accent-color, --surface-color, --heading-color, --default-color) so it
    automatically picks up the brand palette.

  CONTENTS:
    1. Section + Google summary block (Feature 1)
    2. Shared bits: avatar + Google "G" badge, name/date, stars
    3. Review cards in the Swiper carousel (Feature 2)
    4. Reviews pop-up / Bootstrap modal (Feature 3)
==============================================================================*/

.testimonials {
  position: relative;
  overflow: hidden;
}

/* The inline SVG sprite that defines the Google "G" must never take up space. */
.testimonials .gr-svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/*------------------------------------------------------------------------------
  1. Google reviews summary block (logo + average rating + count + CTA button)
------------------------------------------------------------------------------*/
.google-reviews-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  background-color: color-mix(in srgb, var(--default-color), transparent 94%);
  border-radius: 16px;
  padding: 22px 28px;
  margin-bottom: 40px;
}

.google-reviews-summary .gr-summary-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
}

/* The provided "Google Customer Reviews" logo image */
.google-reviews-summary .gr-summary-logo {
  height: 34px;
  width: auto;
  display: block;
}

/* Average rating + stars + count row, written below the logo */
.google-reviews-summary .gr-summary-rating {
  display: flex;
  align-items: center;
  gap: 8px;
}

.google-reviews-summary .gr-avg {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--heading-color);
  line-height: 1;
}

.google-reviews-summary .gr-count {
  font-size: 0.9rem;
  color: color-mix(in srgb, var(--default-color), transparent 30%);
}

/* "Review us on Google" button (dark pill, matches the screenshots) */
.google-reviews-summary .gr-review-btn {
  flex-shrink: 0;
  display: inline-block;
  background-color: var(--heading-color);
  color: var(--contrast-color);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 11px 20px;
  border-radius: 8px;
  white-space: nowrap;
  transition: background-color 0.3s ease;
}

.google-reviews-summary .gr-review-btn:hover {
  background-color: color-mix(in srgb, var(--heading-color), #000 15%);
  color: var(--contrast-color);
}

/*------------------------------------------------------------------------------
  2. Shared bits: gold stars, avatar + Google "G" badge, name + date
------------------------------------------------------------------------------*/
/* Gold star rows (summary, cards and modal all share this) */
.gr-stars {
  display: inline-flex;
  gap: 2px;
  color: #fbbc04; /* Google rating gold */
  font-size: 0.95rem;
  line-height: 1;
}

/* Author avatar: coloured circle with the initial. Background colour is set
   per-review via an inline style on the element. */
.gr-avatar {
  position: relative;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 1.2rem;
  font-weight: 600;
  font-family: var(--default-font);
  text-transform: uppercase;
  user-select: none;
}

/* Small white badge holding the multi-colour Google "G", bottom-right */
.gr-avatar .gr-badge {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 18px;
  height: 18px;
  background: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
}

.gr-avatar .gr-badge-svg {
  width: 12px;
  height: 12px;
  display: block;
}

/* Name + relative date stacked next to the avatar */
.gr-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.gr-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.gr-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--heading-color);
  display: flex;
  align-items: center;
  gap: 5px;
}

/* Blue "verified" tick after the name */
.gr-verified {
  color: #4285f4;
  font-size: 0.85rem;
}

.gr-date {
  font-size: 0.8rem;
  color: color-mix(in srgb, var(--default-color), transparent 40%);
}

/*------------------------------------------------------------------------------
  3. Review cards inside the Swiper carousel (Feature 2)
  Cards are flex columns of equal height; the text is clamped to a few lines so
  every card lines up, and "Read more" sits at the bottom.
------------------------------------------------------------------------------*/
.testimonials .testimonial-slider {
  position: relative;
  padding-bottom: 10px;
}

.testimonials .testimonial-slider .swiper-wrapper {
  height: auto !important;
}

.testimonials .gr-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--surface-color);
  border: 1px solid color-mix(in srgb, var(--default-color), transparent 88%);
  border-radius: 12px;
  padding: 22px;
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.testimonials .gr-card:hover {
  border-color: color-mix(in srgb, var(--default-color), transparent 75%);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.07);
}

/* Clamp the preview text to keep all cards the same height. margin-top:0 +
   flex layout pushes "Read more" to the bottom of the card. */
.testimonials .gr-card .gr-text {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--default-color);
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* "Read more" link-style button that opens the pop-up */
.gr-readmore {
  margin-top: auto;
  align-self: flex-start;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent-color);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.3s ease;
}

.gr-readmore:hover {
  color: color-mix(in srgb, var(--accent-color), #000 20%);
  text-decoration: underline;
}

/*------------------------------------------------------------------------------
  Carousel navigation – kept consistent with the original template arrows
------------------------------------------------------------------------------*/
.testimonials .swiper-navigation {
  position: relative;
  margin-top: 25px;
  display: flex;
  justify-content: flex-end;
}

.testimonials .swiper-button-prev,
.testimonials .swiper-button-next {
  position: static;
  width: 45px;
  height: 45px;
  margin: 0 10px;
  background: var(--accent-color);
  border-radius: 50%;
  color: var(--contrast-color);
  font-size: 16px;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.testimonials .swiper-button-prev:hover,
.testimonials .swiper-button-next:hover {
  background: color-mix(in srgb, var(--accent-color), var(--heading-color) 20%);
  transform: scale(1.05);
}

.testimonials .swiper-button-prev::after,
.testimonials .swiper-button-next::after {
  font-size: 16px;
  font-weight: 600;
}

/*------------------------------------------------------------------------------
  4. Reviews pop-up (Bootstrap modal) – Feature 3
------------------------------------------------------------------------------*/
/* Header holds the same summary block; let it span the full width and put the
   close button in the top-right corner. */
.gr-modal .gr-modal-header {
  position: relative;
  align-items: stretch;
  padding: 20px 24px;
  border-bottom: 1px solid
    color-mix(in srgb, var(--default-color), transparent 88%);
}

.gr-modal .gr-modal-header .google-reviews-summary {
  flex: 1;
  margin-bottom: 0;
  margin-right: 28px; /* room for the close button */
}

.gr-modal .gr-modal-header .btn-close {
  position: absolute;
  top: 16px;
  right: 16px;
  margin: 0;
}

.gr-modal .modal-body {
  padding: 0 24px;
}

/* One full review per block, divider between them */
.gr-modal .gr-modal-review {
  padding: 22px 0;
  border-bottom: 1px solid
    color-mix(in srgb, var(--default-color), transparent 90%);
}

.gr-modal .gr-modal-review:last-child {
  border-bottom: 0;
}

.gr-modal .gr-modal-review .gr-stars {
  margin: 12px 0 8px;
}

/* Full review text. Collapsed by default (clamped); .expanded removes the clamp.
   The inline script decides whether the toggle is needed. */
.gr-modal .gr-modal-text {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--default-color);
  /* Reviews come from YAML with real \n\n paragraph breaks; pre-line renders
     them as blank lines without us having to inject <br> (avoids |safe). */
  white-space: pre-line;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.gr-modal .gr-modal-text.expanded {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
}

/* "Read more" / "Hide" toggle inside the pop-up */
.gr-modal .gr-toggle {
  margin-top: 6px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent-color);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}

.gr-modal .gr-toggle:hover {
  text-decoration: underline;
}

/* Owner reply block (rendered only when a review has a reply) */
.gr-modal .gr-reply {
  margin: 14px 0 0 56px;
  padding: 12px 16px;
  background: color-mix(in srgb, var(--default-color), transparent 94%);
  border-radius: 10px;
}

.gr-modal .gr-reply-head {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--heading-color);
  margin-bottom: 4px;
}

.gr-modal .gr-reply-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: color-mix(in srgb, var(--default-color), transparent 25%);
  background: color-mix(in srgb, var(--default-color), transparent 85%);
  border-radius: 4px;
  vertical-align: middle;
}

.gr-modal .gr-reply-text {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--default-color);
}

/*------------------------------------------------------------------------------
  Responsive tweaks
------------------------------------------------------------------------------*/
@media (max-width: 575px) {
  .google-reviews-summary {
    padding: 18px 20px;
  }

  .google-reviews-summary .gr-summary-logo {
    height: 28px;
  }

  .gr-modal .gr-reply {
    margin-left: 0;
  }
}
