/* ═══════════════════════════════════════════════════════════
   filters-mobile.css
   FILTRO FLOTANTE MOBILE — Wolves Pure
   Solo aplica en pantallas ≤ 991px (lg breakpoint Bootstrap)
   ═══════════════════════════════════════════════════════════ */

/* ── 0. OCULTAR ELEMENTOS MOBILE EN DESKTOP ────────────────
     Por defecto, el FAB y el drawer están ocultos en desktop.
     Solo se muestran en mobile.                              */
.fab-filtros,
.filtros-overlay,
.filtros-drawer {
    display: none;
}

@media (max-width: 991px) {

    /* ── 1. OCULTAR SIDEBAR ORIGINAL ────────────────────────
       La columna aside .col-lg-3 se oculta en mobile;
       el sidebar pasa a ser el drawer superpuesto.          */
    .col-lg-3.order-lg-first {
        display: none !important;
    }

    /* ── 2. BOTÓN FLOTANTE (FAB) ────────────────────────────
       Círculo dorado fijo en esquina inferior derecha.      */
    .fab-filtros {
        display: flex;          /* ← REACTIVAR en mobile */
        position: fixed;
        bottom: 24px;
        right: 20px;
        z-index: 1050;

        width: 56px;
        height: 56px;
        border-radius: 50%;
        background: #c96;
        color: #fff;
        border: none;
        cursor: pointer;
        box-shadow: 0 4px 18px rgba(201, 150, 0, .45);

        align-items: center;
        justify-content: center;
        flex-direction: column;
        gap: 2px;

        transition: transform .2s, box-shadow .2s, background .2s;
        outline: none;
        -webkit-tap-highlight-color: transparent;
    }
    .fab-filtros:hover,
    .fab-filtros:focus { background: #a87830; box-shadow: 0 6px 24px rgba(201,150,0,.55); }
    .fab-filtros:active { transform: scale(.93); }

    /* Ícono dentro del FAB */
    .fab-filtros .fab-icon {
        font-size: 20px;
        line-height: 1;
        transition: transform .25s;
    }
    .fab-filtros .fab-label {
        font-size: 8px;
        font-weight: 800;
        text-transform: uppercase;
        letter-spacing: .08em;
        line-height: 1;
        opacity: .85;
    }

    /* Cuando el drawer está abierto: icono cambia a ✕ */
    .fab-filtros.is-open .fab-icon::before {
        content: '\f00d'; /* fa-times */
    }
    .fab-filtros.is-open .fab-label { opacity: 0; }

    /* Badge con número de filtros activos */
    .fab-badge {
        position: absolute;
        top: -3px;
        right: -3px;
        width: 20px;
        height: 20px;
        border-radius: 50%;
        background: #e53e3e;
        color: #fff;
        font-size: 10px;
        font-weight: 800;
        display: flex;
        align-items: center;
        justify-content: center;
        border: 2px solid #fff;
        line-height: 1;
        display: none; /* se muestra por JS cuando hay filtros */
    }
    .fab-badge.visible { display: flex; }

    /* ── 3. OVERLAY OSCURO (backdrop) ───────────────────────*/
    .filtros-overlay {
        display: block;         /* ← REACTIVAR en mobile */
        position: fixed;
        inset: 0;
        z-index: 1055;
        background: rgba(0, 0, 0, .5);
        backdrop-filter: blur(2px);
        -webkit-backdrop-filter: blur(2px);
        opacity: 0;
        pointer-events: none;
        transition: opacity .3s ease;
    }
    .filtros-overlay.visible {
        opacity: 1;
        pointer-events: all;
    }

    /* ── 4. DRAWER PANEL ─────────────────────────────────────
       Sube desde abajo. Ocupa ~90% de la pantalla.          */
    .filtros-drawer {
        display: flex;          /* ← REACTIVAR en mobile */
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 1060;
        height: 90dvh;          /* dvh = dynamic viewport height */
        height: 90vh;           /* fallback */
        background: #fff;
        border-radius: 18px 18px 0 0;
        box-shadow: 0 -8px 40px rgba(0, 0, 0, .2);

        flex-direction: column;
        overflow: hidden;

        transform: translateY(100%);
        transition: transform .35s cubic-bezier(.32, .72, 0, 1);
        will-change: transform;
    }
    .filtros-drawer.is-open {
        transform: translateY(0);
    }

    /* Handle visual (barra de arrastre) */
    .drawer-handle {
        width: 36px;
        height: 4px;
        border-radius: 2px;
        background: #ddd;
        margin: 10px auto 0;
        flex-shrink: 0;
    }

    /* Header del drawer */
    .drawer-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 12px 18px 10px;
        border-bottom: 1px solid #ede8e0;
        flex-shrink: 0;
    }
    .drawer-title {
        font-size: 15px;
        font-weight: 800;
        color: #1a1a1a;
        letter-spacing: .01em;
    }
    .drawer-active-count {
        font-size: 11px;
        color: #c96;
        font-weight: 700;
        background: rgba(201,150,0,.1);
        padding: 2px 8px;
        border-radius: 10px;
        margin-left: 6px;
    }
    .drawer-close {
        width: 32px;
        height: 32px;
        border-radius: 50%;
        background: #f5f5f5;
        border: none;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 14px;
        color: #555;
        transition: background .2s;
        flex-shrink: 0;
    }
    .drawer-close:hover { background: #ffe4e4; color: #e53e3e; }

    /* Área scrollable del contenido */
    .drawer-body {
        flex: 1 1 auto;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
        padding: 10px 14px 16px;
    }
    /* Scrollbar discreta */
    .drawer-body::-webkit-scrollbar { width: 4px; }
    .drawer-body::-webkit-scrollbar-thumb { background: #e0d8ce; border-radius: 2px; }

    /* Footer: botones Limpiar / Ver resultados */
    .drawer-footer {
        flex-shrink: 0;
        display: flex;
        gap: 10px;
        padding: 12px 16px;
        padding-bottom: max(12px, env(safe-area-inset-bottom));
        border-top: 1px solid #ede8e0;
        background: #fff;
    }
    .drawer-btn-clear {
        flex: 0 0 auto;
        padding: 0 18px;
        height: 44px;
        border: 1.5px solid #e53e3e;
        border-radius: 8px;
        background: #fff;
        color: #e53e3e;
        font-size: 13px;
        font-weight: 700;
        cursor: pointer;
        text-decoration: none;
        display: flex;
        align-items: center;
        gap: 5px;
        transition: background .2s;
        white-space: nowrap;
    }
    .drawer-btn-clear:hover { background: #fff5f5; color: #e53e3e; }

    .drawer-btn-apply {
        flex: 1 1 auto;
        height: 44px;
        background: #c96;
        color: #fff;
        border: none;
        border-radius: 8px;
        font-size: 14px;
        font-weight: 800;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 6px;
        transition: background .2s;
        text-decoration: none;
    }
    .drawer-btn-apply:hover { background: #a87830; color: #fff; }

    /* ── 5. AJUSTES INTERNOS DEL SIDEBAR DENTRO DEL DRAWER ──
       Removemos sticky, re-ajustamos márgenes y radios.     */
    .filtros-drawer .sidebar-shop {
        position: static !important;
        top: auto !important;
    }
    .filtros-drawer .sidebar-shop > .widget,
    .filtros-drawer .sidebar-shop > .widget-clean-modern {
        margin-bottom: 10px;
        border-radius: 10px;
    }
    /* Hacer que los widgets se vean bien apretados en mobile */
    .filtros-drawer .sidebar-shop .widget-body {
        padding: 10px 12px;
    }
    .filtros-drawer .sidebar-shop .widget-title a {
        padding: 12px 14px;
        font-size: 11px;
    }

    /* ── 6. CHIPS DE FILTROS ACTIVOS — compactos en mobile ── */
    .active-filters-bar {
        padding: 8px 10px;
        gap: 5px;
    }
    .af-chip {
        font-size: 10px;
        padding: 3px 7px;
    }

    /* ── 7. TOOLBOX — ordenamiento más compacto ─────────────*/
    .toolbox {
        flex-wrap: wrap;
        gap: 8px;
    }
    .toolbox-left { width: 100%; }
    .toolbox-right { width: 100%; }
    .toolbox-sort { display: flex; align-items: center; gap: 8px; }
    .toolbox-sort .select-custom { flex: 1; }
    .toolbox-sort select { width: 100%; }

    /* ── 8. GRID PRODUCTOS — 2 cols en mobile ───────────────*/
    .products .row > .col-6 { padding-left: 6px; padding-right: 6px; }
    .products .row { margin-left: -6px; margin-right: -6px; }

    /* ── 9. PREVENIR SCROLL DEL BODY cuando drawer abierto ──*/
    body.drawer-open {
        overflow: hidden;
        position: fixed;
        width: 100%;
    }

} /* fin @media (max-width: 991px) */