/* Scoopna controls. Use sn-pill, sn-cta or sn-icon on new controls.
   Native checked/pressed/current states remain the source of truth.
   Layered priorities isolate this treatment from section-level overrides. */
@layer scoopna-controls {
  :root {
    --sc-ink: var(--sn-charcoal,#242929);
    --sc-gold: var(--sn-amber,#f2b72a);
    --sc-light: #fffdf8;
    --sc-line: #757971;
  }
  :is(.sn-pill,.facets__disclosure>.facets__summary,.facet-filters__sort,.bs-store-back,.bs-filters>summary,.heritage-locker-head a,.heritage-fuel__details>summary,.sn-story__actions a,.sn-brass-button,.bw-motion-control,.sn-pt-brands a,.av-nav a,[data-av-brand],.av-sizes button[data-pack],
    button.av-flavor-sample,.av-more-flavors,.oi-chip,.sc-tool,.oi-compare,.oi-clear,
    .bs-category,.bw-rail-nav a,.bw-rail-nav button,.bs-reset,.bs-choice-label,
    .sbl-category,[data-brand-letter],[data-brand-reset],[data-directory-reset],[data-letter],
    .sn-lp-option:not(.sn-lp-planned),[data-fuel-tab],.sn-needs-go,.sn-needs-source,
    variant-radios .product-form__input input[type=radio] + label[data-sn-value],
    .active-facets__button-inner,.mobile-facets__open,.button--secondary,
    .sn-cta,.button:not(.button--tertiary,.button--secondary,.button--plain,.button--unstyled),
    .sn-pt-go,.av-buy,.oi-add,.bs-add,.sl-action,.sn-action,.sgb-action,.bw-cta,
    .heritage-shelf__all,.sn-member__action,.sbl-all-products,.sn-directory__back,
    .sn-empty-kit a,.sn-quote-body [data-run],.filters-dialog .action,.club-results>button,
    .product-form__submit,.cart__checkout-button,.quick-add__submit,.customer form button[type=submit]) {
    --pill-bg:var(--sc-light);
    --pill-fg:var(--sc-ink);
    --pill-edge:var(--sc-line);
    box-sizing:border-box!important;
    border:1px solid var(--pill-edge)!important;
    border-radius:999px!important;
    clip-path:none!important;
    background:var(--pill-bg)!important;
    color:var(--pill-fg)!important;
    text-shadow:none!important;
    box-shadow:none!important;
    text-decoration:none!important;
    min-block-size:44px!important;
    transition:background-color .18s ease-out,color .16s ease-out,border-color .18s ease-out!important;
    &:is(.sn-cta,.button:not(.button--secondary),.sn-pt-go,.av-buy,.oi-add,.bs-add,
      .sl-action,.sn-action,.sgb-action,.bw-cta,.heritage-shelf__all,.sn-member__action,
      .sbl-all-products,.sn-directory__back,.sn-empty-kit a,[data-run],.filters-dialog .action,
      .club-results>button,.product-form__submit,.cart__checkout-button,.quick-add__submit,
      .customer form button[type=submit]) {
      --pill-bg:var(--sc-gold);
      --pill-edge:var(--sc-gold);
    }
    &:is([aria-pressed=true]:not(.bw-cta),[aria-selected=true],[aria-current]:not([aria-current=false]),
      .sn-lp-current,input:checked + label,input:checked + .bs-choice-label,.is-active) {
      --pill-bg:var(--sc-ink);
      --pill-edge:var(--sc-ink);
      --pill-fg:var(--sc-light);
    }
    & :is(.av-icon,.av-qty,.av-unit,.bs-choice-copy,.bs-size-unit,.sn-pack-weight,.sn-pack-count,
      .sn-serving-choice,.sn-lp-name,[data-bs-add-text],b,small), &>span:not(.loading-overlay__spinner,.bs-choice-visual) {
      color:inherit!important;
    }
    &:is(:disabled,[aria-disabled=true],.disabled,.is-unavailable *,input.disabled + label,input:disabled + label) {
      --pill-bg:#edece7;
      --pill-fg:#646761;
      --pill-edge:#c5c6bf;
      cursor:not-allowed;
    }
    &:where(:not(:disabled,[aria-disabled=true],.disabled,.is-unavailable *,input.disabled + label,input:disabled + label)) {
      @media (hover:hover) and (pointer:fine) {
        &:hover {
          background:var(--sc-gold)!important;
          border-color:var(--sc-gold)!important;
          color:var(--sc-ink)!important;
        }
        &:hover:is(.sn-cta,.button:not(.button--secondary),.sn-pt-go,.av-buy,.oi-add,.bs-add,
          .sl-action,.sn-action,.sgb-action,.bw-cta,.heritage-shelf__all,.sn-member__action,
          .sbl-all-products,.sn-directory__back,.sn-empty-kit a,[data-run],.filters-dialog .action,
          .club-results>button,.product-form__submit,.cart__checkout-button,.quick-add__submit,
          .customer form button[type=submit]) {
          background:var(--sc-ink)!important;
          color:var(--sc-gold)!important;
          border-color:var(--sc-ink)!important;
        }
      }
      &:active {
        background:var(--sc-gold)!important;
        color:var(--sc-ink)!important;
        box-shadow:inset 0 0 0 2px var(--sc-ink)!important;
        transition:none!important;
      }
    }
    &:is(:focus-visible,input:focus-visible + label,input:focus-visible + .bs-choice-label) {
      outline:2px solid var(--sc-ink)!important;
      outline-offset:2px!important;
      box-shadow:0 0 0 2px var(--sc-gold)!important;
    }
    @media(prefers-reduced-motion:reduce) { transition:none!important; transform:none!important; }
  }
  :is(.button:not(.button--tertiary),.sgb-action,.bw-cta,.product-form__submit,.sn-action,.bs-add,.av-buy,.sl-action,.av-nav a,.sbl-category,.bs-category,[data-fuel-tab]) {
    &::before,&::after {box-shadow:none!important;background:transparent!important;border:0!important;border-radius:inherit!important;}
  }
  .sn-pt-brands {gap:clamp(8px,1.1vw,16px)!important;padding-block:10px!important;}
  :is(.sn-pt-brands a,.sn-pill,.sn-cta,.sn-pt-go) {
    display:inline-flex;align-items:center;justify-content:center;
    padding:9px clamp(18px,2.15vw,34px)!important;
    font:600 clamp(14px,1.15vw,16px)/1.3 var(--font-body-family,sans-serif)!important;
    text-align:center;
  }
  .sn-pt-brands a {white-space:nowrap;min-inline-size:clamp(90px,9vw,140px);}
  .av-nav,.bs-categories,.bw-rail-nav {gap:8px!important;}
  .av-nav a,.bw-rail-nav :is(a,button) {padding-inline:12px!important;}
  .av-nav a svg,.bs-add svg,.av-buy svg,.product-form__submit span,.sgb-action span {color:inherit!important;}
  :is(.sbl-category,[data-brand-letter],[data-letter]) { margin-inline:3px; }
  :is(.sn-pack-size,.sn-flavours) input+label {text-align:center!important;align-items:center!important;transform:none!important;}
  .sn-flavours label[data-sn-value] {padding:5px 5px 13px!important;overflow-wrap:anywhere!important;}
  .sn-flavours label[data-sn-value]::before {max-inline-size:94%!important;border-width:1px!important;}
  .sn-flavours input:checked+label[data-sn-value]::before {outline:2px solid var(--sc-gold)!important;}
  :is(.bs-select,.oi-pick select,.av-pick select,.facet-filters__sort,.quantity,.sn-pt-dialog input,.sn-quote-body select,.sn-lp-toggle,.heritage-fuel select,.product-form__input .select,.product-form__input select) {border-radius:999px!important;}
  .quantity::before,.quantity::after,.product-form__input .select::after {border-radius:inherit!important;}
  :is(.sn-icon,.bw-search-submit,.sn-pt-head,.sn-pt-btn>svg,.header__icon,.slider-button,.sn-lp-close,
    .x-button,.sn-pop__close,.drawer__close,.ap-close,.snb-key,.sgb-motion,
    .quantity__button,.club-submit,.search__button,.quick-add-modal__toggle,[data-shelf-step]) {
    border-radius:50%!important;
    transition:background-color .18s ease-out,color .16s ease-out,border-color .18s ease-out!important;
    &:focus-visible {outline:2px solid var(--sc-gold)!important;outline-offset:2px!important;}
    @media(prefers-reduced-motion:reduce) {transition:none!important;}
  }
  .sn-pt-btn>svg {color:var(--sc-ink)!important;border-color:var(--sc-line)!important;background:var(--sc-light)!important;}
  .sn-pt-btn[data-pt-save]>svg {background:transparent!important;border-color:transparent!important;}
  .sn-pt-btn[aria-pressed=true]>svg {background:var(--sc-ink)!important;color:var(--sc-gold)!important;fill:var(--sc-gold)!important;}
  .sn-pt-btn:focus-visible {outline:2px solid var(--sc-ink)!important;outline-offset:-2px!important;border-radius:50%!important;}
  @media(hover:hover) and (pointer:fine) {
    :is(.sn-icon,.bw-search-submit,.sn-pt-head,.header__icon,.slider-button,.sn-lp-close,.x-button,.sn-pop__close,
      .drawer__close,.ap-close,.snb-key,.sgb-motion,.quantity__button,
      .club-submit,.search__button,.quick-add-modal__toggle,[data-shelf-step]):not(:disabled,[aria-disabled=true]):hover,
    .sn-pt-btn:hover>svg {
      background:var(--sc-gold)!important;color:var(--sc-ink)!important;border-color:var(--sc-gold)!important;
    }
    .sn-pt-btn[data-pt-save]:hover>svg {fill:var(--sc-ink)!important;}
  }
  :is(.sn-icon,.bw-search-submit,.sn-pt-head,.header__icon,.slider-button,.quantity__button,.club-submit,.search__button,[data-shelf-step]):not(:disabled):active,
  .sn-pt-btn:active>svg {background:var(--sc-gold)!important;color:var(--sc-ink)!important;transition:none!important;}

  /* Long flavour names stay inside the capsule, alongside the scoop. */
  .av .av-flavor-shelf:not([hidden]) {
    display:flex!important;flex-wrap:wrap!important;align-items:center!important;gap:6px!important;
  }
  .av .av-flavor-shelf button.av-flavor-sample:not([hidden]) {
    display:inline-flex!important;flex-direction:row!important;align-items:center!important;
    justify-content:flex-start!important;gap:9px!important;padding:6px 12px 6px 8px!important;
    padding-inline:8px 12px!important;width:auto!important;max-width:100%!important;min-width:0!important;
    text-align:start!important;
  }
  .av .av-flavor-shelf button.av-flavor-sample i {flex:none!important;width:27px!important;height:27px!important;}
  .av .av-flavor-shelf button.av-flavor-sample>span {
    min-width:0!important;max-width:none!important;overflow-wrap:anywhere!important;text-decoration:none!important;
  }
  .av .av-more-flavors {min-width:44px!important;}
  .av .av-training-nav .av-training-link::after {content:none!important;}
  .av .av-training-nav .av-icon {color:var(--sc-ink)!important;border-radius:50%!important;}
  .av .av-sizes button[data-pack]::after {content:none!important;}
  .sn-product-room variant-radios fieldset.sn-flavours {
    display:flex!important;flex-wrap:wrap!important;gap:10px!important;align-items:stretch!important;
  }
  .sn-product-room variant-radios .sn-flavours>div:has(legend) {flex-basis:100%!important;}
  .sn-product-room variant-radios .sn-flavours label[data-sn-value] {
    flex:0 1 auto!important;inline-size:auto!important;max-inline-size:100%!important;
    flex-direction:row!important;justify-content:center!important;gap:10px!important;
    padding:6px 16px!important;padding-inline-start:7px!important;
    font-size:14px!important;line-height:1.25!important;text-align:start!important;
  }
  .sn-product-room variant-radios .sn-flavours label[data-sn-value]::before {
    margin:0!important;width:40px!important;flex:0 0 40px!important;height:40px!important;
  }
  .vz-essential-tabs {gap:8px!important;padding:10px!important;}
  .vz-essential-tabs [data-fuel-tab][aria-selected=true],.sbl-category[aria-pressed=true],
  [data-brand-letter][aria-pressed=true] {border-color:var(--sc-gold)!important;}
  .footer :is(.localization-selector,.disclosure__button,.localization-form__select,.localization-form__select::before,.localization-form__select::after) {border-radius:999px!important;}
  :is(.av-buy,.bs-add,.oi-add,.product-form__submit,.quick-add__submit,.sl-action):is(:disabled,[aria-disabled=true]) {
    background:#edece7!important;border-color:#c5c6bf!important;color:#555951!important;opacity:1!important;
  }
  @media(max-width:749px) {
    .av-nav a {padding-inline:7px!important;white-space:normal!important;overflow-wrap:anywhere!important;}
    .av .av-flavor-shelf button.av-flavor-sample:not([hidden]) {width:100%!important;}
    .av .av-flavor-shelf .av-flavor-sample:not(button) {width:auto!important;max-width:100%!important;}
    .vz-essential-tabs {display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;}
    .vz-essential-tabs [data-fuel-tab] {width:100%!important;justify-content:center!important;padding-inline:5px!important;white-space:normal!important;text-align:center;}
  }

  .heritage-locker-head a,.heritage-fuel__details>summary,.sn-brass-button {
    padding:8px 18px!important;justify-content:center!important;gap:12px!important;
    text-align:center!important;line-height:1.15!important;
  }
  .heritage-locker-head a {font-size:clamp(15px,1.4vw,20px)!important;}
  .heritage-fuel__details>summary {margin:12px auto!important;width:fit-content!important;max-width:96%!important;font-size:clamp(18px,2vw,24px)!important;}
  .sn-story__actions {gap:5px!important;padding:6px!important;}
  .sn-story__actions a {font-size:clamp(13px,1.3vw,18px)!important;padding-inline:2px!important;min-width:0!important;}
  .sn-story__actions a>span {color:inherit!important;}
  .bs-filters[open]>summary {background:var(--sc-ink)!important;color:var(--sc-light)!important;}
  .bs-filters>summary,.bw-motion-control {padding-inline:15px!important;border-radius:999px!important;}
  .bw-rail-search,.bw-rail-search input,.sn-needs-title,.sn-needs:not([open]),.bs-input,.footer .localization-form select {border-radius:999px!important;}
  .vz-essential-tabs a[data-fuel-tab][aria-selected=true] {border:1px solid var(--sc-gold)!important;}
  .sn-pt-btn[data-pt-save]:not([aria-pressed=true]):not(:hover)>svg {background:#fffdf8d9!important;}
  .av-nav a[aria-current] svg.av-icon {color:var(--sc-ink)!important;}
  .av .av-flavor-shelf .av-more-flavors {width:44px!important;flex:none!important;justify-self:start;}
  .av .av-sizes button[data-pack] {padding-inline:11px!important;}
  .footer .localization-form__select:after,.footer .localization-form__select:before {border-radius:999px!important;}
  .vz-essential-tabs a[data-fuel-tab][aria-selected=true] {outline:1px solid var(--sc-gold)!important;outline-offset:-2px!important;}
  .bs-store-back {padding-inline:15px!important;align-items:center!important;}
  .bw-search-submit {border-radius:999px!important;}
  .bw-search-submit:not(:hover) {background:var(--sc-gold)!important;color:var(--sc-ink)!important;}
  @media(hover:hover) and (pointer:fine) {
    .bw-search-submit:not(:disabled):hover {background:var(--sc-ink)!important;color:var(--sc-gold)!important;}
  }
  .template-search__search :is(.field,.field::before,.field::after,.search__input) {border-radius:999px!important;}
  .facets__disclosure>.facets__summary,.mobile-facets__open,.facet-filters__sort {
    padding:9px 16px!important;margin-block:4px!important;line-height:1.3!important;
  }
  .facets__disclosure>.facets__summary,.facet-filters__sort {padding-inline-end:32px!important;}
  .facets__disclosure>.facets__summary .icon-caret,.facet-filters__field .select>.icon-caret {inset-inline-end:12px!important;color:var(--sc-ink)!important;}
  .facets__disclosure[open]>.facets__summary {border-color:var(--sc-gold)!important;}
  .facets__summary-label,.mobile-facets__open-label {text-decoration:none!important;color:inherit!important;}
  .facet-filters__sort option {background:var(--sc-light);color:var(--sc-ink);}
  .mobile-facets__open-wrapper:focus-visible .mobile-facets__open {outline:2px solid var(--sc-gold)!important;outline-offset:2px!important;}
  /* Keep sale and stock badges clear of both actions in search and recommendations. */
  .card__inner:has(.card__badge .badge)>.sn-pt {inset-block-start:auto!important;inset-block-end:4px!important;}
  .template-search__search .field,.template-search__search form.search,.template-search__search .field:before,.template-search__search .field:after {border-radius:999px!important;}
}

/* Option 09 on available add-to-cart actions only. */
@layer scoopna-controls {
  @media (forced-colors: none) {
    :root body button:is([name="add"],.av-buy[type="submit"],[data-bs-add],.oi-add):enabled:not([aria-disabled="true"],.disabled,.loading) {
      background: #C8D999 !important;
      color: #242929 !important;
      border-color: #768551 !important;
    }
    @media (hover: hover) and (pointer: fine) {
      :root body button:is([name="add"],.av-buy[type="submit"],[data-bs-add],.oi-add):enabled:not([aria-disabled="true"],.disabled,.loading):hover {
        background: #242929 !important;
        color: #C8D999 !important;
        border-color: #242929 !important;
      }
    }
  }
}
