/* ============================================================
   maryruths — 同类按钮统一（CTA unify）
   标准取自源站 https://p0bvkm-e1.myshopify.com/ 实测：
     高度 49px / 字重 700 / 圆角 8px / 内边距 0 30px / 大写 / 字距 1px
     PDP 字号 19px（源站 1.9rem），列表卡片 16px（源站 1.6rem）
     颜色走本站主题按钮 token：--mr-cta-bg 46,62,78 / --mr-cta-fg 253,251,247
     hover：填充横向收合、文字转按钮色（与源站 ::after scaleX(0) 一致）
   ============================================================ */

:root {
  --mr-cta-bg: 46, 62, 78;        /* #2e3e4e 主题按钮色 */
  --mr-cta-fg: 253, 251, 247;     /* #fdfbf7 */
  --mr-cta-h: 49px;
  --mr-cta-radius: 8px;
}

/* ---------- 统一外观：PDP 主 CTA / 吸底 CTA / 列表卡片 CTA / 抽屉按钮 ---------- */
html body .product-form__submit,
html body .product-form__submit.button,
html body .sticky-atc .button.main-product-atc,
html body .mr-card__cta .mr-btn,
html body cart-drawer .button,
html body .cart-drawer .button,
html body #CartDrawer .button {
  position: relative !important;
  isolation: isolate;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  box-sizing: border-box !important;
  height: var(--mr-cta-h) !important;
  min-height: var(--mr-cta-h) !important;
  max-height: var(--mr-cta-h) !important;
  line-height: 1.2 !important;
  padding: 0 30px !important;
  border: 0 !important;
  border-radius: var(--mr-cta-radius) !important;
  background: transparent !important;
  background-image: none !important;
  color: rgb(var(--mr-cta-fg)) !important;
  font-weight: 700 !important;
  letter-spacing: 1px !important;
  text-transform: uppercase !important;
  text-decoration: none !important;
  box-shadow: none !important;
  overflow: hidden;
  cursor: pointer;
  transition: color .3s ease !important;
  z-index: 0;
}

/* 填充层：替代被 WooCommerce 默认皮肤覆盖的底色 */
html body .product-form__submit::after,
html body .sticky-atc .button.main-product-atc::after,
html body .mr-card__cta .mr-btn::after,
html body cart-drawer .button::after,
html body .cart-drawer .button::after,
html body #CartDrawer .button::after {
  content: "" !important;
  position: absolute !important;
  inset: 0 !important;
  z-index: -1 !important;
  background: rgb(var(--mr-cta-bg)) !important;
  background-image: none !important;
  border-radius: var(--mr-cta-radius) !important;
  box-shadow: none !important;
  transform-origin: center center;
  transition: transform .3s ease !important;
}

/* hover / focus-visible：填充收合 + 文字转按钮色（源站同款） */
html body .product-form__submit:hover::after,
html body .product-form__submit:focus-visible::after,
html body .sticky-atc .button.main-product-atc:hover::after,
html body .sticky-atc .button.main-product-atc:focus-visible::after,
html body .mr-card:hover .mr-btn::after,
html body .mr-card:focus-visible .mr-btn::after,
html body cart-drawer .button:hover::after,
html body .cart-drawer .button:hover::after,
html body #CartDrawer .button:hover::after {
  transform: scaleX(0) !important;
}

html body .product-form__submit:hover,
html body .product-form__submit:focus-visible,
html body .sticky-atc .button.main-product-atc:hover,
html body .sticky-atc .button.main-product-atc:focus-visible,
html body .mr-card:hover .mr-btn,
html body .mr-card:focus-visible .mr-btn,
html body cart-drawer .button:hover,
html body .cart-drawer .button:hover,
html body #CartDrawer .button:hover {
  color: rgb(var(--mr-cta-bg)) !important;
  background: transparent !important;
}

/* ---------- 字号：PDP 主 CTA / 吸底 CTA 19px（源站 1.9rem） ---------- */
html body .product-form__submit,
html body .sticky-atc .button.main-product-atc {
  font-size: 19px !important;
}

/* 吸底按钮：宽度自适应，其余规格与主 CTA 完全一致 */
html body .sticky-atc .button.main-product-atc {
  width: auto !important;
  margin: 0 !important;
}

/* ---------- 列表页卡片 CTA：16px（源站 1.6rem），行为仍是进 PDP ---------- */
html body .mr-card__cta .mr-btn {
  font-size: 16px !important;
  width: 100% !important;
}

/* ---------- 抽屉 / 购物车按钮：同一套底，主按钮 18px（源站同口径） ---------- */
html body cart-drawer .button,
html body .cart-drawer .button,
html body #CartDrawer .button {
  font-size: 16px !important;
}

html body cart-drawer .button.cart__checkout-button,
html body .cart-drawer .button.cart__checkout-button,
html body #CartDrawer .button.cart__checkout-button {
  font-size: 18px !important;
}

/* 移动端不缩水，保持同一规格 */
@media screen and (max-width: 749px) {
  html body .product-form__submit,
  html body .sticky-atc .button.main-product-atc,
  html body .mr-card__cta .mr-btn {
    height: var(--mr-cta-h) !important;
    min-height: var(--mr-cta-h) !important;
    max-height: var(--mr-cta-h) !important;
  }
  html body .product-form__submit,
  html body .sticky-atc .button.main-product-atc {
    font-size: 19px !important;
  }
}
