/* Shop by brand directory page */
body.ds-brands-page-active {
	overflow-x: clip;
}

.ds-brands-page-active .ds-brand-content {
	padding: 0 !important;
	max-width: none !important;
}

.ds-brands-page-active .ds-brand-content > .alignfull:first-child {
	margin-top: 0;
}

/* Full-bleed hero background edge to edge */
body.ds-brands-page-active .ds-brand-content > .alignfull.ds-brands-hero {
	width: 100vw;
	max-width: 100vw;
	margin-left: calc(50% - 50vw) !important;
	margin-right: calc(50% - 50vw) !important;
	padding-inline: 0 !important;
	border-radius: 0;
}

.ds-brands-hero {
	background: linear-gradient(135deg, #062a42 0%, #0a3d5c 48%, #115b8a 100%);
	color: #fff;
	padding-block: clamp(2rem, 5vw, 3.5rem);
}

.ds-brands-hero .ds-brand-breadcrumb {
	margin-bottom: 1rem;
}

.ds-brands-hero-title {
	margin: 0 0 1rem;
	max-width: 14ch;
	color: #fff;
	font-family: var(--ds-font-display, inherit);
	font-size: clamp(2rem, 4.5vw, 3rem);
	line-height: 1.1;
}

.ds-brands-hero-lead {
	margin: 0;
	max-width: 48ch;
	color: rgba(255, 255, 255, 0.92);
	font-size: 1.05rem;
	line-height: 1.65;
}

.ds-brands-hero-media {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.85rem;
	align-items: center;
}

.ds-brands-hero-media img {
	width: 100%;
	height: auto;
	border-radius: 12px;
	box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
	object-fit: cover;
}

.ds-brands-hero-media__item--wide {
	grid-column: span 2;
	max-height: 180px;
	object-fit: cover;
}

.ds-brands-directory {
	padding-block: clamp(1.5rem, 3vw, 2.5rem) clamp(2.5rem, 5vw, 4rem);
}

.ds-brands-directory > .ds-container {
	max-width: var(--ds-container, 1200px);
	margin-inline: auto;
	padding-inline: var(--ds-space-lg, 1.5rem);
}

.ds-brands-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 1rem 1.5rem;
	margin-bottom: 1.75rem;
	padding: 1.1rem 1.25rem;
	background: #fff;
	border: 1px solid #dbe3ec;
	border-radius: 14px;
	box-shadow: 0 8px 28px rgba(8, 47, 71, 0.06);
}

.ds-brands-search-wrap {
	position: relative;
	flex: 1 1 260px;
	max-width: 360px;
}

.ds-brands-search-wrap svg {
	position: absolute;
	left: 0.95rem;
	top: 50%;
	transform: translateY(-50%);
	width: 18px;
	height: 18px;
	color: #64748b;
	pointer-events: none;
}

.ds-brands-search {
	width: 100%;
	min-height: 44px;
	padding: 0.55rem 1rem 0.55rem 2.65rem;
	border: 1px solid #cbd5e1;
	border-radius: 10px;
	font: inherit;
	font-size: 0.9375rem;
	color: #0f172a;
	background: #f8fafc;
}

.ds-brands-search:focus {
	outline: 2px solid rgba(17, 91, 138, 0.35);
	border-color: var(--ds-primary, #115b8a);
	background: #fff;
}

.ds-brands-alpha {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.35rem;
}

.ds-brands-alpha__label {
	margin-right: 0.35rem;
	font-size: 0.875rem;
	font-weight: 600;
	color: #475569;
	white-space: nowrap;
}

.ds-brands-alpha-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2rem;
	min-height: 2rem;
	padding: 0 0.45rem;
	border: none;
	border-radius: 999px;
	background: transparent;
	color: #64748b;
	font: inherit;
	font-size: 0.8125rem;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.15s, color 0.15s;
}

