.review__button-play {
  user-select: none;
  -webkit-appearance: none;
  appearance: none;
  outline: none !important;
}

.reviews-filter {
  --reviews-filter-line-height: 64px;

  display: flex;
  column-gap: 40px;
  align-items: stretch;

  padding: 20px;
  border-radius: 80px;
  margin-bottom: 80px;
  background-color: #fff;
  box-shadow: 0 4px 24px 0px rgba(0,0,0,0.2);

  @media screen and (max-width: 1200px) {
    column-gap: 24px;
  }
  @media screen and (max-width: 1024px) {
    --reviews-filter-line-height: 54px;

    padding: 14px;
    column-gap: 16px;
  }
  @media screen and (max-width: 991px) {
    column-gap: 12px;
  }
  @media screen and (max-width: 768px) {
    row-gap: 16px;
    flex-direction: column;
    border-radius: 24px;
  }

  & .reviews-filter-select {
    width: 100%;
    height: var(--reviews-filter-line-height);
    z-index: 10;
    position: relative;

    border-radius: 34px;
    border: 1px solid #7d9c9e;
    transition: .3s;

    @media screen and (max-width: 1024px) {
      border-radius: 28px;
    }

    &:hover {
      border-color: #222222;
    }
    &:not(.shown) {
      cursor: pointer;
    }
    &.shown {
      z-index: 11;
      border-color: transparent;
    }
    &:not(:hover) {
      transition: 0s;
    }

    & .reviews-filter-select-control {
      z-index: 11;
      position: absolute;
      right: 20px;
      top: 50%;
      transform: translateY(-50%);

      width: 20px;
      height: 20px;
      display: flex;
      align-items: center;
      justify-content: center;
    }
    & :is(.reviews-filter-select-arrow, .reviews-filter-select-close) {
      width: 100%;
      height: 100%;
      display: block;
      fill: #7d9c9e;
      stroke: #7d9c9e;

      &.reviews-filter-select-close {
        width: 16px;
        height: 16px;
        cursor: pointer;
      }
    }
    &.shown .reviews-filter-select-arrow {
      display: none;
    }
    &:not(.shown) .reviews-filter-select-close {
      display: none;
    }
  }
  & .reviews-filter-options {
    width: calc(100% + 2px);
    min-height: calc(100% + 2px);
    overflow-y: hidden;

    z-index: 1;
    position: relative;
    left: -1px;
    top: -1px;

    border-radius: 34px;
    border: 1px solid transparent;

    @media screen and (max-width: 1024px) {
      border-radius: 28px;
    }

    .reviews-filter-select.shown & {
      /* padding: 8px 0; */
      position: absolute;
      border-color: #222222;
      background-color: #fff;
    }
    & .reviews-filter-select-list {
      width: 100%;
      height: 100%;
      max-height: 400px;
      overflow-y: auto;
      -webkit-overflow-scrolling: touch;
      overscroll-behavior-y: contain;

      padding: 12px 0;
      display: flex;
      flex-direction: column;
    }
  }
  & .reviews-filter-option {
    display: block;
    font-weight: 300;
    font-family: "Mulish", sans-serif;
    font-size: calc(16px + 4 * ((100vw - 375px) / 1545));
    text-decoration: none;
    padding: 8px 20px;
    color: #7d9c9e;
    transition: color .3s;

    @media screen and (max-width: 1024px) {
      padding: 4px 20px;
    }

    &::before {
      content: '';
      z-index: 1;
      position: absolute;
      inset: 0;
    }
    &:not([data-select="1"]) {
      display: none;
    }
    .reviews-filter-select.shown &[data-select="1"]::before {
      background-color: rgba(125,156,158,.1);
    }

    &:not(:has(img)):not([data-value="0"]) {
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      width: 100%;
    }

    .reviews-filter-select:is(.shown, :hover) & {
      z-index: 0;
      position: relative;
      color: #222222;
    }
    .reviews-filter-select:not(.shown) & {
      pointer-events: none;
    }
    .reviews-filter-select.shown & {
      display: block;
      padding: 8px 20px;

      &:hover {
        text-decoration: underline;
      }
      &[data-select="1"] {
        color: #7d9c9e;
      }
      &[data-select="1"] {
        pointer-events: none;
      }
    }
  }
  & .reviews-filter-option:has(img) {
    & .reviews-filter-doctor-photo {
      width: 60px;
      min-width: 60px;
      height: 60px;

      overflow: hidden;
      border-radius: 50%;
      border: 1px solid #7d9c9e;

      & img {
        display: block;
        object-fit: cover;
        object-position: center top;
      }
    }
    & .reviews-filter-doctor-info {
      display: flex;
      row-gap: 8px;
      flex-direction: column;
    }
    & .reviews-filter-doctor-position {
      font-size: 14px;
      color: #222222;
    }
    & .reviews-filter-doctor-name {
      font-size: 20px;
      color: #7d9c9e;
    }

    &:hover {
      text-decoration: none !important;

      & .reviews-filter-doctor-name {
        text-decoration: underline !important;
      }
    }

    .reviews-filter-select.shown & {
      display: flex;
      column-gap: 12px;
      align-items: center;
    }
    .reviews-filter-select:not(.shown) &[data-select="1"] *:not(.reviews-filter-doctor-name):not(.reviews-filter-doctor-info) {
      display: none;
    }
    .reviews-filter-select:not(.shown) & .reviews-filter-doctor-name {
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
      width: 100%;
      line-height: 1;
    }
  }
  & .reviews-filter-reset {
    width: var(--reviews-filter-line-height);
    min-width: var(--reviews-filter-line-height);
    height: var(--reviews-filter-line-height);

    display: flex;
    column-gap: 16px;
    align-items: center;
    justify-content: center;

    color: #fff;
    opacity: .5;
    cursor: pointer;
    border-radius: 50%;
    pointer-events: none;
    text-decoration: none;
    background-color: #7d9c9e;
    transition: background-color .3s;

    @media screen and (max-width: 768px) {
      width: 100%;
      border-radius: 24px;
    }

    & svg {
      width: 20px;
      height: 20px;
      stroke: currentColor;

      @media screen and (max-width: 1024px) {
        width: 16px;
        height: 16px;
      }
    }
    & span {
      display: none;
      font-weight: 400;
      font-family: "Forum", serif;
      font-size: calc(16px + 4 * ((100vw - 375px) / 1545));

      @media screen and (max-width: 768px) {
        display: block;
      }
    }
    &:hover {
      background-color: #222222;
    }
    .reviews-filter-select.selected ~ & {
      opacity: 1;
      pointer-events: all;
    }
    .reviews-filter:has(.reviews-filter-option[data-select="1"]:not([data-value="0"])) & {
      opacity: 1;
      pointer-events: all;
    }
  }
}

