﻿/* Filtros Sidebar */
.filtro-seccion {
    border-bottom: 1px solid #e9ecef;
}

.filtro-header {
    padding: 1rem 1.5rem;
    background: #f8f9fa;
    font-weight: 600;
    color: #495057;
    font-size: 0.875rem;
    border-bottom: 1px solid #e9ecef;
}

.filtro-contenido {
    padding: 1rem 1.5rem;
}

.categoria-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
    margin-bottom: 0.25rem;
}

    .categoria-item:hover {
        background: #f8f9fa;
        padding-left: 0.5rem;
    }

    .categoria-item.active {
        background: #f0f8ff;
        color: #1976d2;
        font-weight: 600;
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }

.categoria-nombre {
    font-size: 0.875rem;
}

.categoria-count {
    background: #6c757d;
    color: white;
    padding: 0.125rem 0.5rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

.categoria-item.active .categoria-count {
    background: #1976d2;
}

/* Productos Grid */
.productos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.productos-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

    .productos-list .producto-card .card {
        flex-direction: row;
        align-items: stretch; /* Asegura que ambos lados tengan la misma altura */
    }

    .productos-list .producto-imagen {
        width: 200px;
        flex-shrink: 0;
        display: flex; /* Agregado para centrar */
        align-items: center; /* Centra verticalmente */
        justify-content: center; /* Centra horizontalmente */
    }

        /* Estilos específicos para imagen en modo lista */
        .productos-list .producto-imagen img {
            width: auto; /* Cambiado de 100% */
            height: 180px; /* Altura fija más pequeña para modo lista */
            max-width: 100%; /* Evita desbordamiento */
            object-fit: contain; /* Mantiene proporciones sin recortar */
        }

    /* Ajustar el card-body en modo lista */
    .productos-list .card-body {
        flex: 1;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }

/* Producto Card */
.producto-card {
    transition: all 0.3s ease;
}

    .producto-card:hover {
        transform: translateY(-5px);
    }

.producto-imagen {
    position: relative;
    overflow: hidden;
    background: #f8f9fa;
}

    .producto-imagen img {
        width: 100%;
        height: 250px;
        object-fit: cover;
        transition: transform 0.3s ease;
    }

.producto-card:hover .producto-imagen img {
    transform: scale(1.05);
}


.badge-agotado {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: #dc3545;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 2;
}

.badge-stock-bajo {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: #fd7e14;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 2;
}

/* Información del Producto */
.producto-categoria {
    margin-bottom: 0.5rem;
}

.producto-titulo {
    font-weight: 600;
    color: #212529;
    margin-bottom: 0.5rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.producto-descripcion {
    color: #6c757d;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.producto-precio {
    border-top: 1px solid #e9ecef;
    padding-top: 1rem;
}

.precio-actual {
    font-size: 1.25rem;
    font-weight: 700;
    color: #2563eb;
}

.precio-descuento {
    display: block;
    color: #dc3545;
    font-weight: 600;
    margin-top: 0.25rem;
}

.producto-acciones {
    display: flex;
    gap: 0.5rem;
}

/* Barra de Resultados */
.resultados-barra {
    background: white;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.vista-controles .btn {
    border-radius: 6px;
    margin-left: 0.25rem;
}

    .vista-controles .btn.active {
        background: #2563eb;
        border-color: #2563eb;
        color: white;
    }

/* Cards */
.card {
    border-radius: 12px;
    transition: all 0.3s ease;
}

    .card:hover {
        box-shadow: 0 8px 25px rgba(0,0,0,0.15) !important;
    }

/* Responsive */
@media (max-width: 768px) {
    .productos-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
    }

    .col-lg-3 {
        margin-bottom: 2rem;
    }

    .d-flex.justify-content-between {
        flex-direction: column;
        gap: 1rem;
    }

    .vista-controles {
        align-self: flex-start;
    }
}

@media (max-width: 576px) {
    .productos-grid {
        grid-template-columns: 1fr;
    }

    .producto-imagen img {
        height: 200px;
    }
}
