.bw {
  margin-top: 20px;
  padding: 10px 15px;
  background: $white;
  border: 1px solid $gray;

  &_min-h {
    min-height: 220px;
  }

  &__cc-btn {
    white-space: normal;
  }

  .stock {
    background: $white;

    &__bot {
      transition: none;
      position: absolute;
      z-index: 2;
      bottom: 180px;
      left: 20px;
      width: calc(100% - 40px);
      height: 220px;
      padding: 15px 20px;
      border: 1px solid $gray;
      outline: 0;
    }

    &__det-open {
      &::after {
        content: '';
        position: absolute;
        left: -4px;
        top: 0;
        width: 4px;
        height: 100%;
        background: $white;
        border-right: 2px solid $gray;
      }
    }

    &__result {
      &_hide {
        display: none;
      }
    }

    &__find {
      &_hide {
        display: none;
      }
    }

    &__accordion {
      &.collapsed {
        .stock__angel {
          transform: rotate(180deg);
        }
      }

      &.non-reg {
        margin: -11px -16px;
        padding: 15px;
        background: $gray-bg;
      }
    }

    &__head {
      font-size: 1rem;
      font-weight: 500;
      color: $blue;

      &.non-reg {
        margin: -15px;
        padding: 8px;
        border-radius: 3px;
        background: $green;
        color: $white;
        text-align: center;
        font-size: .875rem;
        font-weight: 500;
        line-height: 1.57143;
        cursor: pointer;
      }
    }

    &__i-search {
      padding-right: 5px;
    }

    &__angel {
      float: right;
    }

    &__title {
      text-decoration: underline;
    }

    &__tabs {
      display: flex;
      justify-content: center;
      margin-top: 20px;
      border-bottom: 1px solid $warm-grey;

      &_hide {
        display: none;
      }
    }

    &__tab {
      position: relative;
      bottom: -1px;
      width: 45%;
      min-width: 110px;
      margin: 0 5px;
      padding: 3px 0 0;
      border-radius: 5px 5px 0 0;
      border: 1px solid;
      border-color: $gray $gray $warm-grey;
      text-align: center;
      font-size: .9375rem;
      color: $blue;
      cursor: pointer;

      &.active {
        border: 1px solid;
        border-color: $warm-grey $warm-grey $white;
        color: $gray-dark;
        font-weight: 500;
        background: linear-gradient(180deg, $gray-gradient 0%, $white 100%);
      }
    }

    &__content {
      padding-top: 20px;
      padding-bottom: 5px;
    }

    &__postcode {
      margin-bottom: 20px;

      &_label {
        display: flex;
      }

      &_invalid {
        border-radius: 3px;

        & input {
          border-color: $red;
        }

        & .stock__target {
          border-color: $red;
        }

        & .stock__postcode_invalid-msg {
          display: block;
        }
      }

      &_invalid-msg {
        display: none;
        color: $red;
        line-height: 1rem;
        font-size: .75rem;
      }
    }

    &__input {
      border-radius: 3px 0 0 3px;
    }

    &__target {
      height: 40px;
      width: 40px;
      padding: 0 10px;
      border-color: $gray;
      border-radius: 0 3px 3px 0;
      border-left: 0;
      font-size: 1.25rem;

      & .btn__text {
        vertical-align: middle;
      }
    }

    &__params,
    &__quest,
    &__cancel {
      display: none;
      margin-bottom: 20px;
    }

    &__close {
      display: none;
    }

    &__quest {
      & .chb {
        margin-bottom: 20px;
        font-size: .875rem;
        font-weight: 400;

        &:last-of-type {
          margin-bottom: 0;
        }
      }
    }

    &__cancel {
      margin-top: 15px;
    }

    &__price {
      font-size: 1.25rem;
      font-weight: 400;
      display: flex;
      align-items: baseline;

      .price-vat {
        margin-left: .25rem;
      }
    }


    &-more {
      transition: none;
      height: 100vh;
      width: 100%;
      position: fixed;
      top: 0;
      right: 0;
      bottom: 0;
      left: 0;
      z-index: 1051;
      overflow: scroll;
      outline: 0;
      border: 0;

      .quantity-label {
        font-weight: 400;
        margin-bottom: 0;
      }

      .tbx_quantity {
        margin-left: 5px;
      }

      & .stock {
        &__accordion {
          display: none;
        }

        &__head {
          text-transform: uppercase;
        }

        &__title {
          text-decoration: none;
        }

        &__params {
          display: flex;
          align-items: center;
          justify-content: space-between;
        }

        &__quest,
        &__cancel {
          display: block;
        }

        &__cancel {
          display: block;
          text-align: center;

          & a {
            font-weight: 500;
            font-size: .875rem;
          }
        }

        &__angel {
          display: none;
        }

        &__close {
          display: block;
          float: right;
          cursor: pointer;
          position: relative;
          top: -8px;
        }
      }
    }

    &__search {
      display: flex;
      padding-bottom: 20px;
      border-bottom: 1px solid $gray;
    }

    &__res {
      @include make-col(9);
      padding-right: 15px;

    }

    &__edit {
      @include make-col(3);
      text-align: right;

      & .btn {
        width: 70px;
        padding: 12px 8px;

        &__text {
          white-space: normal;
        }
      }
    }

    &__arg {
      display: flex;
      justify-content: space-between;
    }

    &__cost {
      display: flex;
      align-items: baseline;
      font-size: .9375rem;
      font-weight: 700;

      .price-vat {
        margin-left: .25rem;
      }
    }

    &__amount {
      font-size: .875rem;
      font-weight: 500;
      padding-bottom: 5px;
    }

    &__descr {
      font-size: .875rem;

      &_s {
        .stock {
          &__descr {
            &_both,
            &_c-and-c {
              display: none;
            }
          }
        }
      }

      &_c {
        .stock {
          &__descr {
            &_both,
            &_stock {
              display: none;
            }
          }
        }
      }
    }

    &__amount-val,
    &__descr_stock,
    &__descr_c-and-c,
    &__descr_post {
      font-weight: 500;
      color: $blue;
    }

    &__item {
      display: flex;
      flex-wrap: wrap;
      border-bottom: 1px solid $gray-light;

      &:last-of-type {
        border-bottom: 0;
      }
    }

    &__radio {
      @include make-col(1);

      & label {
        top: 3px;
      }
    }

    &__store {
      @include make-col(11);
    }

    & .icon-info-component {
      display: none;
    }

    &__valid {
      display: none;

      &_show {
        display: block;
      }
    }
  }

  .store {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 17px 0 15px 10px;

    &__info {
      align-self: flex-start;
    }

    &__name {
      font-size: .9375rem;
      font-weight: 500;
      text-transform: uppercase;
      white-space: nowrap;
      text-overflow: ellipsis;
      overflow: hidden;
      max-width: 170px;
      padding-bottom: 3px;
    }

    &__stock {
      line-height: .875rem;
    }

    &__amount {
      &_out,
      &_low,
      &_enough,
      &_inStock,
      &_lowStock,
      &_outOfStock {
        display: inline-block;
        margin-right: 2px;
      }

      &_out,
      &_outOfStock {
        color: $red;
      }

      &_low,
      &_lowStock {
        color: $orange;
      }

      &_enough,
      &_inStock {
        color: $green;
      }
    }

    &__dist {
      width: 61px;
      margin-bottom: 3px;
      text-align: center;
      background: $gray-light;
      color: $gray-dim;

      &_val {
        font-weight: 500;
      }

      &_uom {
        font-size: .75rem;
      }
    }

  }

  .chosen {
    padding-bottom: 15px;
    margin-bottom: 10px;
    border-bottom: 1px solid $gray;

    &:not(.chosen_hide) + .stock {
      .stock__accordion {
        display: none;
      }
    }

    &_hide {
      display: none;
    }

    &__msg {
      display: none;
    }

    &__success {
      .chosen__notif {
        display: block;

        .notification_success {
          display: block;
        }
      }
    }

    &__error {
      .chosen__notif {
        display: block;

        .notification_error {
          display: block;
        }
      }
    }

    &__nearest {
      .chosen__msg {
        display: block;
      }
    }

    &__item {
      padding: 0;
      margin-bottom: 15px;

      .store {
        &__count {
          display: none;
        }
      }
    }

    &__notif {
      display: none;
      margin-bottom: 15px;

      .notification {
        display: none;
        border: 0;
        padding-right: 20px;
      }
    }

    .default-store {
      border: 1px solid $gray;
      margin-top: 15px;
      padding: 5px;
      background: $gray-bg;

      &__inf {
        padding: 10px;
      }

      &__name {
        text-align: center;
      }

      &__make,
      &__det__current {
        text-decoration: underline;
        cursor: pointer;
      }

      &__default {
        display: none;
      }

      &__det {
        @include additional-text;
        padding: 10px;
        display: flex;
        justify-content: space-between;
        border-top: 1px dashed $gray;
      }
    }
  }


  .reserve {
    display: flex;
    align-items: center;
    margin-top: 15px;
    color: $gray-matt;

    &_ic {
      font-size: 1.75rem;
      line-height: 1;
    }

    &_msg {
      padding-left: 10px;
      font-size: .875rem;
      line-height: 19px;
    }

    &_bold {
      font-weight: 500;
    }
  }

  .stock__tabs {
    &.def-stores-present {
      border: 0;
      color: $blue;
      line-height: 1rem;

      .def-stock__tab {
        text-decoration: $blue underline;
        cursor: pointer;
        margin-left: .875rem;
      }

      & + .stock__content {
        padding: 0 0 10px;
      }
    }
  }

  .stock-more {
    .stock__head {
      .stock__close {
        padding-top: 5px;
      }
    }

    .stock__store {
      padding-bottom: 40px;
    }

    .stock__tabs {
      &.def-stores-present {
        margin: -3px 0 0;
        padding-bottom: 20px;
        padding-top: 5px;

        .def-stock__tab {
          text-decoration: none;
          cursor: auto;
        }
      }
    }

    .store-state {
      font-size: .75rem;
      text-transform: none;
      font-weight: bold;
    }
  }

  .store__tick {
    display: none;
  }
}

