/* Product Search & Filter */
#psf-wrapper {
    max-width: 100%;
    margin: 0 auto 30px;
    font-family: inherit;
}

/* Search Bar */
.psf-search-wrap {
    margin-bottom: 20px;
}

#psf-search {
    width: 100%;
    padding: 14px 18px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: #fff;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

#psf-search:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

/* Filters Row */
.psf-filters {
    display: flex;
    gap: 16px;
    align-items: flex-end;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.psf-filter {
    flex: 1;
    min-width: 150px;
}

.psf-filter label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #555;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Standard select (Sort By) */
.psf-filter select {
    width: 100%;
    padding: 11px 14px;
    font-size: 14px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background-color: #fff;
    outline: none;
    cursor: pointer;
    transition: border-color 0.2s;
    appearance: auto;
    box-sizing: border-box;
}

.psf-filter select:focus {
    border-color: #0073aa;
}

/* Custom Multi-Select Dropdown */
.psf-multi-select {
    position: relative;
}

.psf-ms-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 14px;
    font-size: 14px;
    border: 2px solid #ddd;
    border-radius: 8px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    user-select: none;
    box-sizing: border-box;
}

.psf-ms-toggle:hover {
    border-color: #bbb;
}

.psf-multi-select.open .psf-ms-toggle {
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.psf-ms-toggle.has-selection {
    border-color: #0073aa;
    color: #0073aa;
    font-weight: 600;
}

.psf-ms-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.psf-ms-arrow {
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid #666;
    margin-left: 10px;
    transition: transform 0.2s;
}

.psf-multi-select.open .psf-ms-arrow {
    transform: rotate(180deg);
}

.psf-ms-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border: 2px solid #0073aa;
    border-top: none;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    max-height: 220px;
    overflow-y: auto;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.psf-multi-select.open .psf-ms-dropdown {
    display: block;
}

.psf-ms-option {
    display: flex;
    align-items: center;
    padding: 9px 14px;
    cursor: pointer;
    transition: background 0.15s;
    font-size: 14px;
    color: #333;
    gap: 8px;
    margin: 0;
}

.psf-ms-option:hover {
    background: #f0f7fc;
}

.psf-ms-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    cursor: pointer;
    accent-color: #0073aa;
    flex-shrink: 0;
}

.psf-ms-option span {
    flex: 1;
    line-height: 1.3;
}

/* Reset Button */
#psf-reset {
    padding: 11px 24px;
    font-size: 14px;
    font-weight: 600;
    color: #666;
    background: #f0f0f0;
    border: 2px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

#psf-reset:hover {
    background: #e0e0e0;
    border-color: #ccc;
    color: #333;
}

/* Popular Categories */
.psf-popular {
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.psf-popular-label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-right: 4px;
}

.psf-popular-btn {
    display: inline-block;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.psf-popular-btn:hover {
    border-color: #0073aa;
    color: #0073aa;
}

.psf-popular-btn.active {
    background: #0073aa;
    border-color: #0073aa;
    color: #fff;
}

/* Result Count */
#psf-result-count {
    font-size: 14px;
    color: #666;
    margin-bottom: 16px;
    font-weight: 500;
}

/* Products Grid */
.psf-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.psf-product {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    overflow: hidden;
    transition: box-shadow 0.2s;
    display: flex;
    flex-direction: column;
}

.psf-product:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.psf-product-link {
    text-decoration: none;
    color: inherit;
    display: block;
    flex: 1;
}

.psf-product-img {
    display: block;
    position: relative;
    overflow: hidden;
}

.psf-product-img img {
    width: 100%;
    height: auto;
    display: block;
    margin: 0;
}

.psf-product-title {
    display: block;
    padding: 12px 16px 0;
    margin: 0;
    font-size: 1em;
    line-height: 1.5;
    font-weight: 600;
    color: #333;
}

.psf-product-price {
    display: block;
    padding: 8px 16px 12px;
    font-size: 14px;
    color: #32373c;
    font-weight: 500;
}

.psf-product-price del {
    color: #999;
    margin-right: 6px;
}

.psf-product-price ins {
    text-decoration: none;
    color: #32373c;
    font-weight: 600;
}

.psf-add-to-cart {
    display: block;
    margin: 0 16px 16px;
    padding: 10px;
    background-color: #32373c;
    color: #fff;
    text-align: center;
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.psf-add-to-cart:hover {
    background-color: #23282d;
    color: #fff;
}

/* No Results */
.psf-no-results {
    text-align: center;
    padding: 40px 20px;
    font-size: 16px;
    color: #888;
    background: #f9f9f9;
    border-radius: 10px;
}

/* Responsive */
@media (max-width: 900px) {
    .psf-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .psf-filters {
        flex-direction: column;
    }

    .psf-filter {
        min-width: 100%;
    }

    .psf-grid {
        grid-template-columns: 1fr;
    }

    .psf-popular {
        flex-direction: column;
        align-items: flex-start;
    }
}
