/* --- ESTILOS MÓVILES OCULTOS EN DESKTOP --- */
#mie-mobile-filter-btn,
.mie-mobile-close-container,
#mie-mobile-apply-btn,
.mie-mobile-overlay,
#mie-mobile-filter-btn * {
    display: none !important;
}

/* --- CONTENEDOR PRINCIPAL (Efecto Soft UI) --- */
#mie-filters-wrapper { 
    box-sizing: border-box !important; 
    font-family: 'Open Sans', Arial, sans-serif;
    max-width: 320px; 
    width: 100%;
    background-color: #F9FAFB; 
    padding: 16px;
    border-radius: 12px; 
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03); 
}
#mie-filters-wrapper * { box-sizing: inherit !important; }

/* --- SECCIONES DE FILTROS --- */
.mie-filter-section { 
    background-color: #FFFFFF; 
    border: 1px solid rgba(0, 0, 0, 0.04); 
    margin-bottom: 12px; 
    border-radius: 8px; 
    overflow: hidden; 
    width: 100%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.mie-filter-section:hover { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05); }

/* --- ESTILO DE LA BARRA PRINCIPAL --- */
.mie-search-container {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
}
.mie-main-search {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid rgba(0,0,0,0.08) !important; 
    border-radius: 8px;
    outline: none;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    background-color: #fff;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
    transition: all 0.3s ease;
}
.mie-main-search:focus {
    border-color: #D2080F !important;
    box-shadow: 0 0 0 3px rgba(210,8,15,0.1) !important; 
}

/* --- ACORDEONES --- */
.mie-accordion { 
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%; 
    padding: 14px 16px; 
    background: #FFFFFF; 
    border: none; 
    text-align: left; 
    font-weight: 700; 
    font-size: 14.5px;
    color: #1a1a1a;
    cursor: pointer; 
    transition: background 0.3s ease, color 0.3s ease;
    border-bottom: 1px solid transparent;
}
.mie-accordion:hover {
    background: #fdfdfd;
    color: #D2080F !important; 
}
.mie-accordion::after {
    content: '+';
    font-size: 18px;
    font-weight: 400;
    color: #D2080F;
    transition: transform 0.3s ease;
}
.mie-accordion[aria-expanded="true"] { border-bottom-color: rgba(0, 0, 0, 0.04); }
.mie-accordion[aria-expanded="true"]::after { content: '−'; }

/* --- CONTENIDOS DE LOS FILTROS --- */
.mie-panel { padding: 14px 16px; width: 100%; }
.mie-checkbox-list { display: flex; flex-direction: column; align-items: flex-start; width: 100%; }

/* --- OPCIONES INDIVIDUALES --- */
.mie-filter-option { 
    display: flex !important; 
    align-items: flex-start !important;
    width: 100% !important; 
    line-height: 1.4 !important; 
    margin-bottom: 6px !important; 
    font-size: 13.5px;
    color: #4a4a4a; 
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
    border-radius: 6px;
    padding: 6px 8px;
    margin-left: -8px;
}
.mie-filter-option input[type="checkbox"] {
    margin-right: 10px !important;
    margin-top: 2px !important;
    flex-shrink: 0 !important;
    cursor: pointer;
    accent-color: #D2080F; 
}
.mie-filter-option:hover:not(.mie-is-pinned) {
    background-color: #FFF0F0; 
    color: #D2080F;
}
.mie-hidden-by-limit { display: none !important; }

