/**
 * AF Commerce — brand archive.
 *
 * Loaded only on brand taxonomy archives, on top of shop.css.
 */

.af-brand {
	padding-block-end: var(--af-space-xxl);
}

.af-brand__products {
	min-width: 0;
}

.af-brand-header {
	position: relative;
	margin-bottom: var(--af-space-xl);
}

.af-brand-header__media {
	position: relative;
	aspect-ratio: 1600 / 380;
	max-height: 380px;
	overflow: hidden;
	background: var(--af-surface);
}

.af-brand-header__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.af-brand-header--banner .af-brand-header__inner {
	position: relative;
	/* Pull the identity block up over the banner without absolute positioning,
	   which would take it out of flow and break on short banners. */
	margin-top: calc(var(--af-space-xl) * -1);
}

.af-brand-header__identity {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--af-space-lg);
	padding: var(--af-space-lg);
	border: 1px solid var(--af-border);
	border-radius: var(--af-radius-lg);
	background: var(--af-background);
}

.af-brand-header--banner .af-brand-header__identity {
	box-shadow: var(--af-shadow-2);
}

.af-brand-header__logo {
	display: grid;
	place-items: center;
	flex: none;
	width: 120px;
	height: 120px;
	padding: var(--af-space-sm);
	border: 1px solid var(--af-border);
	border-radius: var(--af-radius-md);
	background: #fff;
}

.af-brand-header__logo img {
	max-width: 100%;
	height: auto;
	object-fit: contain;
}

.af-brand-header__text {
	min-width: 0;
	flex: 1 1 260px;
}

.af-brand-header__title {
	margin: 0 0 6px;
	font-size: var(--af-fs-h1);
}

.af-brand-header__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--af-space-sm);
	margin: 0;
	color: var(--af-muted);
	font-size: var(--af-fs-small);
}

.af-brand-header__promo {
	display: inline-flex;
	padding: 3px 10px;
	border-radius: 999px;
	background: var(--af-accent-soft);
	color: var(--af-accent);
	font-size: var(--af-fs-caption);
	font-weight: 600;
}

.af-brand-header__all {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin-top: var(--af-space-sm);
	color: var(--af-primary);
	font-size: var(--af-fs-small);
	font-weight: 600;
	text-decoration: none;
}

.af-brand-header__all:hover {
	color: var(--af-accent);
}

.af-brand-header .af-breadcrumbs {
	margin-bottom: var(--af-space-md);
}

/* -------------------------------------------------------------------------
 * Brand index (all brands)
 * ---------------------------------------------------------------------- */

.af-brands-index {
	display: grid;
	gap: var(--af-space-xl);
	padding-block-end: var(--af-space-xxl);
}

.af-brands-index__group {
	scroll-margin-top: var(--af-scroll-offset, 100px);
}

.af-brands-index__heading {
	margin: 0 0 var(--af-space-md);
	padding-bottom: var(--af-space-xs);
	border-bottom: 1px solid var(--af-border);
	font-size: var(--af-fs-h4);
}

.af-brands-index__list {
	display: grid;
	gap: var(--af-space-sm) var(--af-space-lg);
	grid-template-columns: repeat(auto-fill, minmax(min(180px, 100%), 1fr));
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: var(--af-fs-small);
}

.af-brands-index__list a {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: var(--af-space-sm);
	color: var(--af-text);
	text-decoration: none;
}

.af-brands-index__list a:hover .af-brands-index__name {
	color: var(--af-accent);
}

.af-brands-index__count {
	color: var(--af-muted);
	font-size: var(--af-fs-caption);
	white-space: nowrap;
}

/* An A–Z jump bar for long brand lists. */
.af-brands-index__jump {
	position: sticky;
	inset-block-start: var(--af-sticky-offset, 90px);
	z-index: 5;
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
	margin-bottom: var(--af-space-lg);
	padding: var(--af-space-sm);
	border-radius: var(--af-radius-md);
	background: var(--af-surface);
	font-size: var(--af-fs-caption);
}

.af-brands-index__letter {
	display: grid;
	place-items: center;
	min-width: 28px;
	height: 28px;
	border-radius: var(--af-radius-sm);
	color: var(--af-secondary);
	text-decoration: none;
}

.af-brands-index__letter:hover {
	background: var(--af-background);
	color: var(--af-primary);
}
