/* Vehicle Filter Styles */
.vehicle-filter-form {
    background: #f9f9f9;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.vehicle-filter-form h3 {
    margin-top: 0;
    margin-bottom: 20px;
    color: #333;
    font-size: 1.2em;
}

/* NEW: Flexbox layout for the form fields */
.vehicle-filter-form form {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.filter-field {
    margin-bottom: 0; /* Handled by gap */
    flex: 1 1 200px; /* Responsive width: min 200px, grow to fill */
    min-width: 160px; /* Ensure space for placeholders */
    width: auto; 
}

.filter-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #555;
}

.filter-field select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background-color: #fff;
}

.filter-field select:disabled {
    background-color: #f5f5f5;
    color: #999;
    cursor: not-allowed;
}

.filter-actions {
    flex: 1 1 100%;
    width: 100%;
    margin-top: 20px;
    text-align: center;
}

.filter-actions button {
    background-color: #0073aa;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    cursor: pointer;
    margin: 0 5px;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.filter-actions button:hover {
    background-color: #005a87;
}

.filter-actions button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

#filter-reset {
    background-color: #666;
}

#filter-reset:hover {
    background-color: #555;
}

#filter-results {
    margin-top: 30px;
    border-top: 2px solid #e1e1e1;
    padding-top: 20px;
}

#loading {
    text-align: center;
    padding: 20px;
    color: #666;
    font-style: italic;
}

.results-info {
    background: #e7f4ff;
    border: 1px solid #b3d9ff;
    border-radius: 4px;
    padding: 10px;
    margin-bottom: 20px;
    color: #0073aa;
    font-weight: bold;
}

.vehicle-filtered-products {
    display: grid;
    gap: 20px;
}

.vehicle-product-item {
    display: flex;
    background: white;
    border: 1px solid #e1e1e1;
    border-radius: 6px;
    padding: 15px;
    align-items: center;
    transition: box-shadow 0.3s ease;
}

.vehicle-product-item:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.product-image {
    flex-shrink: 0;
    margin-right: 15px;
}

.product-image img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
}

.product-details {
    flex-grow: 1;
}

.product-details h4 {
    margin: 0 0 8px 0;
    font-size: 1.1em;
}

.product-details h4 a {
    color: #333;
    text-decoration: none;
}

.product-details h4 a:hover {
    color: #0073aa;
}

.product-sku {
    margin: 0 0 5px 0;
    font-size: 0.9em;
    color: #666;
}

.product-price {
    margin: 0 0 8px 0;
    font-weight: bold;
    color: #0073aa;
    font-size: 1.1em;
}

.product-stock {
    margin: 0 0 10px 0;
    font-size: 0.9em;
    font-weight: bold;
}

.product-stock.in-stock {
    color: #46b450;
}

.product-stock.out-of-stock {
    color: #dc3232;
}

.product-actions {
    margin-top: 10px;
}

.product-actions .button {
    display: inline-block;
    background-color: #0073aa;
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 4px;
    font-size: 13px;
    margin-right: 8px;
    transition: background-color 0.3s ease;
}

.product-actions .button:hover {
    background-color: #005a87;
    color: white;
}

.product-actions .add-to-cart {
    background-color: #46b450;
}

.product-actions .add-to-cart:hover {
    background-color: #3ba748;
}

/* Responsive Design */
@media (max-width: 768px) {
    .vehicle-filter-form {
        margin: 10px 0;
        padding: 15px;
    }
    
    .filter-actions button {
        display: block;
        width: 100%;
        margin: 5px 0;
    }
    
    .vehicle-product-item {
        flex-direction: column;
        text-align: center;
    }
    
    .product-image {
        margin-right: 0;
        margin-bottom: 15px;
    }
}

/* Adjusted for Flex Compatibility */
@media (min-width: 769px) {
    /* Removed restrictive inline-block widths to allow flex to handle layout */
    /* Kept structure for reference but neutralized interfering styles */
    .filter-field {
        display: block;
        width: auto;
        margin-right: 0;
    }
}