.reviews__list {
  display: block;

  @media screen and (min-width: 1301px) {
    column-count: 3;
    column-gap: 58px;

    &:has(.reviews__column) {
      grid-template-columns: repeat(3, minmax(0, 1fr));
      gap: 58px;

      & .reviews__column {
        min-width: 0;
      }

      & .reviews__list-item {
        display: inline-block;
        width: 100%;
        margin-bottom: 68px;
      }
    }
  }
  @media screen and (max-width: 1300px) and (min-width: 769px) {
    column-count: 2;
    column-gap: 20px;

    &:has(.reviews__column) {
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 20px;
    }
  }

  @media screen and (max-width: 768px) {
    &:has(.reviews__column) {
      grid-template-columns: minmax(0, 1fr);
      gap: 0;
    }
  }

  &:has(.reviews__column) {
    display: grid;
    /* column-gap: unset !important; */
    column-count: unset !important;
  }
  & .reviews__column {
    min-width: 0;
    margin: 0;
    padding: 0;
    list-style: none;

    & .reviews__list-item {
      display: block;
      width: 100%;
      margin-bottom: 68px;
      break-inside: unset;
    }
  }

  & .reviews__list-item {
    z-index: 0;
    position: relative;
    break-inside: avoid;
    margin-bottom: 68px;
    display: inline-block;
    width: 100%;

    @media screen and (max-width: 1300px) {
      padding: 20px;
      margin-bottom: 40px;
    }
    @media screen and (max-width: 1024px) {
      margin-bottom: 30px;
    }

    &.hide {
      display: none !important;
    }
    &::before {
      content: '';
      z-index: -1;
      position: absolute;
      left: -20px;
      top: -20px;
      width: calc(100% + 40px);
      height: calc(100% + 40px);
      border-bottom-right-radius: 60px;
      background-color: rgba(125,156,158,.1);

      @media screen and (max-width: 1300px) {
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        border-radius: 24px;
      }
    }
  }
  & .review__info:not(:has(.review__link)) {
    padding-left: 0;
  }
  & .review__info-wrap {
    order: 0;

    &:not(:has(img)):not(:has(video)) {
      margin-bottom: 0;
    }
  }
  & .review__text {
    order: 2;
  }
  & .review__item-footer {
    order: 1;
    min-height: 40px;
    margin-bottom: 12px;
  }
  & .review__source-image {
    height: 40px;
  }
  .review__image-wrap {
    & video {
      width: 100%;
      height: 260px;
      margin: 0 auto;
      display: block;
      object-fit: cover;
      object-position: center;
    }
  }
  & .reviews__list-item:not(:has(.review__link)) .review__image-wrap {
    padding-bottom: 51.2%;
  }
  & .review:not(:has(img.review__image)) {
    & .review__name {
      padding-right: 70px;
    }
    &:not(:has(video)) .review__link {
      white-space: nowrap;
      transform: translateY(200%) rotate(180deg);
    }
    &:not(:has(video)) .review__video-link {
      width: 50px;
      height: 50px;
      z-index: 5;
      left: 0;
      top: 0;

      & .review__button-play {
        border-color: #7d9c9e;
        background-color: #FFFFFF;
      }
      & .review__button-play-icon {
        fill: #7d9c9e
      }
      &:hover .review__button-play-icon {
        transform: scale(1.3, 1.3);
      }
    }
    & .review__image-wrap {
      padding: 0;

      &:not(:has(video)) {
        overflow: initial;
      }
    }
    &:not(:has(video)):has(.review__video-link) .review__item-footer {
      padding-left: 60px;
      min-height: 50px;
    }
  }
}

