@import '../helpers/variables';

.page_my-account_new {
  .table_profile_top {
    .table {
      &__content {
        .row:last-of-type {
          .table__content-info {
            padding-top: 15px;
            display: inline-block;

            &-desk {
              display: block;
            }

            &-mob {
              display: none;
            }
          }
        }

        .email-me {
          padding-top: 15px;
        }
      }
    }

    &.my-account_new_name {
      .col {
        max-width: 33%;
      }

      .table__content-info {
        word-wrap: break-word;
      }
    }
  }

  .my-account_mp {
    .opted {
      max-width: 33%;

      .table__content-info-mob {
        display: none;
      }

      &__quest,
      &__value {
        padding-top: 10px;
      }

      &__value {
        line-height: 1.5rem;
        margin-bottom: 10px;
      }
    }

    .acc-icon {
      + .table__content-heading {
        max-width: 100%;
        flex: 100%;
      }
    }
  }

  .acc-icon {
    padding: 0 15px 0 10px;
    width: 30px;
    color: $warm-grey;
    position: absolute;

    + .col {
      padding-left: 45px;
    }

    + .table__content-heading {
      max-width: 37%;
      flex: 37%;
      padding-left: 45px;
      margin-bottom: 0;
      line-height: 40px;
    }

    svg {
      width: 1.25em;
      height: 1.25em;
      vertical-align: - .25em;
    }
  }

  .my-account-section_details {
    .table__content {
      line-height: 40px;

      &-heading {
        font-size: 1rem;
      }

      &-info {
        margin-right: 15px;
        text-overflow: ellipsis;
        overflow: hidden;
      }
    }

    .row + .row {
      margin-top: 0;
    }

    &.my-account_new_tradepro {
      .table {
        &__content .row + .row,
        &__actions .btn + .btn {
          margin-top: 10px;
        }
      }
    }
  }

  .table__actions {
    padding: 0 15px;
  }

  .table__content {
    &-heading {
      font-size: 1rem;
    }
  }

  .my-account_default_store {
    position: relative;

    .table__actions {
      border: 0;

      .stock {
        &__postcode {
          &_invalid-msg {
            display: none;
          }

          &_label {
            display: flex;
            margin: 0;

            .stock {
              &__target {
                min-width: auto;
                width: auto;
                border-top-left-radius: 0;
                border-bottom-left-radius: 0;
              }

              &__input {
                border-bottom-right-radius: 0;
                border-top-right-radius: 0;
              }
            }
          }

          .my-account_find-store {
            width: 100%;
            margin-top: 15px;
          }
        }

        &__valid_show {
          display: none;
        }

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

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

      .bw_act {
        margin-top: 20px;
        text-align: center;
        display: flex;
        flex-direction: column;

        .btn {
          width: 100%;
          margin-bottom: 20px;
        }
      }

      .bw,
      .bw_act,
      .stock__postcode,
      .store-change {
        display: none;
      }

      .store-change {
        margin: 0;
      }

      .store__info {
        width: calc(100% - 60px);
      }
    }
  }

  .s-details__close {
    min-width: auto !important;
  }

  .stock__postcode_invalid {
    .stock {
      &__input,
      &__target {
        border: 1px solid $red;
      }

      &__target {
        border-left: 0;
      }
    }

    &-msg {
      color: $red;
      line-height: 1rem;
      font-size: .75rem;
      display: inherit;
      margin-top: .5rem;
    }
  }
}

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

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

  .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;
    }

    &-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,
    &__amount {
      font-size: .875rem;
      font-weight: 500;
    }

    &__amount {
      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;
      display: block;
      text-align: left;
    }

    &__stock {
      text-transform: uppercase;
      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: 100%;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1051;
  overflow: hidden;
  outline: 0;
  border: 0;
  background: $white;

  &::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;
  }

  &__address {
    font-weight: 400;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    margin: 0 10px 0 0;
    width: 150px;
    text-align: left;
  }

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

    .simplebar-content {
      margin-right: 0 !important;
      overflow-x: auto;

      .s-details {
        &__address {
          width: 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;
    min-width: auto;
    width: 40px !important;
    height: 40px;
  }

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

    &_val {
      font-weight: 400;
    }
  }

  &__phone {
    margin-top: 15px;
  }

  &__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;
    }
  }
}

@include media-breakpoint-up(md) {
  .my-account_default_store {
    .s-details {
      right: 310px;
      width: 50%;
      top: -64px;
      height: auto;
      position: absolute;
      margin-right: 15px;

      &__table_cell {
        padding: 0 0 0 20px;
      }

      .simplebar-scroll-content {
        margin: 0;
      }

      .simplebar-content {
        padding-bottom: 0;
      }
    }
  }

  .bw {
    .stock {
      &-more {
        position: absolute;
        bottom: 0;
        left: 0;
        top: auto;
        right: auto;
        z-index: 2;
        width: 100%;
        height: 100%;
        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 {
    padding: 0;

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

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

      .simplebar-scroll-content {
        margin-bottom: 0 !important;
        text-align: left;
      }
    }
  }
}


@include media-breakpoint-down(sm) {
  .page_my-account_new {
    .table_profile {
      padding: 20px 0;
      border: 0;
      border-bottom: 1px solid $gray-light;
      margin: 0;

      &:first-child {
        border-top: 1px solid $gray-light;
      }

      .table {
        &__content-heading {
          width: 50%;
          padding-right: 15px;
          min-width: 150px;
        }

        &__content {
          .col {
            padding-left: 45px;
            margin-bottom: 0;
            padding-right: 15px;
          }

          &-address {
            @include truncate;
          }
        }

        &__actions {
          border-top: 0;
          padding: 0;
        }
      }

      &.my-account_new_name {
        & .col {
          display: flex;
          max-width: 100%;

          & .table__content-info {
            max-width: 45%;
          }
        }
      }

      .s-details__address {
        width: auto;
      }
    }

    .table_profile_top {
      .table {
        &__content {
          .row:last-of-type {
            .table__content-info {
              &-desk {
                display: none;
              }

              &-mob {
                display: block;
                padding-top: 0;
              }
            }
          }

          .email-me {
            padding-top: 0;
          }
        }
      }
    }

    .acc-icon {
      padding-left: 15px;

      + .table__content-heading {
        max-width: inherit;
      }
    }

    .my-account-section_details {
      .table__actions {
        padding-top: 15px;
      }
    }

    .my-account_mp {
      .opted {
        display: flex;
        max-width: 100%;

        .table__content-info {
          &-mob {
            display: block;
            padding-top: 10px;
            line-height: 1.5rem;
          }

          &-desk {
            display: none;
          }
        }
      }
    }
  }
}


@include media-breakpoint-only(md) {
  .page_my-account_new {
    .my-account-section_details {
      .table__actions {
        .btn {
          min-width: 222px;
        }
      }
    }

    .table {
      &_profile {
        .btn-secondary {
          min-width: 222px;
        }
      }
    }
  }
}

@include media-breakpoint-up(lg) {
  .page_my-account_new {
    .my-account-section_details {
      .table__actions {
        .btn {
          width: 180px;
        }
      }
    }
  }
}
