/* Shared cas:pace text-action treatment. Section layouts continue to own visibility and placement. */
:root {
  --cp-action-blue: #0761b2;
  --cp-action-deep: #095496;
  --cp-action-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 7 7'%3E%3Cpath fill='white' d='M.602 0 6.58.518l-.518 5.977-1.1-.095.354-4.099L.88 6.031.168 5.185 4.605 1.456.506 1.101z'/%3E%3C/svg%3E");
}

:root, :where([class$="-scheme"],[class*="-scheme "]) {
  --cp-action-fill: var(--cp-action-blue);
  --cp-action-edge: var(--cp-action-blue);
  --cp-action-disc: var(--cp-action-deep);
  --cp-action-hover: var(--cp-action-deep);
}

:where(.secondary-scheme,.tertiary-scheme,.scheme-ecc57679-62c4-4fbb-98f0-c05340e0727c-scheme,
       .cp-care-hero,.cw-hero,.cm-hero,.cp-editorial-hero,.cp-series__hero,.cph-edition-cover,
       .cph-brand-cover,.cp-model-finder,.caspace-bf__wrap,.hero-slideshow-content,
       .slideshow-content,.video-text-overlay-content,.theatre) {
  --cp-action-fill: transparent;
  --cp-action-edge: #fff;
  --cp-action-disc: var(--cp-action-blue);
  --cp-action-hover: var(--cp-action-blue);
}

/* Opt in by the existing action hooks. Product links, text links, swatches, steppers
   and disclosure controls have independent semantics and keep their own layouts. */
