.sts-price-pair {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  align-items: baseline;
}

.sts-price-pair > span {
  display: inline-flex;
  gap: 0.3rem;
  align-items: baseline;
}

.sts-price-pair small {
  font-size: 0.72em;
  font-weight: 500;
  opacity: 0.78;
}

.sts-box-purchase {
  box-sizing: border-box;
}

.sts-box-purchase {
  width: 100%;
  margin-block: 1rem 1.25rem;
  padding: clamp(1rem, 2.5vw, 1.35rem);
  color: inherit;
  background: rgba(127, 127, 127, 0.06);
  border: 1px solid rgba(127, 127, 127, 0.35);
  border-radius: 12px;
}

.sts-box-notice {
  margin: 0 0 0.85rem;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
  text-wrap: pretty;
}

.sts-box-facts dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin: 0;
}

.sts-box-facts dl > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.55rem;
  border-bottom: 1px solid rgba(127, 127, 127, 0.24);
}

.sts-box-facts dl > div:nth-child(odd) {
  padding-right: 1rem;
}

.sts-box-facts dl > div:nth-child(even) {
  padding-left: 1rem;
}

.sts-box-facts dt,
.sts-box-facts dd {
  margin: 0;
}

.sts-box-facts dt {
  opacity: 0.78;
}

.sts-box-facts dd {
  font-weight: 700;
  text-align: right;
}

.sts-box-selection-prompt {
  margin: 0;
  opacity: 0.78;
}

.sts-quantity-label {
  display: block;
  margin-bottom: 0.35rem;
  font-weight: 700;
}

.sts-freight-quote-required {
  display: block;
  max-width: 62ch;
  line-height: 1.5;
}

.sts-checkout-blocked-control {
  display: none !important;
}

/*
 * Authoritative no-JS fallback for themes that replace cart/checkout controls
 * after WooCommerce refreshes the shipping fragments. The marker is rendered
 * by the server only while a manual freight quote is required.
 */
body.woocommerce-cart:has([data-sts-freight-checkout-blocked]) .wc-proceed-to-checkout,
body.woocommerce-cart:has([data-sts-freight-checkout-blocked]) a.checkout-button,
body.woocommerce-cart:has([data-sts-freight-checkout-blocked]) button.checkout-button,
body.woocommerce-cart:has([data-sts-freight-checkout-blocked]) .woocommerce-mini-cart__buttons .checkout,
body.woocommerce-checkout:has([data-sts-freight-checkout-blocked]) #place_order,
body.woocommerce-checkout:has([data-sts-freight-checkout-blocked]) .wc-block-components-checkout-place-order-button {
  display: none !important;
}

