.hw-purchase .product-form-buttons {
  align-items: stretch;
  gap: 10px;
}

.hw-purchase .product-form-buttons > * {
  min-width: 0;
  max-width: 100%;
}

.hw-purchase .quantity-label {
  margin: 0;
  font-weight: 650;
}

.hw-purchase .quantity-selector-wrapper {
  flex-basis: 100%;
}

/* The two product form buttons sample a blush reflection behind their glass. */
.hw-purchase :is(add-to-cart-component, hecwet-buy-now) {
  display: block;
  position: relative;
  isolation: isolate;
  min-width: 0;
  width: 100%;
}
@supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .hw-purchase :is(add-to-cart-component, hecwet-buy-now)::before {
    content: "";
    position: absolute;
    z-index: -1;
    pointer-events: none;
    inset: 7px 10% auto 37%;
    height: 35px;
    border-radius: 50%;
    background: radial-gradient(ellipse at center, #e8b7c8, transparent 72%);
  }
  .hw-purchase hecwet-buy-now::before {
    background: radial-gradient(ellipse at center, #d586a6, transparent 72%);
  }
}

.hw-purchase :is(.add-to-cart-button, .hecwet-buy-now__button) {
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 100%;
  min-height: 50px;
  padding: .65rem 1.2rem;
  font: inherit;
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.3;
}

:is(
  .hw-purchase .add-to-cart-button,
  .hw-purchase .hecwet-buy-now__button,
  .shopify-section:has(.hw-purchase) .sticky-add-to-cart__button,
  .cart-page .cart__checkout-button,
  .cart-drawer__inner .cart__checkout-button
) {
  /* Opaque default when backdrop-filter is unavailable. */
  --glass-solid: #fbe5ec;
  --glass-tint: rgb(251 230 237 / 77%);
  --glass-edge: #b78092;
  --glass-shadow: rgb(119 65 87 / 10%);
  position: relative;
  appearance: none;
  border: 1px solid var(--glass-edge);
  border-radius: 999px;
  color: #593b49;
  background-color: var(--glass-solid);
  background-image: linear-gradient(171deg, rgb(255 255 255 / 56%), transparent 44%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 92%), inset 0 -1px 1px rgb(151 86 113 / 19%), 0 3px 9px -4px var(--glass-shadow);
  cursor: pointer;
  transition: translate 160ms ease-out, box-shadow 160ms ease-out;

  &:is(.hecwet-buy-now__button, .cart__checkout-button) {
    --glass-solid: #f2b9ca;
    --glass-tint: rgb(243 179 201 / 77%);
    --glass-edge: #ac7186;
    --glass-shadow: rgb(122 55 84 / 18%);
    font-weight: 750;
  }
  &.cart__checkout-button { width: 100%; min-height: 48px; padding-inline: 1.2rem; }
  @supports ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    background-color: var(--glass-tint);
    -webkit-backdrop-filter: blur(9px) saturate(116%);
    backdrop-filter: blur(9px) saturate(116%);
  }
  @media (hover: hover) {
    &:enabled:hover {
      translate: 0 -1px;
      box-shadow: inset 0 1px 0 white, inset 0 -1px 1px rgb(151 86 113 / 24%), 0 5px 11px -4px var(--glass-shadow);
    }
  }
  &:enabled:active {
    translate: 0 1px;
    scale: 1;
    box-shadow: inset 0 2px 4px rgb(135 72 99 / 18%);
  }
  &:focus-visible { outline: 2px solid #805268; outline-offset: 3px; }
  &:disabled { opacity: .65; cursor: default; }
  &[aria-busy="true"] { cursor: progress; }

  @media (prefers-reduced-motion: reduce) {
    &, &:enabled:is(:hover, :active) { translate: none; scale: none; transition: none; }
  }
  @media (prefers-reduced-transparency: reduce) {
    background: var(--glass-solid);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    &:disabled { color: #806775; opacity: 1; }
  }
  @media (forced-colors: active) {
    background: ButtonFace;
    color: ButtonText;
    border-color: ButtonText;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    &, &:enabled:is(:hover, :active) { box-shadow: none; }
    &:is(.hecwet-buy-now__button, .cart__checkout-button) { border-width: 2px; }
    &:focus-visible { outline-color: Highlight; }
    &:disabled { opacity: 1; color: GrayText; border-color: GrayText; }
  }
}
@media (prefers-reduced-transparency: reduce), (forced-colors: active) {
  .hw-purchase :is(add-to-cart-component, hecwet-buy-now)::before { content: none; }
}
.hw-purchase .hecwet-buy-now__button[hidden] { display: none; }
.hw-purchase .hecwet-buy-now__message { margin: .5rem 0 0; font-size: .875rem; color: #674052; }
.hw-purchase .hecwet-buy-now__message:empty { margin: 0; }

.hw-purchase .hw-purchase__express {
  flex: 1 0 100%;
  color: var(--color-foreground);
}

.hw-purchase__express:has(.accelerated-checkout-block[hidden]) { display: none; }
.hw-purchase__express summary {
  min-height: 44px;
  display: list-item;
  list-style: revert;
  list-style-position: inside;
  align-content: center;
  cursor: pointer;
  text-align: center;
  text-decoration: underline;
  text-underline-offset: .18em;
}

.hw-purchase__express summary:focus-visible { outline-offset: -3px; }
.hw-purchase__express[open] summary { margin-block-end: 6px; }

/* Rhinestone pavé interaction. */
@property --hw-pave-front {
  syntax: "<length-percentage>";
  inherits: false;
  initial-value: -45px;
}

:is(
  a.hw-intro__button,
  a.hecwet-kits__action,
  .hw-purchase .add-to-cart-button,
  .hw-purchase .hecwet-buy-now__button,
  .shopify-section:has(.hw-purchase) .sticky-add-to-cart__button,
  .cart-page .cart__checkout-button,
  .cart-drawer__inner .cart__checkout-button
) {
  position: relative;
  isolation: isolate;

  &::after {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: url("hecwet-pave.svg") left top / 18px 32px repeat;
    opacity: .86;
    /* Browsers with older masking support still paint the same faceted stones. */
    clip-path: inset(0 var(--hw-pave-rest, 100%) 0 0);
    transition: clip-path var(--hw-pave-time, 0s) steps(22, end);
  }

  &:is(.hecwet-buy-now__button, .cart__checkout-button)::after { opacity: .98; }

  @supports (width: round(down, 30px, 18px)) and (mask-size: 18px 64px) {
    &::after {
      /* Each step lands on a stone boundary. Odd rows start half a stone later. */
      --hw-pave-front: var(--hw-pave-target, -45px);
      --row-one: round(down, calc(var(--hw-pave-front) + 18px), 18px);
      --row-two: calc(round(down, calc(var(--hw-pave-front) - 9px), 18px) + 9px);
      --row-three: round(down, calc(var(--hw-pave-front) - 18px), 18px);
      --row-four: calc(round(down, var(--hw-pave-front), 18px) + 9px);
      clip-path: none;
      mask-image:
        linear-gradient(to bottom, black 25%, transparent 25%),
        linear-gradient(to bottom, transparent 25%, black 25% 50%, transparent 50%),
        linear-gradient(to bottom, transparent 50%, black 50% 75%, transparent 75%),
        linear-gradient(to bottom, transparent 75%, black 75%);
      mask-position: left top;
      mask-repeat: repeat-y;
      mask-size:
        clamp(0px, var(--row-one), 100%) 64px,
        clamp(0px, var(--row-two), 100%) 64px,
        clamp(0px, var(--row-three), 100%) 64px,
        clamp(0px, var(--row-four), 100%) 64px;
      transition: --hw-pave-front var(--hw-pave-time, 0s) linear;
    }
  }

  &:not(:disabled):focus-visible {
    --hw-pave-target: calc(100% + 45px);
    --hw-pave-rest: 0%;
    --hw-pave-time: 660ms;
    color: #4d3040;
  }

  @media (hover: hover) and (pointer: fine) {
    &:not(:disabled):hover {
      --hw-pave-target: calc(100% + 45px);
      --hw-pave-rest: 0%;
      --hw-pave-time: 660ms;
      color: #4d3040;
    }
  }

  @media (prefers-reduced-motion: reduce) {
    &::after { transition: none; }
  }
  @media (prefers-reduced-transparency: reduce) {
    &::after, &:is(.hecwet-buy-now__button, .cart__checkout-button)::after { opacity: 1; }
  }
  @media (forced-colors: active) {
    &::after { content: none; }
    &:not(:disabled):is(:focus-visible, :hover) { color: ButtonText; }
    &:is(a):is(:focus-visible, :hover) { color: LinkText; }
  }
}
