/* Magezon_Editor — storefront compatibility with Magento's own widget markup.
 *
 * Linked from view/frontend/layout/mgz_editor_storefront.xml (the renderer tier,
 * only on pages with editor content). A rule here must name a HOST
 * selector (Luma's, not ours) and be right on Magento only — anything correct
 * in every environment belongs in ReactAPP's source instead
 * (css-override-contract § "Where a platform fix lives").
 *
 * `@magezon/block-library` ships `.mgz-profile * { box-sizing: border-box }`,
 * and `.mgz-profile` wraps whatever a block renders — including a Magento
 * product widget whose swatches Luma sizes under `content-box`. Under the reset
 * they shrink and clip. Page Builder 1 shipped the same counterweight for the
 * same reason (`.mgz-element .swatch-option { box-sizing: content-box }`);
 * until 2026-09-27 Page Builder 2 had it only inside the Menu Builder's own
 * stylesheet, so a converted page carrying the widget did not get it.
 * [0,2,0] beats the reset's [0,1,0] without `!important`. */
.mgz-profile .swatch-option {
	box-sizing: content-box;
}

/* The Search Form block renders Luma's own `top.search`. On a phone Luma hides
 * the input at `left: -300%` of its `.control` and shows it when the magnifier
 * is tapped — off-screen only while `.control` is as wide as Luma's header. In a
 * builder column it is a fraction of that: a 2/12 header column put the input at
 * -117px, half on screen under the icon (measured 2026-11-07, lane3-smoke, 375px).
 *
 * Page Builder 1 made the block static so `.control` spanned the ROW as a bar
 * (`module-builder`, `.mgz-element-search_form`). V2 cannot borrow the row: the
 * column is the containing block for its dividers and background layers
 * (block-library `Column/style.css`). So the bar spans the viewport instead —
 * `fixed` with `top: auto` stays at its in-flow height under the magnifier, and
 * `-300%` of a viewport-wide box is off-screen at any width. The look applies
 * only while Luma marks the form `.active`, so the closed bar paints nothing.
 * Luma floats the magnifier right, and a fixed box ignores `clear`, so the bar
 * would open OVER the icon that closes it; the label leaves the float and keeps
 * its place with an auto margin, and the bar's in-flow height is under it. */
@media only screen and (max-width: 767px) {
	.mgz-block-search-form .block-search .label {
		float: none;
		margin-inline-start: auto;
		width: fit-content;
	}

	.mgz-block-search-form .block-search .control {
		border: 0;
		left: 0;
		margin: 0;
		padding: 0;
		position: fixed;
		right: 0;
		top: auto;
		z-index: 4;
	}

	.mgz-block-search-form .block-search .form.active .control {
		background: #fff;
		box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
		padding: 10px 15px;
	}

	.mgz-block-search-form .block-search .form.active .control input {
		position: static;
	}
}
