.moze-bis-card {
  margin: 0;
  padding: 4px;
  background: #fff;
}
.moze-bis-title { margin: 0 42px 8px 0; font-size: 1.12rem; font-weight: 700; }
.moze-bis-description { margin: 10px 0 14px; }
.moze-bis-row { display: flex; gap: 8px; flex-wrap: wrap; }
.moze-bis-row input { flex: 1 1 230px; min-height: 44px; }
.moze-bis-row button { min-height: 44px; }
.moze-bis-message { margin: 0; font-size: .92em; }
.moze-bis-message.is-error { color: #b32d2e; }
.moze-bis-message.is-success { color: #008a20; }
.moze-bis-cart-button-hidden,
.moze-bis-quantity-hidden { display: none !important; }
.moze-bis-notify-button { cursor: pointer; }

/* Extra protection for themes that add their own AJAX click handlers. */
form.variations_form.moze-bis-waitlist-active .single_add_to_cart_button,
form.variations_form.moze-bis-waitlist-active .quantity {
  display: none !important;
}

.moze-bis-variation-summary {
  margin: 0 0 10px;
  font-size: .94em;
  line-height: 1.5;
}
.moze-bis-separator { opacity: .55; }

body.moze-bis-modal-open { overflow: hidden; }
.moze-bis-modal[hidden] { display: none !important; }
.moze-bis-modal {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.moze-bis-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .5);
}
.moze-bis-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 520px);
  max-height: calc(100vh - 36px);
  overflow: auto;
  padding: 22px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .22);
}
.moze-bis-modal-close {
  position: absolute !important;
  top: 10px !important;
  right: 12px !important;
  left: auto !important;
  inset-inline-start: auto !important;
  inset-inline-end: 12px !important;
  display: flex !important;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin: 0 !important;
  padding: 0 !important;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}
.moze-bis-modal-close:hover,
.moze-bis-modal-close:focus { background: rgba(0, 0, 0, .06); }

@media (max-width: 480px) {
  .moze-bis-modal { align-items: flex-end; padding: 0; }
  .moze-bis-modal-dialog {
    width: 100%;
    max-height: 85vh;
    padding: 20px 16px;
    border-radius: 18px 18px 0 0;
  }
  .moze-bis-row { display: block; }
  .moze-bis-row input,
  .moze-bis-row button { width: 100%; }
  .moze-bis-row button { margin-top: 8px; }
}

/* Anti-spam honeypot: hidden from real users, kept in the DOM for bots. */
.moze-bis-honeypot {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Back in stock: unavailable size swatches remain selectable, but are visually
 * distinct from immediately purchasable sizes. WoodMart marks these exposed
 * swatches as wd-enabled, so the plugin adds its own state class in JS. */
body.moze-bis-enabled-product
.wd-swatches-product[data-id="pa_size"]
.wd-swatch.moze-bis-out-of-stock-swatch {
  opacity: 1 !important;
  display: inline-flex !important;
  visibility: visible !important;
  color: #7c7c7c !important;
  /* Draw the unavailable slash on the swatch itself. WoodMart also uses
     ::before for swatch effects and may hide or override that pseudo-element.
     Background-image is therefore much more reliable across WoodMart layouts. */
  background-color: #f5f5f5 !important;
  background-image: linear-gradient(135deg,
    transparent calc(50% - .75px),
    #bebebe 50%,
    transparent calc(50% + .75px)) !important;
  background-repeat: no-repeat !important;
  background-position: center !important;
  background-size: 100% 100% !important;
  border: 1px solid #d8d8d8 !important;
  box-shadow: none !important;
  cursor: pointer !important;
  pointer-events: auto !important;
  position: relative;
}
body.moze-bis-enabled-product
.wd-swatches-product[data-id="pa_size"]
.wd-swatch.moze-bis-out-of-stock-swatch * {
  pointer-events: none;
}
body.moze-bis-enabled-product
.wd-swatches-product[data-id="pa_size"]
.wd-swatch.moze-bis-out-of-stock-swatch::after {
  content: "";
  position: absolute;
  right: 5px;
  top: -2px;
  width: 7px;
  height: 7px;
  border: 0;
  border-radius: 50%;
  background-color: #1d1d1d;
  box-sizing: border-box;
  z-index: 2;
  pointer-events: none;
}

body.moze-bis-enabled-product
.wd-swatches-product[data-id="pa_size"]
.wd-swatch.moze-bis-out-of-stock-swatch.wd-active,
body.moze-bis-enabled-product
.wd-swatches-product[data-id="pa_size"]
.wd-swatch.moze-bis-out-of-stock-swatch:focus-visible {
  border-color: #9274aa !important;
  box-shadow: 0 0 0 1px #9274aa !important;
  /* Do not use background shorthand: it clears the diagonal gradient. */
  background-color: #f5f5f5 !important;
}
@media (hover: hover) and (pointer: fine) {
  body.moze-bis-enabled-product
  .wd-swatches-product[data-id="pa_size"]
  .wd-swatch.moze-bis-out-of-stock-swatch:hover {
    border-color: #9274aa !important;
    box-shadow: 0 0 0 1px #9274aa !important;
  }
}

/* 0.5.0: the two purchase-path choices are isolated to eligible BIS products. */
.moze-bis-actions {
  display: flex;
  gap: 8px;
  align-items: stretch;
  flex-wrap: wrap;
  margin: 0;
  width: 100%;
}
.moze-bis-actions > .button {
  flex: 1 1 180px;
  /* JS reads WoodMart's own add-to-cart button height before hiding it. */
  box-sizing: border-box;
  height: var(--moze-bis-native-cta-height, 42px) !important;
  min-height: var(--moze-bis-native-cta-height, 42px) !important;
  display: inline-flex !important;
  justify-content: center;
  align-items: center;
  text-align: center;
  margin: 0 !important;
  padding: 0 14px !important;
  border-radius: 6px !important;
  letter-spacing: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  white-space: normal;
  cursor: pointer;
}
.moze-bis-actions > .moze-bis-similar-button {
  background: #7d4b99;
  border-color: #7d4b99;
  color: #fff;
}
.moze-bis-actions > .moze-bis-notify-button {
  background: #fff;
  border: 1px solid #7d4b99;
  color: #583367;
}
.moze-bis-actions > .moze-bis-similar-button:hover,
.moze-bis-actions > .moze-bis-similar-button:focus-visible {
  background: #65367f;
  color: #fff;
}
.moze-bis-actions > .moze-bis-notify-button:hover,
.moze-bis-actions > .moze-bis-notify-button:focus-visible {
  background: #f6eff9;
  color: #583367;
}
.moze-bis-modal-dialog.is-similar { width: min(100%, 740px); }
@media (max-width: 600px) {
  .moze-bis-actions { flex-direction: column; gap: 8px; }
  .moze-bis-actions > .button { flex: initial; width: 100%; }
  .moze-bis-modal-dialog.is-similar { width: 100%; }
}

/* The subscription result stays visible while similar products load below. */
.moze-bis-signup-success {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 16px;
  margin: 0 0 23px;
  border: 1px solid #dcebdd;
  border-radius: 10px;
  background: #f5faf5;
}
.moze-bis-signup-success-icon {
  flex: 0 0 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #e1f2e5;
  color: #287444;
  font-size: 19px;
  font-weight: 700;
}
.moze-bis-signup-success-title {
  margin: 1px 0 5px;
  font-size: 1.08rem;
  line-height: 1.3;
  font-weight: 700;
  color: #263b2b;
}
.moze-bis-signup-success-message {
  margin: 0;
  font-size: .92rem;
  line-height: 1.5;
  color: #526357;
}
