/* Phox Woo Builder: shared look of the add-to-cart family (Add To Cart
   Button, Add To Cart Form, Buy Now Button, and the cart button inside
   Wishlist rows).

   Base rules are single-class so a theme's `button {}` does not win;
   hover/focus is repeated at two-class weight because themes set
   `html a:hover` and `button:hover` colours. Every colour reads a house
   token (see pwb-base.css), so a builder container's Colors section
   restyles all of it. Element design controls (css.twig) are emitted at
   `%%SELECTOR%% .class` weight and come after this file. */

.pwb-icon { display: block; width: 1em; height: 1em; flex: none; }

@keyframes pwb-spin { to { transform: rotate(360deg); } }
@keyframes pwb-pop { 0% { transform: scale(.4); opacity: 0; } 60% { transform: scale(1.15); opacity: 1; } 100% { transform: scale(1); } }

/* ------------------------------------------------------------------ */
/* Buttons: Add To Cart (.pwb-atc__btn, and WooCommerce's own button   */
/* inside the Form), Buy Now (.pwb-buy-now__btn)                       */
/* ------------------------------------------------------------------ */
.pwb-atc__btn,
.pwb-atcf .single_add_to_cart_button,
.pwb-buy-now__btn {
  position: relative;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--pwb-input-h, 44px);
  margin: 0;
  padding: 0 22px;
  border: 1px solid var(--pwb-primary-border, var(--pwb-primary, #222));
  border-radius: var(--pwb-btn-radius, var(--pwb-radius, 8px));
  background: var(--pwb-primary, #222);
  color: var(--pwb-primary-text, #fff);
  -webkit-text-fill-color: currentColor;
  font: inherit;
  font-size: var(--pwb-font, 15px);
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: background-color var(--pwb-transition, .2s ease), border-color var(--pwb-transition, .2s ease), color var(--pwb-transition, .2s ease), opacity var(--pwb-transition, .2s ease);
}
.pwb-atc .pwb-atc__btn:where(:hover, :focus-visible),
.pwb-atcf .single_add_to_cart_button:where(:hover, :focus-visible) {
  background: var(--pwb-primary-hover, #000);
  border-color: var(--pwb-primary-border-hover, var(--pwb-primary-hover, #000));
  color: var(--pwb-primary-text-hover, var(--pwb-primary-text, #fff));
  -webkit-text-fill-color: currentColor;
}
/* Buy Now is the secondary action by default: an outline. Breakdance's
   Secondary button when set (--pwb-sec-*, see pwb-base.css), otherwise it sits
   on the product page, so text and border follow the colour around it. */
.pwb-buy-now__btn {
  background: var(--pwb-sec-bg, var(--bde-button-secondary-background-color, transparent));
  border-color: var(--pwb-sec-border, var(--bde-button-secondary-border-color, currentColor));
  border-radius: var(--pwb-sec-radius, var(--bde-button-border-radius, var(--pwb-btn-radius, var(--pwb-radius, 8px))));
  color: var(--pwb-sec-text, var(--bde-button-secondary-text-color, inherit));
}
.pwb-buy-now .pwb-buy-now__btn:where(:hover, :focus-visible) {
  background: var(--pwb-sec-bg-hover, var(--bde-button-secondary-background-color-hover, var(--pwb-primary, #222)));
  border-color: var(--pwb-sec-border-hover, var(--bde-button-secondary-border-color-hover, var(--pwb-primary, #222)));
  color: var(--pwb-sec-text-hover, var(--bde-button-secondary-text-color-hover, var(--pwb-primary-text, #fff)));
  -webkit-text-fill-color: currentColor;
}
.pwb-atc__btn:focus-visible,
.pwb-atcf .single_add_to_cart_button:focus-visible,
.pwb-buy-now__btn:focus-visible { outline: 2px solid var(--pwb-focus, var(--pwb-primary-border, var(--pwb-primary, #222))); outline-offset: 2px; }

/* WooCommerce's stylesheet draws its own loading / added icons with ::after
   (and themes add arrows); ours are real elements instead. The Form's
   button is WooCommerce's, so its busy spinner is a ::before. */
.pwb-atc .pwb-atc__btn::before,
.pwb-atc .pwb-atc__btn::after,
.pwb-atcf .single_add_to_cart_button::after,
.pwb-atcf .single_add_to_cart_button:not(.is-busy)::before { content: none !important; }
.pwb-atcf .single_add_to_cart_button.is-busy::before {
  content: "" !important;
  display: inline-block;
  flex: none;
  width: 1.1em;
  height: 1.1em;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: pwb-spin .7s linear infinite;
}

.pwb-atc__btn[disabled], .pwb-atc__btn.is-soldout,
.pwb-atcf .single_add_to_cart_button.disabled,
.pwb-atcf .single_add_to_cart_button:disabled,
.pwb-buy-now__btn[disabled], .pwb-buy-now__btn.is-soldout,
.pwb-buy-now__btn.is-needs-options {
  opacity: .5;
  cursor: not-allowed;
}

.pwb-atc__icon, .pwb-buy-now__icon { display: inline-flex; flex: none; font-size: 1.15em; line-height: 1; }
.pwb-atc__icon svg, .pwb-buy-now__icon svg { display: block; width: 1em; height: 1em; }
.pwb-atc__label, .pwb-buy-now__label { min-width: 0; }

/* Busy and done states */
.pwb-atc__spin, .pwb-buy-now__spin,
.pwb-atc__check { display: none; flex: none; width: 1.1em; height: 1.1em; }
.pwb-atc__spin, .pwb-buy-now__spin {
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: pwb-spin .7s linear infinite;
}
.pwb-atc__btn.is-busy .pwb-atc__spin,
.pwb-buy-now__btn.is-busy .pwb-buy-now__spin { display: inline-block; }
.pwb-atc__btn.is-busy .pwb-atc__icon,
.pwb-buy-now__btn.is-busy .pwb-buy-now__icon { display: none; }
.pwb-atc__btn.is-busy,
.pwb-atcf .single_add_to_cart_button.is-busy,
.pwb-buy-now__btn.is-busy { cursor: progress; }
.pwb-atc__btn.is-done .pwb-atc__check { display: inline-flex; animation: pwb-pop .3s ease; }
.pwb-atc__btn.is-done .pwb-atc__icon { display: none; }
.pwb-atc__check svg { display: block; width: 100%; height: 100%; }
.pwb-atc .pwb-atc__btn.is-done {
  background: var(--pwb-success, #1f7a43);
  border-color: var(--pwb-success, #1f7a43);
  color: #fff;
  -webkit-text-fill-color: currentColor;
}

/* ------------------------------------------------------------------ */
/* Add To Cart Button wrapper: quantity + button + View cart link      */
/* ------------------------------------------------------------------ */
.pwb-atc {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: var(--pwb-atc-justify, flex-start);
  gap: 8px 10px;
  min-width: 0;
  max-width: 100%;
}
.pwb-atc__qty { flex: none; height: var(--pwb-input-h, 44px); }
.pwb-atc .added_to_cart {
  flex: 0 0 auto;
  padding: 4px 2px;
  color: var(--pwb-soft);
  font-size: var(--pwb-font-sm, 13px);
  text-decoration: underline;
}
.pwb-atc .added_to_cart:where(:hover, :focus-visible) { color: inherit; }
.pwb-atc--no-viewcart .added_to_cart { display: none; }

/* ------------------------------------------------------------------ */
/* Add To Cart Form: WooCommerce's own form markup, restyled           */
/* ------------------------------------------------------------------ */
/* On the product page, straight on the page background: no forced text colour. */
.pwb-atcf { width: 100%; min-width: 0; color: inherit; }
.pwb-atcf__notices { display: grid; gap: 8px; }
.pwb-atcf__notices:empty { display: none; }
.pwb-atcf__notices { margin-bottom: 12px; }
.pwb-atcf__notices .pwb-notice a { color: inherit; font-weight: 600; text-decoration: underline; }
/* WooCommerce's script adds its own "View cart" link after the form's button;
   the form shows WooCommerce's "added to cart" notice (with that link) above it. */
.pwb-atcf .added_to_cart { display: none; }

.pwb-atcf form.cart { margin: 0; }
/* Simple, external, subscription: quantity and buttons on one row. */
.pwb-atcf form.cart:not(.variations_form):not(.grouped_form),
.pwb-atcf .woocommerce-variation-add-to-cart {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 12px;
}
.pwb-atcf .single_add_to_cart_button { flex: 1 1 auto; }
.pwb-atcf.pwb-atcf--no-qty .quantity { display: none; }
.pwb-atcf .quantity { margin: 0; float: none; }
.pwb-atcf .quantity .screen-reader-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Quantity input without steppers */
.pwb-atcf .quantity .qty {
  box-sizing: border-box;
  width: 76px;
  height: var(--pwb-input-h, 44px);
  padding: 0 10px;
  border: 1px solid var(--pwb-input-border, #8f8f8f);
  border-radius: var(--pwb-radius, 8px);
  background: var(--pwb-surface, #fff);
  color: var(--pwb-text, #222);
  font: inherit;
  font-size: var(--pwb-font, 15px);
  text-align: center;
}
/* Quantity with minus / plus (class added by the Form) */
.pwb-atcf--stepper .quantity {
  display: inline-flex;
  align-items: stretch;
  height: var(--pwb-input-h, 44px);
  border: 1px solid var(--pwb-input-border, #8f8f8f);
  border-radius: var(--pwb-radius, 8px);
  background: var(--pwb-surface, #fff);
  overflow: hidden;
}
.pwb-atcf--stepper .quantity .qty {
  width: 52px;
  height: auto;
  border: 0;
  border-radius: 0;
  border-left: 1px solid var(--pwb-border, #e5e5e5);
  border-right: 1px solid var(--pwb-border, #e5e5e5);
  background: transparent;
  -moz-appearance: textfield;
  appearance: textfield;
}
.pwb-atcf--stepper .quantity .qty::-webkit-outer-spin-button,
.pwb-atcf--stepper .quantity .qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pwb-qty__btn,
.pwb-atcf .quantity .pwb-qty__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--pwb-text, #222);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: background-color var(--pwb-transition, .2s ease);
}
.pwb-qty__btn:where(:hover, :focus-visible) { background: var(--pwb-surface-2, #f5f5f5); }
.pwb-qty__btn[disabled] { opacity: .35; cursor: not-allowed; }
.pwb-qty__btn:focus-visible { outline: 2px solid var(--pwb-focus, var(--pwb-primary-border, var(--pwb-primary, #222))); outline-offset: -2px; }

/* The variations table becomes stacked label + control rows. */
.pwb-atcf table.variations { display: block; width: 100%; margin: 0 0 16px; border: 0; }
.pwb-atcf table.variations tbody,
.pwb-atcf table.variations tr { display: block; }
.pwb-atcf table.variations tr + tr { margin-top: 14px; }
.pwb-atcf table.variations th,
.pwb-atcf table.variations td { display: block; padding: 0; border: 0; background: none; text-align: left; }
.pwb-atcf table.variations th.label { padding-bottom: 6px; font-weight: 600; line-height: 1.3; }
.pwb-atcf table.variations th.label label { font-weight: inherit; }
.pwb-atcf table.variations select {
  box-sizing: border-box;
  width: 100%;
  min-height: var(--pwb-input-h, 44px);
  padding: 0 14px;
  border: 1px solid var(--pwb-input-border, #8f8f8f);
  border-radius: var(--pwb-radius, 8px);
  background-color: var(--pwb-surface, #fff);
  color: var(--pwb-text, #222);
  font: inherit;
  font-size: var(--pwb-font, 15px);
}
.pwb-atcf table.variations select:focus {
  outline: none;
  border-color: var(--pwb-primary, #222);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--pwb-primary, #222) 15%, transparent);
}
.pwb-atcf .reset_variations {
  display: inline-block;
  margin-top: 8px;
  color: var(--pwb-soft);
  font-size: var(--pwb-font-sm, 13px);
  text-decoration: underline;
}
.pwb-atcf .reset_variations[style*="hidden"] { display: none; }
.pwb-atcf .woocommerce-variation { margin: 0 0 14px; }
.pwb-atcf .woocommerce-variation-description p { margin: 0 0 8px; }
.pwb-atcf .woocommerce-variation-price .price { font-weight: 700; font-size: var(--pwb-font-lg, 18px); }
.pwb-atcf .woocommerce-variation-availability p, .pwb-atcf p.stock { margin: 0 0 8px; font-size: var(--pwb-font-sm, 13px); color: var(--pwb-soft); }
.pwb-atcf p.stock.out-of-stock { color: var(--pwb-error, #b3292b); }

/* The real <select> stays (WooCommerce's script drives it) but is hidden
   whenever our button / swatch group stands in for it. */
.pwb-var-select {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Grouped products */
.pwb-atcf table.woocommerce-grouped-product-list { width: 100%; margin: 0 0 16px; border-collapse: collapse; border: 0; }
.pwb-atcf table.woocommerce-grouped-product-list td { padding: 10px 8px 10px 0; border: 0; border-bottom: 1px solid var(--pwb-border, #e5e5e5); vertical-align: middle; background: none; }
.pwb-atcf table.woocommerce-grouped-product-list .woocommerce-grouped-product-list-item__label a { color: inherit; font-weight: 600; text-decoration: none; }
.pwb-atcf table.woocommerce-grouped-product-list .woocommerce-grouped-product-list-item__price { text-align: right; white-space: nowrap; }
.pwb-atcf form.cart.grouped_form { display: block; }

/* ------------------------------------------------------------------ */
/* Option buttons and swatches                                         */
/* ------------------------------------------------------------------ */
.pwb-swatches { display: flex; flex-wrap: wrap; gap: var(--pwb-sw-gap, 8px); min-width: 0; }
.pwb-swatch {
  position: relative;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--pwb-sw-size, 44px);
  height: var(--pwb-sw-size, 44px);
  margin: 0;
  padding: 0 14px;
  border: 1px solid var(--pwb-sw-border, var(--pwb-input-border, #8f8f8f));
  border-radius: var(--pwb-sw-radius, var(--pwb-radius, 8px));
  background: var(--pwb-sw-bg, var(--pwb-surface, #fff));
  color: var(--pwb-sw-color, var(--pwb-text, #222));
  -webkit-text-fill-color: currentColor;
  font: inherit;
  font-size: var(--pwb-font, 15px);
  line-height: 1;
  cursor: pointer;
  overflow: hidden;
  transition: border-color var(--pwb-transition, .2s ease), box-shadow var(--pwb-transition, .2s ease), background-color var(--pwb-transition, .2s ease), color var(--pwb-transition, .2s ease), opacity var(--pwb-transition, .2s ease);
}
.pwb-swatches .pwb-swatch:where(:hover) { border-color: var(--pwb-sw-selected, var(--pwb-primary, #222)); }
.pwb-swatches .pwb-swatch.is-selected {
  border-color: var(--pwb-sw-selected, var(--pwb-primary, #222));
  box-shadow: 0 0 0 1px var(--pwb-sw-selected, var(--pwb-primary, #222));
}
.pwb-swatches .pwb-swatch--text.is-selected {
  background: var(--pwb-sw-selected-bg, var(--pwb-primary, #222));
  color: var(--pwb-sw-selected-color, var(--pwb-primary-text, #fff));
}
.pwb-swatch:focus-visible { outline: 2px solid var(--pwb-focus, var(--pwb-primary-border, var(--pwb-primary, #222))); outline-offset: 2px; }

.pwb-swatch--color, .pwb-swatch--image { padding: 0; }
.pwb-swatch--color { border-radius: var(--pwb-sw-radius, 50%); }
.pwb-swatch--color .pwb-swatch__dot {
  position: absolute;
  inset: 4px;
  border-radius: inherit;
  background: var(--pwb-swatch-color, #ccc);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12);
}
.pwb-swatch--image .pwb-swatch__img { display: block; width: 100%; height: 100%; object-fit: cover; }

/* Combinations that do not exist: faded with a strike line. */
.pwb-swatch.is-unavailable { opacity: .4; cursor: not-allowed; }
.pwb-swatch.is-unavailable::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top right, transparent calc(50% - 1px), currentColor, transparent calc(50% + 1px));
  opacity: .55;
  pointer-events: none;
}

/* ------------------------------------------------------------------ */
/* Buy Now                                                             */
/* ------------------------------------------------------------------ */
.pwb-buy-now { display: flex; flex-wrap: wrap; align-items: center; justify-content: var(--pwb-bn-justify, flex-start); gap: 8px; min-width: 0; max-width: 100%; }
.pwb-buy-now__msg { flex: 1 1 100%; font-size: var(--pwb-font-sm, 13px); color: var(--pwb-error, #b3292b); }
.pwb-atcf .pwb-buy-now { flex: 1 1 auto; }
.pwb-atcf .pwb-buy-now__btn { flex: 1 1 auto; }

@media (prefers-reduced-motion: reduce) {
  .pwb-atc__spin, .pwb-buy-now__spin { animation-duration: 1.6s; }
  .pwb-atc__btn.is-done .pwb-atc__check { animation: none; }
}
