/**
 * Brand taxonomy archive — header, grid, load more.
 * Card visuals: product-card.css (+ .onoff-brand-archive overrides below).
 */

.onoff-brand-archive {
	--onoff-card-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
}

@media (min-width: 900px) {
	.onoff-brand-archive {
		--onoff-card-width: 255px;
		--onoff-card-height: 472px;
		--onoff-card-image-size: 255px;
	}
}

/* Archive header */
.onoff-brand-archive .brand-archive-header {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--onoff-gap-md);
	margin-block-end: var(--onoff-gap-xl);
	text-align: center;
}

@media (min-width: 768px) {
	.onoff-brand-archive .brand-archive-header {
		flex-direction: row;
		align-items: flex-start;
		text-align: start;
		gap: var(--onoff-gap-lg);
	}
}

.onoff-brand-archive .brand-archive-header__media {
	flex-shrink: 0;
}

.onoff-brand-archive .brand-archive-header__logo-img {
	display: block;
	max-width: 8rem;
	height: auto;
}

.onoff-brand-archive .brand-archive-header__name {
	margin: 0 0 0.5rem;
	font-family: var(--onoff-font-family);
	font-size: clamp(1.5rem, 3vw, 2.25rem);
	font-weight: 900;
	color: #262415;
}

.onoff-brand-archive .brand-archive-header__description {
	color: #7c6f5f;
	font-size: 1.0625rem;
	line-height: 1.6;
}

.onoff-brand-archive .woocommerce-breadcrumb {
	margin-block-end: var(--onoff-gap-md);
	font-size: 0.9375rem;
}

/* Product grid — fixed card width; fewer columns when space is tight */
.onoff-brand-archive .brand-products-grid ul.products {
	grid-template-columns: repeat(auto-fit, var(--onoff-card-width));
	gap: 16px;
	justify-content: center;
}

.onoff-brand-archive .custom-product-card {
	justify-self: center;
	width: var(--onoff-card-width);
	max-width: var(--onoff-card-width);
}

/* Figma-aligned card overrides on brand archives */
.onoff-brand-archive .product-card {
	min-height: var(--onoff-card-height);
	box-shadow: var(--onoff-card-shadow);
}

.onoff-brand-archive .product-card__image-wrap {
	height: var(--onoff-card-image-size);
	background-color: #f8f8f5;
	background-image: none;
}

.onoff-brand-archive .product-card__image-wrap img,
.onoff-brand-archive .product-card__image-wrap .woocommerce-placeholder,
.onoff-brand-archive .product-card__image-wrap .product-card__image {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	max-height: none;
	object-fit: cover;
	transform: scale(1);
	transition: transform 250ms ease;
}

.onoff-brand-archive .product-card:hover .product-card__image-wrap img,
.onoff-brand-archive .product-card:focus-within .product-card__image-wrap img {
	transform: scale(1.06);
}

.onoff-brand-archive .product-card__body,
.onoff-brand-archive .product-card__content {
	padding: 24px;
	text-align: end;
}

.onoff-brand-archive .product-card__title {
	margin: 0 0 0;
	min-height: 56px;
	display: flex;
	flex-direction: column;
	justify-content: center;
	font-size: 18px;
	line-height: 28px;
}

.onoff-brand-archive .product-card__title a {
	-webkit-line-clamp: 2;
	text-align: inherit;
}

.onoff-brand-archive .product-card__actions .button,
.onoff-brand-archive .product-card__actions .add_to_cart_button,
.onoff-brand-archive .product-card__actions a.button {
	min-height: 48px !important;
	padding: 12px 20px !important;
	font-size: 16px !important;
	line-height: 24px !important;
}

@media (prefers-reduced-motion: reduce) {
	.onoff-brand-archive .product-card__image-wrap img,
	.onoff-brand-archive .product-card__image {
		transition: none;
	}

	.onoff-brand-archive .product-card:hover .product-card__image-wrap img,
	.onoff-brand-archive .product-card:focus-within .product-card__image-wrap img {
		transform: none;
	}
}

