/* Customer-facing WooCommerce documents and the opt-in MERCHPLUG design frames. */
body.mp-studio-commerce,
body.mp-studio-frame {
  --mps-sale-paper: #f6f4ed;
  --mps-sale-surface: #fffefa;
  --mps-sale-ink: #171817;
  --mps-sale-muted: #545650;
  --mps-sale-rule: #cccac1;
  --mps-sale-accent: #2e43ca;
  --mps-sale-hover: #2234a2;
  --mps-sale-sans: var(--mp-studio-sans, "Instrument Sans", Arial, sans-serif);
}

body.mp-studio-commerce {
  background-color: var(--mps-sale-paper);
}

body.mp-studio-commerce :is(.woocommerce, .wp-block-woocommerce-cart, .wp-block-woocommerce-checkout,
.wp-block-woocommerce-order-confirmation-status, .woocommerce-order) {
  color: var(--mps-sale-ink);
  font-family: var(--mps-sale-sans);
  --wc-primary: var(--mps-sale-accent);
  --wc-primary-text: #fff;
  --wc-secondary: #e8e7df;
  --wc-secondary-text: var(--mps-sale-ink);
}

body.mp-studio-commerce main .wp-block-post-title {
  color: var(--mps-sale-ink);
  font-family: var(--mps-sale-sans);
  font-weight: 650;
  font-size: clamp(2.5rem, 5vw, 4.65rem);
  line-height: 1.03;
  letter-spacing: -.055em;
}

body.mp-studio-commerce :is(.woocommerce h2, .woocommerce h3, .wc-block-components-title,
.wc-block-components-checkout-step__title, .wc-block-cart__totals-title, .woocommerce-MyAccount-content h2) {
  font-family: var(--mps-sale-sans);
  color: var(--mps-sale-ink);
  line-height: 1.16;
  letter-spacing: -.032em;
}

body.mp-studio-commerce :is(.woocommerce-cart-form, .cart_totals, .woocommerce-order-details,
.woocommerce-customer-details) table.shop_table {
  border-radius: 6px;
  border-color: var(--mps-sale-rule);
}

body.mp-studio-commerce :is(.wc-block-cart-items, .woocommerce-cart-form, .woocommerce-MyAccount-content)
:is(.woocommerce-Price-amount, .wc-block-components-product-price, .amount),
body.mp-studio-commerce .wc-block-components-totals-item__value {
  font-variant-numeric: tabular-nums;
}

body.mp-studio-commerce :is(.woocommerce-MyAccount-content, .woocommerce-form, .woocommerce-checkout,
.wp-block-woocommerce-checkout, .wp-block-woocommerce-cart) :is(p, label, small) a:not(.button) {
  color: var(--mps-sale-accent);
  text-decoration-thickness: .075em;
  text-underline-offset: .18em;
}

body.mp-studio-commerce .woocommerce :is(form.login, form.register, form.lost_reset_password) {
  border: 1px solid var(--mps-sale-rule);
  border-radius: 8px;
  padding: clamp(1.1rem, 3.2vw, 2.15rem);
  background: var(--mps-sale-surface);
}

body.mp-studio-commerce .woocommerce-MyAccount-navigation ul {
  padding: 0;
  margin: 0 0 1.5rem;
  list-style: none;
  border-top: 1px solid var(--mps-sale-rule);
}

body.mp-studio-commerce .woocommerce-MyAccount-navigation li {
  border-bottom: 1px solid var(--mps-sale-rule);
}

body.mp-studio-commerce .woocommerce-MyAccount-navigation li a {
  display: block;
  padding: .8rem .35rem;
  color: var(--mps-sale-ink);
  text-decoration: none;
}

body.mp-studio-commerce .woocommerce-MyAccount-navigation li:is(.is-active, :hover) a {
  color: var(--mps-sale-accent);
  text-decoration: underline;
  text-underline-offset: .22em;
}

body.mp-studio-commerce :is(.wc-block-components-text-input input, .wc-block-components-textarea,
.wc-block-components-combobox .components-combobox-control__input, .wc-blocks-components-select__select,
.woocommerce form .form-row .input-text, .woocommerce form .form-row select) {
  color: var(--mps-sale-ink);
  background-color: var(--mps-sale-surface);
  border-radius: 5px;
  font-family: inherit;
}

/* Woo and payment providers own validation and disabled states. */
body.mp-studio-commerce .woocommerce :is(.checkout-button, #place_order, .woocommerce-form-login__submit,
.woocommerce-form-register__submit, .woocommerce-Button[name="save_account_details"]),
body.mp-studio-commerce :is(.wc-block-components-checkout-place-order-button,
.wc-block-cart__submit-button, .wp-block-woocommerce-proceed-to-checkout-block .wc-block-components-button) {
  background: var(--mps-sale-accent);
  color: #fff;
  border-radius: 5px;
  font-family: var(--mps-sale-sans);
  font-weight: 650;
  line-height: 1.3;
  text-decoration: none;
}

body.mp-studio-commerce .woocommerce :is(.checkout-button, #place_order, .woocommerce-form-login__submit,
.woocommerce-form-register__submit, .woocommerce-Button[name="save_account_details"]):hover:enabled,
body.mp-studio-commerce .woocommerce a.checkout-button:hover,
body.mp-studio-commerce :is(.wc-block-components-checkout-place-order-button,
.wc-block-cart__submit-button):hover:not(:disabled, [aria-disabled="true"]) {
  background: var(--mps-sale-hover);
  color: #fff;
}

