/* Brand directory and taxonomy archive. Typography values can be supplied by
   HỆ THỐNG via the --nbd-brand-* custom properties on the body. */

body.nbd-brand-directory-page .nbd-brand-directory,
body.nbd-brand-archive .nbd-brand-masthead {
	--nbd-brand-ink: #0b2a5b;
	--nbd-brand-muted: #61748f;
	--nbd-brand-line: #dce8f4;
	font-family: var(--nbd-body-font, "Be Vietnam Pro", sans-serif);
	color: var(--nbd-brand-ink);
}

body.nbd-brand-directory-page .nbd-brand-directory {
	width: 100%;
	margin: 28px auto 64px;
	padding: 0;
}

body.nbd-brand-directory-page .nbd-brand-directory__header,
body.nbd-brand-archive .nbd-brand-masthead {
	border: 1px solid var(--nbd-brand-line);
	border-radius: 22px;
	background: linear-gradient(115deg, #f4f9ff 0%, #fff 68%);
	box-shadow: 0 14px 34px rgba(11, 42, 91, 0.055);
}

body.nbd-brand-directory-page .nbd-brand-directory__header {
	padding: clamp(18px, 3vw, 36px);
	margin-bottom: 21px;
}

body.nbd-brand-directory-page .nbd-brand-eyebrow {
	display: inline-block;
	margin-bottom: 13px;
	padding: 7px 12px;
	border-radius: 999px;
	background: #e7f3ff;
	color: #14558d;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

body.nbd-brand-directory-page .nbd-brand-directory__title,
body.nbd-brand-archive .nbd-brand-masthead h1 {
	margin: 0;
	color: var(--nbd-brand-ink);
	font-family: var(--nbd-heading-font, "Manrope", sans-serif);
	font-size: var(--nbd-brand-page-title, 38px);
	font-weight: 750;
	line-height: 1.2;
	letter-spacing: -0.025em;
}

body.nbd-brand-directory-page .nbd-brand-directory__summary {
	margin: 10px 0 0;
	color: var(--nbd-brand-muted);
	font-size: var(--nbd-brand-description, 15px);
	line-height: 1.55;
}

body.nbd-brand-directory-page .nbd-brand-directory__toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 20px;
}

body.nbd-brand-directory-page .nbd-brand-search {
	display: block;
	width: min(100%, 390px);
	margin: 0;
}

body.nbd-brand-directory-page .nbd-brand-search input[type="search"] {
	width: 100%;
	height: 46px;
	margin: 0;
	padding: 0 17px;
	border: 1px solid #cadae8;
	border-radius: 12px;
	background: #fff;
	box-shadow: none;
	color: var(--nbd-brand-ink);
	font: inherit;
	font-size: 14px;
}

body.nbd-brand-directory-page .nbd-brand-search input[type="search"]:focus-visible,
body.nbd-brand-directory-page .nbd-brand-card:focus-visible,
body.nbd-brand-archive .nbd-brand-masthead__back:focus-visible {
	outline: 3px solid #3fa9f5;
	outline-offset: 3px;
}

body.nbd-brand-directory-page .nbd-brand-search__status {
	color: var(--nbd-brand-muted);
	font-size: 13px;
}

body.nbd-brand-directory-page .nbd-brand-grid {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: 18px;
}

body.nbd-brand-directory-page .nbd-brand-card {
	display: flex;
	min-width: 0;
	flex-direction: column;
	align-items: center;
	padding: 14px 14px 18px;
	border: 1px solid var(--nbd-brand-line);
	border-radius: 16px;
	background: #fff;
	box-shadow: 0 6px 20px rgba(11, 42, 91, 0.045);
	color: var(--nbd-brand-ink);
	text-align: center;
	text-decoration: none;
	transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

body.nbd-brand-directory-page .nbd-brand-card[hidden],
body.nbd-brand-directory-page .nbd-brand-empty[hidden] {
	display: none !important;
}

body.nbd-brand-directory-page .nbd-brand-card:hover {
	border-color: #9ccbf0;
	box-shadow: 0 14px 30px rgba(11, 42, 91, 0.11);
	color: var(--nbd-brand-ink);
	transform: translateY(-3px);
}

body.nbd-brand-directory-page .nbd-brand-card__logo,
body.nbd-brand-archive .nbd-brand-masthead__logo {
	display: grid;
	place-items: center;
	flex: none;
	aspect-ratio: 1 / 1;
	padding: 18px;
	border: 1px solid #e7eef6;
	border-radius: 13px;
	background: #fff;
	overflow: hidden;
}

body.nbd-brand-directory-page .nbd-brand-card__logo {
	width: 100%;
	margin-bottom: 15px;
}

body.nbd-brand-directory-page .nbd-brand-card__logo img,
body.nbd-brand-archive .nbd-brand-masthead__logo img {
	display: block;
	width: 100%;
	height: 100%;
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
}

body.nbd-brand-directory-page .nbd-brand-card__name {
	color: var(--nbd-brand-ink);
	font-family: var(--nbd-heading-font, "Manrope", sans-serif);
	font-size: var(--nbd-brand-name, 16px);
	font-weight: 700;
	line-height: 1.35;
}

body.nbd-brand-directory-page .nbd-brand-card__count {
	margin-top: 6px;
	color: var(--nbd-brand-muted);
	font-size: var(--nbd-brand-count, 13px);
	line-height: 1.45;
}

body.nbd-brand-directory-page .nbd-brand-logo-placeholder,
body.nbd-brand-archive .nbd-brand-logo-placeholder {
	display: flex;
	width: 100%;
	height: 100%;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 5px;
	border-radius: 10px;
	background: #eff5fb;
	color: #6e8198;
}

body.nbd-brand-directory-page .nbd-brand-logo-placeholder > span,
body.nbd-brand-archive .nbd-brand-logo-placeholder > span {
	font-family: var(--nbd-heading-font, "Manrope", sans-serif);
	font-size: clamp(28px, 3vw, 48px);
	font-weight: 700;
	line-height: 1;
}

body.nbd-brand-directory-page .nbd-brand-logo-placeholder small,
body.nbd-brand-archive .nbd-brand-logo-placeholder small {
	font-size: 10px;
	line-height: 1.2;
}

body.nbd-brand-directory-page .nbd-brand-empty {
	padding: 20px;
	border: 1px dashed #c9d8e8;
	border-radius: 12px;
	color: var(--nbd-brand-muted);
	text-align: center;
}

body.nbd-brand-archive .nbd-brand-masthead {
	display: flex;
	align-items: center;
	gap: clamp(20px, 3vw, 40px);
	margin: 18px 0 26px;
	padding: clamp(20px, 3vw, 36px);
}

body.nbd-brand-archive .nbd-brand-masthead__logo {
	width: clamp(118px, 14vw, 180px);
}

body.nbd-brand-archive .nbd-brand-masthead__copy {
	min-width: 0;
}

body.nbd-brand-archive .nbd-brand-masthead__back {
	display: inline-block;
	margin-bottom: 10px;
	color: #1c75af;
	font-size: 13px;
	font-weight: 700;
	text-decoration: none;
}

body.nbd-brand-archive .nbd-brand-masthead__back::before {
	content: "←";
	margin-right: 7px;
}

body.nbd-brand-archive .nbd-brand-masthead__back:hover {
	text-decoration: underline;
}

body.nbd-brand-archive .nbd-brand-masthead__description {
	margin-top: 10px;
	color: #405874;
	font-size: var(--nbd-brand-description, 15px);
	line-height: 1.7;
}

body.nbd-brand-archive .nbd-brand-masthead__description > :last-child {
	margin-bottom: 0;
}

body.nbd-brand-archive .nbd-brand-masthead__count {
	margin: 10px 0 0;
	color: var(--nbd-brand-muted);
	font-size: var(--nbd-brand-count, 13px);
}

/* Brand archives always use the theme content width without the legacy shop
   sidebar. The PHP hook prevents sidebar contents; these rules also collapse
   Flatsome's reserved sidebar column. */
body.nbd-brand-archive .category-page-row > .large-9 {
	flex-basis: 100%;
	width: 100%;
	max-width: 100%;
}

body.nbd-brand-archive .category-page-row > .large-3,
body.nbd-brand-archive #shop-sidebar {
	display: none !important;
}

/* Keep Flatsome's native product loop and controls, changing columns only. */
body.nbd-brand-archive .products.row:not(.row-slider) > .product-small.col {
	flex: 0 0 25%;
	width: 25%;
	max-width: 25%;
}

body.nbd-brand-archive.nbd-product-ui .product-small.box:not(.box-vertical) .product-title {
	font-size: var(--nbd-brand-product-title, 15px) !important;
}

body.nbd-brand-archive.nbd-product-ui .product-small.box:not(.box-vertical) .price {
	font-size: var(--nbd-brand-product-price, 15px) !important;
}

@media (max-width: 1024px) {
	body.nbd-brand-directory-page .nbd-brand-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	body.nbd-brand-archive .products.row:not(.row-slider) > .product-small.col {
		flex-basis: 33.3333%;
		width: 33.3333%;
		max-width: 33.3333%;
	}
}

@media (max-width: 600px) {
	body.nbd-brand-directory-page .nbd-brand-directory {
		margin: 16px auto 40px;
		padding: 0 10px;
	}

	body.nbd-brand-directory-page .nbd-brand-directory__header {
		margin-bottom: 15px;
		padding: 18px 15px;
	}

	body.nbd-brand-directory-page .nbd-brand-directory__title,
	body.nbd-brand-archive .nbd-brand-masthead h1 {
		font-size: var(--nbd-brand-page-title-mobile, var(--nbd-brand-page-title, 29px));
	}

	body.nbd-brand-directory-page .nbd-brand-directory__toolbar {
		align-items: stretch;
		flex-direction: column;
		gap: 8px;
	}

	body.nbd-brand-directory-page .nbd-brand-search {
		width: 100%;
	}

	body.nbd-brand-directory-page .nbd-brand-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 10px;
	}

	body.nbd-brand-directory-page .nbd-brand-card {
		padding: 8px 8px 14px;
	}

	body.nbd-brand-directory-page .nbd-brand-card__logo {
		margin-bottom: 10px;
		padding: 12px;
	}

	body.nbd-brand-directory-page .nbd-brand-card__name {
		font-size: var(--nbd-brand-name-mobile, var(--nbd-brand-name, 14px));
	}

	body.nbd-brand-directory-page .nbd-brand-card__count,
	body.nbd-brand-archive .nbd-brand-masthead__count {
		font-size: var(--nbd-brand-count-mobile, var(--nbd-brand-count, 12px));
	}

	body.nbd-brand-archive .nbd-brand-masthead {
		align-items: flex-start;
		gap: 14px;
		margin: 10px 0 20px;
		padding: 16px;
	}

	body.nbd-brand-archive .nbd-brand-masthead__logo {
		width: 88px;
		padding: 8px;
	}

	body.nbd-brand-archive .nbd-brand-masthead__description,
	body.nbd-brand-directory-page .nbd-brand-directory__summary {
		font-size: var(--nbd-brand-description-mobile, var(--nbd-brand-description, 13px));
	}

	body.nbd-brand-archive .products.row:not(.row-slider) > .product-small.col {
		flex-basis: 50%;
		width: 50%;
		max-width: 50%;
	}

	body.nbd-brand-archive.nbd-product-ui .product-small.box:not(.box-vertical) .product-title {
		font-size: var(--nbd-brand-product-title-mobile, var(--nbd-brand-product-title, 13px)) !important;
	}

	body.nbd-brand-archive.nbd-product-ui .product-small.box:not(.box-vertical) .price {
		font-size: var(--nbd-brand-product-price-mobile, var(--nbd-brand-product-price, 13px)) !important;
	}
}

@media (prefers-reduced-motion: reduce) {
	body.nbd-brand-directory-page .nbd-brand-card {
		transition: none;
	}
}
