#no-results-message {
    grid-column: 1 / span 3;
    grid-row: 1;
    text-align: center;
    padding: 20px;
    margin: 20px 0;
}

.product-search-container {
    display: grid;
    grid-template-columns: 1fr 3fr;
    gap: 20px;
}

.search-column {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 10px;
}

.search-column label {
    margin-bottom: 5px;
}

.search-column hr {
    margin: 10px 0;
}

.search-column input[type="text"] {
    padding: 5px;
    margin-bottom: 10px;
    width: 100%;
}

/* Remove bullets from the appended dropdown */
.search-column .ui-autocomplete {
    list-style: none;        
    list-style-type: none;   /* extra check */
    margin: 0;               
    padding: 0;              
    max-height: 300px;     
    overflow-y: auto;      /* vertical scrollbar when content exceeds max-height */
    overflow-x: hidden;    /* no horizontal scroll */
}

/* And ensure each <li> can still highlight properly */
.search-column .ui-autocomplete li {
    list-style: none;        
    margin: 0;               
    padding: 5px;            
    cursor: pointer;
  }

.ui-autocomplete {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 1000;
    float: left;
    display: none;
    min-width: 160px;
    width: 100%;
    padding: 4px 0;
    margin: 2px 0 0 0;
    list-style: none;
    background-color: #ffffff;
    border-color: #ccc;
    border-style: solid;
    border-width: 1px;
    border-radius: 4px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
    box-sizing: border-box;
    max-width: 100%;
}

.ui-autocomplete li {
    padding: 5px;
    cursor: pointer;
}

.ui-autocomplete li:hover {
    background-color: #f0f0f0;
}

.ui-helper-hidden-accessible {
    display: none;
}

#category-list {
    list-style: none;
    padding: 0;
    margin-bottom: 10px;
}

#category-list li {
    margin-bottom: 5px;
    display: flex;
    align-items: center;
}

#category-list input[type="checkbox"] {
    margin-right: 5px;
    border: 1px solid #b4b9be;
    border-radius: 8px;
    cursor: pointer;
    height: 20px;
    width: 20px;
    vertical-align: middle;
    appearance: none; /* Remove default checkbox styling */
    -webkit-appearance: none; /* Remove default checkbox styling for WebKit browsers */
    -moz-appearance: none; /* Remove default checkbox styling for Firefox */
}

#category-list input[type="checkbox"]:checked {
    background-color: #012b49; 
}

#category-list input[type="checkbox"]::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 12px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: translate(-50%, -50%) rotate(45deg);
    display: none;
}

#category-list input[type="checkbox"]:checked::after {
    display: block;
}

#category-list label {
    font-size: 0.9em;
    font-weight: normal;
    color: #555;
}

.hidden {
    display: none;
}

#category-dropdown {
    width: 100%;
    display: none; 
}

#clear-filters {
    color: #333333;
    text-decoration: none;
    display: flex;
    align-items: center;
    margin-top: 10px;
}

.clear-symbol {
    font-size: 1.5em;
    margin-right: 5px;
}

.product-column-container {
    display: flex;
    flex-direction: column;
}

.product-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap; 
}

.product-controls span, .product-controls select {
    margin-bottom: 10px;
}

.custom-product-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.custom-product-item {
    margin: 10px;
    text-align: left; 
    position: relative;
    padding: 5px;
}

.custom-product-image-wrapper {
    position: relative;
    overflow: hidden;
}

.custom-product-image {
    width: 100%;
    height: auto;
    transition: transform 0.3s ease;
}

.custom-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.42);
    opacity: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.3s ease;
}

.custom-magnifier {
    font-size: 2em;
    color: #F6871F;
}

.custom-product-image-wrapper:hover .custom-overlay {
    opacity: 1;
}

.custom-product-image-wrapper:hover .custom-product-image {
    transform: scale(1.05);
}

.custom-product-title {
    color: #012b49;
    font-size: 20px; 
    line-height: 1em;
    margin: 10px 0;
    font-weight: 600; 
}

.custom-product-price {
    color: #F6871F;
    font-size: 20px; 
    line-height: 20px;
    font-weight: 600; 
}

.pagination-container {
    text-align: center;
    margin-top: 20px;
}

.page-numbers.current, a.page-numbers {
    display: inline-block;
    padding: 5px 10px;
    margin: 0px;
    border: 1px solid #ccc;
    border-radius: 5px;
    text-decoration: none;
    color: #000;
}

.page-numbers.current {
    background: #e9e6ed;
    color: #816e99;
}

.page-numbers.current, a.page-numbers:hover {
    background: #e9e6ed;
    color: #816e99;
}

hr {
    border: 1px solid rgba(0,0,0,.1);
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.loading-overlay::before {
    content: '';
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}


@media (min-width: 1000px) {
    #category-dropdown, .product-search-container .select2-container {
        display: none !important;
    }
}

@media (max-width: 1000px) {
    .product-search-container {
        grid-template-columns: 1fr;
    }

    .custom-product-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    #no-results-message {
        grid-row: 1;
        grid-column: 1 / span 2;
    }

    .search-column {
        order: 1;
    }

    .product-column-container {
        order: 2;
    }

    #category-list {
        display: none;
    }

    #category-dropdown, .product-search-container .select2-container { 
        display: block !important; 
        margin-bottom: 10px;
        width: 100%;
    }

    #results-count {
        font-size: 0.9em; 
    }

    .custom-product-item {
        margin: 0px;
    }
}

@media (max-width: 768px) {
    .product-controls {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    #results-count {
        order: 1;
        margin-bottom: 0;
        font-size: 0.8em; 
    }

    #sort-options {
        order: 2;
        font-size: 0.8em; 
        background-color: #ececec; 
        width: 100%;
        margin-top: 10px;
    }

    .custom-product-grid {
        grid-template-columns: 1fr;
    }

    .custom-product-item {
        margin: 0px;
    }

    #no-results-message h4 {
        font-size: 130%;
        line-height: 25px;
    }
}
