.woocommerce-ordering {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap; 
}

.product-count-selector {
    margin-right: 20px;
    display: flex;
    align-items: center;
}

.product-count-selector span {
    margin-right: 10px;
    font-weight: bold;
}

.product-count-option {
    margin-right: 5px;
    padding: 5px 10px;
    color: #333;
    text-decoration: none;
}

.product-count-option.active {
    font-weight: bold;
}

.product-count-option:hover {
    background-color: #e5e5e5;
}

.separator {
    margin: 0 5px;
    font-weight: bold;
}

.woocommerce-ordering-tabs {
    display: flex;
    align-items: center;
    margin-left: 20px; 
}

.sort-tab {
    margin-right: 10px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    background-color: #f5f5f5;
    color: #333;
    text-decoration: none;
}

.sort-tab.active {
    background-color: #333;
    color: #fff;
}

.sort-tab:hover {
    background-color: #e5e5e5;
	color: #000;
}

.sort-by-label {
    margin-right: 10px;
    font-weight: bold;
}

/* Modal styling */
.sorting-modal {
    display: none; 
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: 50vh; /* Limit the height to 50% of the viewport height */
    overflow-y: auto; /* Allow scrolling if content exceeds the modal's height */
    background-color: #fff;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
    z-index: 1001;
    padding: 20px;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    opacity: 0; 
    transform: translateY(100%); 
    transition: opacity 0.3s ease-out, transform 0.3s ease-out; 
}

/* Show modal */
.sorting-modal.show {
    display: flex; 
    opacity: 1; 
    transform: translateY(0); 
}

/* Title styling inside the modal */
.sorting-modal-title {
    text-align: center;
    margin-bottom: 20px;
}

.sorting-modal-title h2 {
    font-size: 18px;
    font-weight: bold;
    margin: 0;
    padding: 0;
    color: #333;
}

/* Styling for the sorting options */
.sorting-modal ul {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

/* Individual sorting option */
.sorting-modal li {
    padding: 10px 0;
    border-bottom: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sorting-modal li:last-child {
    border-bottom: none; 
}

/* Label styling */
.sorting-modal label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    font-size: 16px;
    color: #333;
    cursor: pointer;
}

/* Ensure the text is on the left and the radio button is on the right */
.sorting-modal label span {
    flex-grow: 1;
    text-align: left;
}

/* Radio button styling */
.sorting-modal input[type="radio"] {
    margin-left: 10px; 
    accent-color: inherit; /* Inherit the theme's accent color for radio buttons */
    width: 20px;
    height: 20px;
}

/* Active radio button styling */
.sorting-modal input[type="radio"]:checked {
    accent-color: #333; 
}

/* Close button styling */
.close-modal-button {
    margin-top: 20px;
    padding: 15px;
    background-color: inherit; 
    color: inherit; 
    border: 1px solid #ddd;
    text-align: center;
    cursor: pointer;
    border-radius: 5px;
    width: 100%; 
    font-size: 16px; 
    display: block; 
    box-sizing: border-box; 
}

/* Adjust for mobile screens */
@media screen and (max-width: 768px) {
    .woocommerce-ordering-tabs, 
    .sort-by-label, 
    .product-count-selector {
        display: none !important; 
    }

    .sorting-button {
        display: inline-block;
        padding: 8px 12px;
        background-color: #333;
        color: #fff;
        border: 1px solid #ddd;
        cursor: pointer;
        font-size: 16px;
       /* margin-left: 20px; */
        z-index: 1000;
    }
}

/* Adjust for larger screens */
@media screen and (min-width: 769px) {
    .sorting-button, 
    .sorting-modal {
        display: none !important; 
    }
}

.sorting-option-popularity {
    /* Specific styles for the popularity sorting option in the modal */
}

.sort-tab-popularity {
    /* Specific styles for the popularity sorting option in the desktop tabs */
}

