/* Custom WooCommerce sorting menu. This avoids native iOS/Android select popups. */
.woocommerce-ordering.mlh-sort-ready {
	position: relative !important;
	display: none !important;
	align-items: stretch !important;
	justify-content: stretch !important;
	width: min(100%, 250px) !important;
	height: auto !important;
	overflow: visible !important;
}

.tax-product_cat .shop-loop-head:has(.mlh-sort-open),
.tax-product_cat .shop-loop-head:has(.mlh-sort-ready) {
	z-index: 10020;
	overflow: visible;
}

.tax-product_cat .shop-loop-head.mlh-sort-toolbar-ready,
.tax-product_cat .shop-loop-head.mlh-sort-toolbar-open {
	z-index: 1;
	overflow: visible;
}

.tax-product_cat .shop-loop-head.mlh-sort-toolbar-open {
	z-index: 10040;
}

.tax-product_cat .wd-shop-tools {
	overflow: visible;
}

.woocommerce-ordering.mlh-sort-open {
	z-index: 10030;
}

.woocommerce-ordering.mlh-sort-ready::after {
	display: none !important;
}

.woocommerce-ordering.mlh-sort-ready select.orderby {
	position: absolute !important;
	width: 1px !important;
	height: 1px !important;
	padding: 0 !important;
	border: 0 !important;
	clip: rect(0 0 0 0) !important;
	clip-path: inset(50%) !important;
	overflow: hidden !important;
	white-space: nowrap !important;
}

.mlh-sort-trigger {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    margin: 0;
    padding: 0 18px;
    border-radius: 0;
    background: #ffffff;
    box-shadow: none;
    color: #111111;
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.2;
    text-align: start;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
	text-transform: capitalize;
}

.mlh-sort-trigger::before {
	content: none;
}

[dir="rtl"] .mlh-sort-trigger,
.rtl .mlh-sort-trigger {
	padding-right: 18px;
	padding-left: 18px;
}

.mlh-sort-trigger:hover {
	background: #f7f7f7;
}

.mlh-sort-trigger:focus {
	border-color: #000000;
	box-shadow: none;
	outline: none;
}

.mlh-sort-trigger-text {
	display: block;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.mlh-sort-arrow {
	position: absolute;
	top: 50%;
	inset-inline-end: 18px;
	width: 8px;
	height: 8px;
	border-right: 2px solid #111111;
	border-bottom: 2px solid #111111;
	pointer-events: none;
	transform: translateY(-65%) rotate(45deg);
	transition: transform 0.2s ease;
}

.mlh-sort-trigger[aria-expanded="true"] .mlh-sort-arrow {
	transform: translateY(-35%) rotate(225deg);
}

.mlh-sort-menu {
	position: absolute;
	top: calc(100% + 6px);
	inset-inline-start: 0;
	z-index: 99999;
	display: none;
	width: 100%;
	min-width: 200px;
	border: 1px solid #111111;
	background: #ffffff;
}

.mlh-sort-menu.is-open {
	display: block;
}

.mlh-sort-option {
	display: block;
	width: 100%;
	margin: 0;
	padding: 13px 18px;
	border: 0;
	border-bottom: 1px solid #eeeeee;
	background: #ffffff;
	color: #111111;
	cursor: pointer;
	font: inherit;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.35;
	text-align: start;
text-transform: capitalize;
}

.mlh-sort-option:last-child {
	border-bottom: 0;
}

.mlh-sort-option:hover,
.mlh-sort-option:focus {
	background: #f7f7f7;
	outline: none;
}

.mlh-sort-option.is-selected {
	background: #111111;
	color: #ffffff;
}

@media (max-width: 768px) {
	.woocommerce-ordering.mlh-sort-ready {
		width: 42px !important;
		min-width: 42px !important;
	}

	.woocommerce-ordering.mlh-sort-open {
		z-index: 10040;
	}

	.mlh-sort-trigger {
		justify-content: center;
		width: 42px;
		min-height: 42px;
		padding: 0;
		font-size: 0;
	}

	.mlh-sort-trigger::before {
        content: "";
        display: block;
        width: 18px;
        height: 18px;
        background-image: url(https://test.mylittlehome.com.sa/wp-content/uploads/2026/05/sort.png);
        background-size: contain;
		background-repeat: no-repeat;
        background-position: center;
    }

[dir="rtl"] .mlh-sort-trigger,
.rtl .mlh-sort-trigger {
	padding-right: 0px;
	padding-left: 0px;
}

	.mlh-sort-trigger-text,
	.mlh-sort-arrow {
		display: none;
	}

	.mlh-sort-menu {
		inset-inline-start: auto;
		inset-inline-end: 0;
		width: min(82vw, 200px);
		min-width: min(82vw, 200px);
	}
}