.ds-brands-alpha-btn:hover {
	background: #eef3f8;
	color: var(--ds-navy, #0a3d5c);
}

.ds-brands-alpha-btn.is-active {
	background: var(--ds-navy, #0a3d5c);
	color: #fff;
}

.ds-brands-layout.wp-block-columns {
	display: grid !important;
	grid-template-columns: minmax(0, 280px) minmax(0, 1fr);
	gap: 1.75rem !important;
	align-items: start;
}

.ds-brands-sidebar .wp-block-group {
	margin-bottom: 1rem;
}

.ds-brands-filter-box,
.ds-brands-sidebar-card {
	background: #fff;
	border: 1px solid #dbe3ec;
	border-radius: 14px;
	padding: 1.25rem;
	box-shadow: 0 6px 20px rgba(8, 47, 71, 0.05);
}

.ds-brands-filter-box h3,
.ds-brands-sidebar-card h3 {
	margin: 0 0 0.85rem;
	font-size: 0.9375rem;
	color: var(--ds-navy, #0a3d5c);
}

.ds-brands-filter-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 0.35rem;
}

.ds-brands-filter-list button {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	padding: 0.65rem 0.85rem;
	border: 1px solid transparent;
	border-radius: 10px;
	background: transparent;
	color: #334155;
	font: inherit;
	font-size: 0.875rem;
	text-align: left;
	cursor: pointer;
	transition: background 0.15s, border-color 0.15s;
}

.ds-brands-filter-list button:hover {
	background: #f8fafc;
}

.ds-brands-filter-list button.is-active {
	background: #eef6fb;
	border-color: #b8d9ea;
	color: var(--ds-navy, #0a3d5c);
	font-weight: 700;
}

.ds-brands-filter-count {
	font-size: 0.8125rem;
	color: #64748b;
	font-weight: 500;
}

.ds-brands-filter-list button.is-active .ds-brands-filter-count {
	color: var(--ds-primary, #115b8a);
}

.ds-brands-confidence-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 0.75rem;
}

.ds-brands-confidence-list li {
	display: flex;
	gap: 0.65rem;
	align-items: flex-start;
	font-size: 0.875rem;
	line-height: 1.5;
	color: #475569;
}

.ds-brands-confidence-icon {
	flex-shrink: 0;
	width: 1.35rem;
	height: 1.35rem;
	border-radius: 999px;
	background: #eef6fb;
	color: var(--ds-primary, #115b8a);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 0.75rem;
	font-weight: 800;
}

.ds-brands-sidebar-card p {
	margin: 0 0 1rem;
	font-size: 0.875rem;
	line-height: 1.6;
	color: #64748b;
}

.ds-brands-sidebar-card .wp-block-button__link {
	font-size: 0.875rem;
}

.ds-brands-main-head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem 1rem;
	margin-bottom: 1.25rem;
}

.ds-brands-main-head h2 {
	margin: 0;
	font-size: clamp(1.15rem, 2vw, 1.35rem);
	color: var(--ds-navy, #0a3d5c);
}

.ds-brands-sort {
	min-height: 40px;
	padding: 0.35rem 2rem 0.35rem 0.85rem;
	border: 1px solid #cbd5e1;
	border-radius: 10px;
	background: #fff;
	font: inherit;
	font-size: 0.875rem;
	color: #334155;
	cursor: pointer;
}

.ds-brands-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 1rem;
}

.ds-brands-grid.is-collapsed .ds-brand-card:nth-child(n + 13) {
	display: none;
}

.ds-brand-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	padding: 1.35rem 1rem 1.15rem;
	background: #fff;
	border: 1px solid #dbe3ec;
	border-radius: 14px;
	text-decoration: none;
	color: inherit;
	transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s;
}

.ds-brand-card:hover {
	border-color: #b8d9ea;
	box-shadow: 0 12px 32px rgba(8, 47, 71, 0.1);
	transform: translateY(-2px);
}

.ds-brand-card.is-hidden {
	display: none !important;
}

.ds-brand-card__logo {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 56px;
	margin-bottom: 0.85rem;
}

.ds-brand-card__logo img {
	max-width: 120px;
	max-height: 48px;
	width: auto;
	height: auto;
	object-fit: contain;
}

.ds-brand-card__placeholder {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	border-radius: 12px;
	background: linear-gradient(135deg, #eef3f8 0%, #dbeafe 100%);
	color: var(--ds-navy, #0a3d5c);
	font-size: 1.125rem;
	font-weight: 800;
}

.ds-brand-card__name {
	margin: 0 0 0.25rem;
	font-size: 0.9375rem;
	font-weight: 700;
	color: #0f172a;
}

.ds-brand-card__count {
	margin: 0;
	font-size: 0.8125rem;
	color: #64748b;
}

.ds-brands-empty {
	grid-column: 1 / -1;
	padding: 2.5rem 1rem;
	text-align: center;
	color: #64748b;
	background: #f8fafc;
	border: 1px dashed #cbd5e1;
	border-radius: 14px;
}

.ds-brands-show-all {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.35rem;
	width: 100%;
	margin-top: 1.5rem;
	padding: 0.85rem 1rem;
	border: 1px solid #dbe3ec;
	border-radius: 12px;
	background: #fff;
	color: var(--ds-primary, #115b8a);
	font: inherit;
	font-size: 0.9375rem;
	font-weight: 700;
	cursor: pointer;
	transition: background 0.15s, border-color 0.15s;
}

.ds-brands-show-all:hover {
	background: #f8fafc;
	border-color: #b8d9ea;
}

.ds-brands-show-all[hidden] {
	display: none;
}

.ds-brands-trust {
	padding-block: clamp(2rem, 4vw, 3rem);
	background: #f1f5f9;
	border-block: 1px solid #e2e8f0;
}

.ds-brands-trust .ds-container {
	max-width: var(--ds-container, 1200px);
	margin-inline: auto;
	padding-inline: var(--ds-space-lg, 1.5rem);
}

.ds-brands-trust-columns.wp-block-columns {
	display: grid !important;
	grid-template-columns: minmax(0, 1fr) minmax(0, 320px);
	gap: 2rem !important;
	align-items: center;
}

.ds-brands-trust-grid {
	display: grid !important;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 1rem !important;
}

.ds-brands-trust-item {
	text-align: center;
}

.ds-brands-trust-item h3 {
	margin: 0 0 0.35rem;
	font-size: 0.9375rem;
	color: var(--ds-navy, #0a3d5c);
}

.ds-brands-trust-item p {
	margin: 0;
	font-size: 0.8125rem;
	line-height: 1.5;
	color: #64748b;
}

.ds-brands-trust-cta {
	background: #fff;
	border: 1px solid #dbe3ec;
	border-radius: 16px;
	padding: 1.5rem;
	box-shadow: 0 10px 28px rgba(8, 47, 71, 0.07);
}

.ds-brands-trust-cta h3 {
	margin: 0 0 0.5rem;
	font-size: 1.05rem;
	color: var(--ds-navy, #0a3d5c);
}

.ds-brands-trust-cta p {
	margin: 0 0 1rem;
	font-size: 0.875rem;
	line-height: 1.55;
	color: #64748b;
}

@media (max-width: 1100px) {
	.ds-brands-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.ds-brands-trust-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
	}
}

@media (max-width: 900px) {
	.ds-brands-layout.wp-block-columns {
		grid-template-columns: 1fr;
	}

	.ds-brands-toolbar {
		flex-direction: column;
		align-items: stretch;
	}

	.ds-brands-search-wrap {
		max-width: none;
	}

	.ds-brands-alpha {
		overflow-x: auto;
		flex-wrap: nowrap;
		padding-bottom: 0.25rem;
		-webkit-overflow-scrolling: touch;
	}

	.ds-brands-trust-columns.wp-block-columns {
		grid-template-columns: 1fr !important;
	}
}

@media (max-width: 640px) {
	.ds-brands-hero-media {
		grid-template-columns: 1fr;
	}

	.ds-brands-hero-media__item--wide {
		grid-column: span 1;
	}

	.ds-brands-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.ds-brands-trust-grid {
		grid-template-columns: 1fr !important;
	}
}

@media (max-width: 480px) {
	.ds-brands-grid {
		grid-template-columns: 1fr;
	}
}
