/* TcaBar — lista de produtos (tabela + modais de produto/categorias) */
/* Container da tabela com altura fixa */
    .products-table-container {
        display: flex;
        flex-direction: column;
        max-height: calc(100vh - 200px);
    }
    
    /* Estilos da Tabela de Produtos - Consistente com Modais */
    .products-table {
        border-collapse: separate;
        border-spacing: 0;
        width: 100%;
    }
    
    /* Garantir que o thead fica fixo durante o scroll */
    .products-table thead {
        position: sticky;
        top: 0;
        z-index: 10;
        background-color: #f8f9fa;
    }
    
    /* Estilo para o container de scroll da tabela */
    .products-table-container .table-responsive {
        max-height: 100%;
        overflow-y: auto;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch; /* Scroll suave no iOS */
    }
    
    /* Estilo para a paginação fixa no fundo */
    .products-table-container .border-top {
        border-top: 2px solid #dee2e6 !important;
        box-shadow: 0 -2px 4px rgba(0,0,0,0.05);
        position: relative;
        z-index: 5;
    }
    
    /* Garantir que o scrollbar seja visível */
    .products-table-container .table-responsive::-webkit-scrollbar {
        width: 8px;
        height: 8px;
    }
    
    .products-table-container .table-responsive::-webkit-scrollbar-track {
        background: #f1f1f1;
        border-radius: 4px;
    }
    
    .products-table-container .table-responsive::-webkit-scrollbar-thumb {
        background: #888;
        border-radius: 4px;
    }
    
    .products-table-container .table-responsive::-webkit-scrollbar-thumb:hover {
        background: #555;
    }
    
    /* Estilos da Paginação - Consistente com a aplicação */
    .products-table-container .pagination {
        margin-bottom: 0;
    }
    
    .products-table-container .page-link {
        color: #495057;
        background-color: #fff;
        border: 1px solid #dee2e6;
        padding: 0.5rem 0.75rem;
        transition: all 0.2s ease;
    }
    
    .products-table-container .page-link:hover {
        color: #495057;
        background-color: #f8f9fa;
        border-color: #adb5bd;
    }
    
    .products-table-container .page-item.active .page-link {
        color: #495057;
        background-color: #e9ecef;
        border-color: #adb5bd;
        font-weight: 600;
    }
    
    .products-table-container .page-item.disabled .page-link {
        color: #6c757d;
        background-color: #fff;
        border-color: #dee2e6;
        cursor: not-allowed;
        opacity: 0.6;
    }
    
    .products-table-container .page-item.disabled .page-link:hover {
        color: #6c757d;
        background-color: #fff;
        border-color: #dee2e6;
    }
    
    .products-table-header {
        background-color: #f8f9fa !important;
        font-weight: 600 !important;
        font-size: 14px !important;
        color: #495057 !important;
        padding: 16px 12px !important;
        border-bottom: 2px solid #dee2e6 !important;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }
    
    .products-table-row {
        border-bottom: 1px solid #e9ecef !important;
        transition: background-color 0.2s ease;
    }
    
    .products-table-row:hover {
        background-color: #f8f9fa !important;
    }
    
    .products-table-cell {
        padding: 16px 12px !important;
        vertical-align: middle !important;
    }
    
    .product-name {
        font-size: 15px !important;
        color: #212529 !important;
        margin-bottom: 4px;
    }
    
    .product-stock {
        font-size: 12px !important;
        color: #6c757d !important;
    }
    
    .product-category {
        font-size: 14px !important;
        color: #6c757d !important;
    }
    
    .product-price {
        font-size: 15px !important;
        color: #212529 !important;
    }
    
    .product-image,
    .product-image-placeholder {
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    
    /* Checkboxes estilizados */
    .product-checkbox {
        width: 20px !important;
        height: 20px !important;
        cursor: pointer;
        border: 2px solid #dee2e6 !important;
        border-radius: 4px !important;
    }
    
    .product-checkbox:checked {
        background-color: #28a745 !important;
        border-color: #28a745 !important;
    }
    
    .product-checkbox:focus {
        box-shadow: 0 0 0 0.2rem rgba(40, 167, 69, 0.25) !important;
    }
    
    /* Botões de ação */
    .btn-action-edit {
        min-width: 38px !important;
        min-height: 38px !important;
        padding: 8px 12px !important;
        border-radius: 6px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        font-size: 14px !important;
        transition: all 0.2s ease !important;
        border: 1px solid !important;
        background-color: #ffffff !important;
        border-color: #dee2e6 !important;
        color: #495057 !important;
    }
    
    .btn-action-edit:hover {
        background-color: #f8f9fa !important;
        border-color: #adb5bd !important;
        color: #212529 !important;
        transform: translateY(-1px);
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }
    
    /* Card da tabela */
    .card.shadow-sm {
        box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075) !important;
        border: 1px solid #dee2e6 !important;
    }
    
    /* Estilos do formulário de produto */
    .product-form-modal .modal-dialog {
        max-width: 900px;
    }
    
    .product-form-modal .form-label {
        font-weight: 500;
        margin-bottom: 0.5rem;
    }
    
    .product-form-modal .form-control:disabled {
        background-color: #e9ecef;
        cursor: not-allowed;
    }
    
    .product-form-modal .invalid-feedback {
        display: none;
    }
    
    .product-form-modal .was-validated .form-control:invalid ~ .invalid-feedback,
    .product-form-modal .was-validated .form-select:invalid ~ .invalid-feedback {
        display: block;
    }
    
    .product-form-modal .was-validated .form-control:valid ~ .invalid-feedback,
    .product-form-modal .was-validated .form-select:valid ~ .invalid-feedback {
        display: none;
    }
    
    #productImagePreview img {
        border-radius: 8px;
        border: 1px solid #dee2e6;
    }
    
    .btn-link.btn-sm {
        text-decoration: none;
        font-size: 0.875rem;
    }
    
    .btn-link.btn-sm:hover {
        text-decoration: underline;
    }

/* Nome em células da tabela (lista produtos + categorias) */
.products-table-cell .fw-semibold {
    font-weight: 600 !important;
    font-size: 1rem !important;
    color: #212529 !important;
}

/* Lista categorias (4 colunas): escopado para não afetar a tabela de produtos (7 colunas) */
.tcabar-categorias-table-wrap .products-table thead th:first-child,
.tcabar-categorias-table-wrap .products-table tbody td:first-child {
    width: 80px !important;
    min-width: 80px !important;
    max-width: 80px !important;
    padding: 12px 8px !important;
}

.tcabar-categorias-table-wrap .products-table thead th:nth-child(2),
.tcabar-categorias-table-wrap .products-table tbody td:nth-child(2) {
    width: auto !important;
    min-width: 180px !important;
    max-width: 300px !important;
}

.tcabar-categorias-table-wrap .products-table thead th:nth-child(3),
.tcabar-categorias-table-wrap .products-table tbody td:nth-child(3) {
    width: 220px !important;
    min-width: 220px !important;
    max-width: 220px !important;
}

.tcabar-categorias-table-wrap .products-table thead th:last-child,
.tcabar-categorias-table-wrap .products-table tbody td:last-child {
    width: 100px !important;
    min-width: 100px !important;
    max-width: 100px !important;
}
