/* ============================================================
   FILTROS COLAPSABLES MOBILE — CalidoHogar
   Agregar después de mejoras_catalogo.css
============================================================ */

/* ── Botón abrir filtros (solo visible en mobile) ────────── */

.btn-filtros-mobile {
    display: none; /* Oculto por defecto en desktop */
    align-items: center;
    gap: 8px;
    background: #ff4400;
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 10px 18px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.25s;
    white-space: nowrap;
}

.btn-filtros-mobile:hover {
    background: #e03c00;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 68, 0, 0.35);
}

.btn-filtros-mobile svg {
    flex-shrink: 0;
}

/* ── Header del catálogo actualizado ─────────────────────── */

.catalogo-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.catalogo-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.total-productos-badge {
    background: rgba(255, 68, 0, 0.15);
    color: #ff4400;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid rgba(255, 68, 0, 0.3);
}

/* ── Header del sidebar (solo visible en mobile) ─────────── */

.filtros-header {
    display: none; /* Oculto en desktop */
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #2a2a2a;
    margin-bottom: 20px;
}

.filtros-header-titulo {
    color: #fff;
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0;
}

.filtros-cerrar {
    background: transparent;
    border: none;
    color: #888;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
}

.filtros-cerrar:hover {
    background: rgba(255, 68, 0, 0.15);
    color: #ff4400;
}

/* ── Overlay oscuro (solo mobile) ────────────────────────── */

.filtros-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 998;
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* ============================================================
   RESPONSIVE — MOBILE
============================================================ */

@media (max-width: 767px) {

    /* Mostrar botón de filtros */
    .btn-filtros-mobile {
        display: inline-flex;
    }

    /* Sidebar transformado en drawer lateral */
    #sidebar-filtros {
        position: fixed;
        top: 0;
        left: -100%; /* Oculto fuera de pantalla */
        width: 85%;
        max-width: 360px;
        height: 100vh;
        height: 100dvh; /* Altura real del viewport en mobile */
        z-index: 999;
        transition: left 0.3s ease;
        overflow-y: auto;
        background: #151515;
        margin: 0 !important;
    }

    /* Cuando está abierto */
    #sidebar-filtros.filtros-abiertos {
        left: 0;
    }

    #sidebar-filtros.filtros-abiertos .filtros-overlay {
        display: block;
        opacity: 1;
    }

    /* Mostrar header del sidebar */
    .filtros-header {
        display: flex;
    }

    /* Ajustar padding del contenedor de filtros */
    .filtros-container {
        padding: 0 24px 24px;
    }

    /* Ajustar header del catálogo */
    .catalogo-header {
        margin-bottom: 20px !important;
    }

    .catalogo-header-left {
        flex: 1;
    }

    #catalogo-titulo {
        font-size: 1.8rem;
        margin-bottom: 0;
    }

    /* Productos a 1 columna en mobile pequeño */
    .productos-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* Tablets pequeños */
@media (min-width: 768px) and (max-width: 991px) {
    .productos-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ── Animación de entrada del sidebar ────────────────────── */

@keyframes slideInFromLeft {
    from { transform: translateX(-100%); }
    to   { transform: translateX(0); }
}

@media (max-width: 767px) {
    #sidebar-filtros.filtros-abiertos .filtros-container {
        animation: slideInFromLeft 0.3s ease;
    }
}

/* ── Prevenir scroll del body cuando filtros abiertos ────── */

body.filtros-abiertos-scroll-lock {
    overflow: hidden;
    position: fixed;
    width: 100%;
}