body.mp-studio-commerce :is(.woocommerce, .wp-block-woocommerce-cart, .wp-block-woocommerce-checkout)
:is(a, button, summary, input, select, textarea):focus-visible,
body.mp-studio-frame #merchplug-root :is(a, button, label[tabindex], summary, input, select, textarea):focus-visible {
  outline: 2px solid var(--mps-sale-accent);
  outline-offset: 3px;
}

/* Presentation-only changes. Product artwork, the canvas and its controls retain their geometry. */
body.mp-studio-frame #merchplug-root .mp-function-body,
body.mp-studio-frame #merchplug-root .mpjs {
  color: var(--mps-sale-ink);
  font-family: var(--mps-sale-sans);
}

body.mp-studio-frame #merchplug-root :is(.editor-title h1, .mpjs-title h1, .mp-inquiry-form h2,
.mp-saved-empty h2, .order-summary h2, .cart-item h3) {
  color: var(--mps-sale-ink);
  font-family: var(--mps-sale-sans);
  font-weight: 650;
  letter-spacing: -.04em;
}

body.mp-studio-frame #merchplug-root :is(.product-start .btn, .detail-copy > .btn, .cart-page .btn,
.mp-saved-empty .btn, .editor-title .btn, .editor-bottom .btn, .mpjs .mpjs-save,
.mp-inquiry-form .mp-inquiry-submit) {
  font-family: var(--mps-sale-sans);
  font-weight: 650;
  border-radius: 5px;
  box-shadow: none;
}

body.mp-studio-frame #merchplug-root :is(.product-start .yellow, .detail-copy > .yellow, .cart-page .yellow,
.mp-saved-empty .yellow, .editor-bottom .yellow, .mp-inquiry-form .mp-inquiry-submit, .mpjs .mpjs-save) {
  background: var(--mps-sale-accent);
  color: #fff;
  border-color: var(--mps-sale-accent);
}

body.mp-studio-frame #merchplug-root :is(.product-start .yellow, .detail-copy > .yellow, .cart-page .yellow,
.mp-saved-empty .yellow, .editor-bottom .yellow, .mp-inquiry-form .mp-inquiry-submit,
.mpjs .mpjs-save):hover:not(:disabled, [aria-disabled="true"]) {
  background: var(--mps-sale-hover);
  border-color: var(--mps-sale-hover);
}

body.mp-studio-frame #merchplug-root :is(.product-design-upload, .editor-title .secondary, .detail-copy > .secondary) {
  background: var(--mps-sale-surface);
  color: var(--mps-sale-ink);
  border-color: #787970;
}

body.mp-studio-frame #merchplug-root :is(.product-design-upload:focus-within,
.product-design-upload.is-dragging, .mp-inquiry-filepick.is-over) {
  color: var(--mps-sale-accent);
  border-color: var(--mps-sale-accent);
  outline: 2px solid var(--mps-sale-accent);
  outline-offset: 2px;
}

body.mp-studio-frame #merchplug-root :is(.product-upload-hint, .mp-saved-product, .mp-saved-date,
.mp-inquiry-note, .mpjs-title p, .order-summary p) {
  color: var(--mps-sale-muted);
}

body.mp-studio-frame #merchplug-root :is(.mp-saved-empty, .mp-saved-card, .order-summary,
.mp-inquiry-form, .mpjs-panel, .editor-shell, .editor-bottom) {
  border-color: var(--mps-sale-rule);
  border-radius: 8px;
  background-color: var(--mps-sale-surface);
  box-shadow: none;
}

body.mp-studio-frame #merchplug-root :is(.cart-thumb, .mp-saved-image, .editor-tools,
.mp-settings-group, .mp-inquiry-form .mp-inquiry-filepick) {
  background-color: var(--mps-sale-paper);
}

body.mp-studio-frame #merchplug-root :is(.mp-saved-open, .cart-page .text-button,
.item-actions button, .mp-inquiry-terms a, .mpjs-back) {
  color: var(--mps-sale-accent);
}

body.mp-studio-frame #merchplug-root :is(.view-toggle button.active,
.mpjs-switch button[aria-pressed="true"], .mp-area-tabs button[aria-pressed="true"]) {
  border-color: var(--mps-sale-accent);
  color: #fff;
  background-color: var(--mps-sale-accent);
}

body.mp-studio-frame #merchplug-root :is(.detail-copy, .mp-inquiry-fields, .mp-function-body > .section)
:is(input:not([type]), input[type="text"], input[type="email"], textarea, select) {
  border-radius: 5px;
  font-family: var(--mps-sale-sans);
  background-color: var(--mps-sale-surface);
  color: var(--mps-sale-ink);
}

@media (max-width: 700px) {
  body.mp-studio-commerce :is(.wc-block-components-text-input input, .wc-block-components-textarea,
  .wc-blocks-components-select__select, .woocommerce form .form-row .input-text, .woocommerce form .form-row select),
  body.mp-studio-frame #merchplug-root :is(.detail-copy, .mp-inquiry-fields, .mp-function-body > .section)
  :is(input:not([type]), input[type="text"], input[type="email"], textarea, select) {
    font-size: max(1rem, 16px);
  }
}
