.jdgm-testimonials-carousel {
  margin: 0 auto;
  max-width: var(--max-width);
  padding: 20px;
  text-align: center;

  .jdgm-header {
    margin-bottom: 40px;
  }

  .jdgm-title {
    font-size: 32px;
    font-weight: normal;
    margin-bottom: 8px;
    color: var(--text-color);
    line-height: 1.2;

    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    -webkit-line-clamp: 1;
  }

  .jdgm-header-info {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    justify-content: center;
    margin-top: 8px;
  }

  .jdgm-average-rating {
    display: flex;
    gap: 8px;

    .jdgm-star {
      color: var(--text-color);
    }
  }

  .jdgm-rating-text {
    font-size: 16px;
    color: var(--text-color);
    font-weight: normal;
  }

  .jdgm-testimonials-carousel__verified-badge {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .jdgm-verified-text {
    font-size: 16px;
    color: var(--text-color);
    font-weight: normal;
  }

  .jdgm-verified-checkmark {
    width: 20px;
    height: 20px;
    fill: #3EB2A2;
  }

  .jdgm-content {
    position: relative;
    display: flex;
    align-items: center;
    gap: 24px;
    margin-bottom: 40px;
  }

  .jdgm-card {
    background: var(--card-color);
    border-radius: var(--border-radius);
    border: var(--border);
    box-shadow: var(--box-shadow);
    padding: 40px;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
  }

  .jdgm-card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    width: 100%;
  }

  .jdgm-quote-marks {
    height: var(--quote-size);
    background-image: var(--quote-bg);
    aspect-ratio: var(--quote-aspect);
    background-repeat: no-repeat;
    background-size: contain;
  }

  .jdgm-text {
    font-size: var(--text-size);
    color: var(--text-color);
    line-height: 1.2;
    text-align: center;
    font-weight: normal;
    max-width: 100%;
    min-height: calc(var(--line-clamp) * 1.2em);
    display: flex;
    flex-direction: column;
    justify-content: center;

    p {
      margin: 0;
      /* Truncate text to n lines based on card height */
      display: -webkit-box;
      -webkit-box-orient: vertical;
      overflow: hidden;
      text-overflow: ellipsis;
      -webkit-line-clamp: var(--line-clamp);
    }
  }

  .jdgm-rating-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: 100%;

    .jdgm-star {
      font-size: var(--stars-size);
      color: var(--stars-color);
    }
  }

  .jdgm-reviewer-info {
    display: flex;
    align-items: center;
    gap: 4px;
  }

  .jdgm-reviewer-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
    line-height: 1.5;
  }

  .jdgm-reviewer-verified-icon {
    width: 20px;
    height: 20px;
    display: inline-block;
    color: var(--text-color);
  }

  .jdgm-reviewer-verified-text {
    background: transparent;
    color: var(--text-color);
    font-size: 12px;
    font-weight: 500;
    padding: 4px 8px;
    letter-spacing: 0.05em;
    border-radius: var(--border-radius);
    border: 1px solid var(--text-color);
  }

  .jdgm-product-name {
    font-size: var(--product-name-size);
    color: var(--text-color);
    text-decoration: underline;
    text-decoration-skip-ink: none;
    text-underline-position: from-font;
    font-weight: normal;
    text-align: center;
    width: 510px;
    max-width: 100%;

    a {
      color: var(--text-color);
    }
  }

  .jdgm-arrow {
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--arrows-color);
    transition: opacity 0.2s;
    flex-shrink: 0;

    &:hover {
      opacity: 0.7;
    }

    svg {
      width: 20px;
      height: 34px;
      fill: currentColor;
    }
  }

  .jdgm-arrows--bottom {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
  }

  .jdgm-testimonials-container {
    position: relative;
    height: auto;
    min-height: 200px;
    width: 100%;
  }

  .jdgm-testimonial {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    pointer-events: none;
  }

  .jdgm-testimonial.active {
    opacity: 1;
    pointer-events: auto;
    position: relative;
  }
}

@media (max-width: 768px) {
  .jdgm-testimonials-carousel {
    .jdgm-header-info {
      flex-direction: column;
      gap: 8px;
    }

    .jdgm-card {
      padding: 24px;
    }

    .jdgm-card-content {
      gap: 16px;
    }

    .jdgm-title {
      font-size: 24px;
    }

    .jdgm-text {
      font-size: var(--text-size-mobile);
      min-height: calc(var(--line-clamp-mobile) * 1.2em);

      p {
        -webkit-line-clamp: var(--line-clamp-mobile);
      }
    }

    .jdgm-product-name {
      width: 100%;
    }
  }
}
