.sorting-toolbar {
	display: flex;
	justify-content: flex-end; /* move to the opposite side (right) */
	align-items: center;
	margin: 8px 0 16px 0;
}

.sorting-block {
	display: inline-flex;
	align-items: center;
	gap: 10px;
}

.sorting-label {
	font-size: 14px;
	color: #333;
}

.sorting-select {
	min-width: 240px;
	padding: 10px 12px;
	border: 1px solid #e1e4e8;
	border-radius: 12px;
	background: #fff;
	color: #1f2328;
	box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.sorting-links a {
	margin-right: 12px;
}

/* Mobile: align to the right as per screenshot, keep compact width */
@media (max-width: 735px) {
	.sorting-toolbar {
		justify-content: flex-end; /* move to the right on mobile */
	}
	.sorting-block { width: auto; }
	.sorting-select { width: auto; }
	.sorting-dropdown { width: auto; }

	/* Place filter toggle and sorting centered with 10px gap */
	.new-products-page .page-layout {
		display: flex;
		flex-direction: column;
		align-items: center;
		position: relative;
	}
	
	/* Create centered row container */
	.new-products-page .page-layout::before {
		content: '';
		position: absolute;
		top: 0;
		left: 50%;
		transform: translateX(-50%);
		display: flex;
		align-items: center;
		gap: 10px;
		height: 44px;
	}
	
	.new-products-page .filters-column,
	.new-products-page .content-column .sorting-toolbar {
		position: absolute;
		top: 8px;
		margin: 0;
	}
	
	.new-products-page .filters-column {
		right: calc(50% + 5px); /* half gap from center */
	}
	
	.new-products-page .content-column .sorting-toolbar {
		left: calc(50% + 5px); /* half gap from center */
	}
	.new-products-page #products-container,
	.new-products-page .ui-pagination,
	.new-products-page .new-description,
	.new-products-page .reviewed-wrapper {
		grid-column: 1 / -1; /* full width below the top row */
		padding-top: 8px;
		max-height: 580px;
	}
}

/* Custom stylable dropdown (JS-enhanced) */
.sorting-dropdown {
	position: relative;
	display: inline-block;
}
.sorting-trigger {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 10px 12px;
	background: #fff;
	border: 1px solid #e1e4e8;
	border-radius: 8px;
	color: #1f2328;
	cursor: pointer;
	width: 160px;
    justify-content: center;
}
.sorting-trigger:hover {
	border-color: #c9d1d9;
	box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.sorting-menu {
	position: absolute;
	right: 0;
	z-index: 1000;
	margin-top: 6px;
	min-width: 260px;
	background: #fff;
	border: 1px solid #e1e4e8;
	border-radius: 8px;
	box-shadow: 0 6px 18px rgba(0,0,0,0.08);
	padding: 6px;
	list-style: none;
	display: none;
}
.sorting-trigger[aria-expanded="true"] + .sorting-menu {
    display: block;
}
.sorting-item {
	padding: 10px 10px;
	border-radius: 6px;
	color: #1f2328;
	cursor: pointer;
}
.sorting-item:hover {
	background: #f1f5f9; /* hover color change as requested */
	color: #0f172a;
}
.sorting-item[aria-selected="true"] {
	background: #e6f4ff;
	color: #0550ae;
}

/* Very small screens: smaller sorting controls */
@media (min-width:320px) and (max-width: 368px) {
	.sorting-select {
		min-width: 180px;
		padding: 6px 8px;
		font-size: 12px;
	}
	.sorting-trigger {
		padding: 6px 8px;
		font-size: 12px;
		gap: 6px;
		width: 138px;
		display: flex;
		justify-content: center;
	}
	.sorting-menu {
		min-width: 200px;
	}
	.sorting-item {
		padding: 8px 8px;
		font-size: 12px;
	}
	
	/* Reduce gap between filter and sorting buttons */
	.new-products-page .filters-column {
		right: calc(45% + 0px); /* reduced from 5px to 3px */
	}
	
	.new-products-page .content-column .sorting-toolbar {
		left: calc(50% + 3px); /* reduced from 5px to 3px */
	}
}