.s-details {
  transition: none;
  height: 100vh;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1051;
  overflow: hidden;
  outline: 0;
  border: 0;
  background: $white;
  padding: 15px 0 20px 15px;

  &::after {
    content: '';
    position: absolute;
    right: -4px;
    top: 0;
    width: 4px;
    height: 100%;
    background: $white;
    border-right: 2px solid $gray;
  }

  &_hide {
    visibility: hidden;
    right: 0;
    opacity: 0;
  }

  &__info {
    padding-right: 15px;
    overflow-x: hidden;
    overflow-y: auto;
    height: calc(100% - 75px);

    .simplebar-content {
      overflow-x: auto;
    }

    .simplebar-scroll-content {
      overflow-y: auto;
    }
  }

  &__store {
    position: relative;
    display: flex;
    justify-content: space-between;
    padding-bottom: 10px;


    &::after {
      content: '';
      position: absolute;
      bottom: 0;
      left: 0;
      width: 100%;
      height: 1px;
      background: $warm-grey;
      box-shadow: 0 1px 1px 0 $black-transparent50;
    }

    @include media-breakpoint-up(sm) {
      margin-right: 15px;
    }
  }

  &__distance {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 50px;
    height: 60px;
    text-align: center;
    color: $gray-dark;
    background: $gray-light;
    font-size: .75rem;
    font-weight: 400;
    line-height: 1.125rem;


    &_amount {
      font-size: 1rem;
      font-weight: 500;
      line-height: 1;
    }

  }

  &__s-name {
    display: inline-block;
    width: 70%;
    margin-left: 15px;
    margin-top: 5px;
    font-size: 1rem;
    line-height: 1;
    color: $blue;
    font-weight: 500;
    text-transform: uppercase;
    text-align: center;
  }

  &__close {
    float: right;
    cursor: pointer;
    font-size: 1rem;
    color: $blue;
    width: 40px;
    height: 40px;
  }

  &__phone,
  &__postcode,
  &__address {
    font-size: .875rem;
    font-weight: 500;

    &_val {
      font-weight: 400;
    }
  }

  &__phone {
    margin-top: 15px;
  }

  &__address,
  &__postcode,
  &__action {
    margin-top: 8px;
  }

  &__action {
    display: flex;
    justify-content: space-between;
    font-size: .9375rem;
  }

  &__tgl-map,
  &__copy {
    text-decoration: none;

    &_text {
      text-decoration: underline;
    }
  }

  &__map {
    padding: 15px 0 20px;
    border-bottom: 1px solid $gray;

    & .store-locator-popup__map {
      min-height: 220px;
    }

    &_hide {
      display: none;
    }
  }

  &__open {
    &_title {
      margin-top: 20px;
      margin-bottom: 15px;
      font-size: .875rem;
      font-weight: bold;
    }
  }

  &__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1rem;
    font-weight: 500;

    &_regular {
      .s-details__table_row {
        &:nth-child(1) {
          & td {
            border: 2px solid $gray-dark;
            text-transform: uppercase;

            &:first-of-type {
              background: $gray-dark;
              color: $white;
            }

            &:last-of-type {
              background: $white;
              color: $gray-dark;
            }
          }
        }
      }
    }

    &_time {
      vertical-align: center;
    }

    &_day {
      font-weight: 400;
      font-size: .875rem;
    }

    &_cell {
      border: 1px solid $gray-light;

      &:nth-child(2n+1) {
        padding-left: 20px;
        background: $gray-light;
        color: $gray-dark;
      }

      &:nth-child(2n) {
        text-align: center;
        background: $white;
        color: $gray-dim;
      }
    }
  }

  &__btn {
    position: relative;
    padding-top: 20px;
    background: $white;

    &::before {
      content: '';
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 1px;
      background: $warm-grey;
      box-shadow: 0 1px 1px 0 $black-transparent50;
    }
  }

  .notouch {
    pointer-events: none;
    -webkit-user-select: none;
  }
}

