.locator {
  &__header-wrapper {
    padding-bottom: 24px;

    h2 {
      margin-bottom: 16px;
      font-size: 1.125rem;
      font-weight: $headings-font-weight;
      line-height: 24px;
      text-align: left;
    }

    p {
      margin-bottom: 0;
      font-size: 1rem;
      line-height: 20px;
      text-align: left;
    }
  }

  &__form-wrapper {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  &__near-me,
  &__open-search {
    border: 0;
    background: transparent;
    color: $blue;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0;
    font-size: 0.875rem;
    font-weight: $btn-font-weight;
    line-height: 22px;
    text-align: center;

    &:hover {
      color: $blue-dark;
    }
  }

  &__near-me {
    align-self: flex-start;
  }

  &__near-me-icon,
  &__open-search-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    font-size: 1rem;
  }

  &__divider {
    width: 100%;
    height: 1px;
    background-color: $gray-border;
  }

  &__select-store {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: stretch;
    width: 100%;
  }

  .form-row,
  &__select-row {
    padding: 0;
    margin-bottom: 0;
  }

  &__details-button {
    height: 40px;
    padding-right: 16px;
    padding-left: 16px;
    font-size: 0.875rem;
    font-weight: $btn-font-weight;
    line-height: 22px;
    width: 100%;
    margin-top: 0;
  }


  &__open-search {
    display: none;
    width: 100%;
    min-height: 72px;
    background-color: $gray-bg;
    padding: 24px 40px;
  }
}

.form-locator-wrapper {
  margin-left: -15px;
  margin-right: -15px;
  padding: 24px;
  background-color: $gray-bg;

  .form-row__label_required::before {
    content: none;
  }
}

.forms-locator {
  @include make-col(12);

  display: flex;
  flex-direction: column;
  padding: 0;
  margin: 0 auto;

  .form-locator-list,
  .form-locator {
    margin: 0;
  }

  .form-row {
    margin-bottom: 0;
  }

  .form-row__label,
  .form-row__field,
  .form-row__error {
    @include make-col-ready;
    @include make-col(12);
    @include make-col-offset(0);
  }

  .form-row__label {
    padding-bottom: 8px;
    margin-bottom: 0;
    font-size: 1rem;
    font-weight: $btn-font-weight;
    line-height: 24px;
  }

  .form-row__field {
    input,
    select {
      height: 40px;
      font-size: 1rem;
      line-height: 24px;
    }

    .header-search__submit {
      right: 31px;
      color: $blue;
      font-size: 0.875rem;
      font-weight: $btn-font-weight;
      line-height: 22px;
      padding: 0;

      &-label {
        padding-left: 12px;
      }

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

  .form-row_validation-error {
    .form-row__field {
      input,
      select {
        border-color: $red;
      }
    }

    .form-row__error {
      color: $red;
      font-size: 0.75rem;
      line-height: 20px;
    }
  }
}

.store-locator_geo-off {
  .locator__select-store {
    flex-direction: column;
  }
}

@include media-breakpoint-up(sm) {
  .forms-locator {
    .form-row__field {
      .header-search__submit {
        &-label {
          display: initial !important;
        }
      }
    }
  }

  .form-locator-wrapper {
    margin: 0;
  }

  .store-locator_geo-on,
  .store-locator_geo-off {
    .locator__select-store {
      flex-direction: row;
    }
  }

  .locator__details-button {
    width: auto;
    margin-top: 32px;
  }
}

@include media-breakpoint-up(md) {
  .store-locator .container {
    padding-bottom: 72px;
  }

  .forms-locator {
    max-width: 435px;
  }

  .form-locator-wrapper {
    padding: 40px;
  }

  .locator {
    &__select-row {
      flex-grow: 1;
    }
  }

  .forms-locator {
    max-width: none;
  }
}

@include media-breakpoint-up(lg) {
  .store-locator_geo-on {
    .locator__select-store {
      flex-direction: column;
    }
  }

  .locator__select-row {
    flex-grow: initial;
  }

  .forms-locator {
    max-width: 435px;
  }

  .locator {
    &__select-row {
      flex: 1 1 auto;
      min-width: 212px;
    }

    &__header-wrapper p {
      max-width: none;
    }

    &__details-button {
      width: 100%;
      margin-top: 0;
    }
  }

  .store-locator_geo-off {
    .forms-locator {
      max-width: 435px;
    }

    .locator__details-button {
      width: auto;
      margin-top: 32px;
    }

    .form_invalid {
      margin-bottom: 24px;
    }
  }
}

@include media-breakpoint-up(xl) {
  .locator {
    &__select-store {
      flex-direction: row;
    }
  }

  .store-locator_geo-on {
    .locator__select-store {
      flex-direction: row;
    }
  }

  .locator {
    &__details-button {
      width: auto;
      margin-top: 32px;
    }
  }
}
