/**
 * Price Table CSS - Estilos para tabela de preços
 * Sistema de Cardápio Online Padaria
 */

/* Variáveis CSS */
:root {
    --primary-color: #8B4513;
    --primary-dark: #6B3410;
    --secondary-color: #FFA500;
    --accent-color: #FFD700;
    --success-color: #28a745;
    --white: #ffffff;
    --text-color: #333333;
    --text-light: #666666;
    --text-muted: #999999;
    --bg-color: #f8f9fa;
    --border-color: #dee2e6;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 8px rgba(0,0,0,0.12);
    --shadow-lg: 0 8px 25px rgba(0,0,0,0.15);
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

/* Cabeçalho da Página */
.price-table-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 3rem 0;
    margin-bottom: 2rem;
}

.header-content {
    text-align: center;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.page-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.header-stats {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    opacity: 0.9;
}

.stat-item i {
    font-size: 1.1rem;
}

/* Filtros e Busca */
.price-table-filters {
    background: var(--white);
    border-bottom: 1px solid var(--border-color);
    padding: 1.5rem 0;
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}

.filters-row {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 250px;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(139, 69, 19, 0.1);
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-light);
    font-size: 1.1rem;
}

.sort-select {
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    background: var(--white);
    cursor: pointer;
    transition: var(--transition);
}

.sort-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.view-options {
    display: flex;
    gap: 0.5rem;
}

.view-btn {
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    background: var(--white);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
}

.view-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.view-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white);
}

/* Container Principal */
.price-table-container {
    margin-bottom: 3rem;
}

/* Visualização em Tabela */
.table-view {
    display: none;
}

.table-view.active {
    display: block;
}

.table-responsive {
    overflow-x: auto;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
}

.price-table {
    width: 100%;
    background: var(--white);
    border-collapse: collapse;
    font-size: 0.95rem;
}

.price-table thead {
    background: var(--primary-color);
    color: var(--white);
}

.price-table th {
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    border-bottom: 2px solid var(--primary-dark);
}

.price-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    vertical-align: middle;
}

.price-table tbody tr {
    transition: var(--transition);
}

.price-table tbody tr:hover {
    background: rgba(139, 69, 19, 0.05);
}

/* Colunas da Tabela */
.col-image {
    width: 80px;
}

.col-name {
    width: 200px;
}

.col-description {
    width: auto;
}

.col-price {
    width: 120px;
}

.col-actions {
    width: 140px;
}

/* Thumb do Produto */
.product-thumb {
    width: 60px;
    height: 60px;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.thumb-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.thumb-placeholder {
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 1.5rem;
}

/* Nome do Produto */
.product-name h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0 0 0.25rem 0;
    line-height: 1.3;
}

.product-weight {
    font-size: 0.85rem;
    color: var(--text-light);
    background: var(--bg-color);
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    display: inline-block;
}

/* Descrição */
.product-description p {
    margin: 0;
    color: var(--text-light);
    line-height: 1.4;
}

.no-description {
    font-style: italic;
    color: var(--text-muted);
}

/* Preço */
.product-price {
    text-align: center;
}

.price-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Ações */
.product-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    justify-content: center;
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

.btn-primary {
    background: var(--primary-color);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
}

.btn-outline-primary {
    background: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: var(--white);
}

.btn-secondary {
    background: var(--text-light);
    color: var(--white);
}

.btn-secondary:hover {
    background: var(--text-color);
}

/* Visualização em Grade */
.grid-view {
    display: none;
}

.grid-view.active {
    display: block;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.product-card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    transition: var(--transition);
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.card-image {
    height: 200px;
    overflow: hidden;
    position: relative;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition);
}

.card-image:hover img {
    transform: scale(1.05);
}

.image-placeholder {
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-size: 3rem;
}

.card-content {
    padding: 1.5rem;
}

.card-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-color);
    margin: 0 0 0.5rem 0;
    line-height: 1.3;
}

.card-weight {
    font-size: 0.85rem;
    color: var(--text-light);
    background: var(--bg-color);
    padding: 0.2rem 0.5rem;
    border-radius: 12px;
    display: inline-block;
    margin-bottom: 0.75rem;
}

.card-description {
    color: var(--text-light);
    line-height: 1.4;
    margin: 0 0 1rem 0;
}

.card-price {
    margin-bottom: 1.5rem;
}

.card-price .price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-color);
}

.card-actions {
    display: flex;
    gap: 0.75rem;
}

.card-actions .btn {
    flex: 1;
}

/* Sem Resultados */
.no-results {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-light);
}

.no-results-content {
    max-width: 400px;
    margin: 0 auto;
}

.no-results-icon {
    font-size: 4rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}

.no-results h3 {
    font-size: 1.5rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.no-results p {
    margin-bottom: 2rem;
}

/* Informações Adicionais */
.price-table-info {
    background: var(--bg-color);
    padding: 3rem 0;
    margin-top: 3rem;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.info-card {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.info-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.info-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.info-card h4 {
    font-size: 1.2rem;
    color: var(--text-color);
    margin-bottom: 0.75rem;
}

.info-card p {
    color: var(--text-light);
    line-height: 1.5;
    margin: 0;
}

/* Estados de Erro */
.error-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: 2rem;
}

.error-message {
    text-align: center;
    max-width: 500px;
}

.error-message h2 {
    color: #dc3545;
    margin-bottom: 1rem;
    font-size: 2rem;
}

.error-message p {
    margin-bottom: 2rem;
    font-size: 1.1rem;
    color: var(--text-light);
}

.error-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Responsividade */
@media (max-width: 768px) {
    .page-title {
        font-size: 2rem;
    }
    
    .page-subtitle {
        font-size: 1rem;
    }
    
    .header-stats {
        gap: 1rem;
    }
    
    .filters-row {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-box {
        min-width: auto;
    }
    
    .view-options {
        justify-content: center;
    }
    
    /* Tabela responsiva em mobile */
    .price-table {
        font-size: 0.85rem;
    }
    
    .price-table th,
    .price-table td {
        padding: 0.75rem 0.5rem;
    }
    
    .col-description {
        display: none;
    }
    
    .product-actions {
        flex-direction: column;
    }
    
    .btn-text {
        display: none;
    }
    
    /* Grade em mobile */
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
    }
    
    .card-content {
        padding: 1rem;
    }
    
    .info-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .info-card {
        padding: 1.5rem;
    }
}

@media (max-width: 480px) {
    .price-table-header {
        padding: 2rem 0;
    }
    
    .page-title {
        font-size: 1.75rem;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .card-actions {
        flex-direction: column;
    }
}

/* Animações */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.product-row,
.product-card {
    animation: fadeIn 0.5s ease forwards;
}

/* Estados de loading */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Print styles */
@media print {
    .price-table-filters,
    .view-options,
    .product-actions,
    .price-table-info {
        display: none;
    }
    
    .price-table {
        box-shadow: none;
    }
    
    .price-table th {
        background: #f0f0f0 !important;
        color: #000 !important;
    }
}