:is(
  :is(a,button).button:not(.skip-to-content-link),
  .text-underline:is(.small-btn,.regular-btn,.medium-btn,.large-btn,.default-btn),
  .shopify-payment-button__button--unbranded,
  .cp-care-shortcuts button, .cw-jumps a, .cw-plan .cw-text-link,
  #caspace-model-directory .cm-start, #caspace-model-directory .cm-jump a,
  .cp-model-footer > a, .cp-model-tab,
  .cph-browse, .cph-edition-cover__browse, .cph-filters button[data-filter],
  .cp-editorial-cta, .cp-series__hero-cta, .cp-series__index a,
  .caspace-bf__sale, .caspace-bf__details, .caspace-bf-poster__sale-label,
  .view-all-text:not(.collection-tabs-item-link), .collection-tabs-item-link.active,
  .multicolumn-content-link, .event-button, .collection-tabs-header-link, .tabbed-content-link,
  a[class^="ai-scroll-reveal-button-"], a[class^="ai-holo-banner__button-"],
  a[class^="ai-video-carousel__card-button-"], .address-footer-item,
  .pickup-availability-button, .enter-password-link,
  #caspace-root .primary-button, #caspace-root .text-button, #caspace-root .detail-next,
  #caspace-root .fallback-message button,
  .rte a:is(.btn,[role="button"]), .rte a[style*="border-radius"][style*="background"]
):not([hidden]):not(:where([data-cp-home] *)) {
  box-sizing: border-box;
  justify-content: center;
  align-items: center;
  gap: var(--cp-gap,15px) !important;
  min-height: var(--cp-height,52px) !important;
  max-width: 100%;
  padding: 6px var(--cp-end,15px) 6px var(--cp-start,30px) !important;
  border: 1px solid var(--cp-action-edge) !important;
  border-radius: 999px !important;
  background: var(--cp-action-fill) !important;
  color: #fff !important;
  box-shadow: none !important;
  text-shadow: none;
  text-decoration: none !important;
  font-family: var(--button-font-family,inherit);
  font-size: var(--cp-label,14px);
  font-weight: 500;
  line-height: 1.3;
  text-align: center;
  vertical-align: middle;
  white-space: normal;
  overflow-wrap: anywhere;
  cursor: pointer;

  /* The original Modern animation reveals the button from the arrow disc. */
  --cp-motion-vertical: calc((100% - var(--cp-disc,24px)) / 2);
  --cp-motion-rest: inset(var(--cp-motion-vertical) var(--cp-end,15px) var(--cp-motion-vertical) calc(100% - var(--cp-end,15px) - var(--cp-disc,24px)) round 999px);
  --cp-motion-clip: var(--cp-motion-rest);
  --cp-motion-color: var(--cp-action-disc);
  --cp-motion-time: .4s;
  --cp-motion-ease: cubic-bezier(.785,.135,.15,.86);
  isolation: isolate;
  position: relative;
  & > .button-arrow {
    display: flex; position: static; background: transparent;
    width: var(--cp-disc,24px); height: var(--cp-disc,24px); flex: 0 0 var(--cp-disc,24px);
  }

  /* A button with native markup uses the theme's moving layer and real SVG.
     Plain-text actions get the same geometry and timing from a pseudo-element. */
  & > .button-arrow > .button-arrow-bg,
  &:not(:has(> .button-arrow, > .animate-button-icon))::after {
    content: ""; display: flex; box-sizing: border-box; position: absolute;
    inset: 0; width: auto; height: auto; min-width: 0; margin: 0;
    padding: 0 calc(var(--cp-end,15px) + (var(--cp-disc,24px) - var(--cp-glyph,7px))/2) 0 0;
    border: 0; border-radius: inherit; opacity: 1; z-index: -1;
    align-items: center; justify-content: flex-end; pointer-events: none;
    background: var(--cp-motion-color); color: white; transform: none;
    clip-path: var(--cp-motion-clip);
    transition: clip-path var(--cp-motion-time) var(--cp-motion-ease), background-color var(--cp-motion-time) ease;
  }
  & > .button-arrow .button-arrow-icon1 { width: var(--cp-glyph,7px); height: var(--cp-glyph,7px); }
  &:not(:has(> .button-arrow, > .animate-button-icon)) {
    padding-right: calc(var(--cp-end,15px) + var(--cp-disc,24px) + var(--cp-gap,15px)) !important;
    &::after {
      background-image: var(--cp-action-arrow);
      background-position: right calc(var(--cp-end,15px) + (var(--cp-disc,24px) - var(--cp-glyph,7px))/2) center;
      background-size: var(--cp-glyph,7px) var(--cp-glyph,7px); background-repeat: no-repeat;
    }
    &::before { content: none; }
  }
  &:has(> .button-arrow, > .animate-button-icon)::after { content: none; }
  &:has(> .animate-button-icon) {
    &::before {
      content: ""; position:absolute; inset:0; z-index:-1; border-radius:inherit;
      background:var(--cp-action-disc); transform:scaleX(var(--cp-sweep,0)); transform-origin:right;
      transition:transform var(--cp-motion-time) ease-out;
    }
    & > .animate-button-icon {
      display:grid;place-items:center; width:var(--cp-disc,24px);height:var(--cp-disc,24px);
      flex:0 0 var(--cp-disc,24px);border-radius:50%;background:var(--cp-action-disc);color:white;
    }
    & > .animate-button-icon svg { width:12px;height:12px;transform:translateX(var(--cp-icon-shift,0));transition:transform var(--cp-motion-time) ease-out; }
    & > span:not([class]) { transform:translateX(var(--cp-label-shift,0));transition:transform var(--cp-motion-time) ease-out; }
  }
  &:focus-visible { outline: 2px solid #fff; outline-offset: 2px; box-shadow: 0 0 0 5px #075495 !important; }
  &:is(:disabled,[aria-disabled="true"]) { opacity: .55; cursor: default; }
  &:is(.loading,[aria-busy="true"]) { &::after, & > .button-arrow, & > .animate-button-icon { display:none; } }
  &:not(:disabled,[aria-disabled="true"],.loading,[aria-busy="true"]):is(:focus-visible,:active) {
    --cp-motion-clip: inset(0 round 999px); --cp-motion-color: color-mix(in srgb,var(--cp-action-disc) 80%,#002e5b);
    --cp-sweep:1;--cp-label-shift:5px;--cp-icon-shift:-5px;
  }
  @media (hover:hover) {
    &:not(:disabled,[aria-disabled="true"],.loading,[aria-busy="true"]):hover {
      --cp-motion-clip: inset(0 round 999px); --cp-motion-color: color-mix(in srgb,var(--cp-action-disc) 80%,#002e5b);
      --cp-sweep:1;--cp-label-shift:5px;--cp-icon-shift:-5px;
    }
  }
  @media (hover:none) { &:active { --cp-motion-time:.08s; } }
  @media (prefers-reduced-motion:reduce) {
    &, &:active { --cp-motion-time:0s; }
    & > span, & > .animate-button-icon svg { transition:none;transform:none; }
  }
}

:is(.cp-care-shortcuts button,.cw-jumps a,.cw-plan .cw-text-link,
    .cm-start,.cm-jump a,.cp-model-footer > a,.cp-model-tab,
    .cph-browse,.cph-edition-cover__browse,.cph-filters button,.cp-editorial-cta,.cp-series__hero-cta,.cp-series__index a,
    .caspace-bf__sale,.caspace-bf__details,.caspace-bf-poster__sale-label,
    .view-all-text:not(.collection-tabs-item-link),.collection-tabs-item-link.active,
    .event-button,.multicolumn-content-link,.collection-tabs-header-link,.tabbed-content-link,.address-footer-item,.pickup-availability-button,.enter-password-link,
    a[class^="ai-scroll-reveal-button-"],a[class^="ai-holo-banner__button-"],a[class^="ai-video-carousel__card-button-"],
    .text-underline:is(.small-btn,.regular-btn,.medium-btn,.large-btn,.default-btn),
    #caspace-root .detail-next,#caspace-root .fallback-message button,.rte a.btn,.rte a[role="button"],
    .rte a[style*="border-radius"][style*="background"]):not([hidden]):not(:where([data-cp-home] *)) { display: inline-flex; }

/* The shared moving disc replaces decorative glyphs on custom editorial links. */
:is(:is(.cp-care-shortcuts button,.cw-jumps a,.cw-text-link,.cp-model-footer > a,.cph-browse,
    .cph-edition-cover__browse,.cp-editorial-cta,.caspace-bf__sale,.caspace-bf-poster__sale-label) > [aria-hidden="true"],
.cp-series__hero-cta > .cp-series__arrow,
#caspace-root :is(.text-button,.primary-button,.detail-next,.fallback-message button) > svg):not(:where([data-cp-home] *)) { display: none !important; }
.button:not(.loading) > span:not(.btn-loader):not(:where([data-cp-home] *)) { color: inherit; }

/* The same two finishes at the scale of each action group. */
:is(.cph-brand-cover__link,.cph-edition-cover__browse,.cp-editorial-cta,.cm-start,
    .cp-care-shortcuts button,.cw-jumps a,.cp-model-tab,.cp-model-footer > a,
    .caspace-bf__sale,.caspace-bf__details,.cp-series__hero-cta,
    a[class^="ai-holo-banner__button-"],a[class^="ai-video-carousel__card-button-"],
    :is(.hero-slideshow-content,.slideshow-content,.video-text-overlay-content,.cph-brand-cover,.split-banner-content,.media-banner-content) .outline-button,
    :is(.hero-slideshow-content,.slideshow-content,.video-text-overlay-content,.cph-brand-cover) .button) {
  --cp-action-fill: transparent; --cp-action-edge: #fff; --cp-action-disc: #0761b2; --cp-action-hover: #0761b2;
}
.caspace-bf-poster__sale-label {
  --cp-action-fill: #0761b2; --cp-action-edge: #0761b2; --cp-action-disc: #095496; --cp-action-hover: #095496;
}
:where(.small-btn,.cw-plan .cw-text-link,.cph-filters button,.cm-jump a,.cp-model-tab,.cp-series__index a,
    .caspace-bf__details,.address-footer-item,.pickup-availability-button,
    .multicolumn-content-link,.remove-all-filter,.view-all-text,.enter-password-link,.collection-tabs-header-link,.tabbed-content-link) {
  --cp-height: 42px; --cp-start: 17px; --cp-end: 10px; --cp-gap: 9px; --cp-disc: 20px; --cp-label: 13px;
}
:is(.caspace-bf__sale,.caspace-bf__details,.caspace-bf-poster__sale-label) {
  --cp-height: 32px; --cp-start: 13px; --cp-end: 8px; --cp-gap: 7px; --cp-disc: 17px; --cp-label: 12px;
}
.cw-plan .cw-text-link { margin-top: 10px; align-self: flex-start; }
.cp-model-tab[aria-selected="true"],.cph-filters button[aria-pressed="true"],
.collection-tabs-header-link.active,.tabbed-content-link.active {
  --cp-action-fill: #123f68; --cp-action-edge: #fff; --cp-action-disc: #0761b2;
  font-weight: 700 !important;
}
.collection-tabs-header-link.active,.tabbed-content-link.active,.cph-filters button[aria-pressed="true"] { --cp-action-edge: #123f68; }
.cph-catalog .cph-filters { gap: 6px; }
.cp-model-footer > a { width: fit-content; }
.cp-care-shortcuts, .cw-jumps { display: flex; flex-wrap: wrap; gap: 8px; }
@media (max-width:749px) {
  :is(.cp-care-shortcuts button,.cw-jumps a,.cph-filters button,.cm-jump a,.cp-model-tab,.cp-series__index a) {
    --cp-height: 44px; --cp-start: 11px; --cp-end: 7px; --cp-gap: 5px; --cp-disc: 18px; --cp-label: 12px;
    min-width: 0;
  }
  .cp-care-shortcuts, .cw-jumps { gap: 6px; }
}

/* Input controls cannot draw a pseudo-element; draw its disc and arrow as two background layers. */
input:is(.shopify-challenge__button,.button)[type="submit"]:not(:where([data-cp-home] *)) {
  box-sizing: border-box;
  min-height: 52px; max-width: 100%;
  padding: 8px 56px 8px 30px;
  border: 1px solid var(--cp-action-blue);
  border-radius: 999px; color: #fff;
  background: var(--cp-action-arrow) right 23px center / 7px 7px no-repeat,
              radial-gradient(circle closest-side, #095496 97%, transparent) right 15px center / 24px 24px no-repeat #0761b2;
}

.cp-care-hero .cp-care-shortcuts button, .cw-hero .cw-jumps a { --cp-action-disc: #084f94; }
@media (min-width:750px) {
  .cp-care-tools .cp-care-shortcuts { width: max-content; max-width: min(54vw, 620px); }
}

input:is(.shopify-challenge__button,.button)[type="submit"]:not(:where([data-cp-home] *)) {
  background: var(--cp-action-arrow) right 23px center / 7px 7px no-repeat,
              linear-gradient(var(--cp-action-deep),var(--cp-action-deep)) right 15px center / 0% 100% no-repeat,
              radial-gradient(circle closest-side,#095496 97%,transparent) right 15px center / 24px 24px no-repeat #0761b2;
  transition:background-size .4s cubic-bezier(.785,.135,.15,.86),background-position .4s cubic-bezier(.785,.135,.15,.86);
  &:enabled:is(:active,:focus-visible) { background-size:7px 7px,100% 100%,24px 24px; background-position:right 23px center,right center,right 15px center; }
  @media (hover:hover) { &:enabled:hover { background-size:7px 7px,100% 100%,24px 24px; background-position:right 23px center,right center,right 15px center; } }
  @media (prefers-reduced-motion:reduce) { transition:none; }
}

/* The homepage uses the palette and sizing that each section supplies. */
[data-cp-home] .split-banner-primary-btn.outline-button:not(:hover):not(:focus-visible) {
  color: var(--button-text-color);
  background: var(--button-background, transparent);
}
[data-cp-home] .split-banner-primary-btn.outline-button:focus-visible {
  color: var(--button-text-color-hover);
  background: var(--button-background-hover);
  border-color: var(--button-border-hover);
}
