/* Optional finishes for purchase actions only. Solid keeps the existing design. */
/* The action color is readable on light surfaces; lift the same accent on dark ones. */
body[data-color="dark"] button:is([data-buy], [data-add-product]):has([data-buy-label]),
html[data-admin-color="dark"] [data-cart-design-preview],
html:not([data-admin-color]) .admin-ui[data-color="dark"] [data-cart-design-preview],
body.theme-flow.store-page .flow-main > [data-flow-feed] > .product-card .buy-button,
body.store-page.cards-overlay .product-card .buy-button {
  --purchase-finish-ink:color-mix(in srgb,var(--accent,#fe2c55) 45%,#fff);
  --purchase-glass-ink:#fff;
  --purchase-glass-text-shadow:0 1px 2px #00000080;
}
:is(
  body.theme-flow.store-page[data-buy-style="glass"] .flow-main > [data-flow-feed] > .product-card .buy-button,
  body[data-buy-style="glass"] button:is([data-buy], [data-add-product]):has([data-buy-label]),
  html .admin-ui .admin-content [data-cart-design-preview][data-buy-style="glass"]
):not([data-cart-feedback="success"]) {
  position:relative;
  isolation:isolate;
  color:var(--purchase-glass-ink,var(--action,#df2449)) !important;
  text-shadow:var(--purchase-glass-text-shadow,none);
  background:#ffffff26 !important;
  background:radial-gradient(ellipse 80% 75% at 14% -10%,#ffffffb3 0%,#ffffff1a 38%,transparent 64%),radial-gradient(ellipse 80% 50% at 86% 115%,#ffffff94 0%,transparent 58%),linear-gradient(120deg,color-mix(in srgb,var(--accent,#fe2c55) 28%,transparent),transparent 42%,color-mix(in srgb,var(--accent,#fe2c55) 18%,transparent)),color-mix(in srgb,var(--accent,#fe2c55) 14%,transparent) !important;
  border-color:var(--purchase-glass-border,color-mix(in srgb,var(--accent,#fe2c55) 42%,#ffffffb3)) !important;
  box-shadow:inset 0 2px 2px #ffffffe6,inset 2px 0 3px #ffffff80,inset -2px 0 3px #ffffff4d,inset 0 -3px 2px #ffffffb3,inset 0 0 8px #ffffff33,0 1px 0 color-mix(in srgb,var(--accent,#fe2c55) 35%,transparent),0 5px 12px color-mix(in srgb,var(--accent,#fe2c55) 18%,transparent),0 2px 4px #0000001f !important;
  -webkit-backdrop-filter:blur(8px) saturate(150%);
  backdrop-filter:blur(8px) saturate(150%);
  filter:none !important;
}
/* A rounded lens and two optical layers stay visible even on a plain white surface. */
:is(
  body.theme-flow.store-page[data-buy-style="glass"] .flow-main > [data-flow-feed] > .product-card .buy-button,
  body[data-buy-style="glass"] button:is([data-buy], [data-add-product]):has([data-buy-label]),
  html .admin-ui .admin-content [data-cart-design-preview][data-buy-style="glass"]
) { border-radius:999px !important; }
:is(
  body[data-buy-style="glass"] button:is([data-buy], [data-add-product]):has([data-buy-label]),
  [data-cart-design-preview][data-buy-style="glass"]
):not([data-cart-feedback="success"])::before {
  content:"";
  position:absolute;
  inset:2px;
  z-index:-1;
  padding:1.5px;
  border-radius:inherit;
  background:linear-gradient(135deg,#ffffffe6 2%,#ffffff33 30%,transparent 47%,#ffffffcc 78%,#ffffff4d);
  -webkit-mask:linear-gradient(#fff 0 0) content-box,linear-gradient(#fff 0 0);
  -webkit-mask-composite:xor;
  mask:linear-gradient(#fff 0 0) content-box,linear-gradient(#fff 0 0);
  mask-composite:exclude;
  pointer-events:none;
}
:is(
  body[data-buy-style="glass"] button:is([data-buy], [data-add-product]):has([data-buy-label]),
  [data-cart-design-preview][data-buy-style="glass"]
):not([data-cart-feedback="success"])::after {
  content:"";
  position:absolute;
  inset:4px 7px;
  z-index:-1;
  border-radius:inherit;
  background-image:linear-gradient(112deg,transparent 40%,#ffffffb3 49%,#ffffffe6 51%,transparent 60%),radial-gradient(ellipse 80% 70% at 25% -20%,#ffffffa6,transparent 58%),linear-gradient(112deg,transparent 23%,#ffffff14 35%,transparent 47%);
  background-size:300% 100%,100% 100%,100% 100%;
  background-position:100% 0,0 0,0 0;
  background-repeat:no-repeat;
  pointer-events:none;
}
/* Sweep once on entry; a touch tap never leaves a sticky hover animation. */
@media (hover:hover) and (pointer:fine) {
  :is(
    body[data-buy-style="glass"] button:is([data-buy], [data-add-product]):has([data-buy-label]),
    [data-cart-design-preview][data-buy-style="glass"]
  ):hover:not(:disabled,[aria-disabled="true"],[aria-busy="true"],[data-cart-feedback]) {
    --purchase-glass-border:color-mix(in srgb,var(--accent,#fe2c55) 24%,#fff);
  }
  :is(
    body[data-buy-style="glass"] button:is([data-buy], [data-add-product]):has([data-buy-label]),
    [data-cart-design-preview][data-buy-style="glass"]
  ):hover:not(:disabled,[aria-disabled="true"],[aria-busy="true"],[data-cart-feedback])::after {
    animation:purchase-glass-hover 900ms ease-out both;
  }
}
:is(
  body[data-buy-style="glass"] button:is([data-buy], [data-add-product]):has([data-buy-label]),
  [data-cart-design-preview][data-buy-style="glass"]
):focus-visible:not(:disabled,[aria-disabled="true"],[aria-busy="true"],[data-cart-feedback])::after {
  animation:purchase-glass-hover 900ms ease-out both;
}
@keyframes purchase-glass-hover {
  from { background-position:100% 0,0 0,0 0; }
  to { background-position:0% 0,0 0,0 0; }
}
@media (prefers-reduced-motion:reduce) {
  :is(
    body[data-buy-style="glass"] button:is([data-buy], [data-add-product]):has([data-buy-label]),
    [data-cart-design-preview][data-buy-style="glass"]
  )::after { animation:none !important; }
}
:is(
  body.theme-flow.store-page[data-buy-style="outline"] .flow-main > [data-flow-feed] > .product-card .buy-button,
  body[data-buy-style="outline"] button:is([data-buy], [data-add-product]):has([data-buy-label]),
  html .admin-ui .admin-content [data-cart-design-preview][data-buy-style="outline"]
):not([data-cart-feedback="success"]) {
  color:var(--purchase-finish-ink,var(--action,#df2449)) !important;
  background:transparent !important;
  border-color:currentColor !important;
  box-shadow:inset 0 0 0 .5px currentColor !important;
}
/* Pending uses the readable button surface; success retains its selected color. */
:is(
  body.theme-flow.store-page[data-buy-style="glass"] .flow-main > [data-flow-feed] > .product-card .buy-button,
  body[data-buy-style="glass"] button:is([data-buy], [data-add-product]):has([data-buy-label]),
  body.theme-flow.store-page[data-buy-style="outline"] .flow-main > [data-flow-feed] > .product-card .buy-button,
  body[data-buy-style="outline"] button:is([data-buy], [data-add-product]):has([data-buy-label]),
  [data-cart-design-preview][data-buy-style="glass"],
  [data-cart-design-preview][data-buy-style="outline"]
)[data-cart-feedback="pending"] > .cart-button-feedback { background:transparent; }
:is(
  body.theme-flow.store-page[data-buy-style="glass"] .flow-main > [data-flow-feed] > .product-card .buy-button,
  body[data-buy-style="glass"] button:is([data-buy], [data-add-product]):has([data-buy-label]),
  body.theme-flow.store-page[data-buy-style="outline"] .flow-main > [data-flow-feed] > .product-card .buy-button,
  body[data-buy-style="outline"] button:is([data-buy], [data-add-product]):has([data-buy-label]),
  html .admin-ui .admin-content [data-cart-design-preview][data-buy-style="glass"],
  html .admin-ui .admin-content [data-cart-design-preview][data-buy-style="outline"]
):not([data-cart-feedback="success"]):is(:disabled,[aria-disabled="true"]) { box-shadow:none !important; }
@media (forced-colors:active) {
  body[data-buy-style="glass"] button:is([data-buy], [data-add-product]):has([data-buy-label])::before,
  body[data-buy-style="glass"] button:is([data-buy], [data-add-product]):has([data-buy-label])::after,
  [data-cart-design-preview][data-buy-style="glass"]::before,
  [data-cart-design-preview][data-buy-style="glass"]::after { display:none; }
  body[data-buy-style]:not([data-buy-style="solid"]) button[data-cart-feedback="pending"]:has([data-buy-label]) > .cart-button-feedback,
  [data-cart-design-preview][data-buy-style]:not([data-buy-style="solid"])[data-cart-feedback="pending"] > .cart-button-feedback {
    background:ButtonFace !important;
    color:ButtonText !important;
  }
  :is(
    body.theme-flow.store-page[data-buy-style="glass"] .flow-main > [data-flow-feed] > .product-card .buy-button,
  body[data-buy-style="glass"] button:is([data-buy], [data-add-product]):has([data-buy-label]),
    body.theme-flow.store-page[data-buy-style="outline"] .flow-main > [data-flow-feed] > .product-card .buy-button,
  body[data-buy-style="outline"] button:is([data-buy], [data-add-product]):has([data-buy-label]),
    html .admin-ui .admin-content [data-cart-design-preview][data-buy-style="glass"],
    html .admin-ui .admin-content [data-cart-design-preview][data-buy-style="outline"]
  ):not([data-cart-feedback="success"]) {
    color:ButtonText !important;
    background:ButtonFace !important;
    border-color:ButtonText !important;
    box-shadow:none !important;
    -webkit-backdrop-filter:none;
    backdrop-filter:none;
    text-shadow:none;
  }
}
