/**
 * Publication-agnostic checkout skeleton.
 * Themes can opt in with data-coeditor-preloader and override CSS variables.
 */
#checkout.coeditor-is-loading,
[data-coeditor-preloader].coeditor-is-loading {
  --coeditor-preloader-base: #f0f0f0;
  --coeditor-preloader-highlight: #e5e5e5;
  --coeditor-preloader-min-height: 100vh;
  position: relative;
  min-height: var(--coeditor-preloader-min-height);
  overflow: hidden;
  background-color: #f9f9f9;
}

#checkout.coeditor-is-loading::before,
[data-coeditor-preloader].coeditor-is-loading::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    var(--coeditor-preloader-base) 25%,
    var(--coeditor-preloader-highlight) 50%,
    var(--coeditor-preloader-base) 75%
  );
  background-size: 200% 100%;
  animation: coeditor-preloader-shimmer 1.5s infinite;
  z-index: 1;
}

#coeditor-checkout-preloader {
  --coeditor-preloader-base: #e8e8e8;
  --coeditor-preloader-highlight: #f5f5f5;
  box-sizing: border-box;
  width: 100%;
  max-width: 40rem;
  margin: 1.5rem auto;
  padding: 1.25rem 0;
}

#coeditor-checkout-preloader.is-hidden {
  display: none;
}

#coeditor-checkout-preloader .coeditor-preloader-bar {
  height: 0.85rem;
  margin-bottom: 0.75rem;
  border-radius: 0.25rem;
  background: linear-gradient(
    90deg,
    var(--coeditor-preloader-base) 25%,
    var(--coeditor-preloader-highlight) 37%,
    var(--coeditor-preloader-base) 63%
  );
  background-size: 400% 100%;
  animation: coeditor-preloader-shimmer 1.4s ease infinite;
}

#coeditor-checkout-preloader .coeditor-preloader-bar.is-short {
  width: 55%;
}

#coeditor-checkout-preloader .coeditor-preloader-bar.is-medium {
  width: 80%;
}

#coeditor-checkout-preloader .coeditor-preloader-bar.is-button {
  height: 2.75rem;
  width: 100%;
  margin-top: 1.25rem;
}

@keyframes coeditor-preloader-shimmer {
  0% {
    background-position: 100% 0;
  }
  100% {
    background-position: 0 0;
  }
}
