.testimonial-showcase {
  background-color: rgba(var(--color-background));
  color: rgba(var(--color-text));
}

.testimonial-showcase__inner {
  display: flex;
}

.testimonial-showcase__header {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.testimonial-showcase__header--center {
  align-items: center;
  text-align: center;
}

.testimonial-showcase__heading {
  color: rgba(var(--color-text));
}

.testimonial-showcase__description {
  max-width: 70ch;
  margin: 0;
  color: rgba(var(--color-light-text));
}

/*
  Desktop: left media | right column (tabs top-aligned with media, then quote).
  Figma: media 660, gap 40, content 1100; tabs y=0, body y=148.
*/
.testimonial-showcase__widget {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  grid-template-rows: auto 1fr;
  column-gap: 40px;
  row-gap: 40px;
  align-items: start;
}

.testimonial-showcase__nav {
  display: flex;
  gap: 22px;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  margin: 0;
  overflow-x: auto;
  grid-column: 2;
  grid-row: 1;
}

.testimonial-showcase__avatar {
  flex-shrink: 0;
  width: 108px;
  height: 108px;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  background: none;
  border: 1px solid transparent;
  border-radius: 0;
  opacity: 1;
  transition: border-color 0.2s ease;
}

.testimonial-showcase__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.testimonial-showcase__avatar-fallback {
  display: block;
  width: 100%;
  height: 100%;
  background-color: rgba(var(--color-media-background));
}

.testimonial-showcase__avatar[aria-selected="true"] {
  border-color: rgba(var(--color-text));
}

.testimonial-showcase__panels,
.testimonial-showcase__panel,
.testimonial {
  display: contents;
}

.testimonial-showcase__panel[hidden] {
  display: none;
}

.testimonial__media {
  overflow: hidden;
  aspect-ratio: 1;
  background-color: rgba(var(--color-media-background));
  grid-column: 1;
  grid-row: 1 / span 2;
}

.testimonial-showcase__widget:not(:has(.testimonial-showcase__nav))
  .testimonial__media {
  grid-row: 1;
}

.testimonial__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.testimonial__body {
  display: flex;
  flex-direction: column;
  gap: 20px;
  align-items: flex-start;
  grid-column: 2;
  grid-row: 2;
  padding: 60px;
  background-color: #f6f6f5;
}

.testimonial-showcase__widget:not(:has(.testimonial-showcase__nav))
  .testimonial__body {
  grid-row: 1;
}

.testimonial__rating {
  display: flex;
  gap: 4px;
  align-items: center;
  color: rgba(var(--color-text));
}

.testimonial__rating svg {
  width: 18px;
  height: 18px;
}

.testimonial__quote {
  margin: 0;
  color: rgba(var(--color-text));
}

.testimonial__link {
  color: rgba(var(--color-button-text-link));
  text-decoration: underline;
  text-underline-offset: 4px;
}

.testimonial__author {
  margin: 0;
  color: rgba(var(--color-light-text));
}

.testimonial__product {
  display: flex;
  gap: 16px;
  align-items: center;
  width: 100%;
  max-width: 484px;
  padding: 13px;
  color: #fcfcfa;
  text-decoration: none;
  background-color: #030303;
}

.testimonial__product-main,
a.testimonial__product-main:not(.button),
a.testimonial__product-main:not(.button):hover,
a.testimonial__product-main:not(.button):visited {
  display: flex;
  flex: 1 1 auto;
  gap: 16px;
  align-items: center;
  min-width: 0;
  color: #fcfcfa;
  text-decoration: none;
}

.testimonial__product-media {
  flex-shrink: 0;
  width: 75px;
  height: 75px;
  overflow: hidden;
  background-color: rgba(var(--color-media-background));
}

.testimonial__product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.testimonial__product-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  color: #fcfcfa;
}

.testimonial__product-title {
  margin: 0;
  font-family: var(--sort-display-font);
  font-size: var(--title6-font-size);
  font-weight: 400;
  line-height: 1.2;
  color: #fcfcfa;
}

.testimonial__product .product-price,
.testimonial__product .product-price *,
.testimonial__product-price,
.testimonial__product-price * {
  color: #fcfcfa !important;
  font-size: var(--body3-font-size);
}

.testimonial__product-button,
a.testimonial__product-button:not(.button),
a.testimonial__product-button:not(.button):hover,
a.testimonial__product-button:not(.button):visited {
  display: inline-flex;
  flex-shrink: 0;
  gap: 6px;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  color: #fcfcfa;
  font-size: 12px;
  letter-spacing: 0.04em;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid #fcfcfa;
  align-self: self-end;
}

.testimonial__product-button svg {
  width: 12px;
  height: 12px;
}

@media (max-width: 959px) {
  .testimonial-showcase__widget {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }

  .testimonial-showcase__nav {
    gap: 12px;
  }

  .testimonial-showcase__avatar {
    width: 72px;
    height: 72px;
  }

  .testimonial-showcase__panels,
  .testimonial-showcase__panel:not([hidden]),
  .testimonial {
    display: contents;
  }

  .testimonial-showcase__panel[hidden] {
    display: none;
  }

  .testimonial__media {
    order: 1;
    width: 100%;
  }

  .testimonial-showcase__nav {
    order: 2;
  }

  .testimonial__body {
    order: 3;
    width: 100%;
    grid-column: auto;
    grid-row: auto;
  }

  .testimonial__media {
    grid-column: auto;
    grid-row: auto;
  }

  .testimonial__body {
    gap: 16px;
    padding: 24px 20px;
  }

  .testimonial__product {
    flex-wrap: wrap;
    gap: 12px;
    max-width: none;
    padding: 12px;
  }

  .testimonial__product-media {
    width: 64px;
    height: 64px;
  }

  .testimonial__product-text {
    flex: 1 1 0;
    min-width: 0;
  }

  .testimonial__product-title {
    font-size: 16px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .testimonial__product .product-price,
  .testimonial__product .product-price *,
  .testimonial__product-price,
  .testimonial__product-price * {
    font-size: 14px;
  }

  .testimonial__product-button {
    flex: 1 1 100%;
    align-self: stretch;
    justify-content: center;
    padding: 10px 12px;
    font-size: 12px;
  }
}
