/* Public typography. Component styles consume these tokens; their fallbacks
 * preserve the editor's appearance. Prices, hero titles and icon glyphs keep
 * their own scale. Rem units also respect the visitor's default text size. */
html:has(> body.wd:not(.wp-admin):not(.elementor-editor-active):not(.elementor-editor-preview)) {
	/* WoodMart sets 14px on html; use the browser default as the rem baseline. */
	font-size: 100%;
}

body.wd:not(.wp-admin):not(.elementor-editor-active):not(.elementor-editor-preview) {
	--jardim-site-font: Arial, sans-serif;
	--jardim-font-body: 1rem;
	--jardim-font-ui: .875rem;
	--jardim-font-secondary: .8125rem;
	--jardim-font-badge: .75rem;
	--jardim-font-component: 1.25rem;
	--jardim-font-section: 1.25rem;
	--jardim-leading-text: 1.5;
	--jardim-leading-heading: 1.3;
	--wd-text-font: var(--jardim-site-font);
	--wd-text-font-size: var(--jardim-font-body);
	--wd-title-font: var(--jardim-site-font);
	--wd-entities-title-font: var(--jardim-site-font);
	--wd-alternative-font: var(--jardim-site-font);
	--wd-widget-title-font: var(--jardim-site-font);
	--wd-header-el-font: var(--jardim-site-font);
	--wd-header-el-font-size: var(--jardim-font-ui);
	--btn-font-size: var(--jardim-font-ui);
	--btn-default-font-size: var(--jardim-font-ui);
	--btn-accented-font-size: var(--jardim-font-ui);
	--btn-font-family: var(--jardim-site-font);
	--btn-default-font-family: var(--jardim-site-font);
	--btn-accented-font-family: var(--jardim-site-font);
	font-family: var(--jardim-site-font);
	font-size: var(--jardim-font-body);
	line-height: var(--jardim-leading-text);
}

body.wd:not(.wp-admin):not(.elementor-editor-active):not(.elementor-editor-preview),
body.wd:not(.wp-admin):not(.elementor-editor-active):not(.elementor-editor-preview) .elementor {
	--e-global-typography-primary-font-family: var(--jardim-site-font);
	--e-global-typography-secondary-font-family: var(--jardim-site-font);
	--e-global-typography-text-font-family: var(--jardim-site-font);
	--e-global-typography-accent-font-family: var(--jardim-site-font);
	--e-global-typography-text-font-size: var(--jardim-font-body);
	--e-global-typography-text-line-height: var(--jardim-leading-text);
}

/* Saved menu settings and Elementor commerce widgets specify their own families.
 * Target text containers, never icon classes or their pseudo-elements. */
body.wd:not(.wp-admin):not(.elementor-editor-active):not(.elementor-editor-preview) :is(
	.wd-nav.wd-nav-main > li > a,
	.elementor-heading-title,
	.elementor-widget-text-editor,
	.elementor-widget-button .elementor-button,
	.elementor-widget-woocommerce-cart .woocommerce,
	.elementor-widget-woocommerce-checkout-page,
	.elementor-widget-woocommerce-my-account,
	.elementor-widget-woocommerce-purchase-summary,
	.e-woo-select2-wrapper .select2-results__option,
	input,
	select,
	textarea
) {
	font-family: var(--jardim-site-font);
}

/* Defaults for native WooCommerce and Elementor content. Do not target every
 * descendant: captions, badges, prices and icon-only controls are intentional. */
body.wd:not(.wp-admin):not(.elementor-editor-active):not(.elementor-editor-preview) :where(
	.wd-text-block, .elementor-widget-text-editor, .woocommerce-Tabs-panel,
	.woocommerce-MyAccount-content, .jardim-privacy-help, .jardim-acesso,
	.woocommerce-checkout .payment_box
) {
	font-size: var(--jardim-font-body);
	line-height: var(--jardim-leading-text);
}

