/**
 * 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-md);
}

.af-brand-header--minimal {
	margin-bottom: 0;
}

.af-brand-header--minimal .af-brand-header__inner {
	padding-block: 0;
}

.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 gallery (marketplace cards)
 * ---------------------------------------------------------------------- */

.af-brands-index {
	display: grid;
	gap: var(--af-space-xl);
	padding-block: var(--af-space-lg) var(--af-space-xxl);
}

.af-brands-gallery {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 16px;
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (max-width: 1099px) {
	.af-brands-gallery {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 12px;
	}
}

@media (max-width: 749px) {
	.af-brands-gallery {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 10px;
	}
}

.af-brand-tile {
	margin: 0;
	min-width: 0;
}

.af-brand-tile__link {
	display: grid;
	gap: 10px;
	color: inherit;
	text-decoration: none;
}

.af-brand-tile__media {
	position: relative;
	display: block;
	aspect-ratio: 5 / 7;
	overflow: hidden;
	border-radius: 10px;
	background: var(--af-surface, #f3f3f3);
}

.af-brand-tile__slide {
	position: absolute;
	inset: 0;
	opacity: 0;
	transition: opacity 0.25s ease;
	pointer-events: none;
}

.af-brand-tile__slide.is-active {
	opacity: 1;
	pointer-events: auto;
}

.af-brand-tile__media:not(.af-brand-tile__media--slides) .af-brand-tile__slide {
	position: relative;
	opacity: 1;
}

.af-brand-tile__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	/* Keep face / neckline in frame — never center-crop fashion shots. */
	object-position: 50% 0%;
	display: block;
}

.af-brand-tile__placeholder {
	display: grid;
	place-items: center;
	width: 100%;
	height: 100%;
	font-size: 2rem;
	font-weight: 700;
	color: #bbb;
}

.af-brand-tile__dots {
	position: absolute;
	inset-inline: 0;
	inset-block-end: 10px;
	z-index: 2;
	display: flex;
	justify-content: center;
	gap: 5px;
	pointer-events: none;
}

.af-brand-tile__dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.45);
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.af-brand-tile__dot.is-active {
	background: #fff;
}

.af-brand-tile__meta {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
	padding-inline: 2px;
}

.af-brand-tile__logo {
	flex: none;
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	overflow: hidden;
	border: 1px solid #ececec;
	border-radius: 50%;
	background: #fff;
}

.af-brand-tile__logo img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.af-brand-tile__initials {
	font-size: 14px;
	font-weight: 700;
	color: #666;
}

.af-brand-tile__text {
	display: grid;
	gap: 2px;
	min-width: 0;
}

.af-brand-tile__name {
	font-size: 14px;
	font-weight: 700;
	color: #111;
	line-height: 1.25;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.af-brand-tile__stats {
	display: flex;
	align-items: center;
	gap: 6px;
	color: #888;
	font-size: 12px;
	line-height: 1.3;
}

.af-brand-tile__rating {
	display: inline-flex;
	align-items: center;
	gap: 3px;
	color: #666;
}

.af-brand-tile__rating .af-icon {
	width: 11px;
	height: 11px;
	color: #f5a623;
	fill: currentColor;
}

.af-brand-tile__sep {
	opacity: 0.7;
}

.af-brand-tile__link:hover .af-brand-tile__name {
	color: var(--af-accent, #111);
}

/* Legacy A–Z list styles kept for child-theme overrides. */
.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;
}

.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);
}