/* --- BOTÓN MOSTRAR TODOS --- */
.mie-toggle-more { 
    background: #ffffff; 
    border: 1px solid #e0e0e0; 
    padding: 8px 12px; 
    cursor: pointer; 
    margin-top: 8px; 
    width: 100%;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #666 !important;
    transition: all 0.2s ease;
}
.mie-toggle-more:hover { background: #FFF0F0; border-color: #D2080F; color: #D2080F !important; }
.mie-none { color: #999; font-size: 13px; font-style: italic; padding-top: 4px; }
.mie-internal-search {
    width: 100%; padding: 8px 12px; margin-bottom: 12px; border: 1px solid #e1e1e1; border-radius: 6px; font-size: 13px; color: #333; outline: none; background-color: #FAFAFA; transition: all 0.3s ease;
}
.mie-internal-search:focus { background-color: #fff; border-color: #D2080F; box-shadow: 0 0 0 2px rgba(210,8,15,0.1); }
.mie-date-label { display: block; margin-bottom: 10px; font-size: 13px; font-weight: 600; color: #4a4a4a; }
.mie-date-label input { width: 100%; margin-top: 6px; padding: 8px; border: 1px solid #e1e1e1; border-radius: 6px; font-family: inherit; color: #333; outline: none; transition: all 0.3s ease; }
.mie-date-label input:focus { border-color: #D2080F; box-shadow: 0 0 0 2px rgba(210,8,15,0.1); }

/* --- PÍLDORAS ACTIVAS --- */
.mie-active-filters-container { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; width: 100%; }
.mie-active-tag { background-color: #D2080F; color: #ffffff; font-size: 12px; padding: 6px 14px; border-radius: 20px; display: inline-flex; align-items: center; font-weight: 600; box-shadow: 0 2px 6px rgba(210, 8, 15, 0.25); animation: fadeIn 0.3s ease; }
.mie-remove-tag { margin-left: 8px; cursor: pointer; font-size: 16px; line-height: 1; opacity: 0.7; transition: opacity 0.2s; }
.mie-remove-tag:hover { opacity: 1; }
.mie-filter-option.mie-is-pinned { background-color: #fdf2f2; border-left: 3px solid #D2080F; padding-left: 10px; font-weight: bold; color: #D2080F; margin-bottom: 6px; }
.mie-dead-facet { display: none !important; }

/* --- PAGINACIÓN --- */
.mie-dynamic-pagination { margin-top: 30px; text-align: center; width: 100%; clear: both; }
.mie-dynamic-pagination ul.page-numbers { display: inline-flex; list-style: none; padding: 0; margin: 0; gap: 8px; flex-wrap: wrap; justify-content: center; }
.mie-dynamic-pagination ul.page-numbers li { margin: 0; }
.mie-dynamic-pagination .page-numbers { display: inline-block; padding: 8px 14px; background: #fff; border: 1px solid #e1e1e1; color: #333; text-decoration: none; border-radius: 6px; font-weight: 600; font-size: 14px; transition: all 0.2s ease; }
.mie-dynamic-pagination .page-numbers.current, .mie-dynamic-pagination .page-numbers:hover { background: #D2080F; color: #fff; border-color: #D2080F; box-shadow: 0 2px 6px rgba(210, 8, 15, 0.2); }

#mie-loading-indicator { padding: 20px; text-align: center; font-weight: bold; color: #D2080F; animation: pulse 1.5s infinite; }
@keyframes pulse { 0% { opacity: 0.6; } 50% { opacity: 1; } 100% { opacity: 0.6; } }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }

/* =======================================================
   REGLAS RESPONSIVE (MAGIA PARA MÓVILES - OFF-CANVAS)
   ======================================================= */
@media (max-width: 768px) {
    /* Ocultar el panel de filtros por defecto y transformarlo en Pop-up */
    #mie-filters-wrapper {
        position: fixed;
        top: 0;
        right: -100%; 
        width: 90%; 
        max-width: 400px;
        height: 100vh;
        background: #F9FAFB;
        z-index: 999999;
        overflow-y: auto;
        padding: 20px;
        border-radius: 0;
        transition: right 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
        box-shadow: -5px 0 25px rgba(0,0,0,0.15);
    }
    
    /* Clase que se activa con JS para deslizar el panel hacia adentro */
    #mie-filters-wrapper.mie-filters-open {
        right: 0;
    }

    /* Fondo oscuro desenfocado detrás del modal */
    .mie-mobile-overlay {
        display: block !important;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: rgba(0,0,0,0.4);
        backdrop-filter: blur(3px);
        z-index: 999998; 
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    .mie-mobile-overlay.mie-overlay-visible {
        opacity: 1;
        visibility: visible;
    }

    /* Botón flotante para abrir los filtros en la página */
    #mie-mobile-filter-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 100%;
        padding: 14px;
        background-color: #D2080F;
        color: #fff;
        border: none;
        border-radius: 8px;
        font-weight: 700;
        font-size: 15px;
        margin-bottom: 24px;
        cursor: pointer;
        box-shadow: 0 4px 12px rgba(210, 8, 15, 0.25);
    }

    /* Cabecera del Pop-up */
    .mie-mobile-close-container {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 20px;
        padding-bottom: 15px;
        border-bottom: 1px solid #e1e1e1;
    }
    .mie-mobile-filter-title {
        font-size: 18px;
        font-weight: 800;
        color: #1a1a1a;
    }
    #mie-mobile-close-btn {
        background: #eee;
        border: none;
        width: 32px;
        height: 32px;
        border-radius: 50%;
        font-size: 20px;
        line-height: 1;
        cursor: pointer;
        color: #333;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    /* Botón rojo al final del scroll del pop-up */
    #mie-mobile-apply-btn {
        display: block !important;
        width: 100%;
        padding: 14px;
        background: #D2080F;
        color: #fff;
        border: none;
        border-radius: 8px;
        font-weight: bold;
        font-size: 16px;
        margin-top: 20px;
        margin-bottom: 40px; 
        cursor: pointer;
        box-shadow: 0 4px 12px rgba(210, 8, 15, 0.25);
    }
}

/* =======================================================
   OCULTAR DEFINITIVAMENTE PAGINACIÓN NATIVA DE ELEMENTOR
   ======================================================= */
body nav.elementor-pagination,
body div.e-load-more-anchor,
.elementor-loop-container + .elementor-pagination,
.elementor-loop-container + .e-load-more-anchor {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    pointer-events: none !important;
}