@import '../../../core/src/style/variables';

.PartName {
  text-align: left;

  > span {
    position: relative;
    display: block;
    clear: both;
  }
  .noCpn {
    color: $grey;
  }

  .warn-container {
    white-space: nowrap;
  }

  .BomIcon--edit {
    margin-left: $gutter-m;
    width: $gutter;
    height: $gutter;
    display: inline-block;
    line-height: 20px;
    cursor: pointer;

    &:hover {
      color: $button-hover-black;
    }
  }

  a {
    color: $black;
  }

  .BomIcon--datasheets {
    background-color: $blue;
    margin: 16px 0 0 30px;
    display: inline-block;
    cursor: pointer;
    padding: 8px 6px 8px $gutter-m;

    &:hover {
      background-color: $button-hover-blue;
    }
  }
  &-manuf-value {
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    line-height: 2em;
  }
  &-manufacturer-source {
    clear: both;
  }
  &-icons-wrapper {
    position: absolute;
    bottom: $gutter-m;
    &-rohs {
      font-size: $font-size-l;
    }
    &-obsolescence {
      display: inline-block;
      font-size: 18px;
      color: $red;
      margin-top: 2px;
      margin-right: $gutter-s;
    }
  }
  .wrapper-cpn,
  .wrapper-ec {
    margin-bottom: 5px;
    .appliedCPN {
      cursor: pointer;
      text-decoration: underline;
    }
    span {
      font-size: $font-size-s;
      font-weight: bold;
    }
    wpt-select {
      padding: 4px;
    }

    .wpt-warn {
      height: 12px;
      width: 12px;
    }

    .cpn-map-error {
      color: $red;
      vertical-align: unset;
      white-space: normal;
    }
    button {
      background: transparent;
      border: 0;
      padding: 0;
      &[disabled] {
        color: $middarkergrey;
      }
    }
  }
}

.ListItem {
  &-partName {
    font-size: $font-size-base;
    font-weight: bold;
    overflow: hidden;
    text-transform: uppercase;

    a {
      font-weight: bold;
      text-decoration: underline;
      color: $black;
      display: inline-block;
      width: 100%;
      word-break: break-all;
    }

    .error {
      font-size: $font-size-base;
      color: $red;
      max-height: 3em;
    }
  }

  &-editIcons {
    margin-bottom: $gutter-m;
    overflow: hidden;
    [wpt-button] {
      display: inline-block;
      width: calc(50% - 5px);
      float: left;
      padding: 0 6px;
      transition: all 0.25s ease-out;
      min-width: 0;
      min-height: 36px;
      font-size: 12px;
      &:first-child {
        margin-right: 10px;
      }
    }

    .BomIcon--tick,
    .BomIcon--cross {
      float: left;
      width: $gutter;
      display: inline-block;
      height: $gutter;
      line-height: 26px;
      cursor: pointer;
      margin-left: 3px;
      font-size: 11px;
      font-weight: bold;
    }

    .BomIcon--tick {
      color: $blue;

      &:hover {
        color: $button-hover-blue;
      }
    }

    .BomIcon--cross {
      color: $red;

      &:hover {
        color: $button-hover-red;
      }
    }
  }

  &-partName {
    word-break: break-all;
    float: left;
    max-width: calc(100% - 25px); // accommodate edit icon
  }

  &-editName {
    margin: $gutter-s 0 $gutter-m;
    padding: 0.4em;
    border: 1px solid $grey;
    width: 100%;

    &.invalid {
      border: 1px solid $red;
    }
  }

  &-replacedPart {
    color: $grey;
    font-size: $font-size-s;
    font-style: italic;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: uppercase;

    &:after {
      content: '\e604';
      font-family: $icon-font;
      margin-left: 0.3em;
      font-size: $font-size-s;
      line-height: 1.2em;
      vertical-align: middle;
    }
  }

  &-error {
    color: $red;
    text-align: center;
    text-transform: uppercase;
    font-size: $gutter-m;
    display: block;
    box-sizing: border-box;
    max-width: 120px;
    margin: -0.8em 0 0.5em;
  }
}

.default-view {
  .user-uploaded-tag,
  .user-uploaded-value {
    font-size: 0.7em;
    line-height: 1em;
  }

  .wrapper-cpn .user-uploaded-value {
    font-size: 1em;

    &.cpn-map-error {
      vertical-align: unset;
    }
  }

  .user-uploaded-value {
    font-size: 0.85em;
    font-weight: bold;
  }

  .user-uploaded-mpn-error {
    display: inline-block;
    font-size: 0.85em;
  }

  .wrapper-ec,
  .wrapper-cpn {
    span {
      font-size: 10px;
    }

    .blue-tag {
      display: inline;
      color: $lochmara;
      cursor: pointer;
      text-decoration: underline;
    }
  }

  .PartName-icons-wrapper {
    position: relative;
    bottom: 0;

    a {
      color: $lochmara;
      text-decoration: underline;
      font-size: 0.85em;
      margin-right: 10px;
      position: relative;
      bottom: 3px;
    }
  }

  .buttonText {
    text-decoration: underline;
  }
}