.sts-piece-order {
  --sts-ink: var(--wp--preset--color--contrast, #202124);
  --sts-surface: var(--wp--preset--color--base, #fff);
  box-sizing: border-box;
  width: 100%;
  margin-block: 1rem 1.25rem;
  padding: clamp(1rem, 2.5vw, 1.35rem);
  color: inherit;
  background: rgba(127, 127, 127, 0.055);
  border: 1px solid rgba(127, 127, 127, 0.35);
  border-radius: 12px;
}

.sts-piece-order *,
.sts-piece-order *::before,
.sts-piece-order *::after {
  box-sizing: border-box;
}

.sts-purchase-modes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.sts-mode-button {
  min-height: 44px;
  margin: 0;
  padding: 0.65rem 1rem;
  color: inherit;
  background: transparent;
  border: 1px solid currentColor;
  border-radius: 6px;
  font: inherit;
  font-weight: 700;
  line-height: 1.2;
  cursor: pointer;
}

.sts-mode-button:hover {
  background: rgba(127, 127, 127, 0.1);
}

.sts-mode-button.is-active {
  color: var(--sts-surface);
  background: var(--sts-ink);
  border-color: var(--sts-ink);
}

.sts-mode-button:focus-visible,
.sts-piece-order input:focus-visible,
.sts-piece-order select:focus-visible {
  outline: 3px solid currentColor;
  outline-offset: 3px;
}

.sts-piece-config-message {
  margin: 0 0 1rem;
  padding: 0.75rem 0.85rem;
  background: rgba(127, 127, 127, 0.08);
  border: 1px dashed rgba(127, 127, 127, 0.6);
  border-radius: 8px;
  font-size: 0.9rem;
  line-height: 1.45;
  text-wrap: pretty;
}

.sts-piece-config-message[hidden],
.sts-order-panel[hidden],
.sts-sample-panel[hidden],
[data-sts-box-area-panel][hidden] {
  display: none !important;
}

.sts-order-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.sts-order-fields label,
.sts-sample-quantity {
  display: block;
  margin: 0;
}

.sts-order-fields label > span,
.sts-sample-quantity > span {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.9rem;
  font-weight: 700;
}

.sts-order-fields input,
.sts-order-fields select,
.sts-sample-quantity select {
  width: 100%;
  min-height: 46px;
  margin: 0;
  padding: 0.65rem 0.8rem;
  color: inherit;
  background-color: var(--sts-surface);
  border: 1px solid currentColor;
  border-radius: 6px;
  font: inherit;
}

.sts-order-summary,
.sts-sample-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  margin: 1rem 0 0;
  padding-top: 0.25rem;
  border-top: 1px solid rgba(127, 127, 127, 0.3);
}

.sts-order-summary > div,
.sts-sample-summary > div {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid rgba(127, 127, 127, 0.22);
}

.sts-order-summary > div:nth-child(odd),
.sts-sample-summary > div:nth-child(odd) {
  padding-right: 0.85rem;
}

.sts-order-summary > div:nth-child(even),
.sts-sample-summary > div:nth-child(even) {
  padding-left: 0.85rem;
}

.sts-order-summary dt,
.sts-order-summary dd,
.sts-sample-summary dt,
.sts-sample-summary dd {
  margin: 0;
}

.sts-order-summary dt,
.sts-sample-summary dt {
  opacity: 0.8;
}

.sts-order-summary dd,
.sts-sample-summary dd {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  text-align: right;
}

.sts-sample-copy {
  max-width: 68ch;
  margin: 0 0 0.85rem;
  line-height: 1.5;
  text-wrap: pretty;
}

.sts-sample-quantity {
  width: min(100%, 15rem);
}

form.cart.sts-piece-managed .quantity {
  display: none !important;
}

form.cart.sts-box-area-managed .quantity,
form.cart.sts-box-area-managed .sts-quantity-label {
  display: none !important;
}

form.cart .single_add_to_cart_button.sts-piece-disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

form.cart .sts-box-disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

/* Classic WooCommerce cart/checkout compatibility. These rules stay scoped to
   the two commerce screens so the plugin cannot reshape the rest of the theme. */
body.woocommerce-cart .cart_totals .order-total {
  display: table-row !important;
}

body.woocommerce-cart .wc-proceed-to-checkout,
body.woocommerce-cart .wc-proceed-to-checkout .checkout-button {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

body.woocommerce-cart .wc-proceed-to-checkout .checkout-button {
  box-sizing: border-box;
  width: 100%;
}

body.woocommerce-cart .sts-cart-completion {
  display: grid;
  gap: 1rem;
  box-sizing: border-box;
  width: 100%;
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(127, 127, 127, 0.3);
}

body.woocommerce-cart .sts-cart-completion[hidden],
body.woocommerce-cart .sts-cart-sample-fees[hidden],
body.woocommerce-cart .sts-cart-order-total-fallback[hidden],
body.woocommerce-cart .sts-cart-checkout-fallback[hidden] {
  display: none !important;
}

body.woocommerce-cart .sts-cart-sample-fees h3 {
  margin: 0 0 0.7rem;
  font-size: 1rem;
}

body.woocommerce-cart .sts-cart-sample-fees dl {
  margin: 0;
}

body.woocommerce-cart .sts-cart-sample-fees dl > div,
body.woocommerce-cart .sts-cart-order-total-fallback {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.55rem 0;
}

body.woocommerce-cart .sts-cart-sample-fees dt,
body.woocommerce-cart .sts-cart-sample-fees dd {
  margin: 0;
}

body.woocommerce-cart .sts-cart-sample-fees dd,
body.woocommerce-cart .sts-cart-order-total-fallback strong {
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

body.woocommerce-cart .sts-cart-sample-fees-total,
body.woocommerce-cart .sts-cart-order-total-fallback {
  border-top: 1px solid rgba(127, 127, 127, 0.3);
  font-weight: 700;
}

body.woocommerce-cart .sts-cart-order-total-fallback {
  padding-top: 0.9rem;
  font-size: 1.08rem;
}

body.woocommerce-cart .sts-cart-checkout-button {
  display: block !important;
  box-sizing: border-box;
  width: 100%;
  min-height: 46px;
  text-align: center;
}

body.woocommerce-checkout #billing_state_field,
body.woocommerce-checkout #shipping_state_field {
  display: block !important;
}

body.woocommerce-checkout #billing_state_field .select2-container,
body.woocommerce-checkout #shipping_state_field .select2-container {
  width: 100% !important;
}

body.woocommerce-checkout .woocommerce-checkout-review-order-table .product-name,
body.woocommerce-checkout .woocommerce-checkout-review-order-table .product-total {
  overflow-wrap: anywhere;
  vertical-align: top;
}

@media (max-width: 960px) {
  body.woocommerce-checkout form.checkout.woocommerce-checkout {
    display: block !important;
  }

  body.woocommerce-checkout form.checkout .col2-set,
  body.woocommerce-checkout form.checkout #order_review_heading,
  body.woocommerce-checkout form.checkout #order_review {
    box-sizing: border-box;
    float: none !important;
    clear: both;
    width: 100% !important;
    max-width: none !important;
  }

  body.woocommerce-checkout form.checkout #order_review_heading {
    margin-top: 1.75rem;
  }
}

@media (max-width: 620px) {
  .sts-box-facts dl {
    grid-template-columns: 1fr;
  }

  .sts-box-facts dl > div:nth-child(odd),
  .sts-box-facts dl > div:nth-child(even) {
    padding-inline: 0;
  }

  .sts-order-fields,
  .sts-order-summary,
  .sts-sample-summary {
    grid-template-columns: 1fr;
  }

  .sts-order-summary > div:nth-child(odd),
  .sts-order-summary > div:nth-child(even),
  .sts-sample-summary > div:nth-child(odd),
  .sts-sample-summary > div:nth-child(even) {
    padding-inline: 0;
  }

  .sts-mode-button {
    flex: 1 1 10rem;
  }
}
