/*
 * MBS neutral design tokens.
 *
 * Elementor global colors remain the first authority. Browser/system colors are
 * only neutral fallbacks for contexts that need an opaque surface before a
 * widget-specific Elementor control overrides it. No MBS brand palette lives
 * in the frontend foundation.
 */
:where([class*="elementor-widget-mbs-"], [class*="elementor-widget-mbs-"]) {
	--mbs-color-text: var(--e-global-color-text, CanvasText);
	--mbs-color-primary: var(--e-global-color-primary, CanvasText);
	--mbs-color-secondary: var(--e-global-color-secondary, GrayText);
	--mbs-color-accent: var(--e-global-color-accent, Highlight);
	--mbs-color-surface: Canvas;
	--mbs-color-surface-muted: color-mix(in srgb, CanvasText 5%, Canvas);
	--mbs-color-border: color-mix(in srgb, CanvasText 18%, transparent);
	--mbs-color-border-strong: color-mix(in srgb, CanvasText 32%, transparent);
	--mbs-color-muted: GrayText;
	--mbs-color-overlay: color-mix(in srgb, CanvasText 48%, transparent);
	--mbs-color-focus: color-mix(in srgb, var(--mbs-color-accent) 38%, transparent);
	--mbs-color-placeholder: color-mix(in srgb, CanvasText 10%, Canvas);
	--mbs-color-success: var(--mbs-color-accent);
	--mbs-color-danger: var(--mbs-color-text);
	--mbs-color-warning: var(--mbs-color-secondary);
	font-family: inherit;
}

:where([class*="elementor-widget-mbs-"], [class*="elementor-widget-mbs-"]) :is(button, input, select, textarea) {
	font: inherit;
}

/*
 * Neutral visual baseline.
 *
 * Elementor Theme Style is a fallback layer when a widget does not define a
 * value. MBS therefore neutralizes only the visual properties that must never
 * leak in implicitly. The selector is intentionally class-specific enough to
 * beat Theme Style, while generated {{WRAPPER}} control CSS is loaded later
 * and can override it when the user explicitly sets a value.
 */
.elementor-element.elementor-widget:is([class*="elementor-widget-mbs-"], [class*="elementor-widget-mbs-"]),
.elementor-element.elementor-widget:is([class*="elementor-widget-mbs-"], [class*="elementor-widget-mbs-"]) *,
.elementor-element.elementor-widget:is([class*="elementor-widget-mbs-"], [class*="elementor-widget-mbs-"]) *::before,
.elementor-element.elementor-widget:is([class*="elementor-widget-mbs-"], [class*="elementor-widget-mbs-"]) *::after {
	box-shadow: none;
}

/*
 * Button-like surfaces start transparent and square. Regular content links are
 * deliberately excluded. MBS Button (.mbs-action) owns its own explicit
 * None / Classic / Gradient / Inherit background policy in core.css.
 */
.elementor-element.elementor-widget:is([class*="elementor-widget-mbs-"], [class*="elementor-widget-mbs-"]) :where(
	button,
	[role="button"],
	input[type="button"],
	input[type="submit"],
	input[type="reset"],
	.elementor-button:not(.mbs-action),
	.button:not(.mbs-action),
	.mbs-account,
	.mbs-social__link,
	.mbs-search__all,
	.mbs-cart,
	.mbs-cart-drawer__action,
	.mbs-carousel__view-all,
	.mbs-product-categories__view-all,
	.mbs-product-card__button,
	.mbs-products__view-all-button,
	.mbs-post-card__button,
	.mbs-archive-header__category,
	.mbs-search__result,
	.mbs-menu__drawer-social-link,
	.mbs-review-distribution__row,
	.mbs-review-distribution__clear,
	.mbs-product-whatsapp,
	.mbs-review-control,
	.mbs-review-write-button,
	.mbs-ps-download-button,
	.mbs-ps-action-button,
	.mbs-product-cta__button,
	.page-numbers
) {
	background-color: transparent;
	background-image: none;
	border-radius: 0;
}

.elementor-element.elementor-widget:is([class*="elementor-widget-mbs-"], [class*="elementor-widget-mbs-"]) :where(
	button,
	input[type="button"],
	input[type="submit"],
	input[type="reset"]
) {
	-webkit-appearance: none;
	appearance: none;
}

/* Textual form controls must not inherit Theme/Kit corner rounding. Their
 * component owner may still define background/border and Elementor generated
 * control CSS can intentionally override this zero-radius baseline. */
.elementor-element.elementor-widget:is([class*="elementor-widget-mbs-"], [class*="elementor-widget-mbs-"]) :where(
	input:not([type="button"]):not([type="submit"]):not([type="reset"]):not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]):not([type="hidden"]),
	select,
	textarea
) {
	border-radius: 0;
}

