.spm-service-membership-cta {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 999;
  align-items: center;
  background-color: var(--wp--preset--color--gold);
  border-top: 2px solid var(--wp--preset--color--background);
  display: flex;
  gap: 10px;
  justify-content: space-between;
  margin: 0 !important;
  padding: 15px 45px 15px 15px;
  width: 100%;
  /* Stay hidden until service-membership-cta.js has measured the button
     (on desktop) and set an exact width, so the box never flashes at an
     intermediate size first. The animation is a fallback only: if JS
     never runs (e.g. it errors or is blocked), the block still reveals
     itself after a short delay instead of staying invisible forever. */
  visibility: hidden;
  animation: spm-service-membership-cta-reveal 0s 1.5s forwards;
}

@keyframes spm-service-membership-cta-reveal {
  to {
    visibility: visible;
  }
}

.spm-service-membership-cta.is-sized {
  animation: none;
  visibility: visible;
}

.spm-service-membership-cta.is-hidden {
  display: none;
}

.spm-service-membership-cta__header {
  flex: 0 1 auto;
  margin-bottom: 0;
  min-width: 0;
}

.spm-service-membership-cta .spm-service-membership-cta__heading {
  font-size: 1.125rem;
  font-weight: 700;
  line-height: 1.1667;
  min-width: 0;
}

.spm-service-membership-cta__close {
  background-color: transparent;
  background-image: url("../img/close.svg");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 20px;
  border: 0;
  flex-shrink: 0;
  height: 20px;
  padding: 0;
  position: absolute;
  right: 12px;
  top: 12px;
  width: 20px;
}

.spm-service-membership-cta .wp-element-button {
  flex-shrink: 0;
  white-space: nowrap;
}

@media (min-width: 768px) {
  .spm-service-membership-cta {
    display: block;
    inset: auto 10px 10px auto;
    border: 2px solid var(--wp--preset--color--background);
    border-radius: 15px;
    min-width: 230px;
    max-width: min(90vw, 400px);
    padding: 15px;
    width: fit-content;
  }

  .spm-service-membership-cta__header {
    align-items: flex-start;
    display: flex;
    gap: 15px;
    justify-content: space-between;
    margin-bottom: 10px;
  }

  .spm-service-membership-cta__close {
    position: static;
  }
}
