/* 0.9.37: shower-screen landing and configure finish gallery. 0.9.38: fitting parts, range note. 0.9.40: photo thumbnails, part finish pictures, Art design tiles. 0.9.41: sturdier thumbnails, design tile intro line. 0.9.42: four shape tiles (2 x 2) with line icons. */

/* Force a balanced two-line wrap on small screens; stay on one line on desktop. */
.mg-break .mg-br { display: inline; }
@media (max-width: 699px) {
	.mg-break .mg-br { display: block; }
}

/* ---- Landing tiles (category archive) ---- */
.mg-shower { margin: 0; }
.mg-shower__tiles {
	list-style: none;
	margin: 0 0 clamp(2rem, 4vw, 3rem);
	padding: 0;
	display: grid;
	gap: clamp(.75rem, 1.6vw, 1.25rem);
	grid-template-columns: 1fr;
}
@media (min-width: 700px) {
	.mg-shower__tiles { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 900px) {
	.mg-shower__tiles { grid-template-columns: repeat(6, 1fr); }
	.mg-shower__tile { grid-column: span 2; }
	.mg-shower__tile:nth-child(4) { grid-column: 2 / span 2; }
	.mg-shower__tile:nth-child(5) { grid-column: 4 / span 2; }
}
.mg-shower__tile a {
	position: relative;
	display: block;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background: #cfcac3;
	color: #fff;
	text-decoration: none;
}
.mg-shower__tile img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .4s ease;
}
.mg-shower__tile a::after {
	content: "";
	position: absolute;
	inset: 0;
	background: rgba(0,0,0,.32);
	transition: background-color .3s ease;
}
.mg-shower__label {
	position: absolute;
	inset: 0;
	z-index: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 1rem 1.25rem;
	font-size: clamp(1.05rem, .95rem + .45vw, 1.375rem);
	font-weight: 500;
	letter-spacing: .02em;
	text-shadow: 0 1px 8px rgba(0,0,0,.4);
	line-height: 1.25;
}
.mg-shower__tile a:hover img,
.mg-shower__tile a:focus-visible img { transform: scale(1.03); }
.mg-shower__tile a:hover::after,
.mg-shower__tile a:focus-visible::after { background: rgba(0,0,0,.42); }
.mg-shower__tile a:focus-visible { outline: 2px solid var(--wp--preset--color--contrast, #121212); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
	.mg-shower__tile img, .mg-shower__tile a::after { transition: none; }
}

/* Guidance / request block */
.mg-shower-guide { margin: 0; max-width: 46rem; }
.mg-shower-guide__request { margin: 0 0 .75rem; font-size: var(--wp--preset--font-size--small, .9375rem); }
.mg-shower-guide__glass { margin: 0 0 .75rem; font-size: var(--wp--preset--font-size--small, .9375rem); }
.mg-cfg--shower .mg-cfg__help.mg-break .mg-br { display: block; }
.mg-cfg--shower .mg-cfg__help .mg-nowrap { white-space: nowrap; }
.mg-shower-guide__supply { margin: 0 0 1rem; font-size: var(--wp--preset--font-size--small, .9375rem); color: var(--wp--preset--color--muted, #4a473f); }
.mg-shower-guide__links { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .35rem 1.25rem; }
.mg-shower-guide__links a { font-size: var(--wp--preset--font-size--small, .9375rem); }

/* Range switcher on configure */
.mg-shower-nav { display: flex; flex-wrap: wrap; align-items: baseline; gap: .75rem 1.25rem; margin: 0 0 1.25rem; }
.mg-shower-nav__all { font-size: var(--wp--preset--font-size--small, .9375rem); }
.mg-shower-nav__list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .35rem .9rem; }
.mg-shower-nav__list a { font-size: var(--wp--preset--font-size--small, .9375rem); }
.mg-shower-nav__list a[aria-current="page"] { color: inherit; text-decoration: none; font-weight: 500; }

/* ---- Finish gallery on the shower configure page ---- */
.mg-cfg--shower .mg-cfg__gallery {
	display: grid;
	gap: .75rem;
	margin: 0 0 1.25rem;
}
.mg-cfg__master {
	margin: 0;
	background: #f3f2ee;
	aspect-ratio: 4 / 3;
	overflow: hidden;
}
.mg-cfg__master img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.mg-cfg__thumbs {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(4.5rem, 1fr));
	gap: .5rem;
}
.mg-cfg__thumb {
	display: block;
	margin: 0;
	padding: 0;
	border: 1px solid #b9b4ab;
	background: #fff;
	cursor: pointer;
	aspect-ratio: 1 / 1;
	overflow: hidden;
}
.mg-cfg__thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* 0.9.40: thumbnails are the real photos with a one-word label under each, so finishes can be told apart. */
.mg-cfg__thumbs { grid-template-columns: repeat(auto-fill, minmax(5.25rem, 1fr)); }
.mg-cfg__thumb { aspect-ratio: auto; display: flex; flex-direction: column; text-align: center; color: inherit; font: inherit; }
.mg-cfg__thumbimg { display: block; aspect-ratio: 1 / 1; overflow: hidden; background: #f3f2ee; }
.mg-cfg__thumblabel { display: block; padding: .3rem .25rem .35rem; font-size: .8125rem; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mg-cfg__thumb.is-active .mg-cfg__thumblabel { font-weight: 500; }
/* Dan's photos are portrait and the renders landscape: a square master frame suits both. */
.mg-cfg--shower .mg-cfg__master { aspect-ratio: 1 / 1; }
@media (max-width: 959px) {
	.mg-cfg__thumbs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
/*
 * 0.9.41: thumbnails no longer rely on a percentage height inside an aspect-ratio box (WebKit can
 * resolve that to 0, leaving an empty white tile), and grid items may shrink (min-width: 0).
 * The image carries its own square ratio, so the tile can never collapse. Images load eagerly:
 * they sit right under the main picture and are small.
 */
.mg-cfg__thumbs > li { min-width: 0; }
.mg-cfg__thumb { width: 100%; min-width: 0; }
.mg-cfg__thumbimg { width: 100%; }
.mg-cfg__thumb .mg-cfg__thumbimg img { width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; }
/* Art design renders show a whole room; zoom the thumbnail so the grid itself fills the tile. */
.mg-cfg--shower .mg-cfg__thumbs--zoom .mg-cfg__thumbimg img { transform: scale(1.45); transform-origin: 50% 45%; }
.mg-cfg__thumb.is-active { border-color: #121212; box-shadow: inset 0 0 0 1px #121212; }
.mg-cfg__thumb:focus-visible { outline: 2px solid #121212; outline-offset: 2px; }

@media (min-width: 960px) {
	.mg-cfg--shower .mg-cfg__form {
		grid-template-columns: minmax(16rem, 28%) minmax(0, 1fr) 360px;
	}
	.mg-cfg--shower .mg-cfg__gallery { grid-column: 1; grid-row: 1; margin: 0; position: sticky; top: 6.5rem; align-self: start; }
	.mg-cfg--shower .mg-cfg__fields { grid-column: 2; grid-row: 1; }
	.mg-cfg--shower .mg-cfg__summary { grid-column: 3; grid-row: 1; }
}

.mg-cfg--shower .mg-cfg__step--hide { display: none; }
.mg-cfg--shower .mg-cfg__searchwrap { display: none; }
.mg-cfg--shower .mg-cfg__selectlabel { margin-top: 0; }

/* On the shower category, the shop sidebar is gone with the product collection. */
.tax-product_cat-shower-glass .mg-shop { padding-top: var(--wp--preset--spacing--40); }

/* ---- 0.9.38: range note (Art design proof line) ---- */
.mg-cfg__rangenote { margin: .5rem 0 0; font-size: var(--wp--preset--font-size--small, .9375rem); color: var(--wp--preset--color--muted, #4a473f); }

/* ---- 0.9.38: delivery quote hint under dimensions ---- */
.mg-cfg .mg-nowrap { white-space: nowrap; }
.mg-cfg__delnote:empty { display: none; }

/* ---- 0.9.38: fitting parts ---- */
.mg-cfg__parts .mg-part { border: 1px solid #d9d5ce; background: #fff; margin: 0 0 .5rem; }
.mg-cfg__parts .mg-part.is-on { border-color: #121212; }
.mg-cfg .mg-part__head { display: flex; align-items: center; gap: .65rem; padding: .8rem .9rem; margin: 0; cursor: pointer; font-weight: 400; }
.mg-cfg .mg-part__head input { margin: 0; flex: none; width: 20px; height: 20px; accent-color: #121212; }
.mg-part__name { flex: 1 1 auto; font-weight: 500; }
.mg-part__price { flex: none; font-variant-numeric: tabular-nums; }
.mg-part__body { padding: 0 .9rem .9rem; }
.mg-part__body[hidden] { display: none; }
.mg-part__imgs { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin: 0 0 .75rem; }
.mg-part__fig { margin: 0; background: #fff; border: 1px solid #ece9e3; display: flex; flex-direction: column; }
.mg-part__fig img { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: contain; background: #fff; }
.mg-part__fig figcaption { font-size: .8125rem; color: var(--wp--preset--color--muted, #4a473f); padding: .3rem .5rem .4rem; text-align: center; white-space: nowrap; }
.mg-part__finishes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .4rem; margin: 0 0 .75rem; }
.mg-cfg .mg-part__finish { position: relative; display: block; margin: 0; cursor: pointer; font-weight: 400; }
.mg-part__finish input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.mg-part__finish span { display: block; text-align: center; padding: .45rem .4rem; border: 1px solid #b9b4ab; font-size: .875rem; white-space: nowrap; background: #fff; }
.mg-part__finish input:checked + span { border-color: #121212; box-shadow: inset 0 0 0 1px #121212; font-weight: 500; }
.mg-part__finish input:focus-visible + span { outline: 2px solid #121212; outline-offset: 2px; }
.mg-part__qty { margin: 0; }
.mg-cfg .mg-part__qty label { margin: 0; }

/* ---- 0.9.40: Dan's review ---- */
/* Part finish chips show Dan's finish picture above the name. */
.mg-part__finish span { display: flex; flex-direction: column; align-items: center; gap: .25rem; }
.mg-part__chipimg { display: block; width: 100%; max-width: 4rem; aspect-ratio: 1 / 1; object-fit: contain; background: #fff; }
/* Shape tile on showers: Dan's sentence always breaks after "corners," (even two lines); price on its own line. */
.mg-cfg--shower .mg-tile__desc .mg-br { display: block; }
.mg-tile__price { color: inherit; }
/* Art design subsection: centre a single design tile, two side by side, then three across. */
.mg-shower--designs .mg-shower__tiles { margin-top: clamp(1rem, 2vw, 1.5rem); }
@media (min-width: 900px) {
	.mg-shower--designs .mg-shower__tiles { grid-template-columns: repeat(3, 1fr); justify-content: center; }
	.mg-shower--designs .mg-shower__tile,
	.mg-shower--designs .mg-shower__tile:nth-child(4),
	.mg-shower--designs .mg-shower__tile:nth-child(5) { grid-column: auto; }
	.mg-shower--designs .mg-shower__tile:only-child { grid-column: 2; }
}

/* 0.9.41: design tile name with its intro line underneath. */
.mg-shower--designs .mg-shower__label { flex-direction: column; gap: .35rem; }
.mg-shower__name { display: block; }
.mg-shower__desc { display: block; font-size: .875rem; font-weight: 400; letter-spacing: 0; line-height: 1.35; }
.mg-shower__desc .mg-br { display: block; }

/* ---- 0.9.42 (Jay, 19 Nov): shape step = four equal tiles, 2 x 2 on every screen size ---- */
.mg-cfg--shower .mg-cfg__tiles--shape { grid-template-columns: 1fr 1fr; grid-auto-rows: 1fr; }
.mg-cfg__tiles--shape .mg-tile--shape { height: 100%; }
.mg-cfg__tiles--shape .mg-tile__body { height: 100%; align-items: flex-start; }
.mg-tile__icon { display: block; width: 1.75rem; height: auto; margin: 0 0 .35rem; color: #121212; flex: none; }
.mg-cfg__tiles--shape .mg-tile__desc { text-wrap: balance; }
@media (max-width: 519px) {
	.mg-cfg__tiles--shape { gap: .5rem; }
	.mg-cfg__tiles--shape .mg-tile__body { padding: .85rem .75rem; }
	.mg-cfg__tiles--shape .mg-tile__desc { font-size: .75rem; line-height: 1.35; }
}
/* Summary preview: one curved top corner. */
.mg-cfg__pane.is-curved-left { border-radius: 45% 0 0 0 / 30% 0 0 0; }
.mg-cfg__pane.is-curved-right { border-radius: 0 45% 0 0 / 0 30% 0 0; }

/* 0.9.49 (Dan's Shower Update): "For any unique shapes or special requests…" line under the shape tiles. */
.mg-cfg--shower .mg-cfg__shapehelp, .mg-cfg__shapehelp { margin: .75rem 0 0; }
.mg-cfg__shapehelp a { text-decoration: underline; text-underline-offset: 2px; }
