.popup-new-media {
  user-select: none;
  $parent: ".popup";

  #{$parent} {
    &-container {
      width: 420px;
      max-width: 420px;
      /* padding: 12px 20px 50px; */
      padding: 12px 20px 32.5px;
      //max-height: unquote('min(640px, 100%)');
      max-height: 100%;

      &.is-media:not(.is-album) {
        /* max-height: 425px; */
  
        #{$parent}-photo {
          //max-height: 320px;
          margin: 0 auto;
  
          img {
            object-fit: contain;
          }

          > div {
            display: flex;
            justify-content: center;
            margin: 0 auto;
          }
        }
      }

      &.is-album {
        #{$parent}-photo {
          margin: 0 auto;
          position: relative;

          .album-item {
            position: absolute;
          }

          img, video {
            object-fit: cover;
            width: 100%;
            height: 100%;
          }
        }
      }
    }

    &-header {
      flex: 0 0 auto;
      flex-wrap: wrap;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 9px;
      padding: 12px 20px 15px;
      position: relative;
  
      .btn-primary {
        width: 79px;
        height: 36px;
        font-size: 14px;
        font-weight: normal;
        padding: 0;
        margin-top: -3px;
        border-radius: $border-radius-medium;
      }
    }
  
    &-close {
      font-size: 1.5rem;
      margin: -1px 0 0 -4px;
    }
  
    &-title {
      flex: 1;
      padding: 0 2rem 0 1.5rem;
      margin: 0;
      margin-top: -3px;
      font-size: 1.25rem;
      font-weight: 500;
    }
  
    &-photo {
      max-width: 380px;
      //display: flex;
      overflow: hidden;
      //justify-content: center;
      width: fit-content;
      border-radius: $border-radius-medium;
      user-select: none;
      /* align-items: center; */
  
      .document {
        max-width: 100%;
        overflow: hidden;
        cursor: default;
        padding-left: 3.75rem;
        height: 4.5rem;
  
        &-name {
          font-weight: normal;
          width: 100%;
          max-width: 100%;
          overflow: hidden;
          text-overflow: ellipsis;
          line-height: 1.5;
        }

        &-ico {
          height: 48px;
          width: 48px;
          font-size: 16px;
          font-weight: normal;
          line-height: 11px;
          letter-spacing: 0;
        }
  
        /* &.photo {
          .document-ico {
            border-radius: $border-radius;
          }
        } */
      }
    }
  }

  .scrollable {
    position: relative;
  }

  .input-field {
    width: 100%;
    margin-top: 25px;
    flex: 0 0 auto;

    &-input {
      //height: 54px;
      font-size: 1rem;
      border-radius: $border-radius-medium;

      &:not(:focus):empty ~ label {
        opacity: 0;
      }
    }

    label {
      font-size: inherit;
    }
  }

  .btn-menu-overlay {
    z-index: 3;
  }

  .menu-send {
    z-index: 4;
    top: calc(100% + .25rem);
  }
}

.popup-new-media.popup-send-photo {
  .popup-header {
    padding: 0;
  }

  .checkbox-field {
    margin-bottom: 0;
    margin-left: 0;
  }

  .popup-album, 
  .popup-container:not(.is-album) .popup-item-media {
    position: relative;
    border-radius: inherit;
    overflow: hidden;
  }

  .popup-album + .popup-album, 
  .popup-container:not(.is-album) .popup-item-media + .popup-item-media {
    margin-top: .5rem;
  }
}