/* Command controls only: navigation tabs, forms and native WooCommerce buttons
   retain their own styles. WoodMart supplies both default and accented tokens. */
body :is(
    .gwb2b-quote-button, .gwb2b-link-button,
    .gwb2b-sales .gwb2b-sales-primary, .gwb2b-sales .gwb2b-sales-secondary,
    .gwb2b-icon-button, .gwb2b-sales .gwb2b-sales-text,
    .gwb2b-store-tools > .button, .gwb2b-sales-banner > .button,
    .gwb2b-quote-editor .button,
    .gwb2b-profile a.gwb2b-profile-action.is-primary, .gwb2b-profile a.gwb2b-profile-action,
    .gwb2b-profile-editor button, .gwb2b-profile-editor summary,
    .gwb2b-profile .gwb2b-profile-scroll,
    .gwb2b-account-dashboard .gwb2b-dashboard-filter button,
    .gwb2b-map-channels .gwb2b-map-whatsapp
) {
    box-sizing: border-box;
    min-height: 44px;
    max-width: 100%;
    height: auto;
    white-space: normal;
    overflow-wrap: anywhere;
    line-height: 1.4;
    letter-spacing: 0;
}

body.theme-woodmart :is(
    .gwb2b-quote-button, .gwb2b-link-button,
    .gwb2b-sales .gwb2b-sales-primary, .gwb2b-sales .gwb2b-sales-secondary,
    .gwb2b-icon-button, .gwb2b-sales .gwb2b-sales-text,
    .gwb2b-store-tools > .button, .gwb2b-sales-banner > .button,
    .gwb2b-quote-editor .button,
    .gwb2b-profile a.gwb2b-profile-action.is-primary, .gwb2b-profile a.gwb2b-profile-action,
    .gwb2b-profile-editor button, .gwb2b-profile-editor summary,
    .gwb2b-profile .gwb2b-profile-scroll,
    .gwb2b-account-dashboard .gwb2b-dashboard-filter button,
    .gwb2b-map-channels .gwb2b-map-whatsapp
) {
    border-radius: var(--gwb2b-button-radius, var(--btn-default-brd-radius, 4px));
    background: var(--gwb2b-button-bg, var(--btn-default-bgcolor, #f3f3f3));
    color: var(--gwb2b-button-ink, var(--btn-default-color, #333));
    border-color: transparent;
    box-shadow: var(--gwb2b-button-shadow, var(--btn-default-box-shadow, none));
    filter: none;
}

body.theme-woodmart :is(
    .gwb2b-quote-button, .gwb2b-link-button--primary,
    .gwb2b-sales-primary, .gwb2b-icon-button[aria-pressed="true"],
    .gwb2b-quote-editor .button-primary,
    .gwb2b-profile-action.is-primary, .gwb2b-profile-editor button[type="submit"],
    .gwb2b-map-whatsapp
) {
    --gwb2b-button-bg: var(--btn-accented-bgcolor, #075eaa);
    --gwb2b-button-ink: var(--btn-accented-color, #fff);
    --gwb2b-button-hover-bg: var(--btn-accented-bgcolor-hover, var(--btn-accented-bgcolor, #075eaa));
    --gwb2b-button-hover-ink: var(--btn-accented-color-hover, var(--btn-accented-color, #fff));
    --gwb2b-button-radius: var(--btn-accented-brd-radius, var(--btn-default-brd-radius, 4px));
    --gwb2b-button-shadow: var(--btn-accented-box-shadow, none);
    --gwb2b-button-hover-shadow: var(--btn-accented-box-shadow-hover, none);
}

/* Toggling a favorite changes its emphasis, not its geometry. */
body.theme-woodmart button.gwb2b-icon-button[aria-pressed="true"] {
    --gwb2b-button-radius: var(--btn-default-brd-radius, 4px);
}
body .gwb2b-icon-button[aria-pressed="true"] .gwb2b-line-icon { fill: currentColor; }

/* Destructive commands remain recognizable even with an arbitrary theme palette. */
body.theme-woodmart :is(.gwb2b-link-button--danger, .gwb2b-sales-text) {
    --gwb2b-button-bg: #b42318;
    --gwb2b-button-ink: #fff;
    --gwb2b-button-hover-bg: #8e1c13;
    --gwb2b-button-hover-ink: #fff;
    --gwb2b-button-shadow: none;
    --gwb2b-button-hover-shadow: none;
}
body.theme-woodmart .gwb2b-sales-text { padding-inline: 14px; }

body.theme-woodmart :is(
    .gwb2b-quote-button, .gwb2b-link-button,
    .gwb2b-sales .gwb2b-sales-primary, .gwb2b-sales .gwb2b-sales-secondary,
    .gwb2b-icon-button, .gwb2b-sales .gwb2b-sales-text,
    .gwb2b-store-tools > .button, .gwb2b-sales-banner > .button,
    .gwb2b-quote-editor .button,
    .gwb2b-profile a.gwb2b-profile-action.is-primary, .gwb2b-profile a.gwb2b-profile-action,
    .gwb2b-profile-editor button, .gwb2b-profile-editor summary,
    .gwb2b-profile .gwb2b-profile-scroll,
    .gwb2b-account-dashboard .gwb2b-dashboard-filter button,
    .gwb2b-map-channels .gwb2b-map-whatsapp
):hover:not(:disabled):not([aria-disabled="true"]) {
    background: var(--gwb2b-button-hover-bg, var(--btn-default-bgcolor-hover, var(--btn-default-bgcolor, #e0e0e0)));
    color: var(--gwb2b-button-hover-ink, var(--btn-default-color-hover, var(--btn-default-color, #333)));
    border-color: transparent;
    box-shadow: var(--gwb2b-button-hover-shadow, var(--btn-default-box-shadow-hover, none));
    filter: none;
}

body :is(.gwb2b-quote-cart, .gwb2b-quote-editor, .gwb2b-sales, .gwb2b-profile, .gwb2b-account-dashboard, .gwb2b-store-tools) :is(button, .gwb2b-link-button):disabled {
    opacity: .55;
    cursor: not-allowed;
}

body :is(.gwb2b-quote-button, .gwb2b-link-button, .gwb2b-quote-editor .button):focus-visible {
    outline: 3px solid var(--wd-primary-color, #075eaa);
    outline-offset: 3px;
}
body .gwb2b-profile-cover a.gwb2b-profile-action:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 3px;
}

.gwb2b-actions > form { margin: 0; max-width: 100%; }
.gwb2b-sales-product-actions { align-items: stretch; }
.gwb2b-sales-product-actions > :is(.gwb2b-sales-primary, .gwb2b-sales-secondary) { flex: 1; min-width: 0; }
.gwb2b-sales-product-actions > .gwb2b-icon-button,
.gwb2b-sales-row-actions > .gwb2b-icon-button,
.gwb2b-sales-search > .gwb2b-icon-button { flex: 0 0 44px; }
.gwb2b-profile-editor-actions > button { justify-content: center; }
.gwb2b-profile .gwb2b-profile-scroll { width: 44px; min-width: 44px; flex-basis: 44px; }

@media (max-width: 600px) {
    .gwb2b-actions > :is(button, a, form) { flex: 1 1 180px; min-width: 0; }
    .gwb2b-actions > form > .gwb2b-link-button { width: 100%; }
    .gwb2b-profile-editor-actions > button { flex: 1 1 160px; min-width: 0; }
    .gwb2b-pricing-bulk > .button { flex: 1 1 120px; min-width: 0; }
    .gwb2b-sales-banner > .button { width: 100%; }
}

@container (max-width: 600px) {
    .gwb2b-pricing-form .gwb2b-pricing-bulk {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }
    .gwb2b-pricing-bulk > label,
    .gwb2b-pricing-bulk > .gwb2b-pricing-feedback { grid-column: 1 / -1; }
    .gwb2b-pricing-bulk > .button { width: 100%; min-width: 0; }
}
