/* General Filter Wrapper */
.mvp-filter-wrapper {
font-family: var(--theme-font-family, Arial, sans-serif); /* Added fallback */
}

/* Individual Filter Group */
.mvp-filter-group {
margin-bottom: 15px;
border-bottom: 1px solid #ddd;
}

.mvp-filter-group.active {
padding-bottom: 10px;
}

/* Toggle Button for each filter group */
.mvp-toggle-button {
width: 100%;
background: none;
border: none;
font-size: 16px;
text-align: left;
padding: 8px 0;
cursor: pointer;
display: flex;
justify-content: space-between;
align-items: center;
color: var(--theme-text-color, #333);
font-weight: bold;
}

.mvp-toggle-button i {
transition: transform 0.3s ease;
}

.mvp-filter-group.active .mvp-toggle-button i {
transform: rotate(180deg);
}

/* Content area for each filter group */
.mvp-filter-content {
display: none;
padding-left: 10px;
}

/* Individual Filter Option (Label + Checkbox + Count) */
.mvp-filter-option {
display: block;
margin-bottom: 5px;
}

/* Hide filter options after the first 5 */
.mvp-filter-content .mvp-hidden-filter-option {
display: none;
}

/* "See More" Button */
.mvp-see-more-button {
background: none;
border: 1px solid #E8363C;
border-radius: 47px;
color: var(--theme-button-background-initial-color, #E8363C); /* Added fallback */
cursor: pointer;
font-size: 0.7em;
padding: 5px 10px;
margin-top: 5px;
display: block;
text-align: left;
transition: 0.4s ease-in-out;
}

.mvp-see-more-button:hover{
background: var(--theme-button-background-initial-color, #E8363C); /* Added fallback */
color: white;
border-color: var(--theme-button-background-initial-color, #E8363C); /* Added fallback */
}

/* Product Count Display */
.mvp-count-display {
font-size: 0.85em;
color: #777;
margin-left: 5px;
}

/* --- Price Slider Styling (Enhanced Look) --- */
.mvp-price-filter-content {
padding-top: 5px;
padding-bottom: 20px;
}
#mvp-price-slider {
margin-bottom: 25px;
background: #f1f1f1;
border-radius: 5px;
height: 6px;
position: relative;
border: none;
}
/* Slider range (the colored part of the slider) */
#mvp-price-slider .ui-slider-range {
background: #d81c22;
border-radius: 5px;
}
/* Slider handle */
#mvp-price-slider .ui-slider-handle {
width: 22px;
height: 22px;
border-radius: 50%;
background: #fff;
border: 2px solid #d81c22;
cursor: pointer;
top: -8px; /* Position the handle correctly */
margin-left: -11px; /* Center the handle */
box-shadow: 0 1px 4px rgba(0,0,0,0.2);
transition: box-shadow 0.2s ease;
}
#mvp-price-slider .ui-slider-handle:hover {
box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

/* Price Input Fields */
.mvp-price-inputs-container {
display: flex;
justify-content: space-between;
align-items: center;
margin-top: 15px;
font-size: 0.9em;
}
.mvp-price-inputs-container label {
display: flex;
align-items: center;
gap: 5px;
}
.mvp-price-inputs-container input {
width: 80px;
text-align: center;
padding: 5px;
border: 1px solid #ddd;
border-radius: 4px;
-moz-appearance: textfield; /* Hide arrows for Firefox */
}
.mvp-price-inputs-container input::-webkit-outer-spin-button,
.mvp-price-inputs-container input::-webkit-inner-spin-button {
-webkit-appearance: none; /* Hide arrows for Chrome, Safari, Edge */
margin: 0;
}


/* Active Filters Display (Desktop) */
.mvp-active-filters {
padding: 10px;
margin-bottom: 20px;
border-radius: 5px;
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 10px;
}

.mvp-active-filters h4 {
margin: 0;
font-size: 1.1em;
color: var(--theme-text-color, #333);
}

.mvp-active-filters-list {
display: flex;
flex-wrap: wrap;
gap: 8px;
margin: 0;
align-items: center;
}

.mvp-active-filter-item {
background: #fff;
border: 1px solid #ccc;
padding: 3px 8px;
border-radius: 20px;
display: flex;
align-items: center;
box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.mvp-active-filter-label {
color: black;
font-size: 0.7em;
}

.mvp-remove-filter {
cursor: pointer;
margin-left: 8px;
font-weight: bold;
color: #888;
transition: color 0.2s ease;
}
.mvp-remove-filter:hover {
color: #e7344f;
}

.mvp-reset-filters {
background: none;
border: 1px solid #E8363C;
border-radius: 47px;
color: var(--theme-button-background-initial-color, #E8363C); /* Added fallback */
cursor: pointer;
font-size: 0.7em;
padding: 5px 10px;
margin-left: 10px;
transition: color 0.4s ease;
}
.mvp-reset-filters:hover {
background: var(--theme-button-background-initial-color, #E8363C); /* Added fallback */
color: white;
border-color: var(--theme-button-background-initial-color, #E8363C); /* Added fallback */
}

/* Loader */
.mvp-filter-loader {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
border: 4px solid rgba(0, 0, 0, 0.1);
border-top: 4px solid var(--theme-text-color, #333);
border-radius: 50%;
width: 40px;
height: 40px;
animation: spin 1s linear infinite;
z-index: 999;
}

@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}


/* ========================================= */
/* --- Mobile Filter Styles (Media Query) ---*/
/* ========================================= */

/* Mobile filter button wrapper */
.mvp-mobile-filter-header-wrapper {
display: none; /* Hidden by default on desktop */
margin-bottom: 20px;
}
.mvp-mobile-filter-button {
width: 100%;
background-color: #d81c22;
color: #fff;
border: none;
padding: 12px;
font-size: 1.1em;
cursor: pointer;
text-align: center;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
border-radius: 5px;
/* max-width: 180px;  Adjust as needed */
flex-shrink: 0;
}
.mvp-mobile-filter-button i {
margin-right: 8px;
}
.mvp-mobile-filter-button .mvp-filter-count {
background-color: #fff;
color: #e7344f;
border-radius: 50%;
font-size: 0.8em;
padding: 2px 6px;
margin-left: 5px;
}

/* Modal Overlay */
.mvp-filter-modal-overlay {
display: none; /* Hidden by default */
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: rgba(0, 0, 0, 0.7);
z-index: 1000;
justify-content: center;
align-items: center;
}

/* Modal Content Box */
.mvp-filter-modal-content {
background-color: #000; /* Set to black as requested */
/*width: 90%;*/
/*max-width: 500px;*/
/* max-height: 90vh;  Limit height to prevent overflow */
overflow-y: auto; /* Enable scrolling for long filter lists */
padding: 55px 20px;
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 1000;
justify-content: center;
align-items: center;
}

/* Modal Header and Close Button */
.mvp-filter-modal-header {
border-bottom: 1px solid #ddd;
padding-bottom: 10px;
margin-bottom: 10px;
display: flex;
justify-content: space-between;
align-items: flex-start;
flex-wrap: wrap;
gap: 10px;
}
.mvp-filter-modal-header h4 {
margin: 0;
font-size: 1.2em;
color: #fff; /* Ensure header text is visible on black background */
}
.mvp-filter-modal-close {
position: absolute;
top: 10px;
right: 20px;
background: none;
border: none;
font-size: 2.2em;
cursor: pointer;
color: #888;
}
/* Mobile Active Filters inside modal header */
.mvp-filter-modal-header .mvp-active-filters-mobile {
flex-grow: 1;
background: none; /* Remove background from parent */
padding: 0; /* Remove padding from parent */
margin: 0; /* Remove margin from parent */
display: flex;
flex-direction: row;
gap: 10px;
flex-wrap: wrap;
}
.mvp-filter-modal-header .mvp-active-filters-mobile h4 {
color: #fff; /* Ensure text is visible on black background */
font-size: 1em; /* Adjust size for modal header */
}
.mvp-filter-modal-header .mvp-active-filters-mobile .mvp-active-filter-item {
background: #333; /* Darker background for active filter items in modal */
border-color: #555; /* Darker border */
color: #eee; /* Lighter text */
}
.mvp-filter-modal-header .mvp-active-filters-mobile .mvp-active-filter-label {
color: #eee; /* Lighter text */
}
.mvp-filter-modal-header .mvp-active-filters-mobile .mvp-remove-filter {
color: #bbb; /* Lighter close button */
}
.mvp-filter-modal-header .mvp-active-filters-mobile .mvp-reset-filters {
color: #d81c22; /* Keep WordPress blue for reset */
border-color: #d81c22;
}
.mvp-filter-modal-header .mvp-active-filters-mobile .mvp-reset-filters:hover {
background: #0073aa;
color: white;
border-color: #0073aa;
}

/* Content wrapper inside modal (where filter groups are copied) */
#mvp-filter-modal-content-wrapper {
/* Add padding at the bottom to make space for the sticky footer button */
padding-bottom: 80px;
}
#mvp-filter-modal-content-wrapper .mvp-filter-group {
border-bottom-color: #444; /* Adjust border color for dark background */
}
#mvp-filter-modal-content-wrapper .mvp-toggle-button {
color: #fff; /* Ensure toggle button text is visible */
}
#mvp-filter-modal-content-wrapper .mvp-filter-content {
background-color: #000; /* Ensure content area is black */
}
#mvp-filter-modal-content-wrapper .mvp-filter-option {
color: #fff; /* Ensure filter option labels are visible */
}
#mvp-filter-modal-content-wrapper .mvp-count-display {
color: #bbb; /* Adjust count display color */
}
#mvp-filter-modal-content-wrapper .mvp-see-more-button {
border-color: #E8363C; /* Maintain original border color */
color: var(--theme-button-background-initial-color, #E8363C);
}
#mvp-filter-modal-content-wrapper .mvp-see-more-button:hover {
background: var(--theme-button-background-initial-color, #E8363C);
color: white;
border-color: var(--theme-button-background-initial-color, #E8363C);
}
#mvp-filter-modal-content-wrapper .mvp-price-inputs-container label {
color: #fff; /* Ensure price input labels are visible */
}
#mvp-filter-modal-content-wrapper .mvp-price-inputs-container input {
background-color: #333; /* Darker background for inputs */
color: #fff; /* Lighter text for inputs */
border-color: #555; /* Darker border for inputs */
}


/* State to show the modal */
.mvp-modal-active .mvp-filter-modal-overlay {
display: flex;
}

/* Media query to switch layouts */
@media (max-width: 768px) {
/* Sticky Footer Container for the button */
.mvp-filter-modal-footer {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
background-color: #000; /* Match modal background */
padding: 10px 20px;
box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
z-index: 1010; /* Higher z-index to be on top */
}

/* Apply Filters Button */
.mvp-apply-filters-button {
width: 100%;
background-color: #E8363C;
color: #fff;
border: none;
padding: 12px;
font-size: 1.1em;
cursor: pointer;
text-align: center;
border-radius: 5px;
font-weight: bold;
transition: background-color 0.3s ease;
}

.mvp-apply-filters-button:hover {
background-color: #d81c22;
}

/* Adjust modal content padding to prevent content from being hidden behind the footer */
.mvp-filter-modal-content {
padding-bottom: 80px; /* Adjust this value if needed */
}

/* Hide the desktop sidebar and its active filters on mobile */
.mvp-filter-wrapper,
#mvp-active-filters {
display: none!important;
}
.mvp-mobile-filter-header-wrapper {
display: block; /* Show the mobile button wrapper */
}

}
