@mixin user-address-column-view {
  padding-bottom: 20px;

  &__content {
    // keep '%' as workaround for IE11 bug - https://github.com/philipwalton/flexbugs#flexbug-4
    flex: 1 0 0%;
    min-width: 0;

    @include media-breakpoint-up(md) {
      @include make-col(8);
    }
  }

  &__actions {
    align-items: flex-start;
    padding: 0 30px;
    border-top: 0;
    border-left: 1px solid $gray;

    @include media-breakpoint-up(md) {
      @include make-col(4)
    }
  }

  &__phone,
  &__address {
    @include make-col(5);
    margin: 0;
  }

  &__links {
    @include make-col(2);
    margin: 0;
  }
}

.user-address {
  border: 1px solid $gray;
  padding: 20px 20px 0;

  & + & {
    margin-top: 20px;
  }

  .selected-address {
    display: none;
  }

  .btn-delivery-details + & {
    margin-top: 20px;
  }

  &__wrapper {
    .btn-delivery-details {
      margin-bottom: 0;
    }
  }

  &__content {
    @include make-col-ready;
    @include make-col(9);
    font-size: 1rem;
    padding: 0 15px;
  }

  &__title {
    margin-bottom: 10px;
  }

  &__actions {
    @include make-col-ready;
    @include make-col(3);
    display: flex;
    flex-shrink: 0;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 15px;

    .btn-secondary {
      @include button-full;
      display: block;
      min-width: 130px;
    }

    .btn-secondary + .btn-secondary {
      margin-top: 20px;
    }

    .btn-secondary + .rbn,
    form .rbn {
      margin-top: 35px;
    }
  }

  &__phone,
  &__address {
    @include make-col-ready;
    @include make-col(12);
  }

  &__address {
    display: block;
    word-wrap: break-word;
  }

  &__phone {
    margin: 10px 0 20px;
  }

  &__delete {
    .delete-heading {
      margin: 20px 0 10px;
      font-size: 1.2rem;
    }

    .btn {
      margin-right: 20px;
      padding: 8px 40px;
    }

    .delete-warning {
      display: inline-block;
      margin-top: 15px;
    }
  }

  &.js-selectable_selected {
    // sass-lint:disable no-important
    background-color: $gray-bg;
    border: 1px solid $gray !important;
  }
}

@include media-breakpoint-up(md) {
  .user-address {
    .my-account_address-book & {
      @include user-address-column-view;
    }
  }

  .modal-content {
    .user-address {
      padding-bottom: 20px;

      &__content {
        @include make-col(8);
      }

      &__actions {
        @include make-col(4);
      }
    }
  }
}

@include media-breakpoint-up(lg) {
  .user-address {
    &__actions {
      border-top: 1px solid $gray;
    }

    .delivery-address & {
      @include user-address-column-view;
    }
  }
}

@include media-breakpoint-up(xl) {
  .user-address {
    .edit-delivery-address & {
      @include user-address-column-view;
    }
  }
}

@include media-breakpoint-down(lg) {
  .modal-content {
    .user-address {
      &__actions {
        border-left: 1px solid $gray;
        border-top: 0;
      }
    }
  }
}

@include media-breakpoint-down(md) {
  .user-address {
    &__delete {
      .delete-warning {
        margin-top: 10px;
      }
    }
  }
}

@include media-breakpoint-down(sm) {
  .user-address {
    &__content,
    &__actions {
      @include make-col(12);
    }

    &__delete {
      .btn {
        margin: 0 0 15px;
        width: 100%;
      }
    }
  }

  .modal-content {
    .user-address {
      &__actions {
        border: 0;
      }
    }
  }
}

@include media-breakpoint-only(md) {
  .user-address {
    &__content {
      @include make-col(8);
    }

    &__actions {
      @include make-col(4);
    }
  }
}
