/*
 * Product-page one-click: the spacing for the Apple Pay / Google Pay row that
 * `theme/js/happywags-express-pdp.js` injects under Add to Cart.
 *
 * WHY THIS IS ITS OWN FILE
 * ------------------------
 * These rules used to live in `happywags-checkout.css`, which is linked only by
 * the authored pages (`scripts/checkout-page.mjs` HEAD_EXTRA: /checkout,
 * /checkout-embed, /preview/checkout, /thank-you). No product page has ever
 * linked it — `scripts/build.mjs` injects the two express <script> tags into
 * /products/* and nothing else — so every rule written for `.hw-pdp-express`
 * was dead in production and the row rendered on UA defaults: no margin, no
 * min-height, no skeleton, and a bare <p> for the note. That is why the button
 * sat flush against Add to Cart.
 *
 * Splitting it out rather than linking the whole checkout sheet keeps ~10KB of
 * `.hw-co-*` rules off the highest-traffic template. Nothing here may depend on
 * `happywags-checkout.css` being present — the PDP loads this file alone, which
 * is why the shimmer keyframes are repeated at the bottom.
 *
 * THE SPACING, AND WHY THESE NUMBERS
 * ----------------------------------
 * Add to Cart and one-click are two competing primary actions, and the whole
 * point of the express row is that it is a *different* decision from adding to
 * the cart. Flush against the button it reads as one control with a seam in it,
 * and a mis-tap lands on a charge rather than a cart.
 *
 *   24px  above the row — the repo's separation constant between an express
 *         row and the control it is an alternative to. Same value in
 *         happywags-checkout.css `.hw-co-express` (margin-bottom) and
 *         `.hw-co-or`, tanora-fields.css `.tf-express` / `.tf-express-or`, and
 *         brenner's `src/style.css`. Not a new number.
 *   16px  below — the theme's `.guarantee-badges-container` immediately after
 *         the buy box carries `margin-top: -5px` (and -10px under its own
 *         mobile query), so a 0 bottom margin lets the badges climb onto the
 *         note. 16px absorbs the pull and still leaves a real gap.
 *    8px  under the button for the note, matching `.hw-pdp-express-note`'s
 *         long-standing value and tanora's `.tf-express-note`.
 *
 * The divider carries the same geometry as every other one in the repo —
 * flex, 12px gap, `flex: 1 1 auto` 1px rules, 13/18px, subdued — so the PDP
 * does not invent a third look for a component that already has one.
 */

.hw-pdp-express {
  margin: 24px 0 16px;
  /*
   * FULL WIDTH, EXPLICITLY — defensive, not currently load-bearing.
   *
   * The JS anchors the row inside `.shop-add-to-cart-wrapper`, a block box at
   * `width: 100% !important`, so it fills the buy box on its own. These lines
   * exist because the row is one anchor-fallback away from being a child of
   * `.shop-product-info`, which is `display: flex; flex-direction: column` —
   * and a flex item in a column shrink-wraps unless stretched. Measured while
   * the row was briefly parented there: a 257px express button under a 580px
   * Add to Cart. Cheap insurance against that fallback ever being taken.
   */
  width: 100%;
  align-self: stretch;
  box-sizing: border-box;
}

.hw-pdp-express[hidden] {
  display: none;
}

/*
 * "or", between Add to Cart and one-click.
 *
 * It lives INSIDE `.hw-pdp-express` on purpose: the row withdraws itself whole
 * on a device with no wallet, and a divider left behind would be a labelled
 * separator with nothing under it.
 */
.hw-pdp-express-or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 18px;
  opacity: 0.6;
}

.hw-pdp-express-or::before,
.hw-pdp-express-or::after {
  content: '';
  flex: 1 1 auto;
  height: 1px;
  background: rgba(0, 0, 0, 0.12);
}

.hw-pdp-express-row {
  position: relative;
  min-height: 46px;
}

