.npd-header-second-row {
	--npd-second-row-gap: 0.75rem;
	--npd-brands-width: 13.75rem;
	--npd-brands-min-width: 10.5rem;
	--npd-search-min-width: 17.5rem;
	--npd-control-height: var(--theme-form-field-height, 40px);

	position: relative;
	z-index: 40;
	font-family: inherit;
	color: var(--theme-text-color);
	background-color: var(--theme-palette-color-8, var(--background-color, #fff));
	border-bottom: 1px solid var(--theme-border-color, rgba(0, 0, 0, 0.08));
}

.npd-header-second-row__container {
	position: relative;
	padding-block: 0.5rem;
}

.npd-header-second-row__scroller {
	min-width: 0;
}

.npd-header-second-row__track {
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	gap: var(--npd-second-row-gap);
	min-width: 0;
	width: 100%;
}

.npd-header-second-row__brands {
	position: relative;
	flex: 0 0 var(--npd-brands-width);
	width: var(--npd-brands-width);
	max-width: var(--npd-brands-width);
	min-width: 0;
}

.npd-header-second-row__brands-toggle {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	box-sizing: border-box;
	width: 100%;
	min-height: calc(var(--npd-control-height) + 2px);
	padding: 0 0.85rem;
	list-style: none;
	cursor: pointer;
	color: inherit;
	font-size: var(--theme-font-size, inherit);
	font-weight: 600;
	line-height: 1.2;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	border: 1px solid var(--theme-form-field-border-initial-color, var(--theme-border-color, rgba(0, 0, 0, 0.12)));
	border-radius: 30px;
	background-color: var(--theme-form-field-background-initial-color, transparent);
}

.npd-header-second-row__brands-toggle::-webkit-details-marker,
.npd-header-second-row__brands-toggle::marker {
	display: none;
	content: "";
}

.npd-header-second-row__brands-toggle:focus-visible {
	outline: max(2px, var(--theme-form-field-border-width, 1px)) solid var(--theme-form-field-border-focus-color, currentColor);
	outline-offset: 2px;
}

.npd-header-second-row__brands-label {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	text-transform: none !important;
	font-weight: 300 !important;
}

.npd-header-second-row__brands-icon {
	flex-shrink: 0;
	transition: transform 0.15s ease;
}

.npd-header-second-row__brands[open] .npd-header-second-row__brands-icon {
	transform: rotate(180deg);
}

.npd-header-second-row__brands-panel {
	position: absolute;
	top: 100%;
	left: 0;
	z-index: 2;
	box-sizing: border-box;
	min-width: 100%;
	max-width: min(20rem, calc(100vw - 2rem));
	margin-top: 0.25rem;
	padding: 0.35rem 0;
	background-color: var(--theme-palette-color-8, var(--background-color, #fff));
	border: 1px solid var(--theme-form-field-border-initial-color, var(--theme-border-color, rgba(0, 0, 0, 0.12)));
	border-radius: var(--theme-form-field-border-radius, 3px);
	box-shadow: var(--theme-box-shadow, 0 8px 24px rgba(0, 0, 0, 0.08));
}

.npd-header-second-row__brands-nav {
	max-height: min(70vh, 22rem);
	overflow-x: hidden;
	overflow-y: auto;
}

.npd-header-second-row__brands-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.npd-header-second-row__brands-link {
	display: block;
	padding: 0.55rem 0.85rem;
	color: inherit;
	text-decoration: none;
	overflow-wrap: anywhere;
}

.npd-header-second-row__brands-link:hover,
.npd-header-second-row__brands-link:focus-visible {
	background-color: var(--theme-palette-color-6, rgba(0, 0, 0, 0.04));
}

.npd-header-second-row__brands-link:focus-visible {
	outline: 2px solid var(--theme-form-field-border-focus-color, currentColor);
	outline-offset: -2px;
}

.npd-header-second-row__brands-empty {
	margin: 0;
	padding: 0.75rem 0.85rem;
	color: inherit;
	opacity: 0.75;
}

.npd-header-second-row__brands-select {
	display: none;
}

.npd-header-second-row__search {
	position: relative;
	display: flex;
	flex: 1 1 auto;
	flex-wrap: wrap;
	align-items: stretch;
	min-width: 0;
}

.npd-header-second-row__search-field {
	display: flex;
	align-items: center;
	width: 100%;
	min-width: 0;
	min-height: var(--npd-control-height);
	border: 1px solid var(--theme-form-field-border-initial-color, var(--theme-border-color, rgba(0, 0, 0, 0.12)));
	border-radius: 30px;
	background-color: var(--theme-form-field-background-initial-color, transparent);
	flex-direction: row-reverse;
}

.npd-header-second-row__search-field:focus-within {
	border-color: var(--theme-form-field-border-focus-color, currentColor);
	outline: max(2px, var(--theme-form-field-border-width, 1px)) solid var(--theme-form-field-border-focus-color, currentColor);
	outline-offset: calc(var(--theme-form-field-border-width, 1px) * -1);
}

.npd-header-second-row__search-submit {
	position: relative;
	display: inline-flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	width: 37px;
	min-width: 37px;
	min-height: 37px;
	padding: 0;
	color: inherit;
	cursor: pointer;
	background: transparent;
	border: 0;
	border-radius: 50%;
	right:2px;
}

button.npd-header-second-row__search-submit:hover {
	background-color: #efefef;
}


.npd-header-second-row__search-submit:focus-visible {
	outline: 2px solid var(--theme-form-field-border-focus-color, currentColor);
	outline-offset: -2px;
}

.npd-header-second-row__search-icon {
	display: block;
	fill: currentColor;
}

.npd-header-second-row input[type="search"].npd-header-second-row__search-input {
	flex: 1 1 auto;
	width: 100%;
	min-width: 0;
	height: var(--npd-control-height);
	padding: 0 0 0 0.85rem;
	color: inherit;
	font-size: var(--theme-form-font-size, inherit);
	background: transparent;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	outline: none;
	appearance: none;
}

.npd-header-second-row input[type="search"].npd-header-second-row__search-input:focus {
	outline: none;
	box-shadow: none;
	border-color: transparent;
}

/*
 * Predictive search results dropdown.
 *
 * Blocksy's JS appends .ct-search-results as a direct child of the form.
 * The default theme CSS positions it with negative offsets relative to its
 * parent. We override that here so it sits neatly below the search field
 * and spans the full form width.
 */
.npd-header-second-row__search > .ct-search-results {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	inset-inline: 0;
	z-index: 100;
	margin-top: 0.25rem;
	padding-top: 0;
	border-radius: var(--theme-form-field-border-radius, 3px);
	max-height: min(70vh, 26rem);
	overflow-y: auto;
}

.npd-header-second-row__search .ct-ajax-loader {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	pointer-events: none;
}

.npd-header-second-row__search .ct-ajax-loader svg {
	width: 15px;
	height: 15px;
}

.npd-header-second-row__search.ct-searching .ct-search-button-content {
	opacity: 0;
}

.npd-header-second-row__search.ct-searching .ct-ajax-loader {
	opacity: 1;
}

/* Tablet / Blocksy mobile header range: keep side-by-side, no row overflow. */
@media (max-width: 999.98px) {
	.npd-header-second-row {
		--npd-brands-width: var(--npd-brands-min-width);
	}
}

/*
 * Narrow phones: keep one row, allow the inner scroller to overflow.
 * Do not wrap. Do not overflow the page/body.
 */
@media (max-width: 479.98px) {
	.npd-header-second-row__scroller {
		overflow-x: auto;
		overflow-y: hidden;
		overscroll-behavior-x: contain;
		-webkit-overflow-scrolling: touch;
		scroll-snap-type: x proximity;
		scrollbar-width: none;
		-ms-overflow-style: none;
	}

	.npd-header-second-row__scroller::-webkit-scrollbar {
		display: none;
		width: 0;
		height: 0;
	}

	.npd-header-second-row__track {
		align-items: flex-start;
		width: max-content;
		min-width: 100%;
	}

	.npd-header-second-row__brands,
	.npd-header-second-row__search {
		scroll-snap-align: start;
		scroll-margin-inline: 0.5rem;
	}

	.npd-header-second-row__brands {
		display: none;
	}

	.npd-header-second-row select.npd-header-second-row__brands-select {
		display: block;
		box-sizing: border-box;
		flex: 0 0 10.5rem;
		width: 10.5rem;
		min-width: 10.5rem;
		max-width: 10.5rem;
		height: 44px;
		min-height: 44px;
		margin: 0;
		padding: 0 2rem 0 0.85rem;
		color: inherit;
		font-family: inherit;
		font-size: var(--theme-font-size, inherit);
		font-weight: 300;
		line-height: 1.2;
		letter-spacing: normal;
		text-transform: none;
		cursor: pointer;
		appearance: none;
		border: 1px solid var(--theme-form-field-border-initial-color, var(--theme-border-color, rgba(0, 0, 0, 0.12)));
		border-radius: 30px;
		background-color: var(--theme-form-field-background-initial-color, #fff);
		background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1.5 1.75L6 6.25L10.5 1.75' fill='none' stroke='%23121212' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
		background-repeat: no-repeat;
		background-position: right 0.85rem center;
		background-size: 12px 8px;
		scroll-snap-align: start;
		scroll-margin-inline: 0.5rem;
	}

	.npd-header-second-row select.npd-header-second-row__brands-select:focus-visible {
		outline: max(2px, var(--theme-form-field-border-width, 1px)) solid var(--theme-form-field-border-focus-color, currentColor);
		outline-offset: 2px;
	}

	.npd-header-second-row__search {
		flex: 0 0 var(--npd-search-min-width);
		width: var(--npd-search-min-width);
		min-width: var(--npd-search-min-width);
	}

	.npd-header-second-row input[type="search"].npd-header-second-row__search-input {
		min-width: 12rem;
	}

	/*
	 * On narrow phones the scroller clips absolutely-positioned children.
	 * Remove positioning context from the container, scroller, and form
	 * so the results panel anchors to .npd-header-second-row (the outer
	 * wrapper which keeps position: relative and z-index: 40).
	 * The dropdown then sits directly beneath the entire second row,
	 * spanning its full width.
	 */
	.npd-header-second-row__container {
		position: static;
	}

	.npd-header-second-row__search {
		position: static;
	}

	.npd-header-second-row__search > .ct-search-results {
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		width: auto;
		max-width: none;
		margin-top: 0;
		border-radius: 0;
	}
}
