@mixin tc-floor-base-style {
  position: relative;
  background: $gray-bg;
  padding: 20px;
}

.tc-floor {
  @include tc-floor-base-style;
  counter-increment: floor;

  &:not(:first-of-type) {
    margin-top: 15px;

    & .tc-floor__close {
      display: block;
    }
  }

  &__dpd {
    .form-row,
    .form-row__label {
      margin-bottom: 0;
    }
  }

  &__title {
    &-main {
      margin-bottom: 15px;
      font-weight: bold;
    }

    &-count {
      &::after {
        content: counter(floor);
        display: inline-block;
      }
    }
  }

  &__form {
    @include make-row;
    margin-top: 16px;

    .tc-floor__form-row {
      .tc-floor__specification {
        min-width: 150px;
      }
    }
  }

  &__form-row {
    @include make-col-ready;
    @include make-col(6);

    & label {
      display: flex;
      align-items: center;
      margin-bottom: 0;
    }

    .tc__error {
      color: $red;
      margin-top: 5px;
    }

    &-invalid input {
      border-color: $red;
    }
  }

  &__input {
    // sass-lint:disable no-vendor-prefixes
    max-width: 150px;
    margin-left: 10px;
    padding: 8px 6px;
    text-align: center;
    -moz-appearance: textfield;

    &::-webkit-outer-spin-button,
    &::-webkit-inner-spin-button {
      -webkit-appearance: none;
    }
  }

  &__result {
    display: flex;
    align-items: center;
    vertical-align: center;
    font-size: .875rem;
    font-weight: 400;
    line-height: 22px;

    &-specification {
      padding-right: 5px;
    }

    &-outcome {
      display: flex;
    }

    &-value {
      display: none;
    }
  }

  &__specification,
  &__result-specification {
    font-size: .875rem;
    font-weight: 700;
    line-height: 22px;
  }

  &__close {
    position: absolute;
    top: 4px;
    right: 8px;
    font-size: 1rem;
    font-weight: 400;
    line-height: 24px;
    color: $warm-grey;
    cursor: pointer;
    display: none;
  }

  &__add-floor {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 5px;
    background: $gray-bg;
    padding: 15px 0;
    text-decoration: underline;
    font-size: .875rem;
    font-weight: 500;
    line-height: 22px;
    color: $blue;
    cursor: pointer;

    & .fa-plus {
      color: $green;
      margin-right: 10px;
    }
  }

  &__wastage {
    @include make-container;
    @include make-container-max-widths;
    @include tc-floor-base-style;
  }

  &__measurement {
    @include make-container;
    @include make-container-max-widths;
    @include tc-floor-base-style;

    .row {
      margin: 0;
      align-items: center;
    }

    .tc-floor {
      &__title {
        margin: 8px 10px 8px 0;
        font-weight: bold;
      }
    }
  }
}

@include media-breakpoint-down(md) {
  .tc-floor {
    &__form {
      margin-top: 0;

      .tc-floor__form-row {
        .tc-floor__specification {
          @include make-col(6);
        }
      }
    }

    &__form-row {
      @include make-col(12);
      margin-top: 16px;
    }

    &__input {
      width: 100%;
      margin-left: 0;
    }
  }
}

@include media-breakpoint-down(sm) {
  .tc-floor {
    &__measurement {
      .tc-floor {
        &__dpd {
          @include make-col(12);

          .form-row {
            padding: 0;
          }
        }

        &__title {
          @include make-col(12);
          margin-right: 0;
          margin-top: 0;
        }
      }
    }
  }
}
