/* Approved 2026-10-10: Pedal Switch + compact flat companions.
   Legacy class aliases preserve commerce/plugin handlers and generated Woo HTML.
   Important declarations in this named layer beat old unlayered !important paint;
   layout, visibility, badges, loading spinners and functional controls remain owned
   by their route styles. New components can use lt-button + role/surface modifiers. */
@layer lt-buttons {
  body.lt-material-system {
    --lt-button-copper:#ff8d18;--lt-button-copper-hover:#ff9d2c;
    --lt-button-fired:#d64b20;--lt-button-fired-hover:#ea5a25;
    --lt-button-graphite:#454d50;--lt-button-graphite-hover:#536064;
    --lt-purchase-height:80px;
  }
  body.lt-material-system :where(
    .lt-button,.lt-btn,.lt-cartbtn,.lt-iconbtn,.lt-burger,.lt-drawer__close,
    .lt-auth__login,.lt-search__submit,.lt-accountbar__menu,.lt-accountbar__activity,.ltp-menu-toggle,.ltp-sidebar-close,
    .lt-accountbar__search>button,.lt-preset-favorite,.lt-physical-details,
    .lt-carousel-controls button,.lt-shop-filter-toggle,.lt-hw-nav-toggle,
    .lt-console__glow-button,.lt-console__outline-button,.lt-cd-button,.ltp-button,
    .ltp-button-secondary,.woocommerce .button,.woocommerce input[type=submit],
    .wc-block-components-button,.wp-block-button__link,.wc-forward,.lt-main input[type=submit],
    .lt-popup-more,.lt-popup-close,.lt-popup-back,.lt-checkout-add,.lt-checkout-remove,
    [data-lt-coupon-apply],[data-lt-coupon-remove],.lt-qr-download-button,
    .lt-popup-transfer button,.lt-auth-flow-back,.lt-auth-resend
  ) {
    --lt-btn-face:var(--lt-button-copper);--lt-btn-hover:var(--lt-button-copper-hover);
    --lt-btn-bottom:#eb5808;--lt-btn-hover-bottom:#fa680b;
    --lt-btn-text:#271205;--lt-btn-border:#d36522;--lt-btn-edge:#94300d;
    --lt-btn-height:44px;--lt-btn-padding:10px 13px;--lt-btn-gap:8px;
    --lt-btn-radius:5px;--lt-btn-size:12px;--lt-btn-image:none;--lt-btn-hover-image:none;
    --lt-btn-shadow:none;--lt-btn-hover-shadow:none;--lt-btn-active-shadow:none;
    --lt-btn-hover-y:0px;--lt-btn-active-y:0px;
    box-sizing:border-box;position:relative;isolation:isolate;
    align-items:center;justify-content:center;vertical-align:middle;
    gap:var(--lt-btn-gap)!important;min-height:var(--lt-btn-height)!important;
    max-width:100%;padding:var(--lt-btn-padding)!important;
    border:1px solid var(--lt-btn-border)!important;border-radius:var(--lt-btn-radius)!important;
    background:var(--lt-btn-face)!important;background-image:var(--lt-btn-image)!important;
    color:var(--lt-btn-text)!important;box-shadow:var(--lt-btn-shadow)!important;
    font-family:'Be Vietnam Pro','Segoe UI',sans-serif!important;
    font-size:var(--lt-btn-size)!important;font-weight:600!important;line-height:1.4!important;
    letter-spacing:0!important;text-transform:none!important;text-shadow:none!important;
    text-decoration:none!important;text-align:center;cursor:pointer;touch-action:manipulation;
    transform:translateY(0)!important;
    transition:transform 160ms cubic-bezier(.2,.8,.2,1),box-shadow 160ms ease,
      background-color 140ms ease,border-color 140ms ease!important;
    /* Nesting keeps every state tied to this exact alias inventory. */
    &:not(:disabled):not([aria-disabled=true]):not(.disabled):hover {
      background-color:var(--lt-btn-hover)!important;
      background-image:var(--lt-btn-hover-image)!important;
      border-color:#ff9d00!important;color:var(--lt-btn-text)!important;
      transform:translateY(var(--lt-btn-hover-y))!important;
      box-shadow:var(--lt-btn-hover-shadow)!important;
    }
    &:not(:disabled):not([aria-disabled=true]):not(.disabled):active {
      transform:translateY(var(--lt-btn-active-y))!important;
      box-shadow:var(--lt-btn-active-shadow)!important;
      transition-duration:60ms,60ms,140ms,140ms!important;
    }
    &:focus-visible {outline:2px solid #ff9d00!important;outline-offset:4px!important}
    &:is(:disabled,[aria-disabled=true],.disabled) {
      opacity:.42!important;cursor:not-allowed;transform:none!important;box-shadow:none!important;
    }
    &[aria-busy=true],&.loading {cursor:progress}
    &>svg,&>i.ti {
      position:relative;flex:0 0 18px;width:18px;height:18px;
      font-size:18px!important;line-height:1!important;
    }
    &>svg {fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
  }
  /* Role overrides are variables, so default/hover/pressed never drift apart. */
  body.lt-material-system :where(
    .lt-btn--ghost,.lt-btn--outline,.lt-btn--dark,.lt-btn--ghost-ink,.lt-btn--white,
    .lt-button--graphite,.lt-cartbtn,.lt-iconbtn,.lt-burger,.lt-drawer__close,
    .lt-auth__login,.lt-search__submit,.lt-accountbar__menu,.lt-accountbar__activity,.ltp-menu-toggle,.ltp-sidebar-close,
    .lt-accountbar__search>button,.lt-preset-favorite,.lt-physical-details,
    .lt-carousel-controls button,.lt-shop-filter-toggle,.lt-hw-nav-toggle,
    .lt-console__outline-button,.lt-cd-button--outline,.ltp-button-secondary,
    .lt-popup-more,.lt-popup-close,.lt-popup-back,.lt-checkout-remove,
    [data-lt-coupon-remove],.lt-popup-transfer button,.lt-auth-flow-back,.lt-auth-resend,
    .woocommerce-orders-table .button,.woocommerce-MyAccount-content a.button,.wc-forward
  ) {
    --lt-btn-face:var(--lt-button-graphite);--lt-btn-hover:var(--lt-button-graphite-hover);
    --lt-btn-bottom:#343c3f;--lt-btn-hover-bottom:#404a4e;
    --lt-btn-text:#eeeef0;--lt-btn-border:#748082;--lt-btn-edge:#121617;
  }
  body.lt-material-system :where(
    .lt-button--fired,.lt-pdp__buy:not(.lt-pdp__download),
    .single_add_to_cart_button,#place_order,[data-lt-popup-next],
    .lt-member .lt-btn,.lt-memberband .lt-btn
  ) {
    --lt-btn-face:var(--lt-button-fired);--lt-btn-hover:var(--lt-button-fired-hover);
    --lt-btn-bottom:#aa3015;--lt-btn-hover-bottom:#bc3917;
    --lt-btn-text:#fff4e5;--lt-btn-border:#e1703f;--lt-btn-edge:#681e10;
  }
  body.lt-material-system :where(.lt-cartbtn--download,.lt-button--copper) {
    --lt-btn-face:var(--lt-button-copper);--lt-btn-hover:var(--lt-button-copper-hover);
    --lt-btn-bottom:#eb5808;--lt-btn-hover-bottom:#fa680b;
    --lt-btn-text:#271205;--lt-btn-border:#d36522;--lt-btn-edge:#94300d;
  }
  /* Raised caps are reserved for major actions. */
  body.lt-material-system :where(.lt-btn,.lt-button--pedal,.single_add_to_cart_button,#place_order,[data-lt-popup-next],.lt-customer-auth .button:not(.lt-auth-resend)) {
    --lt-btn-height:50px;--lt-btn-padding:11px 18px;--lt-btn-gap:15px;
    --lt-btn-radius:7px;--lt-btn-size:14px;
    --lt-btn-image:linear-gradient(170deg,var(--lt-btn-face),var(--lt-btn-bottom));
    --lt-btn-hover-image:linear-gradient(170deg,var(--lt-btn-hover),var(--lt-btn-hover-bottom));
    --lt-btn-shadow:inset 0 1px #ffffff60,inset 0 -1px #00000025,
      0 4px 0 var(--lt-btn-edge),0 5px 0 #73808465,0 8px 12px #0005;
    --lt-btn-hover-shadow:inset 0 1px #ffffff85,inset 0 -1px #00000015,
      0 6px 0 var(--lt-btn-edge),0 7px 0 #87949888,0 11px 16px #0006;
    --lt-btn-active-shadow:inset 0 1px 3px #0003,0 1px 0 var(--lt-btn-edge),0 2px 0 #73808465;
    --lt-btn-hover-y:-2px;--lt-btn-active-y:3px;
    display:inline-flex;overflow:visible;
    &::after {
      content:'';position:absolute;inset:-4px 0;z-index:-1;
      background:none;opacity:0;pointer-events:auto;
    }
    &:not(:disabled):not([aria-disabled=true]):not(.disabled):hover {
      background-image:var(--lt-btn-hover-image)!important;
    }
    &>i.ti,&>svg {
      box-sizing:border-box;flex:0 0 32px;width:32px;height:32px;padding:7px;
      border-radius:50%;border:1px solid #00000026;background:#0000000c;
      box-shadow:inset 0 1px 2px #0003,0 1px #ffffff30;
      font-size:16px!important;display:inline-flex;align-items:center;justify-content:center;
    }
  }
  /* Flat companions stay flush with the surface of cards, headers and small boxes. */
  body.lt-material-system :where(
    .lt-button--flat,.lt-card .lt-btn,.lt-libcard .lt-btn,.lt-member .lt-btn,
    .lt-info-panel .lt-btn,.lt-account-content--workspace .lt-btn,
    .lt-shoptoolbar .lt-btn,.lt-shop-empty .lt-btn,.lt-filters .lt-btn,
    .lt-combo-dock .lt-btn,.lt-auth-resend
  ) {
    --lt-btn-height:44px;--lt-btn-padding:10px 13px;--lt-btn-gap:8px;
    --lt-btn-radius:5px;--lt-btn-size:12px;--lt-btn-image:none;--lt-btn-hover-image:none;
    --lt-btn-shadow:none;--lt-btn-hover-shadow:none;--lt-btn-active-shadow:none;
    --lt-btn-hover-y:0px;--lt-btn-active-y:0px;
    &::after {content:none}
    &:hover {background-image:none!important}
    &>i.ti,&>svg {
      flex:0 0 18px;width:18px;height:18px;padding:0;border:0;border-radius:0;
      background:none;box-shadow:none;font-size:18px!important;
    }
  }
  body.lt-material-system :where(.lt-btn,.lt-button)::before {content:none!important}
  body.lt-material-system :where(
    .lt-cartbtn,.lt-iconbtn,.lt-burger,.lt-drawer__close,.lt-accountbar__menu,
    .lt-accountbar__activity,.ltp-menu-toggle,.ltp-sidebar-close,.lt-preset-favorite,.lt-carousel-controls button,
    .lt-popup-close,.lt-popup-back,.lt-checkout-remove,.lt-checkout-add,
    .lt-popup-transfer button,[data-lt-coupon-remove],.lt-button--icon-only
  ) {
    --lt-btn-padding:0;width:44px!important;min-width:44px!important;
    height:44px!important;flex:0 0 44px;
    &>svg,&>i.ti {width:22px;height:22px;flex-basis:22px;font-size:22px!important}
  }
  body.lt-material-system .lt-preset-favorite[aria-pressed=true] {color:#ffb15a!important;border-color:#ff9d00!important}
  @media (max-width:600px) {
    body.lt-material-system .lt-card--physical .lt-preset-actions > :is(.lt-preset-favorite,.lt-cartbtn) {
      width:28px!important;min-width:28px!important;flex-basis:28px;
    }
  }
  /* Store header utilities remain plain icons/text in every interaction state. */
  body.lt-material-system .lt-header :is([data-lt-search-toggle],.lt-search__submit,.lt-auth__login) {
    --lt-btn-face:transparent;--lt-btn-hover:transparent;--lt-btn-text:inherit;
    --lt-btn-padding:0;--lt-btn-size:inherit;
    border:0!important;border-radius:0!important;background:none!important;
    color:inherit!important;box-shadow:none!important;
    &>i.ti {width:22px;height:22px;flex-basis:22px;font-size:22px!important}
    &:hover {opacity:.72}
  }
  body.lt-material-system .lt-accountbar__search {min-height:52px;height:auto!important}
  body.lt-material-system .single_add_to_cart_button::before {
    content:'';display:block;width:22px;height:22px;flex:0 0 22px;background:currentColor;
    mask:url('data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="1.8" stroke-linecap="round" stroke-linejoin="round"%3E%3Cpath d="M5.5 8.5h13l1 11h-15l1-11ZM9 8.5V6a3 3 0 0 1 6 0v2.5"/%3E%3C/svg%3E') center/contain no-repeat;
  }
  body.lt-material-system .lt-button-copy {display:flex;flex-direction:column;align-items:flex-start;gap:2px;min-width:0}
  body.lt-material-system .lt-button-title {font:700 22px/1.2 'Be Vietnam Pro','Segoe UI',sans-serif!important;letter-spacing:-.02em;color:inherit}
  body.lt-material-system .lt-button-caption {font:400 11px/1.5 'Be Vietnam Pro','Segoe UI',sans-serif!important;letter-spacing:0;color:inherit}
  body.lt-material-system .lt-button--purchase {
    --lt-btn-height:var(--lt-purchase-height);--lt-btn-gap:20px;--lt-btn-padding:14px 18px;
    text-align:left;
    &>.lt-button-icon {display:block;width:40px;height:40px;flex-basis:40px;padding:7px;stroke-width:1.7}
  }
  body.lt-material-system .lt-pdp__actions {
    display:flex;align-items:stretch;gap:14px!important;flex-wrap:wrap!important;
    &>.lt-pdp__buy {flex:1 1 210px!important;width:auto;min-width:min(100%,210px)!important}
    &>.lt-pdp__cart--icon {
      --lt-btn-height:var(--lt-purchase-height);--lt-btn-padding:0;
      width:var(--lt-purchase-height)!important;min-width:var(--lt-purchase-height)!important;
      height:var(--lt-purchase-height)!important;flex:0 0 var(--lt-purchase-height)!important;
      &>.lt-button-icon {width:27px;height:27px;flex-basis:27px;padding:0;border:0;border-radius:0;background:none;box-shadow:none;stroke-width:1.7}
    }
  }
  body.lt-material-system :where(.lt-cartbtn,.lt-iconbtn,.lt-auth__login,.lt-physical-details,.ltp-button,.lt-cd-button,.wp-block-button__link,.wc-forward,.woocommerce a.button):not([hidden]) {display:inline-flex!important}
  /* A popup/footer button is compact in height, while retaining the Pedal cap. */
  body.lt-material-system [data-lt-popup-next] {--lt-btn-height:50px}
  @media(max-width:380px) {
    body.lt-material-system .lt-pdp__actions {gap:10px}
    body.lt-material-system .lt-button--purchase {--lt-btn-padding:14px 12px;--lt-btn-gap:12px}
  }
  @media(prefers-reduced-motion:reduce) {
    body.lt-material-system :where(button,a,input) {transition:none!important}
  }
}
