/* BM Nuvei Native Gateway & PDP Buy Box Styles (Bob's Machine design tokens, border-radius: 0).
 * Gateway visibility follows the selected payment method.
 */

/* ── Horizontal Payment Method Tiles ── */
.bm-nv-tiles {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.bm-nv-tiles[data-count="3"] {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (min-width: 520px) {
  .bm-nv-tiles[data-count="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bm-nv-tiles[data-count="3"] { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .bm-nv-tiles[data-count="4"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.bm-nv-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  padding: 12px 13px;
  border: 1px solid var(--rule, #E5E5E0);
  border-radius: 0;
  background: #fff;
  color: var(--ink, #0A0E14);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.14s, background-color 0.14s, box-shadow 0.14s;
}
.bm-nv-tile:hover:not(:disabled) {
  border-color: var(--ink-soft, #6B6B66);
  background: #FCFBF9;
}
.bm-nv-tile[aria-checked="true"] {
  border: 1.5px solid var(--ink, #0A0E14);
  background: var(--cream, #F8F7F4);
  box-shadow: inset 0 2px 0 var(--red, #B43335);
}
.bm-nv-tile:focus-visible {
  outline: 2px solid var(--ink, #0A0E14);
  outline-offset: 2px;
}

.bm-nv-tile__mark {
  display: flex;
  align-items: center;
  height: 22px;
  pointer-events: none;
}
.bm-nv-tile__mark img,
.bm-nv-tile__mark svg {
  height: 20px;
  width: auto;
  display: block;
}
.bm-nv-tile__mark--gpay {
  overflow: hidden;
  width: 38px;
  height: 22px;
  justify-content: center;
}
.bm-nv-tile__mark--gpay img {
  height: 31px;
  width: auto;
  max-width: none;
}
.bm-nv-tile__mark--paypal {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 22px;
  border: 1px solid var(--rule, #D8D8D2);
  background: #fff;
  padding: 2px;
}
.bm-nv-tile__mark--paypal img {
  height: 15px;
  width: auto;
}
.bm-nv-tile__label {
  font-family: var(--bm-field-font, 'Funnel Sans', sans-serif);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink, #0A0E14);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
@media (max-width: 420px) {
  .bm-nv-tiles[data-count="3"] .bm-nv-tile { padding: 9px 9px; }
  .bm-nv-tiles[data-count="3"] .bm-nv-tile__label { font-size: 12.5px; }
}

/* ── Card Hosted Fields (3 clean rows, border-radius: 0) ── */
.bm-nv-card {
  width: 100%;
}
.bm-nv-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bm-nv-field {
  position: relative;
  min-width: 0;
}
.bm-nv-label {
  display: block;
  margin-bottom: 5px;
  font-family: var(--bm-label-font, 'JetBrains Mono', monospace);
  font-size: var(--bm-label-size, 10px);
  font-weight: 500;
  letter-spacing: var(--bm-label-track, 0.14em);
  text-transform: uppercase;
  color: var(--bm-label-color, #53565A);
}
.bm-nv-lbl-short { display: none; }
@media (max-width: 430px) {
  .bm-nv-lbl-full { display: none; }
  .bm-nv-lbl-short { display: inline; }
}

.bm-nv-row-2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.bm-nv-hosted-wrap,
.bm-nv-input-wrap {
  position: relative;
}

.bm-nv-hosted {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100%;
  height: 48px;
  padding: 0 13px;
  border: 1px solid var(--bm-field-border, #E5E5E0);
  border-radius: 0;
  background: var(--bm-field-bg, #fff);
  cursor: text;
  transition: border-color 0.14s, box-shadow 0.14s;
}
.bm-nv-field--number .bm-nv-hosted {
  padding-right: 134px;
}
.bm-nv-hosted-wrap--cvv .bm-nv-hosted {
  padding-right: 38px;
}
.bm-nv-hosted iframe {
  width: 100% !important;
  min-height: 22px;
  border: 0 !important;
  display: block;
}
.bm-nv-hosted.is-focused {
  border-color: var(--bm-field-border-focus, #0A0E14);
  box-shadow: inset 0 0 0 1px var(--bm-field-border-focus, #0A0E14);
}
.bm-nv-hosted.is-invalid,
.bm-nv-hosted.invalid,
.bm-nv-hosted[aria-invalid="true"] {
  border-color: var(--bm-field-error, #AC3E3F);
}

/* 4 auto-detected SVG card brand icons */
.bm-nv-brands {
  position: absolute;
  right: 9px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 4px;
  pointer-events: none;
}
.bm-nv-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 18px;
  border: 1px solid var(--rule, #D8D8D2);
  background: #fff;
  border-radius: 2px;
  opacity: 0.9;
  transition: opacity 0.15s, border-color 0.15s, transform 0.15s;
}
.bm-nv-brand svg {
  width: 24px;
  height: 14px;
}
.bm-nv-brands.has-match .bm-nv-brand { opacity: 0.22; }
.bm-nv-brands.has-match .bm-nv-brand.is-match {
  opacity: 1;
  border-color: var(--ink, #0A0E14);
  transform: scale(1.06);
}
@media (max-width: 410px) {
  .bm-nv-field--number .bm-nv-hosted { padding-right: 110px; }
  .bm-nv-brands { right: 7px; gap: 3px; }
  .bm-nv-brand { width: 24px; height: 16px; }
  .bm-nv-brand svg { width: 20px; height: 12px; }
}

/* Security code (?) popover */
.bm-nv-cvv-help {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid #C5C5BF;
  background: #fff;
  color: var(--ink-soft, #53565A);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.bm-nv-cvv-help:hover {
  border-color: var(--ink, #0A0E14);
  color: var(--ink, #0A0E14);
}
.bm-nv-popover {
  position: absolute;
  right: 0;
  bottom: calc(100% + 6px);
  z-index: 30;
  width: min(240px, 75vw);
  padding: 9px 11px;
  background: var(--ink, #0A0E14);
  color: #fff;
  font-size: 12px;
  line-height: 1.4;
  box-shadow: 0 8px 20px rgba(10, 14, 20, 0.22);
}

/* Name on card input + clear button */
.bm-nv-cardholder {
  box-sizing: border-box;
  width: 100%;
  height: 46px;
  padding: 0 38px 0 12px !important;
  border: 1px solid var(--bm-field-border, #D8D8D2);
  border-radius: 0;
  background: var(--bm-field-bg, #fff);
  color: var(--bm-field-color, #0A0E14);
  font-family: var(--bm-field-font, 'Funnel Sans', sans-serif);
  font-size: 15px;
}
.bm-nv-clear-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink-soft, #53565A);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.bm-nv-clear-btn[hidden] { display: none; }
.bm-nv-clear-btn:hover { color: var(--ink, #0A0E14); }

/* Slotted Billing address toggle inside Payment */
.bm-nv-billing-slot {
  margin-top: 12px;
}
.bm-nv-billing-slot .bm-billing-switch {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}
.bm-nv-billing-slot .bm-billing-switch__title {
  display: none;
}

/* Helper note for Apple Pay / Google Pay / PayPal panes */
.bm-nv-wallet-note {
  margin: 0 0 6px !important;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--ink-soft, #53565A);
}

/* Payment button visibility */
.bm-nv-cta-hidden,
.bm-nv-pp-hidden,
.bm-nv-box-hidden {
  display: none !important;
}
/* PayPal Web SDK v6 buttons measure width once on firstUpdated() and collapse text labels
 * ("Pay Later", "Pay with") to display:none if mounted inside a 0px display:none container.
 * On Checkout v2, park the hidden PayPal CTA wrapper off-screen at 360px (visibility:hidden + inert)
 * so all SDK v6 buttons render full labels immediately with zero clipped P monogram on tile switch. */
.bm-co-v2 form.checkout #order_review > .ppc-button-wrapper.bm-nv-pp-hidden {
  display: block !important;
  position: fixed !important;
  left: -9999px !important;
  top: 0 !important;
  width: 360px !important;
  height: 1px !important;
  overflow: hidden !important;
  visibility: hidden !important;
  pointer-events: none !important;
  opacity: 0 !important;
}

/* Inline busy spinner on #place_order */
#place_order.is-busy {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: wait;
  opacity: 0.9;
}
.bm-nv-spinner {
  display: inline-block;
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: bmNvSpin 0.65s linear infinite;
}
@keyframes bmNvSpin { to { transform: rotate(360deg); } }

/* Official Apple Pay & Google Pay rendered button containers */
apple-pay-button {
  display: block;
  width: 100%;
  --apple-pay-button-width: 100%;
  --apple-pay-button-border-radius: 0;
  --apple-pay-button-padding: 0;
}
.bm-nv-wallet-cta .gpay-card-info-container,
.bm-nv-wallet-cta .gpay-button,
.bm-pdp-express-slot .gpay-card-info-container,
.bm-pdp-express-slot .gpay-button,
.bm-express-slot[data-bm-nv-wallet] .gpay-card-info-container,
.bm-express-slot[data-bm-nv-wallet] .gpay-button {
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  border-radius: 0 !important;
  box-sizing: border-box !important;
}
.bm-express-slot[data-bm-nv-wallet] {
  overflow: hidden;
}

/* Native Wallet CTA buttons (Express, Checkout Payment, PDP) */
.bm-nv-ap-btn,
.bm-nv-gp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 0;
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, 'Funnel Sans', sans-serif;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.15s, opacity 0.15s;
}
.bm-nv-ap-btn { background: #000; }
.bm-nv-ap-btn:hover { background: #1c1c1e; }
.bm-nv-gp-btn { background: #141414; }
.bm-nv-gp-btn:hover { background: #262626; }
.bm-nv-wbtn-prefix { opacity: 0.92; font-size: 14px; }
.bm-nv-wbtn-word { font-weight: 600; letter-spacing: -0.02em; }

/* ── Order-Pay Billing Editor ── */
.bm-nv-billing {
  margin: 0 0 18px;
  padding: 16px;
  background: var(--cream, #F3F2EE);
  border: 1px solid var(--rule, #D8D8D2);
}
.bm-nv-billing h3 {
  margin: 0 0 6px;
  font-size: 16px;
}
.bm-nv-billing-hint {
  margin: 0 0 12px;
  font-size: 13.5px;
  color: var(--ink-soft, #53565A);
}
.bm-nv-ship-reminder {
  margin: 10px 0 0;
  color: var(--ink-soft, #53565A);
}

/* ── PDP Buy Box v2: [Qty + Add to cart] inline -> subtle hairline -> full-width PayPal -> centered Pay Later -> centered More options ── */
html body.bm-pdp-v2.single-product .summary-inner .woocommerce-variation-add-to-cart.bm-pdp-buy-actions,
html body.bm-pdp-v2.single-product .summary-inner form.cart.bm-pdp-buy-actions,
.bm-pdp-v2 .bm-pdp-buy-actions {
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 10px !important;
  align-items: stretch !important;
}
html body.bm-pdp-v2.single-product .summary-inner .bm-pdp-buy-actions > * {
  flex: 0 0 100%;
  min-width: 0;
  order: 0;
}
html body.bm-pdp-v2.single-product .summary-inner .bm-pdp-buy-actions > .quantity {
  flex: 0 0 auto;
  order: 1;
  height: 48px;
  margin: 0 !important;
  box-sizing: border-box;
}
html body.bm-pdp-v2.single-product .summary-inner .bm-pdp-buy-actions > .quantity .qty {
  min-height: 46px !important;
  height: 46px !important;
}
html body.bm-pdp-v2.single-product .summary-inner .bm-pdp-buy-actions > .single_add_to_cart_button {
  flex: 1 1 180px;
  width: auto;
  order: 2;
  min-height: 48px !important;
  height: 48px !important;
  border-radius: 0;
  margin: 0 !important;
}

/* Native wallet slot (Apple Pay only when enabled) */
html body.bm-pdp-v2.single-product .summary-inner .bm-pdp-buy-actions:not(.bm-pdp-has-wallet) .bm-pdp-express-slot {
  display: none !important;
}
html body.bm-pdp-v2.single-product .summary-inner .bm-pdp-buy-actions.bm-pdp-has-wallet .bm-pdp-express-slot {
  flex: 1 1 180px;
  order: 3;
}

/* Full-width primary PayPal button cleanly separated from the Add-to-cart row */
html body.bm-pdp-v2.single-product .summary-inner .bm-pdp-buy-actions .ppc-button-wrapper {
  flex: 0 0 100%;
  order: 4;
  margin: 2px 0 0 !important;
  padding-top: 12px;
  border-top: 1px solid #EAEAE5;
  width: 100%;
  min-width: 0;
}
html body.bm-pdp-v2.single-product .summary-inner .bm-pdp-buy-actions.bm-pdp-has-wallet.bm-pdp-has-paypal .ppc-button-wrapper {
  flex: 1 1 180px;
  width: auto;
  margin-top: 0 !important;
  padding-top: 0;
  border-top: 0;
}
html body.bm-pdp-v2.single-product .summary-inner .bm-pdp-buy-actions #ppc-button-ppcp-gateway-v6 {
  display: block !important;
  width: 100%;
}
html body.bm-pdp-v2.single-product .summary-inner .bm-pdp-buy-actions #ppc-button-ppcp-gateway-v6 > :not(:first-child) {
  display: none !important;
}
html body.bm-pdp-v2.single-product .summary-inner .bm-pdp-buy-actions.bm-pdp-has-wallet #ppc-button-ppcp-gateway-v6 > :first-child {
  height: 46px !important;
  min-height: 46px !important;
  width: 100% !important;
}
html body.bm-pdp-v2.single-product .summary-inner .bm-pdp-buy-actions:not(.bm-pdp-has-wallet) #ppc-button-ppcp-gateway-v6 > :first-child {
  height: 48px !important;
  min-height: 48px !important;
  width: 100% !important;
}

/* PayPal Pay Later messaging: single centered line directly beneath PayPal */
html body.bm-pdp-v2.single-product .summary-inner .bm-pdp-buy-actions > .ppcp-messages {
  flex: 0 0 100%;
  order: 5;
  margin: -2px 0 0 !important;
  display: flex;
  justify-content: center;
  text-align: center;
}
html body.bm-pdp-v2.single-product .summary-inner .bm-pdp-buy-actions > .ppcp-messages:empty {
  display: none !important;
}
html body.bm-pdp-v2.single-product .summary-inner .bm-pdp-buy-actions > .ppcp-messages paypal-message {
  display: inline-block;
  max-width: 100%;
}

/* Centered More payment options */
html body.bm-pdp-v2.single-product .summary-inner .bm-pdp-buy-actions .bm-pdp-more-wrap {
  flex: 0 0 100%;
  order: 10;
  text-align: center;
  margin-top: 0;
}
.bm-pdp-more-pay {
  display: inline-block;
  padding: 4px 6px;
  border: 0;
  background: none;
  color: var(--ink, #0A0E14);
  font-family: var(--bm-field-font, 'Funnel Sans', sans-serif);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  cursor: pointer;
}
.bm-pdp-more-pay:hover {
  color: var(--red, #B43335);
}
.bm-pdp-more-pay:disabled {
  opacity: 0.6;
  cursor: wait;
}
.bm-pdp-error {
  margin-top: 8px;
  padding: 10px 12px;
  border: 1px solid #DEDDD9;
  border-left: 3px solid #AC3E3F;
  background: #fff;
  color: #202327;
  font-size: 14px;
  line-height: 1.45;
  text-align: left;
}
.bm-pdp-error[hidden] { display: none; }

/* R2-11: Shopify-style Express & PDP Terms disclosure (hidden until a native Apple Pay / Google Pay button is active; zero :has()). */
.bm-express-terms,
.bm-pdp-terms {
  display: none;
  margin: 8px 0 0;
  color: var(--ink-soft, #53565A);
  font-size: 11.5px;
  line-height: 1.45;
  text-align: center;
}
.bm-express.bm-express-has-wallet .bm-express-terms,
html body.bm-pdp-v2.single-product .summary-inner .bm-pdp-buy-actions.bm-pdp-has-wallet .bm-pdp-terms,
.bm-pdp-buy-actions.bm-pdp-has-wallet .bm-pdp-terms {
  display: block;
}
.bm-express-terms a,
.bm-pdp-terms a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.bm-express-terms a:hover,
.bm-pdp-terms a:hover {
  color: var(--red, #B43335);
}
