/* Round category photos ("bubbles"), drawn when brand.json sets design.categories_style to "bubbles" (shop,
   category pages, home). From SghiraBrand cfde71e. On a phone the row scrolls sideways; category-bubbles.js shows
   « Swipe → » only when it does not fit, and slides the row a little once. The chosen category has an accent ring. */

.cat-bubbles {
	--bubble: 4rem;
	display: grid;
	gap: var(--space-2);
	min-inline-size: 0;
}

.cat-bubbles__hint {
	justify-self: end;
	margin: 0;
	font-size: var(--step--1);
	font-weight: var(--weight-semibold);
	color: var(--color-ink);
}

.cat-bubbles__hint[hidden] {
	display: none;
}

.cat-bubbles__list {
	display: flex;
	gap: var(--space-3);
	margin: 0;
	padding: var(--space-1) var(--space-1) var(--space-2);
	list-style: none;
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x proximity;
	scrollbar-width: none;
}

.cat-bubbles__list::-webkit-scrollbar {
	display: none;
}

.cat-bubbles__list > li {
	flex: none;
	scroll-snap-align: start;
}

.cat-bubble {
	display: grid;
	justify-items: center;
	gap: var(--space-2);
	inline-size: calc(var(--bubble) + 0.5rem);
	color: var(--color-ink);
	text-align: center;
	text-decoration: none;
}

.cat-bubble__photo {
	display: block;
	inline-size: var(--bubble);
	block-size: var(--bubble);
	overflow: hidden;
	/* A thin white gap, then the accent ring outside it (the box-shadow): the photo reads as framed, not cut out. */
	border: 3px solid var(--color-surface);
	border-radius: 50%;
	background: var(--color-sand);
	box-shadow: 0 0 0 2px var(--color-accent);
	transition: box-shadow var(--duration-fast) var(--ease-out);
}

.cat-bubble__cell {
	display: block;
	inline-size: 100%;
	block-size: 100%;
	overflow: hidden;
	border-radius: 50%;
}

.cat-bubble__cell img {
	display: block;
	inline-size: 100%;
	block-size: 100%;
	object-fit: cover;
	/* Product photos stand the product low in a portrait frame, with room around it: zoom the circle onto it. */
	object-position: 50% 64%;
	transform: scale(1.5);
	transform-origin: 50% 64%;
}

/* « Tout »: four recent products in one circle. */
.cat-bubble__photo--mosaic {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1px;
}

.cat-bubble__photo--mosaic .cat-bubble__cell {
	border-radius: 0;
}

.cat-bubble__photo--mosaic .cat-bubble__cell:first-child {
	border-start-start-radius: 100% 100%;
}

.cat-bubble__photo--mosaic .cat-bubble__cell:nth-child(2) {
	border-start-end-radius: 100% 100%;
}

.cat-bubble__photo--mosaic .cat-bubble__cell:nth-child(3) {
	border-end-start-radius: 100% 100%;
}

.cat-bubble__photo--mosaic .cat-bubble__cell:nth-child(4) {
	border-end-end-radius: 100% 100%;
}

.cat-bubble__photo--mosaic .cat-bubble__cell:only-child {
	grid-column: 1 / -1;
	border-radius: 50%;
}

.cat-bubble__initial {
	display: grid;
	place-items: center;
	inline-size: 100%;
	block-size: 100%;
	border-radius: 50%;
	background: var(--color-accent-tint);
	color: var(--color-accent-text);
	font-family: var(--font-heading);
	font-size: calc(var(--bubble) * 0.4);
}

.cat-bubble__name {
	font-size: var(--step--1);
	font-weight: 700;
	line-height: 1.3;
}

.cat-bubble:hover .cat-bubble__photo {
	box-shadow: 0 0 0 3px var(--color-accent-deep);
}

/* The page's own category: a thicker ring and its name in the accent, so "where am I" never rests on colour alone. */
.cat-bubble[aria-current] .cat-bubble__photo {
	box-shadow: 0 0 0 4px var(--color-accent);
}

.cat-bubble[aria-current] .cat-bubble__name {
	color: var(--color-accent-text);
	text-decoration: underline;
	text-decoration-thickness: 2px;
	text-underline-offset: 4px;
}

.cat-bubble:focus-visible {
	outline: none;
}

.cat-bubble:focus-visible .cat-bubble__photo {
	outline: 2px solid var(--color-accent);
	outline-offset: 2px;
}

/* Phones: smaller circles and tighter rows, so the products start higher. The name keeps a wider cell than the
   circle; 2px under it keep the chosen name's underline inside the row, which clips (it scrolls sideways). */
@media (max-width: 47.99rem) {
	.cat-bubbles {
		--bubble: 4.5rem;
	}

	/* The row runs to the screen's edges, so a cut-off circle at the end shows there is more to swipe. */
	.cat-bubbles__list {
		margin-inline: calc(-1 * var(--gutter));
		padding-block: var(--space-1) 2px;
		padding-inline: var(--gutter);
		scroll-padding-inline: var(--gutter);
	}

	.cat-bubble {
		gap: var(--space-1);
		inline-size: 5rem;
	}

	.cat-bubble__name {
		font-size: 0.8125rem;
	}
}

/* A computer has room: bigger bubbles in a row that wraps if ever needed. */
@media (min-width: 48rem) {
	.cat-bubbles {
		--bubble: 7.5rem;
	}

	.cat-bubbles__list {
		flex-wrap: wrap;
		gap: var(--space-5);
		overflow: visible;
	}

	.cat-bubble__name {
		font-size: var(--step-0);
	}
}
