﻿/* Multi Seller: the "Sold By" card on the product page.

   Logo on the left, store name centred over the two rating pills on the right,
   so the name always sits in the middle of the pills whatever the panel width.
   The logo and the pills scale with the card; the pills never wrap, they shrink.
   Loaded by the product controller, so it only costs one request on that page. */

.ms-soldby {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 12px 14px 14px;
	text-align: left;
}

/* The card is a child of the query container, so the width queries below can
   restyle the card itself; 1cqi is 1% of the width the card is given. */
.ms-soldby-list {
	container-type: inline-size;
}

/* The theme caps labels at 48% and right-aligns the row; this card is not. */
.ms-soldby .meta-label {
	align-self: flex-start;
	max-width: none;
	margin: 0;
	white-space: nowrap;
}

/* Two content-sized columns pushed to the edges: the right one is as wide as
   the wider of name and pills, which is what keeps the name centred on them. */
.ms-soldby__value {
	display: grid;
	grid-template-columns: auto auto;
	justify-content: center;
	align-items: center;
	column-gap: clamp(12px, 2.8cqi, 20px);
	row-gap: clamp(4px, 1.2cqi, 8px);
	width: 100%;
}

.ms-soldby__thumb {
	grid-column: 1;
	grid-row: 1 / span 2;
	display: block;
	line-height: 0;
	text-decoration: none;
}

/* Fluid: 1cqi is 1% of the card width, so the logo fills the space it is given
   instead of being pinned to one size, between a floor and a ceiling. */
