/* General body styling */
body {
    font-family: inherit; /* Use theme font */
    color: inherit; /* Use theme color */
    margin: 0;
}

/* Apply box-sizing globally to fix content overflow */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* Container styling for the search and filter */
.searchandfilter {
    max-width: 800px;
    margin: 20px auto;
    padding: 20px;
    background-color: #f9f9f9; /* Light background to separate it */
    border: 1px solid #e0e0e0; /* Subtle border for structure */
    border-radius: 15px; /* Rounded corners */
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.05); /* Soft shadow for depth */
    overflow: hidden; /* Prevent content from overflowing the box */
}

/* Paragraph and inline list items styling */
.searchandfilter p, .searchandfilter ul {
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap; /* Ensure items wrap properly */
    gap: 15px; /* Increased gap for better visibility */
}

/* List item styling */
.searchandfilter li {
    list-style: none;
    padding: 10px 15px; /* Increased padding for touch devices */
    background-color: #fff; /* White background for contrast */
    border: 1px solid #e0e0e0; /* Subtle border for each item */
    border-radius: 5px; /* Slightly rounded corners */
    max-width: 100%; /* Prevent items from overflowing the container */
    flex: 1 1 auto; /* Allow items to shrink and grow evenly */
    transition: all 0.3s ease; /* Smooth transition for all properties */
}

.searchandfilter li:hover {
    background-color: #f0f0f0; /* Highlight on hover */
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); /* Enhanced shadow on hover */
}

/* Label and header styling */
.searchandfilter label {
    display: block;
    font-size: 14px;
    font-weight: 600; /* Semibold for better emphasis */
    margin-bottom: 5px;
    color: #333; /* Darker text for labels */
}

.searchandfilter h4 {
    margin: 15px 0 10px;
    font-size: 18px;
    color: #2c3e50; /* Darker color for the header */
}

/* Nested list adjustments */
.searchandfilter ul > li > ul:not(.children) {
    margin-left: 20px;
}

/* Widget area adjustments for sidebar */
.widget-area .searchandfilter {
    margin: 0;
    padding: 0;
    border: none; /* Remove border for sidebar integration */
    background: transparent; /* Transparent background for sidebar */
    box-shadow: none; /* No shadow in sidebar */
}

.widget-area .searchandfilter li, .widget-area .searchandfilter p {
    display: block;
    margin-bottom: 10px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .searchandfilter {
        padding: 15px; /* Reduce padding for smaller screens */
    }
    .searchandfilter ul {
        flex-direction: column; /* Stack items vertically on smaller screens */
    }

    .searchandfilter li {
        width: 100%; /* Full width for smaller devices */
    }
}
