#pickup_location_field.hidden {
  display: none;
}

.pickup_location_notice.hidden, #pickup_location_customer_number_field.hidden {
  display: none !important;
}

#pickup_location_field .select2-selection__clear {
  margin-right: 5px; padding: 0 3px;
}

.woocommerce-checkout, .woocommerce-account {
  .woocommerce form, form.checkout {
    .pickup_location_notice.hidden, #pickup_location_customer_number_field.hidden {
      display: none !important;
    }

    #current_pickup_location_field {
      display: none;
    }

    .pickup_location_notice {
      margin-top: -.5rem;

      p {
        margin: 0;
        padding: 0;
      }

      a.pickup-location-remove {
        color: var(--wc-subtext);
        font-size: 0.9em;
        margin-top: 1rem;
      }
    }

    .wc-shiptastic-managed-by-pickup-location {
      position: relative;
    }

    .wc-shiptastic-managed-by-pickup-location {
      .woocommerce-input-wrapper {
        input.input-text:read-only {
          background-color: #eee;
        }
      }

      select + .select2-container {
        pointer-events: none;
        touch-action: none;

        .select2-selection {
          background: #eee;
          box-shadow: none;
        }

        .select2-selection__arrow,
        .select2-selection__clear {
          display: none;
        }
      }

      select {
        pointer-events: none;
        touch-action: none;
      }
    }

    .wc-shiptastic-managed-by-pickup-location-notice {
      font-size: 0.7em;
      color: var(--wc-subtext);
      line-height: 1em;
      position: absolute;
      right: 0;
      bottom: auto;
      margin-top: -1.5rem;
    }

    #shipping_address_2_field.wc-shiptastic-managed-by-pickup-location {
      margin-top: 2rem;
    }

    @media (max-width: 400px) {
      .wc-shiptastic-managed-by-pickup-location-notice {
        position: relative;
        margin-top: -1em;
        margin-bottom: .7rem;
        display: block;
      }
    }
  }
}

body.wc-stc-body-modal-active {
  overflow: hidden;
}

.wc-stc-modal-background {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #000;
  opacity: .50;
  filter: alpha(opacity=50);
  z-index: 1000;
}

.select2-container--open {
  .wc-stc-pickup-location-select-dropdown {
    z-index: 1051 !important;
  }
}

.wc-stc-modal-content {
  display: none;
  z-index: 1001;
  position: fixed;
  padding-top: 100px;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;

  .wc-stc-modal-close {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40px' height='40px' viewbox='0 0 40 40'%3E%3Cpath d='M 10,10 L 30,30 M 30,10 L 10,30' stroke='black' stroke-width='4' stroke-linecap='butt' /%3E%3C/svg%3E");
    text-indent: -9999px;
    background-repeat: no-repeat;
    width: 1.2em;
    height: 1.2em;
    background-size: contain;
  }

  .wc-stc-modal-content-inner {
    background-color: white;
    border-radius: 5px;
    margin: 0 auto;
    width: 80%;

    header {
      background: #fcfcfc;
      border-top-left-radius: 5px;
      border-top-right-radius: 5px;
      padding: 1em 1.2em;
      border-bottom: 1px solid #ddd;
      display: flex;
      justify-content: space-between;
      align-items: center;

      h4 {
        font-size: 1.2em;
        margin: 0;
      }
    }

    article {
      overflow: auto;
      padding: 1.2em;
    }

    .pickup-location-search-fields-wrapper {
      display: flex;
      flex-wrap: wrap;
      justify-content: flex-start;

      p.form-row {
        float: none;
        flex-grow: 1;
        width: auto;
        margin: 0;
        margin-right: 1.5em;
        padding: 0;
      }

      #wc-shiptastic-search-pickup-location-submit {
        align-self: flex-end;
        padding: .9rem 1.1rem;
      }
    }

    .pickup-location-search-results {
      margin-top: 2em;

      #pickup_location_field {
        padding: 0;

        &.hidden {
          display: none;
        }
      }
    }

    .pickup-location-search-actions {
      display: flex;
      justify-content: flex-end;
      margin-top: 1.5em;
      align-items: baseline;

      a {
        &.pickup-location-remove {
          color: var(--wc-red);
          font-size: .9em;
        }

        &.submit-pickup-location {
          margin-left: 1.5em;
        }
      }

      a.hidden {
        display: none;
      }
    }
  }
}

.wc-stc-modal-background.active, .wc-stc-modal-content.active {
  display: block !important;
}