/**
 * Mobile typography scale — loads after page styles.
 * Aligned to home hero reference (title + body + divider gaps).
 */

@media (max-width: 767px) {
	:root {
		--cbr-text-min: 13px;
		--cbr-text-base: var(--cbr-type-body, var(--cbr-hero-body-size));
		--cbr-text-subtitle: var(--cbr-type-body, var(--cbr-hero-body-size));
		--cbr-text-title: var(--cbr-type-section, var(--cbr-section-title-size));
		--cbr-text-button: 14px;
		--cbr-btn-height: 48px;
		--cbr-btn-padding-x: 16px;
		--cbr-btn-min-width: min(260px, 100%);
		--cbr-section-title-size: calc(var(--cbr-hero-title-size) / 1.25);
	}

	body.cbr-theme {
		font-size: var(--cbr-text-base);
		line-height: var(--cbr-hero-body-line);
	}

	/* Bottoni — 14px, altezza 40px */
	body.cbr-theme :is(
		.cbr-btn,
		.cbr-link,
		[class*="-btn"]:not(.cbr-catalog-pdf-btn),
		.cbr-cart-widget__toggle,
		.cbr-cart-widget__quote,
		.cbr-con-cart-trigger,
		.cbr-nol-catalog__filters-toggle
	) {
		font-size: var(--cbr-text-button);
	}

	/* Catalog PDF pill — same lock as desktop (footer + catalog strip) */
	body.cbr-theme .cbr-catalog-pdf-btn {
		min-width: min(260px, 100%);
		height: 44px;
		min-height: 44px;
		max-height: 44px;
		padding: 0 30px;
		font-size: 0.82rem;
		line-height: 1;
		display: inline-flex;
		align-items: center;
		justify-content: center;
	}

	/* Bottoni d'azione — altezza fissa 40px */
	body.cbr-theme :is(
		.cbr-btn:not(.cbr-btn--ghost),
		.cbr-nol-btn,
		.cbr-per-btn,
		.cbr-con-btn,
		.cbr-cart-widget__toggle
	) {
		box-sizing: border-box;
		height: var(--cbr-btn-height);
		min-height: var(--cbr-btn-height);
		max-height: var(--cbr-btn-height);
		width: auto;
		min-width: var(--cbr-btn-min-width);
		padding-block: 0;
		padding-inline: var(--cbr-btn-padding-x);
		line-height: 1;
		display: inline-flex;
		align-items: center;
		justify-content: center;
	}

	/* Floating cart pill — content-width on mobile (not action-btn min-width) */
	body.cbr-theme .cbr-cart-widget__toggle {
		min-width: 0;
		padding-inline: var(--cbr-btn-padding-x);
		gap: 0.35rem;
		letter-spacing: 0.04em;
	}

	body.cbr-theme :is(
		.cbr-hero__actions-row .cbr-btn,
		.cbr-nol-hero__cta,
		.cbr-nol-showroom__cta,
		[class*="hero__cta"]
	):is(.cbr-btn, .cbr-nol-btn, button) {
		width: 100%;
		min-width: 0;
		max-width: 100%;
		align-self: stretch;
	}

	body.cbr-theme .cbr-home-hero__cta--dual .cbr-btn {
		width: auto !important;
		min-width: 0 !important;
		max-width: none !important;
		flex: 1 1 0 !important;
		height: auto !important;
		min-height: var(--cbr-btn-height) !important;
		max-height: none !important;
		white-space: normal !important;
		line-height: 1 !important;
		padding-block: 6px !important;
		font-size: var(--cbr-text-button) !important;
	}

	.cbr-cart-widget__quote {
		width: 100%;
	}

	/* Minimo — 13px */
	body.cbr-theme :is(
		.placeholder span,
		.cbr-form__error,
		.cbr-stat__label,
		.cbr-contact-list__label,
		.cbr-event-type__label,
		.cbr-category-card__title,
		.cbr-nol-mise__style,
		.cbr-nol-catalog__chip,
		.cbr-nol-catalog__filter-label,
		.cbr-nol-catalog__sort-label,
		.cbr-nol-catalog__page-btn,
		.cbr-nol-product__badge,
		.cbr-evt-card__date,
		.cbr-cart-widget__count,
		.cbr-cart-panel__price-unit,
		.cbr-con-inline-link,
		small,
		.cbr-caption
	) {
		font-size: var(--cbr-text-min);
	}

	/* iOS Safari zooms focused inputs below 16px */
	html {
		-webkit-text-size-adjust: 100%;
		text-size-adjust: 100%;
		touch-action: manipulation;
	}

	body.cbr-theme {
		touch-action: manipulation;
	}

	body.cbr-theme :is(
		input,
		select,
		textarea,
		.cbr-form__input,
		.cbr-form__textarea,
		.cbr-form__select,
		.cbr-cart-panel__qty-input,
		.cbr-staff-select__qty-input,
		#cbr-cart-qty-input
	) {
		font-size: 16px !important;
	}
}
