/* Swatch names ABOVE their photos (1.105.1, David 3 Dec 2026: "Can it be above the photo? It
 * currently looks like the names are on the wrong fabrics").
 *
 * A picture swatch's label is the choice's own "<img><br>Name". In a grid with no row gap the
 * name sat ~22px under its photo but ~14px over the next row's photo, so it read as that one's.
 * Here the label becomes a column with the photo last (order:1; the name is the label's bare
 * text, so it cannot be given an order of its own) and the <br> is hidden: name, small gap,
 * photo, then room before the next row's name. The markup, the choice values and the labels'
 * text are untouched (the webapp import, the cart's sample chips, the photo gallery and the
 * visualizer read them). Only labels that hold a picture match; a browser without :has keeps
 * the old layout, badges included. */
.gform_wrapper .gfield .gchoice > label:has(> img) {
	display: inline-flex;
	flex-direction: column;
	align-items: flex-start;
	margin-bottom: 16px;
	text-align: left;
	line-height: 1.25;
	overflow-wrap: anywhere;
}
.gform_wrapper .gfield .gchoice > label:has(> img) > img {
	order: 1;
	flex: none;
	display: block;
	/* The gap under the name. Not the flex gap: the lazy-load <noscript> beside the photo is a
	 * box of its own on the sample pages (no height, but a gap would go round it). */
	margin: 4px 0 0;
}
.gform_wrapper .gfield .gchoice > label:has(> img) > br {
	display: none;
}
/* A name that wraps ("Coal (Matt Black)" on a phone) would push its photo below the others in
 * the row: the choices sit on the row's bottom, so the photos line up and the names hang above.
 * The grid (desktop) and the theme's phone flex rows take align-items; the old markup's
 * inline-block rows (vertical and free-sample pages on a desktop) take vertical-align. */
.gform_wrapper .gfield .gfield_radio:has(> .gchoice > label > img),
.gform_wrapper .gfield .gfield_checkbox:has(> .gchoice > label > img) {
	align-items: flex-end;
}
.gform_wrapper .gfield ul.gfield_radio:has(> .gchoice > label > img) > li.gchoice,
.gform_wrapper .gfield ul.gfield_checkbox:has(> .gchoice > label > img) > li.gchoice {
	vertical-align: bottom;
}
/* The ETA / NEW / Popular badges (assets/fabric-eta.js) sit on the photo's top corner, which is
 * now under the name: they move to the photo's bottom corner. The photo is the label's last
 * box, so the label's bottom is the photo's. Which badge shows is fabric-eta.js's rule. */
.gform_wrapper .gfield .gchoice > label:has(> img) > .tlb-fabric-eta--photo,
.gform_wrapper .gfield .gchoice > label:has(> img) > .tlb-fabric-pop--photo,
.gform_wrapper .gfield .gchoice > label:has(> img) > .tlb-fabric-new--photo {
	top: auto;
	bottom: 5px;
	margin: 0;   /* the sample pages' theme gives a label's spans a bottom margin */
}