.ms-soldby__logo {
	--ms-logo-size: clamp(56px, 25cqi, 104px);
	width: var(--ms-logo-size);
	height: var(--ms-logo-size);
	padding: 3px;
	background: var(--surface, #fff);
	border-radius: 24%;
	object-fit: cover;
	box-shadow: 0 0 0 1px var(--brand-line, #cfe6e4), 0 14px 28px -18px rgba(23, 49, 59, 0.6);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ms-soldby__logo--text {
	display: grid;
	grid-column: 1;
	grid-row: 1 / span 2;
	place-items: center;
	background: var(--brand, #17807f);
	color: #fff;
	font-size: clamp(22px, 8cqi, 40px);
	line-height: 1;
	box-shadow: none;
}

.ms-soldby__thumb:hover .ms-soldby__logo,
.ms-soldby__thumb:focus .ms-soldby__logo {
	box-shadow: 0 0 0 1px var(--brand-soft, #2a9d9a), 0 18px 34px -18px rgba(23, 49, 59, 0.7);
	transform: translateY(-2px) scale(1.02);
}

.ms-soldby__name {
	grid-column: 2;
	grid-row: 1;
	justify-self: center;
	color: var(--ink, #17313b);
	font-size: clamp(16px, 4.4cqi, 18.5px);
	font-weight: 800;
	letter-spacing: -0.005em;
	line-height: 1.15;
	text-align: center;
	text-decoration: none;
	overflow-wrap: anywhere;
	text-wrap: balance;
}

/* Brand gradient on the store name, with a plain ink fallback for browsers
   that cannot clip text. */
@supports ((background-clip: text) or (-webkit-background-clip: text)) {
	.ms-soldby__name {
		background-image: linear-gradient(96deg, var(--ink, #17313b) 0%, var(--brand-deep, #0f5c5b) 48%, var(--brand, #17807f) 100%);
		-webkit-background-clip: text;
		background-clip: text;
		-webkit-text-fill-color: transparent;
	}

	.ms-soldby__name:hover,
	.ms-soldby__name:focus {
		background-image: linear-gradient(96deg, var(--brand-deep, #0f5c5b) 0%, var(--brand, #17807f) 52%, var(--brand-soft, #2a9d9a) 100%);
	}
}

.ms-soldby__name:hover,
.ms-soldby__name:focus {
	text-decoration: none;
}

/* A glyph rather than an icon font: it keeps the same baseline as the name and
   cannot be pushed onto its own line by the theme's icon rules. */
.ms-soldby__chev {
	display: inline-block;
	margin-left: 8px;
	color: var(--brand, #17807f);
	font-size: 0.95em;
	line-height: 1;
	-webkit-text-fill-color: var(--brand, #17807f);
	transition: transform 0.2s ease;
}

.ms-soldby__name:hover .ms-soldby__chev,
.ms-soldby__name:focus .ms-soldby__chev {
	transform: translateX(3px);
}

.ms-soldby__pills {
	grid-column: 2;
	grid-row: 2;
	justify-self: center;
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	justify-content: center;
	gap: 0.45em;
	font-size: 13px;
}

/* Everything inside a pill is sized in em, so one font-size per breakpoint
   shrinks the whole chip instead of each part separately. */
.ms-soldby__pill {
	display: inline-flex;
	flex: 0 1 auto;
	align-items: center;
	gap: 0.4em;
	height: 2.6em;
	min-width: 0;
	padding: 0 1.05em;
	border: 1px solid transparent;
	border-radius: 999px;
	font-size: 1em;
	font-weight: 800;
	line-height: 1;
	white-space: nowrap;
}

/* Trust: blue shield and blue word, the score itself stays in ink. */
.ms-soldby__pill--trust {
	background: color-mix(in srgb, #1d4ed8 7%, #fff);
	border-color: color-mix(in srgb, #1d4ed8 22%, #fff);
	color: #1d4ed8;
}

.ms-soldby__pill--trust i {
	font-size: 1em;
	-webkit-text-fill-color: #1d4ed8;
}

.ms-soldby__pill-num {
	color: var(--ink, #17313b);
}

.ms-soldby__pill-word {
	margin-left: 0.35em;
	color: #1d4ed8;
}

.ms-soldby__pill--vote {
	gap: 0.1em;
	padding: 0 0.6em;
	background: var(--sand, #edf4f4);
	border-color: var(--line, #dfe9ea);
	color: var(--ink-soft, #264650);
}

.ms-soldby__vote {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 1.85em;
	height: 1.85em;
	border-radius: 50%;
	color: var(--brand, #17807f);
	font-size: 1em;
	text-decoration: none;
	transition: background-color 0.16s ease, color 0.16s ease;
}

.ms-soldby__vote:hover,
.ms-soldby__vote:focus {
	background: var(--surface, #fff);
	text-decoration: none;
}

.ms-soldby__vote--down {
	color: var(--brick, #c62828);
}

.ms-soldby__score {
	margin: 0 0.15em;
	font-size: 1em;
}

/* The theme paints every link in the summary panel brand teal through
   `.product-summary-panel .summary-meta a`, which outranks a plain class;
   these scoped rules give each arrow its own colour and keep the icon in step
   with the pill font-size. */
.product-summary-panel .summary-meta .ms-soldby__vote,
.product-summary-panel .summary-meta .ms-soldby__vote:hover,
.product-summary-panel .summary-meta .ms-soldby__vote:focus {
	color: var(--brand, #17807f);
	text-decoration: none;
}

.product-summary-panel .summary-meta .ms-soldby__vote i {
	font-size: 1em;
}

.product-summary-panel .summary-meta .ms-soldby__vote--down,
.product-summary-panel .summary-meta .ms-soldby__vote--down:hover,
.product-summary-panel .summary-meta .ms-soldby__vote--down:focus {
	color: var(--brick, #c62828);
}

.product-summary-panel .summary-meta .ms-soldby__name {
	text-decoration: none;
}

.ms-soldby__name:focus-visible,
.ms-soldby__vote:focus-visible {
	outline: 2px solid var(--brand, #17807f);
	outline-offset: 3px;
	border-radius: 8px;
}

.ms-soldby__thumb:focus-visible {
	outline: 2px solid var(--brand, #17807f);
	outline-offset: 4px;
	border-radius: 24%;
}

/* Medium panel (tablet portrait and narrow desktop columns): the pills step
   down a size but stay on one line beside the logo. */
@container (max-width: 359px) {
	.ms-soldby__pills {
		font-size: 12px;
	}
}

/* Very wide card — the stacked product layout makes the panel wider than the
   desktop column: the label joins the row so the block keeps the height of a
   normal summary row, and the seller group sits at the right, clear of it. */
@container (min-width: 440px) {
	/* Scoped to outrank the theme's `gap: 16px` on .summary-meta li, so the
	   group centres in the space left of the label and not of a phantom gap. */
	.product-summary-panel .summary-meta .ms-soldby {
		flex-direction: row;
		align-items: center;
		justify-content: flex-start;
		gap: 0;
		padding: 10px 14px;
	}

	/* The label keeps the row's left edge and stays legible now that it shares
	   the line with the seller group. */
	.product-summary-panel .summary-meta .ms-soldby .meta-label {
		align-self: center;
		flex: none;
		color: var(--ink-soft, #264650);
		font-size: 12px;
	}

	/* The group takes the rest of the row and centres itself inside it. */
	.ms-soldby__value {
		flex: 1 1 auto;
		width: auto;
	}
}

/* Small panel: the word "Trust" goes first and the chip tightens up, so both
   pills still sit on one row beside the logo. */
@container (max-width: 309px) {
	.ms-soldby__value {
		column-gap: 8px;
	}

	.ms-soldby__pills {
		font-size: 10.5px;
	}

	.ms-soldby__pill {
		padding: 0 0.9em;
	}

	.ms-soldby__pill-word {
		display: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ms-soldby__logo,
	.ms-soldby__chev {
		transition: none;
	}

	.ms-soldby__thumb:hover .ms-soldby__logo,
	.ms-soldby__thumb:focus .ms-soldby__logo,
	.ms-soldby__name:hover .ms-soldby__chev,
	.ms-soldby__name:focus .ms-soldby__chev {
		transform: none;
	}
}