body.wd:not(.wp-admin):not(.elementor-editor-active):not(.elementor-editor-preview) :is(
	input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=hidden]):not([type=submit]):not([type=button]):not([type=reset]):not(.infixs-correios-automatico-input),
	select, textarea, .select2-container .select2-selection,
	.select2-container .select2-results__option,
	.elementor-widget-text-editor, .elementor-widget-text-editor p,
	.jardim-acesso--login .jardim-acesso__header p,
	.product-grid-item .wd-entities-title
) {
	font-size: var(--jardim-font-body);
	line-height: var(--jardim-leading-text);
}

body.wd:not(.wp-admin):not(.elementor-editor-active):not(.elementor-editor-preview) :is(
	label:where(:not(.jardim-checkout-coupon > label, .jardim-checkout-summary__toggle)), .wd-nav-main > li > a, .wd-nav-mobile > li > a,
	.woocommerce-MyAccount-navigation a,
	.btn:not(.remove):not(.wd-action-btn), .button:not(.remove):not(.add_to_cart_button), .elementor-button, .wd-button-wrapper .wd-btn-text, input[type=submit], input[type=button],
	input[type=reset], .jardim-acesso button, .wpcf7-submit,
	.jardim-business-panel__actions > a, .jardim-acesso__phone-help
) {
	font-size: var(--jardim-font-ui);
	line-height: var(--jardim-leading-text);
}

body.wd:not(.wp-admin):not(.elementor-editor-active):not(.elementor-editor-preview) :is(
	.woocommerce-error, .woocommerce-message, .woocommerce-info,
	.wpcf7-response-output, .wpcf7-not-valid-tip,
	.jardim-acesso__hint, .jardim-acesso__help, .jardim-acesso__email-status,
	.jardim-av-search__status
) {
	font-size: var(--jardim-font-ui);
	line-height: var(--jardim-leading-text);
}

body.wd:not(.wp-admin):not(.elementor-editor-active):not(.elementor-editor-preview) :is(
	.woocommerce-breadcrumb, .wd-breadcrumbs, .woocommerce-result-count,
	.product_meta, .jardim-acesso__privacy, .jardim-acesso__security-note,
	.jardim-acesso__divider, .jardim-acesso__account-note
) {
	font-size: var(--jardim-font-secondary);
	line-height: var(--jardim-leading-text);
}

/* Saved Elementor headings can bypass theme variables. Scope section headings
 * to page content, leaving h1, hero artwork and the footer's component titles. */
body.wd:not(.wp-admin):not(.elementor-editor-active):not(.elementor-editor-preview) :is(
	.wd-page-content h2.elementor-heading-title,
	.wd-page-content .title-wrapper .title:not(h1),
	.wd-page-content h2.wd-el-title,
	.woocommerce-MyAccount-content > h2, .woocommerce-Tabs-panel > h2,
	.related > h2, .upsells > h2, .cross-sells > h2
) {
	font-size: var(--jardim-font-section);
	line-height: var(--jardim-leading-heading);
}

body.wd:not(.wp-admin):not(.elementor-editor-active):not(.elementor-editor-preview) :is(
	.jardim-acesso h2, .jardim-acesso__account-name, .widget-title,
	.jardim-av-search .jardim-av-search__title
) {
	font-size: var(--jardim-font-component);
	line-height: var(--jardim-leading-heading);
}

/* Text fields must grow for enlarged text without resizing checkboxes, hidden
 * OTP overlays, icon buttons or compact quantity steppers. */
body.wd:not(.wp-admin):not(.elementor-editor-active):not(.elementor-editor-preview) :is(
	.wpcf7 input:not([type=checkbox]):not([type=radio]):not([type=hidden]):not([type=submit]),
	.woocommerce form .form-row input.input-text,
	.jardim-quote-fields input, #jardim-recovery-dialog input:not([type=hidden]):not([type=submit]),
	.jardim-product-shipping input.infixs-correios-automatico-input
) {
	min-height: max(44px, 2.75rem);
}

@media (max-width: 768px) {
	body.wd:not(.wp-admin):not(.elementor-editor-active):not(.elementor-editor-preview) {
		--jardim-font-component: 1.125rem;
		--jardim-font-section: 1.125rem;
	}
}