/* Load more */
.onoff-brand-archive .brand-load-more {
	display: flex;
	flex-direction: column;
	align-items: center;
	margin-block: var(--onoff-gap-xl) var(--onoff-gap-lg);
	gap: var(--onoff-gap-sm);
}

.onoff-brand-archive .brand-load-more.is-hidden {
	display: none;
}

.onoff-brand-archive .brand-load-more__button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: min(100%, 320px);
	min-height: 52px;
	padding: 14px 32px;
	border: 1px solid #262415;
	border-radius: 999px;
	background: #fff;
	color: #262415;
	font-family: var(--onoff-font-family);
	font-size: 1.0625rem;
	font-weight: 700;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.onoff-brand-archive .brand-load-more__button:hover:not(:disabled),
.onoff-brand-archive .brand-load-more__button:focus-visible:not(:disabled) {
	background: #262415;
	color: #fff;
	outline: none;
	box-shadow: 0 0 0 3px rgba(242, 251, 4, 0.45);
}

.onoff-brand-archive .brand-load-more__button:disabled {
	opacity: 0.6;
	cursor: wait;
}

/* Pagination: crawlable in DOM; visually de-emphasized when JS runs */
.onoff-brand-archive .woocommerce-pagination {
	margin-block-start: var(--onoff-gap-lg);
	text-align: center;
}

.js .onoff-brand-archive .woocommerce-pagination {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Mobile — match shop archive: 171px cards, 2-column grid, compact card chrome */
@media (max-width: 899px) {
	.onoff-brand-archive {
		--onoff-card-width: 171px;
		--onoff-card-height: 316px;
		--onoff-card-radius: 16px;
		--onoff-card-image-size: 171px;
	}

	.onoff-brand-archive .brand-products-grid ul.products {
		grid-template-columns: repeat(2, var(--onoff-card-width)) !important;
		gap: 11px;
		justify-content: center;
	}

	.onoff-brand-archive .brand-products-grid ul.products li.product,
	.onoff-brand-archive .brand-products-grid ul.products li.custom-product-card {
		flex: unset;
		width: var(--onoff-card-width) !important;
		max-width: var(--onoff-card-width) !important;
		padding-bottom: 10px !important;
		padding-left: 7px !important;
		padding-right: 7px !important;
	}

	.onoff-brand-archive .custom-product-card {
		width: var(--onoff-card-width);
		max-width: var(--onoff-card-width);
	}

	.onoff-brand-archive .product-card {
		width: var(--onoff-card-width);
		max-width: var(--onoff-card-width);
		min-height: var(--onoff-card-height);
		border-radius: var(--onoff-card-radius, 16px);
	}

	.onoff-brand-archive .product-card__image-wrap {
		height: var(--onoff-card-image-size);
		min-height: var(--onoff-card-image-size);
		border-start-start-radius: var(--onoff-card-radius, 16px);
		border-start-end-radius: var(--onoff-card-radius, 16px);
	}

	.onoff-brand-archive .product-card__body,
	.onoff-brand-archive .product-card__content {
		padding: 16px;
	}

	.onoff-brand-archive .product-card__title {
		min-height: 38px;
		font-size: 12px;
		line-height: 19px;
	}

	.onoff-brand-archive .product-card__actions {
		padding-block-start: 3px;
	}

	.onoff-brand-archive .product-card__actions .button,
	.onoff-brand-archive .product-card__actions .add_to_cart_button,
	.onoff-brand-archive .product-card__actions a.button {
		min-height: 32px !important;
		padding: 8px 13px !important;
		font-size: 11px !important;
		line-height: 16px !important;
	}

	.onoff-brand-archive .brand-archive-header {
		margin-block-end: var(--onoff-gap-md);
	}

	.onoff-brand-archive .brand-load-more {
		margin-block: var(--onoff-gap-lg) var(--onoff-gap-md);
	}
}
