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

.ti-floor {
  @include ti-floor-base-style;
  counter-increment: floor;
  margin-top: 15px;

  &:nth-of-type(2) {
    & .ti-floor__close {
      display: none;
    }
  }

  & .ti-floor__close {
    display: block;
  }

  &__title {
    margin-bottom: 16px;

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

  &__form {
    display: flex;
    justify-content: flex-start;
    margin-top: 16px;
  }

  &__form-row {
    margin-right: 10px;

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

  &__input {
    // sass-lint:disable no-vendor-prefixes
    width: 68px;
    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;
      flex-wrap: wrap;
    }

    &-value {
      padding-right: 4px;
      word-break: break-all;
    }
  }

  &__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: 15px;
    background: $gray-bg;
    padding: 15px 0;
    text-decoration: underline;
    font-size: .875rem;
    font-weight: 500;
    line-height: 22px;
    color: $blue;
    cursor: pointer;

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

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

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

    .ti-floor {
      &__title,
      &__dpd {
        @include make-col(6);
      }
    }
  }

  .ti-unit_small {
    min-width: 25px;
  }
}

@include media-breakpoint-down(md) {
  .ti-floor {
    padding: 0;

    &__title {
      padding: 20px 0 0 15px;
      font-weight: 500;
    }

    &__form {
      flex-direction: column;
    }

    &__form-row {
      margin-bottom: 15px;
      margin-right: 15px;
      padding-left: 15px;

      & label {
        justify-content: space-between;
      }
    }

    &__result {
      width: 100%;
      height: 40px;
      background-color: $gray-light;
      justify-content: space-between;
      padding: 0 15px;
    }

    &__measurement {
      .ti-floor {
        &__title,
        &__dpd {
          @include make-col(12);
        }
      }
    }

    .ti-floor {
      &__title {
        padding-left: 15px;
      }
    }
  }
}

@include media-breakpoint-down(sm) {
  .ti-floor {

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

    &__add-floor {
      margin-top: 10px;
    }

    &__measurement {
      .ti-floor {
        &__dpd {
          .form-row {
            padding: 0;
          }
        }
      }
    }
  }
}