.reviews-block__info {
  & .reviews-block__image-wrap:not(:has(img, video)) {
    display: none;
  }
  & .reviews-block__image-wrap:has(video) {
    height: 260px;
    padding-bottom: 0;

    & video {
      width: 100%;
      height: 100%;
      display: block;
      margin: 0 auto;
      object-fit: cover;
      object-position: center;
    }
  }
}

.reviews:has(.reviews-filter.inited) {
  & .reviews__list-item.shown {
    display: inline-block !important;
  }
  &:has(.reviews__list-item.shown) .reviews__list-item:not(.shown) {
    display: none;
  }
  &:has(.reviews__list-item.shown) .reviews-paginav {
    display: none;
  }
}

.reviews-paginav.hide {
  display: none !important;
}

.reviews.empty :is(.reviews__list, .reviews-paginav) {
  display: none;
}

.fancybox__html5video, .fancybox__iframe, .fancybox__slide.has-html5video .fancybox__content {
  width: auto !important;
  height: auto !important;
  aspect-ratio: auto !important;
  max-height: calc(100% - 40px) !important;
}

.review, .reviews-block__info {
  & .review__item-audio {
    --review__item-audio-left: 50px;
    --review__item-audio-height: 40px;

    width: 100%;
    padding-left: var(--review__item-audio-left);
    padding-right: 20px;
    margin-top: 16px;
    margin-bottom: 24px;
    z-index: 0;
    position: relative;

    &:has(.hide) {
      display: none;
    }

    & .review__audio {
      display: flex;
      column-gap: 20px;
      align-items: start;
      overflow: hidden;
      height: var(--review__item-audio-height);

      & > div {
        width: 100%;
        height: 40px;
      }
      &._loading > div {
        display: none;
      }
    }

    & .review__audio-loading {
      width: 100%;
      height: var(--review__item-audio-height);

      order: 5;
      display: flex;
      align-items: center;
      padding-left: 10px;

      position: absolute;
      left: var(--review__item-audio-left);
      top: 0;
      
      font-size: 1rem;
      font-weight: 400;
      color: #7d9c9e;
      font-family: "Mulish", sans-serif;

      .review__audio:not(._loading) & {
        display: none !important;
      }
    }

    & .review__audio-link {
      z-index: 1;
      position: absolute;
      left: 0;
      top: 50%;
      cursor: pointer;
      transform: translateY(-50%);

      border: 0;
      padding: 0;
      margin: 0;
      display: block;
      user-select: none;
      background: none;

      -webkit-appearance: none;
      appearance: none;
      outline: none !important;

      & .review__button-play {
        width: 40px;
        height: 40px;
        border-color: #7d9c9e;

        & svg {
          width: 14px;
          height: 14px;
          transform: scale(1,1);
          transition: transform .3s;

          &, & path {
            fill: #7d9c9e;
          }
        }
        &:hover svg {
          transform: scale(1.3,1.3);
        }
      }
      &.play .review__button-play-icon {
        display: none;
      }
      &:not(.play) .review__button-pause-icon {
        display: none;
      }
      .review__audio._loading & {
        opacity: 0.8;
        pointer-events: none;
      }
    }

    & .review__audio-duration {
      order: 5;
      font-size: 1rem;
      font-weight: 400;
      font-family: "Mulish", sans-serif;

      display: flex;
      align-items: end;
      width: max-content;
      height: var(--review__item-audio-height);

      .review__audio._loading & {
        opacity: 0 !important;
      }
    }
  }

  & .review__item-doctor {
    order: 10;
    display: flex;
    column-gap: 12px;
    align-items: center;
    z-index: 0;
    position: relative;

    &.hide {
      display: none !important;
    }

    & .review__item-doctor__photo {
      width: 60px;
      min-width: 60px;
      height: 60px;
      border-radius: 50%;
      overflow: hidden;
      border: 1px solid #FFFFFF;

      & img {
        width: 100%;
        height: 100%;
        display: block;
        object-fit: cover;
        object-position: center top;
      }
    }
    & .review__item-doctor__detail {
      display: flex;
      row-gap: 2px;
      flex-direction: column;

      & span {
        color: #7d9c9e;
        font-weight: 400;
        font-size: 0.875rem;
        font-family: "Mulish", sans-serif;
      }
      & a {
        font-weight: 400;
        font-size: 1.125rem;
        color: #222222;
        text-decoration: none;
        font-family: "Mulish", sans-serif;

        &::before {
          content: '';
          z-index: 1;
          position: absolute;
          inset: 0;
        }
        &:hover {
          text-decoration: underline;
        }
      }
    }
  }
}