
/* === GLOBAL WIDGET STYLES === */

.widget_wc_multi_cat_filter {
    background: #fff;
    margin-bottom: 20px;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    overflow: hidden;
}

/* HEADER */
.mcf-header {
    background: #fff;
    padding: 18px 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid transparent;
    transition: all 0.2s;
}
.mcf-header:hover { background: #f9f9f9; }
.mcf-header.open { border-bottom: 1px solid #eee; background: #fff; }
.mcf-title-text { font-weight: 800; font-size: 14px; color: #111; text-transform: uppercase; letter-spacing:0.5px; }
.mcf-arrow { font-size: 18px; color: #777; transition: transform 0.2s; }
.mcf-header.open .mcf-arrow { transform: rotate(180deg); }
.mcf-close-mobile { display: none; font-size: 24px; cursor:pointer; color:#333; } 

/* LIST */
.mcf-body { display: none; padding: 10px 0; max-height: 500px; overflow-y: auto; }
ul.mcf-list { list-style: none !important; padding: 0 !important; margin: 0 !important; }
.mcf-list.level-child { padding-left: 25px !important; background: #fff; }
.mcf-item { margin: 0; padding: 0; }

/* LABEL */
.mcf-label {
    display: flex;
    align-items: center;
    padding: 8px 20px;
    cursor: pointer;
    transition: background 0.1s;
    width: 100%;
    box-sizing: border-box;
}
.mcf-label:hover { background: #f7f7f7; }
.mcf-label.active-row { background: #fff1f2; color: #ce2a37; font-weight: 700; }

/* CHECKBOX & TEXT */
input.mcf-chk { 
    accent-color: #ce2a37; 
    width: 18px; 
    height: 18px; 
    margin-right: 12px; 
    cursor: pointer; 
    border: 2px solid #ccc;
    border-radius: 4px;
}
.mcf-name { flex-grow: 1; font-size: 14px; color: #444; }
.active-row .mcf-name { color: #ce2a37; }
.mcf-count { font-size: 11px; background: #f1f1f1; color: #999; padding: 2px 8px; border-radius: 20px; font-weight: 600; margin-left: 8px; }

/* === APPLY BUTTON (DESKTOP + MOBILE) === */
#mcf-desktop-apply-wrap {
    padding: 15px 20px;
    border-top: 1px solid #eee;
    background: #fff;
    position: sticky;
    bottom: 0;
}
#mcf-apply-btn {
    width: 100%;
    background-color: #ce2a37;
    color: white;
    border: none;
    padding: 12px;
    border-radius: 4px;
    font-weight: 700;
    font-size: 14px;
    text-transform: uppercase;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s;
}
#mcf-apply-btn:hover { background-color: #a31621; }

/* === MOBILE STYLES (Strict Hiding) === */
@media (max-width: 991px) {
    /* 1. FORCE HIDE sidebar widget on mobile unless open */
    .widget_wc_multi_cat_filter { display: none !important; } 
    
    /* 2. Show Trigger */
    #mcf-mobile-trigger { display: flex; }

    /* 3. OPEN DRAWER */
    body.mcf-filter-open .widget_wc_multi_cat_filter {
        display: block !important;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        max-height: 85vh; 
        z-index: 99999;
        border-radius: 20px 20px 0 0;
        box-shadow: 0 -10px 40px rgba(0,0,0,0.2);
        margin: 0;
        border: none;
        animation: slideUp 0.3s ease-out;
    }
    
    body.mcf-filter-open .mcf-header {
        position: sticky; top: 0; background: #fff; z-index: 10;
        border-bottom: 1px solid #eee;
        padding: 20px;
        border-radius: 20px 20px 0 0;
    }
    
    /* Reveal Header elements specific to mobile */
    .mcf-close-mobile { display: block; }
    .desktop-only { display: none; }

    /* Body scrollable area */
    body.mcf-filter-open .mcf-body {
        display: block !important;
        height: 60vh;
        overflow-y: scroll;
        padding-bottom: 20px; 
    }
}

/* DESKTOP TWEAKS */
@media (min-width: 992px) {
    #mcf-mobile-trigger, #mcf-mobile-overlay { display: none !important; }
}

/* TRIGGER BUTTON */
#mcf-mobile-trigger {
    display: none;
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: #222;
    color: white;
    padding: 14px 30px;
    border-radius: 50px;
    box-shadow: 0 5px 25px rgba(0,0,0,0.3);
    z-index: 99990;
    cursor: pointer;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 14px;
    align-items: center;
    gap: 10px;
}
#mcf-mobile-trigger span { font-size:18px; }
#mcf-mobile-overlay {
    display: none; position: fixed; top:0; left:0; width:100%; height:100%;
    background: rgba(0,0,0,0.6); z-index: 99998; backdrop-filter: blur(3px);
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
