/* =======================================================
   MF Unified Filter - Combined Fiverr-style Filter
   (Version 1.2: Added Mobile Scroll Lock & Full Width Fix)
   ======================================================= */

/* NEW: 0. Body Lock for Mobile Scroll Prevention */
body.mfu-body-lock {
    overflow: hidden !important;
}

/* 1. Wrapper (Container) */
.mfu-filter-container {
    position: relative;
    display: inline-block;
    font-family: "Inter", system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    z-index: 20;
}

/* 2. Main Filter Button (.mfu-filter-btn) */
.mfu-filter-btn {
    background: #ffffff;
    color: #333333;
    border: 1px solid #e4e5e7;
    border-radius: 8px;
    padding: 12px 24px;
    cursor: pointer;
    font-weight: 500;
    font-size: 16px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: none;
}

/* --- STANDARD NEUTRAL HOVER/FOCUS --- */
.mfu-filter-btn:hover {
    background: #f0f0f0;
    color: #111111;
}
.mfu-filter-btn:focus {
    outline: none;
    box-shadow: none;
}

/* 3. Active/Open State */
.mfu-dropdown.open + .mfu-filter-btn,
.mfu-filter-btn[aria-expanded="true"] {
    background: #e9f5ff; /* Light Blue BG */
    border-color: #0087ff; /* Blue Border */
    color: #0087ff;
}

/* 4. Dropdown Panel */
.mfu-dropdown {
    /* Position and Layout */
    position: absolute;
    top: 100%;
    left: 0; /* Left align by default */
    width: 320px; /* Standard Desktop Width */
    max-width: calc(100vw - 32px);
    margin-top: 10px;
    /* Styling */
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 100;
    padding: 16px;
    /* Hide by default */
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}
.mfu-dropdown.open,
.mfu-dropdown[aria-hidden="false"] {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* 5. Section Titles and Dividers */
.mfu-section-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin: 0 0 10px 0;
}
.mfu-divider {
    border: 0;
    height: 1px;
    background-color: #f0f0f0;
    margin: 16px 0;
}

/* 6. Sort Options */
.mfu-sort-options {
    list-style: none;
    padding: 0;
    margin: 0;
}
.mfu-sort-options li {
    padding: 4px 0;
}
.mfu-sort-options label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    transition: background 0.15s ease;
    width: 100%;
    margin-bottom: 0;
}
.mfu-sort-options label:hover {
    background: #f0f0f0;
}
.mfu-sort-options input[type="radio"] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid #ccc;
    border-radius: 50%;
    outline: none;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin: 0;
}
.mfu-sort-options input[type="radio"]:checked {
    background-color: #0087ff; /* Blue fill when checked */
    border-color: #0087ff;
    box-shadow: 0 0 0 3px #fff inset;
}

/* 7. Budget Inputs */
.mfu-inputs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.mfu-input-group {
    width: 50%;
}
.mfu-input-group label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #777;
    margin-bottom: 4px;
}
.mfu-inputs input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e4e5e7;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s ease;
    text-align: center;
}
.mfu-inputs input:focus {
    outline: none;
    border-color: #0087ff;
    box-shadow: 0 0 0 2px rgba(0, 135, 255, 0.1);
}


/* 8. Final Action Buttons (Clear and Apply) */
.mfu-actions {
    display: flex;
    gap: 8px;
}
/* General styles for action buttons (Clear and Apply) */
.mfu-actions button {
    border: none;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    font-size: 14px;
    transition: all 0.2s ease;
    width: 50%;
    flex-shrink: 0;
}

/* Apply Button (Standard Primary Green) */
#mfu-apply {
    background: #1dbf73;
    color: #fff;
}
#mfu-apply:hover {
    background: #14a05b;
}

/* Clear Button (Standard Secondary Neutral) */
#mfu-clear {
    background: transparent;
    color: #777;
}
#mfu-clear:hover {
    background: #f0f0f0;
    color: #111111;
}

/* Consistent Focus States */
#mfu-apply:focus, #mfu-clear:focus {
    outline: none;
    box-shadow: none;
}


/* =======================================================
   9. Mobile Responsive Design (Bottom Sheet)
   ======================================================= */
@media (max-width: 768px) {
    /* FIX: Full Width and Position Fixed to Bottom */
    .mfu-dropdown {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        /* Ensure 100% width on mobile */
        width: 100%;
        min-width: 100%;
        margin-top: 0;
        border-radius: 12px 12px 0 0;
        border: none;
        box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.15);
        transform: translateY(100%); /* Start off-screen */
    }
    .mfu-dropdown.open,
    .mfu-dropdown[aria-hidden="false"] {
        transform: translateY(0); /* Slide up */
    }
}