/* Matjari option: the `bar` filter mode (4.10.2). Every selector starts with .filter--bar (O1),
   and the file is sent only to a page that draws it (docs/DESIGN-SYSTEM.md 5.4).

   The filters in sight, and the grid as wide as the page: from 900 the groups
   are a band of named buttons above the products, each opening as a panel
   under it.
   Who picks it: fashion, and any catalogue browsed four and five across.
   Under 900 the same groups are the sheet's, so nothing here reaches a phone.

   Every group is a <details>: without a script each button opens and closes
   its own panel, which is the whole behaviour. ui.js keeps one open at a
   time, closes it on a click outside it and on Escape, and hands the focus
   back to its button (4.10.2). */
@media (min-width: 900px) {
	/* One band across the page, between two hairlines: the groups in its
	   first cell, the toolbar (the count and the sort) in its second. The
	   main column is display: contents, so the toolbar is that second cell
	   and everything after it spans the row; below the floor of display:
	   contents the toolbar is simply the next row. The band is what makes the
	   bar a choice she can see at rest (the review's P2-R3): the sheet has
	   one quiet button where the bar names every filter and what of it is on. */
	.filter--bar .m-shop__body--filter { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
	.filter--bar .m-shop__main { display: contents; }
	.filter--bar .m-shop__main > * { grid-column: 1 / -1; }
	.filter--bar .m-shop__main > .m-toolbar, .filter--bar .m-filtersheet { grid-row: 1; margin-block-end: var(--m-sp-5); border-block: var(--m-bw-hair) solid var(--m-c-line); }
	.filter--bar .m-shop__main > .m-toolbar { grid-column: 2; padding-inline-start: var(--m-sp-5); }

	/* The aside is the band itself: no surface (the sheet's is not the
	   page's ground under every Look), no other edge, no shadow, never a
	   sheet. */
	.filter--bar .m-filtersheet {
		position: static;
		grid-column: 1;
		inline-size: auto;
		border-inline: 0;
		border-radius: 0;
		background-color: transparent;
		box-shadow: none;
		transform: none;
		visibility: visible;
	}
	.filter--bar .m-filtersheet__head, .filter--bar .m-filtersheet__foot, .filter--bar .m-toolbar__filter, .filter--bar .is-on[open] .m-filtersheet__title::after { display: none; }
	.filter--bar .m-filtersheet__body { display: flex; flex-wrap: wrap; gap: 0 var(--m-sp-1); padding: var(--m-sp-1) 0; overflow: visible; }
	.filter--bar .m-filter { display: contents; }
	.filter--bar .m-filtersheet__group { position: relative; padding: 0; border: 0; }

	/* A group's button: its name at the size of the page's words, a chevron,
	   and what of it is in force as an ink capsule (the same "this one" as a
	   chosen value). The open one is underlined in the ink at the strong
	   weight, so open and in force never look alike. The capsule stays when
	   the group opens, so the sheet's dot for an open group in force is not
	   drawn (hidden with the head, above): one mark for one state. */
	.filter--bar .m-filtersheet__sum {
		padding-inline: var(--m-sp-3);
		background-image: linear-gradient(var(--m-c-ink), var(--m-c-ink));
		background-position: bottom;
		background-repeat: no-repeat;
		background-size: 0 var(--m-bw-strong);
	}
	.filter--bar .m-filtersheet__group[open] > .m-filtersheet__sum { background-size: 100% var(--m-bw-strong); }
	.filter--bar .m-filtersheet__val { display: block; max-inline-size: 140px; padding: calc(var(--m-sp-1) / 2) var(--m-sp-2); border-radius: var(--m-r-badge); background-color: var(--m-inverse); color: var(--m-on-inverse); }
	/* The chevron: the sheet's two bars, leaned into a V (each turned by
	   --m-dir, so it is the same V in both directions); it turns over while
	   its panel is open. */
	.filter--bar .m-filtersheet__mark { transition: transform var(--m-dur-panel) var(--m-ease); }
	.filter--bar .m-filtersheet__mark::before { inline-size: 10px; margin-inline: 0 auto; transform: rotate(calc(45deg * var(--m-dir))); }
	.filter--bar .m-filtersheet__mark::after, .filter--bar .m-filtersheet__group[open] .m-filtersheet__mark::after { inline-size: 10px; margin-inline: auto 0; transform: rotate(calc(-45deg * var(--m-dir))); }
	.filter--bar [open] .m-filtersheet__mark { transform: rotate(180deg); }

	/* The panel: under its button, on the panel surface with the overlay's
	   edge and its own elevation, above the grid. The edge is never thinner
	   than a hairline (declared twice, section 7): a Look whose surface is its
	   ground and whose elevation is flat (yasmin) still draws the panel.
	   Long value lists scroll inside it. A form group shows the form's own
	   button under its fields; a value is a link and needs none. */
	.filter--bar .m-filtersheet__panel {
		position: absolute; inset-block-start: calc(100% + var(--m-sp-2)); inset-inline-start: 0; z-index: var(--m-z-popover);
		inline-size: 300px; max-block-size: 60vh; padding: var(--m-sp-4); overflow-y: auto;
		border: var(--m-bw-hair) solid var(--m-overlay-edge);
		border: max(var(--m-overlay-bw), var(--m-bw-hair)) solid var(--m-overlay-edge);
		border-radius: var(--m-r-card); background-color: var(--m-surface-1); box-shadow: var(--m-elev-2);
	}
	.filter--bar .m-filter__apply { display: block; padding-block-start: var(--m-sp-3); }
}
/* Its underline is drawn from 900 only, so under 900 this changes nothing. */
@media (hover: hover) and (pointer: fine) {
	.filter--bar .m-filtersheet__sum:hover { background-size: 100% var(--m-bw-hair); }
}
