.terms-storefront__agreement {
  margin-block: 0.75rem;
  padding: 0.875rem;
  color: inherit;
  background: rgba(128, 128, 128, 0.12);
  border: 1px solid rgba(128, 128, 128, 0.45);
  border-radius: 12px;
  font: inherit;
  font-size: 14px;
  line-height: 21px;
}

.terms-storefront__agreement-label {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  cursor: pointer;
}

/* Both cards top-align the checkbox with the first line of text. A theme rule
   on checkbox labels outranks the single-class rules above, so repeat them
   behind the card class. */
.terms-storefront__agreement .terms-storefront__agreement-label {
  display: flex;
  align-items: flex-start;
  gap: 4px;
}

.terms-storefront__agreement .terms-storefront__agreement-label .terms-storefront__checkbox {
  margin-top: 0;
}

.terms-storefront__checkbox {
  flex: 0 0 auto;
  width: 1.4rem;
  height: 1.4rem;
  margin-top: 0.125rem;
  accent-color: currentColor;
}

.terms-storefront__agreement-copy {
  min-width: 0;
}

.terms-storefront__agreement a,
.terms-storefront__agreed a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.12em;
}

.terms-storefront__agreed {
  margin-block: 0.75rem;
  color: inherit;
  font: inherit;
  font-size: 14px;
  line-height: 21px;
}

cart-drawer-component .terms-storefront__agreed {
  margin-block-end: 0;
  padding-block-end: 10px;
  font-size: 14px;
  line-height: 21px;
}

.terms-storefront__saving {
  margin-block: 0.75rem;
  color: inherit;
  font-size: 14px;
  line-height: 21px;
}

/* BACtrack+ box: heading, agreed and saving lines, checking placeholder, retry. */
.terms-storefront__heading {
  margin: 0 0 8px;
  font-family: "Poppins", sans-serif;
  font-size: 18px;
  font-weight: 500;
  line-height: 24px;
  letter-spacing: 0;
  /* The bactrack.com theme sets h4 to uppercase. Show the heading as written,
     so it matches the stored record and keeps the "BACtrack+" brand casing. */
  text-transform: none;
  color: inherit;
}

/* The bold renewal paragraph above the BACtrack+ checkbox. */
.terms-storefront__notice {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 700;
  line-height: 21px;
  color: inherit;
}

/* The agreed and saving lines share one set of metrics, so nothing moves between them. */
.terms-storefront__agreed--plus,
.terms-storefront__saving--plus {
  margin-block: 12px 0;
  padding-block-end: 10px;
  font-size: 14px;
  line-height: 21px;
}

cart-drawer-component .terms-storefront__agreed--plus,
cart-drawer-component .terms-storefront__saving--plus {
  margin-block-start: 0;
}

/* Checking: the box holds its space. Bars stand where the copy will be. */
.terms-storefront__pending {
  flex: 1;
  --ghost-lines: 7;
  --ghost-bar: rgba(18, 18, 18, 0.1);
}

/* Before the copy arrives the heading holds its row with a bar. */
.terms-storefront__heading:empty {
  min-height: 24px;
  background: linear-gradient(rgba(18, 18, 18, 0.1), rgba(18, 18, 18, 0.1)) no-repeat 0 7px / 38% 10px;
}

.terms-storefront__checking {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: rgba(18, 18, 18, 0.7);
  white-space: nowrap;
}

.terms-storefront__checking::after {
  content: "";
  flex: 1;
  height: 10px;
  background: var(--ghost-bar);
}

.terms-storefront__ghost {
  height: calc((var(--ghost-lines) - 1) * 21px);
  background:
    linear-gradient(var(--ghost-bar), var(--ghost-bar)) no-repeat 0 calc(100% - 6px) / 58% 9px,
    repeating-linear-gradient(to bottom, transparent 0 6px, var(--ghost-bar) 6px 15px, transparent 15px 21px) no-repeat 0 0 / 100% calc(100% - 21px);
}

@media (min-width: 750px) {
  .terms-storefront__pending[data-terms-surface-kind="cart_page"] {
    --ghost-lines: 8;
  }
}

/* Could not save: message and a quiet Try again button inside the same box. */
.terms-storefront__agreement--plus .terms-storefront__error {
  margin: 0 0 12px;
}

.terms-storefront__retry {
  display: inline-flex;
  align-items: center;
  height: 44px;
  padding: 0 20px;
  font-family: "Poppins", sans-serif;
  font-size: 14px;
  font-weight: 500;
  line-height: 1;
  color: inherit;
  background: transparent;
  border: 1px solid rgba(18, 18, 18, 0.35);
  border-radius: 5px;
  cursor: pointer;
}

.terms-storefront__error {
  color: #b42318;
}

/* This is also the first-paint guard before the loader observes native hosts. */
[data-terms-surface]:not([data-terms-ready="true"]) :is(shopify-paypal-button, shopify-google-pay-button, shopify-apple-pay-button) {
  pointer-events: none;
  opacity: 0.5;
}

[data-terms-surface] {
  width: 100%;
}

[data-terms-surface="product"] {
  flex: 1 0 100% !important;
  min-width: 0;
}