/*
 * MBS Elementor Toolkit shared visual foundation.
 *
 * Purpose:
 * - keep Elementor icon controls predictable across font icons and SVG icons;
 * - make icon size controls resize the artwork, not the surrounding button box;
 * - make parent Text/Icon color controls reach the rendered icon artwork;
 * - keep the contract shared instead of re-implementing it widget by widget.
 */

:where(
	.mbs-icon-host,
	.mbs-action__icon,
	.mbs-account__icon,
	.mbs-cart__icon,
	.mbs-search__icon,
	.mbs-menu__toggle-icon,
	.mbs-menu__close-icon,
	.mbs-cart-drawer__close-icon,
	.mbs-contact-list__icon,
	.mbs-social__link,
	.mbs-ticker__icon,
	.mbs-menu__drawer-search-icon,
	.mbs-menu__drawer-social-link,
	.mbs-product-whatsapp__icon,
	.mbs-atc-icon,
	.mbs-product-card__button-icon,
	.mbs-breadcrumbs__icon,
	.mbs-breadcrumbs__separator,
	.mbs-product-trust__icon,
	.mbs-product-cta__icon,
	.mbs-product-cta__button-icon,
	.mbs-product-note__icon,
	.mbs-product-info-card__icon,
	.mbs-product-highlight__icon,
	.mbs-whatsapp__launcher-icon,
	.mbs-whatsapp__question-icon,
	.mbs-whatsapp__send-icon
) {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	line-height: 1;
	color: inherit;
}

/* Icon/text spacing contract: the parent owns column-gap; the icon artwork owns size;
 * parent padding owns the outer interior. Theme/font-library margins must not leak into the gap. */
:where(
	.mbs-action__icon,
	.mbs-account__icon,
	.mbs-cart__icon,
	.mbs-search__icon,
	.mbs-menu__toggle-icon,
	.mbs-menu__close-icon,
	.mbs-cart-drawer__close-icon,
	.mbs-contact-list__icon,
	.mbs-ticker__icon,
	.mbs-menu__drawer-search-icon,
	.mbs-product-whatsapp__icon,
	.mbs-atc-icon,
	.mbs-product-card__button-icon,
	.mbs-breadcrumbs__icon,
	.mbs-breadcrumbs__separator,
	.mbs-product-trust__icon,
	.mbs-product-cta__icon,
	.mbs-product-cta__button-icon,
	.mbs-product-note__icon,
	.mbs-product-info-card__icon,
	.mbs-product-highlight__icon,
	.mbs-whatsapp__launcher-icon,
	.mbs-whatsapp__question-icon,
	.mbs-whatsapp__send-icon
) {
	flex: 0 0 auto;
	margin: 0;
	padding: 0;
	box-sizing: border-box;
}

:where(
	.mbs-action__icon,
	.mbs-account__icon,
	.mbs-cart__icon,
	.mbs-search__icon,
	.mbs-menu__toggle-icon,
	.mbs-menu__close-icon,
	.mbs-cart-drawer__close-icon,
	.mbs-contact-list__icon,
	.mbs-ticker__icon,
	.mbs-menu__drawer-search-icon,
	.mbs-product-whatsapp__icon,
	.mbs-atc-icon,
	.mbs-product-card__button-icon,
	.mbs-breadcrumbs__icon,
	.mbs-breadcrumbs__separator,
	.mbs-product-trust__icon,
	.mbs-product-cta__icon,
	.mbs-product-cta__button-icon,
	.mbs-product-note__icon,
	.mbs-product-info-card__icon,
	.mbs-product-highlight__icon,
	.mbs-whatsapp__launcher-icon,
	.mbs-whatsapp__question-icon,
	.mbs-whatsapp__send-icon
) > :is(i, svg, img) {
	margin: 0;
	padding: 0;
}

/*
 * Elementor Icons_Manager can output font-icon <i> markup or SVG markup.
 * Uploaded SVG icons also come through the SVG path.  Image markup is
 * supported for sizing as a defensive fallback, although raster images do
 * not support arbitrary CSS recoloring.
 */
:where(
	.mbs-icon-host,
	.mbs-action__icon,
	.mbs-account__icon,
	.mbs-cart__icon,
	.mbs-search__icon,
	.mbs-menu__toggle-icon,
	.mbs-menu__close-icon,
	.mbs-cart-drawer__close-icon,
	.mbs-contact-list__icon,
	.mbs-social__link,
	.mbs-ticker__icon,
	.mbs-menu__drawer-search-icon,
	.mbs-menu__drawer-social-link,
	.mbs-product-whatsapp__icon,
	.mbs-atc-icon,
	.mbs-product-card__button-icon,
	.mbs-breadcrumbs__icon,
	.mbs-breadcrumbs__separator,
	.mbs-product-trust__icon,
	.mbs-product-cta__icon,
	.mbs-product-cta__button-icon,
	.mbs-product-note__icon,
	.mbs-product-info-card__icon,
	.mbs-product-highlight__icon,
	.mbs-whatsapp__launcher-icon,
	.mbs-whatsapp__question-icon,
	.mbs-whatsapp__send-icon
) > :is(i, svg, img) {
	display: block;
	flex: 0 0 auto;
	width: var(--mbs-icon-size, 1em);
	height: var(--mbs-icon-size, 1em);
	max-width: none;
	max-height: none;
	font-size: var(--mbs-icon-size, 1em);
	line-height: 1;
	color: inherit;
	object-fit: contain;
}

