/* Keep the native POST intact while making the in-flight state unmistakable. */
.woocommerce div.product form.cart .single_add_to_cart_button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.2;
  text-transform: none;
  white-space: nowrap;
}

@media screen and (max-width: 767px) {
  .woocommerce div.product form.cart .single_add_to_cart_button {
    width: calc(100% - 85px);
    min-width: 0;
    padding-inline: .8rem;
    white-space: nowrap;
    font-size: clamp(.8rem, 3.7vw, .95rem);
  }
}

.single_add_to_cart_button.is-adding,
.single_add_to_cart_button[aria-busy="true"] {
  position: relative;
  pointer-events: none;
  cursor: wait;
  opacity: 1;
  background: var(--brand-color, #e45826) !important;
  color: var(--text-dark-color, #fef4ee) !important;
}

form.cart[data-eva-submitting="true"] {
  cursor: wait;
}

/* Fixed to the edge so the centered label does not jump when loading starts. */
.single_add_to_cart_button.is-adding::after,
.single_add_to_cart_button[aria-busy="true"]::after {
  content: "";
  position: absolute;
  top: 50%;
  right: clamp(.8rem, 2vw, 1.15rem);
  width: 1em;
  height: 1em;
  box-sizing: border-box;
  border: .17em solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  transform: translateY(-50%);
  animation: eva-atc-spin .7s linear infinite;
  pointer-events: none;
}

@keyframes eva-atc-spin {
  to {
    transform: translateY(-50%) rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .single_add_to_cart_button.is-adding::after,
  .single_add_to_cart_button[aria-busy="true"]::after {
    animation: none;
  }
}
