/* ========================================
   MPBOX Product Filter - Custom Styles
   Megapalety.com / Enfold Child Theme
   ======================================== */

/* ---- Layout ---- */
.mpbox-filter-wrapper {
    display: flex;
    gap: 30px;
    max-width: 1310px;
    margin: 0 auto;
    padding: 20px 0;
    font-family: inherit;
}

/* ---- Sidebar ---- */
.mpbox-sidebar {
    width: 250px;
    flex-shrink: 0;
    position: sticky;
    top: 100px;
    align-self: flex-start;
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 6px;
    padding: 20px;
}

.mpbox-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #ff9900;
}

.mpbox-sidebar-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #333;
}

.mpbox-clear-cats {
    background: none;
    border: none;
    color: #ff9900;
    cursor: pointer;
    font-size: 13px;
    padding: 0;
    text-decoration: underline;
}

.mpbox-clear-cats:hover {
    color: #e68a00;
}

.mpbox-category-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mpbox-category-list li {
    margin-bottom: 8px;
}

.mpbox-category-list label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    padding: 6px 8px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.mpbox-category-list label:hover {
    background-color: #f5f5f5;
}

.mpbox-cat-checkbox {
    width: 18px;
    height: 18px;
    accent-color: #ff9900;
    flex-shrink: 0;
}

.mpbox-cat-name {
    flex: 1;
}

.mpbox-cat-count {
    color: #999;
    font-size: 12px;
    flex-shrink: 0;
}

/* ---- Main Content ---- */
.mpbox-main {
    flex: 1;
    min-width: 0;
}

/* ---- Top Bar ---- */
.mpbox-topbar {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    padding: 15px 20px;
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 6px;
    margin-bottom: 15px;
}

.mpbox-search-wrap {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.mpbox-search {
    width: 100%;
    padding: 10px 40px 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
	margin-bottom: 0px !important;
}

.mpbox-search:focus {
    border-color: #ff9900;
}

.mpbox-search-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    color: #999;
    pointer-events: none;
}

.mpbox-sort-wrap {
    flex-shrink: 0;
}

.mpbox-sort {
    padding: 10px 35px 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
    outline: none;
    appearance: auto;
	margin-bottom: 0px !important;
}

.mpbox-sort:focus {
    border-color: #ff9900;
}

.mpbox-price-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
    min-width: 250px;
	margin-bottom: 0px !important;
}

.mpbox-price-label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}

.mpbox-price-inputs {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: #555;
    white-space: nowrap;
}

.mpbox-price-input {
    width: 80px;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
    text-align: center;
    outline: none;
    -moz-appearance: textfield;
	margin-bottom: 0px !important;

}

.mpbox-price-input::-webkit-outer-spin-button,
.mpbox-price-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.mpbox-price-input:focus {
    border-color: #ff9900;
}

.mpbox-price-currency {
    font-size: 13px;
    color: #555;
    font-weight: 600;
}

.mpbox-price-separator {
    color: #999;
}

#mpbox-price-slider {
    flex: 1;
    min-width: 120px;
    margin: 0 5px;
}

/* jQuery UI Slider overrides */
#mpbox-price-slider.ui-slider {
    height: 6px;
    background: #e1e1e1;
    border: none;
    border-radius: 3px;
}

#mpbox-price-slider .ui-slider-range {
    background: #ff9900;
    border-radius: 3px;
}

#mpbox-price-slider .ui-slider-handle {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ff9900;
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    top: -8px;
    cursor: pointer;
    outline: none;
}

#mpbox-price-slider .ui-slider-handle:hover,
#mpbox-price-slider .ui-slider-handle:focus {
    background: #e68a00;
}

.mpbox-clear-all {
    padding: 10px 18px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #666;
    cursor: pointer;
    font-size: 13px;
    white-space: nowrap;
    transition: all 0.2s;
}

.mpbox-clear-all:hover {
    background: #ff9900;
    border-color: #ff9900;
    color: #fff;
}

/* ---- Results Info ---- */
.mpbox-results-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 10px 0;
    margin-bottom: 10px;
}

.mpbox-product-count {
    font-size: 14px;
    color: #666;
    font-weight: 600;
}

.mpbox-active-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.mpbox-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    background: #fff3e0;
    border: 1px solid #ff9900;
    border-radius: 20px;
    font-size: 12px;
    color: #333;
}

.mpbox-filter-tag-remove {
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
    color: #ff9900;
    font-weight: bold;
}

.mpbox-filter-tag-remove:hover {
    color: #cc7a00;
}

/* ---- Loading Overlay ---- */
.mpbox-loading {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.75);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10;
    border-radius: 6px;
}

.mpbox-loading.active {
    display: flex;
}

.mpbox-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e1e1e1;
    border-top-color: #ff9900;
    border-radius: 50%;
    animation: mpbox-spin 0.8s linear infinite;
}

@keyframes mpbox-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ---- Products Grid ---- */
.mpbox-products-grid .products {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.mpbox-products-grid .products .product {
    width: 100% !important;
    float: none !important;
    margin: 0 !important;
    clear: none !important;
}

.mpbox-no-results {
    text-align: center;
    padding: 60px 20px;
    color: #999;
    font-size: 16px;
}

/* ---- Pagination ---- */
.mpbox-pagination {
    margin-top: 30px;
    text-align: center;
}

.mpbox-page-numbers {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.mpbox-page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 12px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #333;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s;
}

.mpbox-page-link:hover {
    background: #ff9900;
    border-color: #ff9900;
    color: #fff;
}

.mpbox-page-current {
    background: #ff9900;
    border-color: #ff9900;
    color: #fff;
    cursor: default;
    font-weight: 700;
}

.mpbox-page-dots {
    padding: 0 5px;
    color: #999;
}

.mpbox-page-prev,
.mpbox-page-next {
    font-size: 13px;
}

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 989px) {
    .mpbox-filter-wrapper {
        flex-direction: column;
        padding: 15px;
    }

    .mpbox-sidebar {
        width: 100%;
        position: static;
    }

    .mpbox-category-list {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
    }

    .mpbox-category-list li {
        margin-bottom: 0;
    }

    .mpbox-category-list label {
        padding: 6px 12px;
        border: 1px solid #e1e1e1;
        border-radius: 20px;
        font-size: 13px;
        background: #fff;
        transition: all 0.2s;
    }

    .mpbox-category-list label:hover,
    .mpbox-cat-checkbox:checked + .mpbox-cat-name {
        color: #ff9900;
    }

    .mpbox-cat-checkbox:checked ~ .mpbox-cat-name {
        font-weight: 600;
    }

    .mpbox-products-grid .products {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px;
    }
}

@media (max-width: 600px) {
    .mpbox-topbar {
        flex-direction: column;
        align-items: stretch;
    }

    .mpbox-search-wrap {
        min-width: unset;
    }

    .mpbox-price-wrap {
        min-width: unset;
        flex-wrap: wrap;
    }

    #mpbox-price-slider {
        min-width: 100%;
        margin-top: 5px;
    }

    .mpbox-sort {
        width: 100%;
    }

    .mpbox-clear-all {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 479px) {
    .mpbox-products-grid .products {
        grid-template-columns: 1fr !important;
    }

    .mpbox-page-link {
        min-width: 34px;
        height: 34px;
        font-size: 13px;
        padding: 0 8px;
    }
}