/*
 * The theme hides every empty element (`div:empty { display: none }` in its
 * base sheet), and the row is empty until the buttons land — so the 46px
 * skeleton pill never drew and the row measured 0px, the buttons then pushing
 * everything below down by 46px. Out-specify it.
 */
.hw-pdp-express .hw-pdp-express-row {
  display: block;
}

.hw-pdp-express-row {
  /*
   * The wallet buttons are drawn by theme/js/happywags-elements.js
   * (payments.paymentRequest, 2026-10-06). Same 46px as the skeleton they
   * replace, and the theme's own pill radius so they read as siblings of Add
   * to Cart — nothing moves when they land.
   */
  --hw-wallet-radius: var(--global-button-radius, 40px);
}

.hw-pdp-express .hw-wallet-btn {
  height: 46px;
}

.hw-pdp-express[data-express-state='probing'] .hw-wallets {
  visibility: hidden;
}

.hw-pdp-express-error {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 18px;
  text-align: center;
  color: #c0392b;
}

.hw-pdp-express-error[hidden] {
  display: none;
}

/*
 * The skeleton is a promise that something is coming, so it never outlives the
 * probe — `happywags-express-pdp.js` withdraws the whole row at the deadline.
 *
 * The radius tracks the THEME's own button variable rather than the checkout
 * page's `--hw-radius`, which is not defined on a product page. It resolves to
 * 40px here, matching the Add to Cart pill the skeleton sits under — the old
 * rule only matched by accident, via `var(--hw-radius, 40px)` falling through
 * to a 40px literal that happened to equal `--global-button-radius`. Reading
 * the theme's variable makes the match intentional and survives a retheme.
 */
.hw-pdp-express[data-express-state='probing'] .hw-pdp-express-row::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--global-button-radius, 40px);
  background-color: rgba(37, 40, 42, 0.07);
  background-image: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.65) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  background-size: 200% 100%;
  background-repeat: no-repeat;
  animation: hw-shimmer 1.25s ease-in-out infinite;
  pointer-events: none;
}

/* The note is a claim about the order, so it only appears once the button
 * actually has, never over the skeleton. */
.hw-pdp-express-note {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 18px;
  text-align: center;
  opacity: 0.6;
}

.hw-pdp-express[data-express-state='probing'] .hw-pdp-express-note {
  visibility: hidden;
}

/*
 * The recurring-charge disclosure for renewing offers: what is charged today,
 * what is rebilled and how often, and the cancellation policy — the
 * checkout's subscription notice, condensed. Set in the note's voice, a step
 * smaller; held invisible (not removed) under the skeleton so nothing moves
 * when the buttons land.
 */
.hw-pdp-express-terms {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 16px;
  text-align: center;
  opacity: 0.72;
}

.hw-pdp-express-terms a {
  color: inherit;
  text-decoration: underline;
}

.hw-pdp-express-terms[hidden] {
  display: none;
}

.hw-pdp-express[data-express-state='probing'] .hw-pdp-express-terms {
  visibility: hidden;
}

/* Repeated from happywags-checkout.css rather than shared: the product page
 * links this file and only this file. */
@keyframes hw-shimmer {
  from {
    background-position: -120% 0;
  }
  to {
    background-position: 220% 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hw-pdp-express[data-express-state='probing'] .hw-pdp-express-row::after {
    animation: none;
  }
}

/*
 * AIM powder one-time link. Sits under the COA button as a priced add-to-cart
 * action for the selected tier.
 */
.hw-onetime-link {
  display: block;
  width: 100%;
  margin: 16px 0 8px;
  padding: 0;
  text-align: center;
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.4;
  color: #254f4f;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  background: none;
  border: 0;
  box-sizing: border-box;
}

.hw-onetime-link:hover,
.hw-onetime-link:focus-visible {
  color: #1b3b3b;
}

.hw-onetime-link[hidden] {
  display: none;
}

.hw-onetime-link[aria-busy='true'] {
  opacity: 0.55;
  pointer-events: none;
}
