/* Red & Mint — 商品页购买区布局
   目标：Buy It Now 永远紧邻 Add to cart（同一行、等高）。
   桌面：数量 | Add to cart | Buy It Now
   手机：数量单独一行，Add to cart 与 Buy It Now 并排各占一半
   仅覆盖布局，不改按钮配色。 */
body.single-product form.cart:not(.grouped_form):not(.variations_form) {
  display: grid !important;
  grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr);
  align-items: center;
  column-gap: 9px;
  row-gap: 10px;
  flex-wrap: nowrap !important;
}

body.single-product form.cart > .dtc-volume-picker,
body.single-product form.cart > .rdpit-quantity-label,
body.single-product form.cart > .rdpit-variation-buttons,
body.single-product form.cart > .woocommerce-variation-description,
body.single-product form.cart > .woocommerce-variation-price,
body.single-product form.cart > .woocommerce-variation-availability {
  grid-column: 1 / -1;
}

body.single-product form.cart > .quantity {
  grid-column: 1;
  margin: 0 !important;
  justify-self: start;
}

body.single-product form.cart > .single_add_to_cart_button {
  grid-column: 2;
  justify-self: stretch;
  align-self: stretch;
  width: 100% !important;
  min-width: 0 !important;
  min-height: 50px !important;
  margin: 0 !important;
  padding: 12px 14px !important;
  font-size: 14px !important;
  letter-spacing: .04em !important;
  line-height: 1.25 !important;
  white-space: nowrap;
}

body.single-product form.cart > .single_add_to_cart_button.rdpit-buy-now {
  grid-column: 3;
  margin-left: 0 !important;
}

@media (max-width: 767px) {
  body.single-product form.cart:not(.grouped_form):not(.variations_form) {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  body.single-product form.cart > .quantity {
    grid-column: 1 / -1;
    margin: 0 0 2px !important;
  }

  body.single-product form.cart > .single_add_to_cart_button {
    grid-column: 1;
    min-height: 46px !important;
    padding: 10px 6px !important;
    font-size: 12px !important;
    letter-spacing: .01em !important;
    line-height: 1.2 !important;
  }

  body.single-product form.cart > .single_add_to_cart_button.rdpit-buy-now {
    grid-column: 2;
  }
}

/* 手机端：右侧有悬浮购物车 / 客服按钮，给物流条留出安全边距，避免文字被遮挡 */
@media (max-width: 767px) {
  body.single-product .rdpit-info-strip--shipping {
    padding-right: 74px !important;
  }
}

/* ---------- My Account：登录 / 注册表单与全站按钮统一 ---------- */
body.woocommerce-account .woocommerce-form-login .woocommerce-form-login__submit,
body.woocommerce-account .woocommerce-form-register .woocommerce-form-register__submit,
body.woocommerce-account form.woocommerce-ResetPassword .woocommerce-Button {
  min-height: 46px !important;
  padding: 11px 26px !important;
  border: 1px solid #2d696b !important;
  border-radius: 7px !important;
  background: #2d696b !important;
  color: #fff !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  letter-spacing: .04em;
  line-height: 1.3 !important;
  text-transform: none;
  cursor: pointer;
}

body.woocommerce-account .woocommerce-form-login .woocommerce-form-login__submit:hover,
body.woocommerce-account .woocommerce-form-register .woocommerce-form-register__submit:hover,
body.woocommerce-account form.woocommerce-ResetPassword .woocommerce-Button:hover {
  background: #24595b !important;
  border-color: #24595b !important;
}

/* 输入框与全站商品页一致 */
body.woocommerce-account .woocommerce-form-login input.input-text,
body.woocommerce-account .woocommerce-form-register input.input-text {
  min-height: 44px;
  border: 1px solid #e5e3df !important;
  border-radius: 7px !important;
  background: #fff !important;
  box-shadow: none !important;
  font-size: 15px;
}

body.woocommerce-account .woocommerce-form-login input.input-text:focus,
body.woocommerce-account .woocommerce-form-register input.input-text:focus {
  border-color: #2d696b !important;
  outline: 0;
}

/* 手机端：注册区给右侧悬浮按钮留出空间，避免压住输入框和按钮 */
@media (max-width: 767px) {
  body.woocommerce-account .woocommerce-form-register,
  body.woocommerce-account .woocommerce-form-login {
    padding-bottom: 26px;
  }

  body.woocommerce-account .woocommerce-form-register .form-row,
  body.woocommerce-account .woocommerce-form-login .form-row {
    padding-right: 0;
  }

  body.woocommerce-account .woocommerce-form-register .woocommerce-form-register__submit,
  body.woocommerce-account .woocommerce-form-login .woocommerce-form-login__submit {
    width: 100%;
    margin-top: 6px;
  }

  /* 账户页不需要悬浮购物车按钮（顶部导航已有购物车），避免压住输入框 */
  body.woocommerce-account #cfw-side-cart-floating-button {
    display: none !important;
  }

  /* 给右下角客服悬浮球留出空间：滚到底部时注册按钮不会被挡住 */
  body.woocommerce-account .woocommerce-form-register {
    padding-bottom: 104px !important;
  }

  body.woocommerce-account .woocommerce {
    padding-bottom: 40px;
  }
}
