/**
 * PitStop Filter - Main CSS
 * (CSS classes like .wc-tab-filter-* are kept for now for compatibility with previous HTML structure)
 *
 * @since 1.0.3
 */

.wc-tab-filter-wrapper {
    position: relative; /* For loading overlay positioning */
    /* Add a border or background if desired for the whole widget */
    /* border: 1px solid #e0e0e0; */
    /* background-color: #f9f9f9; */
    /* border-radius: 5px; */
    /* overflow: hidden; */ /* If using rounded corners and child elements might poke out */
}

/* Tab Navigation */
.wc-tab-filter-nav {
    display: flex;
    flex-wrap: wrap; /* Allow tabs to wrap on smaller screens */
    list-style: none;
    padding: 0;
    margin: 0 0 -1px 0; /* Negative margin to overlap border with content area */
    border-bottom: 1px solid #ddd; /* Default bottom border for the nav container */
    position: relative;
    z-index: 2; /* Ensure nav is above content border */
}

.wc-tab-filter-nav-item {
    padding: 10px 20px;
    cursor: pointer;
    background-color: #f1f1f1; /* Default tab background */
    color: #333; /* Default tab text color */
    border: 1px solid #ddd; /* Default tab border */
    border-bottom: none; /* Remove bottom border, handled by nav container or active tab */
    margin-right: 5px;
    margin-bottom: 0; /* Reset margin for flex items */
    border-radius: 4px 4px 0 0; /* Rounded top corners */
    font-weight: 500;
    transition: background-color 0.3s ease, color 0.3s ease;
    white-space: nowrap; /* Prevent tab text from wrapping */
}

.wc-tab-filter-nav-item:hover {
    background-color: #e9e9e9; /* Tab hover background */
    color: #000;
}

.wc-tab-filter-nav-item.active {
    background-color: #ffffff; /* Active tab background (often same as content area) */
    color: #000; /* Active tab text color */
    border-color: #ddd; /* Active tab border color */
    border-bottom: 1px solid #ffffff; /* Make bottom border same as active tab bg to "connect" */
    /* Example for top border active accent, like in the image */
    /* border-top: 3px solid #d9534f; */
    /* padding-top: calc(10px - 3px); */ /* Adjust if using top border */
}

/* Tab Content Panes */
.wc-tab-filter-content {
    background-color: #ffffff; /* Content area background */
    border: 1px solid #ddd; /* Content area border */
    border-top: none; /* Avoid double border with nav */
    position: relative;
    z-index: 1;
    clear: both; /* Ensure it clears floated elements if any */
}
.wc-tab-filter-content-inner {
    padding: 20px; /* Padding for the actual content inside the pane */
}


.wc-tab-filter-pane {
    display: none; /* Hide inactive panes */
}

.wc-tab-filter-pane.active {
    display: block; /* Show active pane */
}

/* Filter Fields Styling */
.wc-tab-filter-fields {
    display: flex; /* Align fields in a row */
    flex-wrap: wrap; /* Allow wrapping on smaller screens */
    gap: 15px; /* Space between filter fields */
    margin-bottom: 20px; /* Space before the search button */
}

.filter-field {
    flex: 1 1 180px; /* Allow fields to grow and shrink, with a base width */
    display: flex;
    flex-direction: column;
    min-width: 150px; /* Ensure a minimum width before shrinking too much */
}

.filter-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    font-size: 0.9em;
    color: #555;
}

.filter-field select,
.filter-field input[type="text"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box; /* Include padding and border in the element's total width and height */
    background-color: #fff;
    transition: border-color 0.3s ease;
    font-size: 1em; /* Ensure consistent font size */
}

.filter-field select:disabled {
    background-color: #e9ecef; /* Bootstrap-like disabled color */
    cursor: not-allowed;
    opacity: 0.7;
}
.filter-field select:focus,
.filter-field input[type="text"]:focus {
    border-color: #0073aa; /* WordPress blue for focus */
    outline: none;
    box-shadow: 0 0 0 1px #0073aa;
}


/* Search Button */
/* Targeting the Elementor button class directly for better integration */
.wc-tab-filter-submit.elementor-button { 
    /* Elementor handles most styling. Add overrides if needed. */
    /* Example: make it full width on small screens if not already */
    /* width: auto; */ /* Default */
}
/* Ensure icon within the button is styled as expected */
.wc-tab-filter-pane .elementor-button .elementor-button-icon i {
    font-size: 1em; /* Adjust icon size if needed */
}


/* Product Results Area (less relevant if always redirecting, but good for messages) */
.wc-tab-filter-results {
    margin-top: 20px;
    padding: 10px;
    min-height: 50px; /* To give it some space even when empty or for messages */
    /* border: 1px dashed #eee; */ /* Optional: to see its boundaries */
}

/* Loading Overlay and Spinner */
.wc-tab-filter-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.8); /* Slightly more opaque for better visibility */
    z-index: 100; /* Ensure it's on top of other content within the wrapper */
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: inherit; /* Inherit border radius from wrapper if any */
}

.wc-tab-filter-spinner {
    border: 4px solid #f3f3f3; /* Light grey */
    border-top: 4px solid #0073aa; /* WordPress blue, or your theme's accent color */
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Adjustments (Example) */
@media (max-width: 768px) {
    /* .wc-tab-filter-fields { */
        /* flex-direction: column; // This might be too restrictive, flex-wrap is often better */
    /* } */
    .filter-field {
        flex-basis: calc(50% - 10px); /* Two columns on medium screens, adjust gap as needed */
        min-width: calc(50% - 10px); /* Ensure they don't get too small before wrapping */
    }
     .wc-tab-filter-submit.elementor-button {
        width: 100%; /* Make button full width on smaller screens */
    }
}
@media (max-width: 480px) {
    .filter-field {
        flex-basis: 100%; /* Single column on small screens */
        min-width: 100%;
    }
    .wc-tab-filter-nav-item {
        flex-grow: 1; /* Allow tabs to take full width if they don't fit on one line */
        text-align: center;
        margin-right: 0; /* Remove right margin if they stack or take full width */
        margin-bottom: 2px; /* Add a little space if they wrap and stack */
        border-radius: 4px; /* Adjust radius if they stack */
    }
    .wc-tab-filter-nav {
        border-bottom: none; /* Remove bottom border if tabs stack */
    }
    .wc-tab-filter-nav-item.active {
        border-bottom: 1px solid #ddd; /* Re-add bottom border for active stacked tab */
    }

}