/**
 * PLP-GRID — Flat-Lay view toggle.
 *
 * Figma: "Body Filter" (268:4513) / "Flat-Lay Filter" (268:4530). Inspected
 * the actual rectangle nodes directly (get_design_context with forceCode on
 * I268:4513;3828:2123/2124), since the audit couldn't read these values from
 * the composed instance alone:
 *   - Outer pill (Rectangle 85): 37x20, border 1px solid Ink, radius 5px.
 *   - Active half fill (Rectangle 86/88): solid Ink background, radius 5px.
 *   - Active-state icon stroke: Paper (light-on-dark, for contrast on the
 *     Ink fill) — confirmed from the exported SVG paths, not assumed.
 *   - Inactive icon stroke: Taupe, on the plain (unfilled) half.
 * Corrected from the previous pass, which had the border as Sand, the
 * active fill as Stone, the active icon as Ink, and a 10px pill radius —
 * none of which matched the actual component.
 *
 * Tokens only — Ink var(--ink_text) · Paper var(--bg_clr1) · Taupe var(--h_clr).
 */

/* Figma places this pill immediately left of the Row/Portrait icons, both
   far right of the toolbar (Body Filter 268:4513 at x=1241, Stack Row/Stack
   at x=1322) — not on the left next to FILTER. Printed after the columns-
   switcher (see plp-flatlay.php) so, with both float:right, it lands to the
   switcher's left as Figma shows. */


@media (max-width: 767px)
{
	.woocommerce-archive .vataly-flatlay-toggle{
	display: flex;
	align-items: stretch;
	width: 32px !important; /* Figma: Rectangle 85, exact */
	height: 17px !important;
	margin: -1px 38px 0 0 !important; /* Figma gap: 1322 - (1241 + 37) = 44px; -1px centres the 20px pill on the FILTER line */
	border: 1px solid var(--ink_text);
	border-radius: 5px;
	overflow: hidden;
	float: right;
	}
}



.woocommerce-archive .vataly-flatlay-toggle {
	display: flex;
	align-items: stretch;
	width: 37px; /* Figma: Rectangle 85, exact */
	height: 20px;
	margin: -1px 44px 0 0; /* Figma gap: 1322 - (1241 + 37) = 44px; -1px centres the 20px pill on the FILTER line */
	border: 1px solid var(--ink_text);
	border-radius: 5px;
	overflow: hidden;
	float: right;
}

.vataly-flatlay-toggle__half {
	display: inline-flex;
	flex: 1 1 0;
	align-items: center;
	justify-content: center;
	/* The halves are <button>s now (client-side toggle): strip the theme's
	   button chrome so they render exactly as the former links. */
	min-width: 0;
	height: auto;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
	box-shadow: none;
	color: var(--h_clr); /* inactive = Taupe icon, no fill */
	text-decoration: none;
	line-height: 1;
	cursor: pointer;
}

.vataly-flatlay-toggle__half.active {
	color: var(--bg_clr1); /* Paper icon, for contrast on the Ink fill */
	background-color: var(--ink_text);
}

.vataly-flatlay-toggle__half svg {
	display: block;
}

