/* Checkout Loading Overlay */
.woocommerce-loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 99999;
  opacity: 0;
  transition: opacity 0.2s ease-in-out;
}

.woocommerce-loading-overlay.is-visible {
  display: flex;
  opacity: 1;
}

/* Overlay content container */
.woocommerce-loading-overlay > div {
  text-align: center;
  padding: 2rem;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  max-width: 400px;
}

/* Spinner */
.woocommerce-loading-spinner {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 6px solid rgba(255, 255, 255, 0.2);
  border-top-color: #ffffff;
  border-right-color: #ffffff;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
  box-sizing: border-box;
}

/* Loading message */
.woocommerce-loading-message {
  color: #ffffff;
  margin-top: 1.25rem;
  font-size: 16px;
  font-weight: 500;
  text-align: center;
  line-height: 1.5;
}

/* Spinner animation */
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* Prevent body scroll when overlay is visible */
body:has(.woocommerce-loading-overlay.is-visible) {
  overflow: hidden;
}

/* Form state when WooCommerce adds processing class */
form.checkout.processing,
form.woocommerce-checkout.processing {
  pointer-events: none;
  position: relative;
}

form.checkout.processing::after,
form.woocommerce-checkout.processing::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.1);
  pointer-events: none;
  z-index: 10;
}

/* Buttons during processing */
form.checkout.processing button,
form.checkout.processing input[type="submit"],
form.woocommerce-checkout.processing button,
form.woocommerce-checkout.processing input[type="submit"] {
  cursor: not-allowed !important;
  opacity: 0.6;
}

/* Clickable error links for field validation */
.hora-field-error-link {
  color: inherit;
  text-decoration: underline;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.hora-field-error-link:hover {
  opacity: 0.8;
  text-decoration: underline;
}

/* Highlight animation for focused fields */
.hora-field-highlight {
  animation: hora-field-pulse 0.6s ease-in-out;
  border-color: #e53935 !important;
  box-shadow: 0 0 0 3px rgba(229, 57, 53, 0.2) !important;
}

@keyframes hora-field-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(229, 57, 53, 0.4);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(229, 57, 53, 0);
  }
}