/* Preserve stroke-only SVGs while making normal monochrome SVGs obey color controls. */
:where(
	.mbs-icon-host,
	.mbs-action__icon,
	.mbs-account__icon,
	.mbs-cart__icon,
	.mbs-search__icon,
	.mbs-menu__toggle-icon,
	.mbs-menu__close-icon,
	.mbs-cart-drawer__close-icon,
	.mbs-contact-list__icon,
	.mbs-social__link,
	.mbs-ticker__icon,
	.mbs-menu__drawer-search-icon,
	.mbs-menu__drawer-social-link,
	.mbs-product-whatsapp__icon,
	.mbs-atc-icon,
	.mbs-product-card__button-icon,
	.mbs-breadcrumbs__icon,
	.mbs-breadcrumbs__separator,
	.mbs-product-trust__icon,
	.mbs-product-cta__icon,
	.mbs-product-cta__button-icon,
	.mbs-product-note__icon,
	.mbs-product-info-card__icon,
	.mbs-product-highlight__icon,
	.mbs-whatsapp__launcher-icon,
	.mbs-whatsapp__question-icon,
	.mbs-whatsapp__send-icon
) > svg:not([fill="none"]) {
	fill: currentColor;
}

:where(
	.mbs-icon-host,
	.mbs-action__icon,
	.mbs-account__icon,
	.mbs-cart__icon,
	.mbs-search__icon,
	.mbs-menu__toggle-icon,
	.mbs-menu__close-icon,
	.mbs-cart-drawer__close-icon,
	.mbs-contact-list__icon,
	.mbs-social__link,
	.mbs-ticker__icon,
	.mbs-menu__drawer-search-icon,
	.mbs-menu__drawer-social-link,
	.mbs-product-whatsapp__icon,
	.mbs-atc-icon,
	.mbs-product-card__button-icon,
	.mbs-breadcrumbs__icon,
	.mbs-breadcrumbs__separator,
	.mbs-product-trust__icon,
	.mbs-product-cta__icon,
	.mbs-product-cta__button-icon,
	.mbs-product-note__icon,
	.mbs-product-info-card__icon,
	.mbs-product-highlight__icon,
	.mbs-whatsapp__launcher-icon,
	.mbs-whatsapp__question-icon,
	.mbs-whatsapp__send-icon
) svg [fill]:not([fill="none"]) {
	fill: currentColor;
}

:where(
	.mbs-icon-host,
	.mbs-action__icon,
	.mbs-account__icon,
	.mbs-cart__icon,
	.mbs-search__icon,
	.mbs-menu__toggle-icon,
	.mbs-menu__close-icon,
	.mbs-cart-drawer__close-icon,
	.mbs-contact-list__icon,
	.mbs-social__link,
	.mbs-ticker__icon,
	.mbs-menu__drawer-search-icon,
	.mbs-menu__drawer-social-link,
	.mbs-product-whatsapp__icon,
	.mbs-atc-icon,
	.mbs-product-card__button-icon,
	.mbs-breadcrumbs__icon,
	.mbs-breadcrumbs__separator,
	.mbs-product-trust__icon,
	.mbs-product-cta__icon,
	.mbs-product-cta__button-icon,
	.mbs-product-note__icon,
	.mbs-product-info-card__icon,
	.mbs-product-highlight__icon,
	.mbs-whatsapp__launcher-icon,
	.mbs-whatsapp__question-icon,
	.mbs-whatsapp__send-icon
) svg [stroke]:not([stroke="none"]) {
	stroke: currentColor;
}

/* Parent Text/Icon color controls must also color nested icon/text markup. */
:where(
	.mbs-action,
	.mbs-account,
	.mbs-cart,
	.mbs-cart__button,
	.mbs-search__toggle,
	.mbs-search__submit,
	.mbs-menu__toggle,
	.mbs-menu__close,
	.mbs-cart-drawer__close,
	.mbs-contact-list__item,
	.mbs-social__link,
	.mbs-ticker__item,
	.mbs-product-whatsapp,
	.mbs-product-card__button,
	.mbs-product-cta__button,
	.mbs-whatsapp__launcher,
	.mbs-whatsapp__question,
	.mbs-whatsapp__send
) > :where(span, i, svg) {
	color: inherit;
}

/* Archive Toolbar uses intentionally hand-built SVGs rather than Icons_Manager. */
.mbs-archive-toolbar__view svg {
	width: var(--mbs-icon-size, 20px);
	height: var(--mbs-icon-size, 20px);
	max-width: none;
	max-height: none;
	color: inherit;
	fill: currentColor;
	pointer-events: none;
}
