@import '../../styles/variables';

.ManagersInfo {
  &__button {
    width: 56px;
    height: 56px;
    margin: 0;
    padding: 0;
    border: 0;
    outline: 0;
    background: none;

    &-icon {
      border-radius: 28px;
    }

    &-person {
      display: none;
      background: #ffffff;
      font-size: $font-normal;
      font-weight: 100;
      line-height: 1.43;

      &-post {
        padding-bottom: 3px;
        color: $gray50;
        line-height: 1.3;
      }

      &-data {
        display: flex;
        text-align: left;
        color: $action-color;
        align-items: baseline;
      }

      &-name {
        display: inline-block;
        overflow: hidden;
        max-width: 132px;
        margin-right: 4px;
        white-space: nowrap;
        text-overflow: ellipsis;
        border-bottom: 1px dotted;
        line-height: 1.2;
      }
    }
  }

  &_active > .ManagersInfo__button {
    transition: .22s ease;
    background-color: $gray95;
    box-shadow: inset 0 2px 0 0 $brand-color;
  }

  &__wrapper {
    position: absolute;
    top: 56px;
    left: 0;
    display: flex;
    flex-direction: column;
    width: 100vw;
    height: 100vh;
    background: white;
    box-shadow: inset 0 4px 6px -2px rgba(0, 0, 0, .25);
    align-items: center;
    justify-content: flex-start;
  }

  &__person {
    display: flex;
    flex-direction: column;
    padding: 30px 0;
    font-size: $font-normal-big;
    line-height: 1.5;
    align-items: center;

    &-avatar {
      width: 72px;
      height: 72px;
      margin: 0 0 20px;
      border-radius: 36px;
    }
  }

  &__item {
    display: flex;
    flex-direction: column;
    padding-bottom: 30px;
    font-size: $font-normal;
    line-height: 1.14;
    align-items: center;

    &-link {
      word-break: break-all;
      color: $action-color;
    }

    &-icon {
      padding: 0 0 12px 0;
      color: $gray50;
      font-size: 15px;

      &_phone {
        margin-left: 2px;
      }
    }
  }
}

@media screen and (min-width: $layout-desktop) {
  .ManagersInfo {
    position: relative;
    padding: 0 10px;
    cursor: pointer;

    &__button {
      width: auto;

      &-icon {
        display: none;
      }

      &-person {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
      }
    }

    &_active > .ManagersInfo__button {
      transition: none;
      background-color: $white;
      box-shadow: none;
    }

    &__wrapper {
      position: absolute;
      left: 0;
      transform: translateX(-50%);
      width: auto;
      height: auto;
      margin-left: 50%;
      box-shadow: 0 4px 12px rgba(0,0,0,.1), 0 1px 3px rgba(0,0,0,.25);
      align-items: flex-start;

      &::after {
        position: absolute;
        top: 0;
        right: 50%;
        display: block;
        width: 0;
        height: 0;
        margin-right: -7px;
        content: '';
        transform: rotate(-45deg);
        transform-origin: 0 50%;
        border: 7px solid;
        border-color: $white $white transparent transparent;
        box-shadow: 2px -2px 4px 0 rgba(0, 0, 0, .11);
      }
    }

    &__person {
      flex-direction: row;
      width: 100%;
      padding: 20px;
      border-bottom: 1px solid $gray95;
      font-size: $font-small;
      line-height: 1.33;
      justify-content: space-between;

      &-avatar {
        width: 32px;
        height: 32px;
        margin: 0 0 0 10px;
        padding: 0;
        border-radius: 16px;
      }

      &-post {
        display: none;
      }

      &-name {
        font-size: 16px;
        line-height: 1.5;
        word-break: break-word;
      }
    }

    &__info {
      padding: 20px;
    }

    &__item {
      flex-direction: row;
      padding-bottom: 14px;
      white-space: nowrap;
      font-size: $font-normal;
      line-height: 1.14;

      &:last-child {
        padding-bottom: 0;
      }

      &-icon {
        padding: 0 10px 0 0;
      }
    }
  }
}