@include media-breakpoint-up(md) {
  .bw {
    .stock {
      &-more {
        position: absolute;
        bottom: 0;
        left: 0;
        top: auto;
        right: auto;
        z-index: 101;
        width: 100%;
        min-height: 100%;
        height: fit-content;
        outline: 4px solid $warm-grey;
        margin-top: 0;
        overflow: visible;

        & .stock__close {
          padding-top: 0;
        }
      }

      &__tab {
        width: 120px;
        min-width: auto;
      }

      &__quest {
        & label {
          width: 85%;
        }
      }

      & .icon-info-component {
        display: inline-block;
        vertical-align: top;
      }

      &__bot {
        transition: .6s ease-in;
      }
    }
  }

  .s-details {
    transition: .5s ease;
    position: absolute;
    z-index: 1;
    top: 0;
    right: calc(100% + 4px);
    left: auto;
    bottom: auto;
    opacity: 1;
    width: 100%;
    height: 100%;
    outline: 4px solid $warm-grey;
    padding: 15px 0 20px 15px;
    overflow: visible;

    &_hide {
      visibility: hidden;
      right: 0;
      opacity: 0;
    }
  }
}

@include media-breakpoint-up(xl) {
  .bw {
    .stock {
      &__quest {
        & label {
          width: auto;
        }
      }
    }
  }
}

@include media-breakpoint-only(lg) {
  .bw {
    .stock {
      &__title {
        font-size: .9375rem;
      }
    }

    .store {
      &__name {
        max-width: 150px;
      }
    }
  }
}

@include media-breakpoint-only(md) {
  .bw {
    .chosen {
      &__notif {
        & .notification {
          padding: 8px 10px 8px 35px;
        }
      }
    }

    .stock {
      &__quest {
        & label {
          width: 80%;
        }
      }
    }
  }
}

@include media-breakpoint-down(sm) {
  .s-details {
    height: 100%;
    padding: 0;

    &__store {
      margin-right: 0;
      padding: 15px 15px 10px;
    }

    &__info {
      padding: 15px 15px 20px;

      .simplebar-scroll-content {
        text-align: left;
      }
    }
  }
}
