/* css/style.css */

/* ==========================================================
   1. CONFIGURAÇÕES GERAIS E TEMA ESCURO (CHAPA & BRASA)
   ========================================================== */
:root {
    --bg-dark: #121212;
    --bg-card: #1e1e1e;
    --bg-card-hover: #262626;
    --border-color: #2d2d2d;
    --brand-yellow: #ffc107;
    --brand-yellow-hover: #e0a800;
    --text-light: #f8f9fa;
    --text-muted: #a0a0a0;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-light);
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    padding-bottom: 85px;
}

/* Scrollbar personalizada para a página */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-dark);
}
::-webkit-scrollbar-thumb {
    background: #333;
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--brand-yellow);
}

/* ==========================================================
   2. DASHBOARD & PAINEL DE LOGIN
   ========================================================== */
.card-login {
    max-width: 400px;
    margin: 80px auto;
    border-radius: 12px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
}

/* ==========================================================
   3. HEADER & BANNER (HERO)
   ========================================================== */
.hero-banner { 
    background: linear-gradient(180deg, rgba(0,0,0,0.7) 0%, rgba(18,18,18,1) 100%), url('../img/banner-hero.jpg') center/cover no-repeat; 
    padding: 35px 15px 25px; 
}

/* ==========================================================
   4. NAVEGAÇÃO DE CATEGORIAS (STICKY HORIZONTAL)
   ========================================================== */
.nav-categories { 
    overflow-x: auto; 
    white-space: nowrap; 
    background: #181818; 
    position: sticky; 
    top: 0; 
    z-index: 1000; 
    border-bottom: 1px solid var(--border-color); 
    -webkit-overflow-scrolling: touch;
}

/* Esconde a barra de rolagem visualmente mantendo o scroll funcional */
.nav-categories::-webkit-scrollbar { 
    display: none; 
}
.nav-categories {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.nav-categories .btn { 
    color: var(--text-muted); 
    border: none; 
    border-bottom: 3px solid transparent; 
    border-radius: 0; 
    padding: 12px 20px; 
    font-weight: 600; 
    transition: all 0.25s ease;
}

.nav-categories .btn:hover {
    color: var(--brand-yellow);
}

.nav-categories .btn.active { 
    color: var(--brand-yellow); 
    border-bottom-color: var(--brand-yellow); 
    background: transparent; 
}

/* ==========================================================
   5. CARDS DE PRODUTOS & ANIMAÇÕES
   ========================================================== */
.card-produto { 
    background: var(--bg-card); 
    border: 1px solid var(--border-color); 
    border-radius: 12px; 
    overflow: hidden;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease; 
}

.card-produto:hover { 
    transform: translateY(-4px); 
    border-color: rgba(255, 193, 7, 0.4);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.6);
}

.img-produto { 
    height: 150px; 
    width: 100%;
    object-fit: cover; 
    border-top-left-radius: 12px; 
    border-top-right-radius: 12px; 
    transition: transform 0.3s ease;
}

.card-produto:hover .img-produto {
    transform: scale(1.03);
}

/* ==========================================================
   6. BARRA FLUTUANTE DO CARRINHO (RODAPÉ)
   ========================================================== */
.bar-carrinho { 
    position: fixed; 
    bottom: 0; 
    left: 0; 
    right: 0; 
    background: var(--brand-yellow); 
    color: #000; 
    z-index: 1050; 
    padding: 14px 20px; 
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.7); 
    cursor: pointer;
    transition: background-color 0.2s ease, transform 0.2s ease;
    animation: slideUp 0.3s ease-out;
}

.bar-carrinho:hover {
    background: var(--brand-yellow-hover);
}

.bar-carrinho:active {
    transform: scale(0.99);
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

/* Espaço extra no rodapé para não ficar encostado na barra fixa do carrinho */
footer,
.rodape-site {
    padding-bottom: 24px;
}

/* ==========================================================
   7. ESTILIZAÇÃO DOS MODAIS (PRODUTO & CHECKOUT)
   ========================================================== */
.modal-content {
    background-color: var(--bg-card) !important;
    border: 1px solid var(--border-color) !important;
    border-radius: 14px;
}

.modal-header, .modal-footer {
    border-color: var(--border-color) !important;
}

.form-control, .form-select {
    background-color: #2a2a2a !important;
    border: 1px solid #3a3a3a !important;
    color: #fff !important;
}

.form-control:focus, .form-select:focus {
    border-color: var(--brand-yellow) !important;
    box-shadow: 0 0 0 0.25rem rgba(255, 193, 7, 0.25) !important;
}

/* ==========================================================
   8. REGRA DE IMPRESSÃO (TÉRMICA MPT-II 58mm)
   ========================================================== */
@media print {
    body * {
        visibility: hidden;
    }

    #comanda-impressao, 
    #comanda-impressao * {
        visibility: visible;
    }

    #comanda-impressao {
        position: absolute;
        left: 0;
        top: 0;
        width: 48mm;
        font-family: 'Courier New', monospace;
        font-size: 11px;
        color: #000;
        line-height: 1.2;
    }

    #comanda-impressao hr {
        border-top: 1px dashed #000;
        margin: 5px 0;
    }

    #comanda-impressao .text-center {
        text-align: center;
    }

    #comanda-impressao .header-titulo {
        margin: 0;
        font-size: 14px;
        font-weight: bold;
    }

    #comanda-impressao .total-destaque {
        font-size: 13px;
        font-weight: bold;
        margin: 5px 0;
    }
}
/* Correção de Contraste para Descrição do Produto no Card */
.card-produto .text-muted {
    color: var(--text-muted) !important; /* Exibe em tom cinza claro de alto contraste */
}

.card-produto h6 {
    color: var(--text-light) !important; /* Força o título em branco/claro */
}

/*impressão*/
@media print {
    /* 1. Oculta tudo que não pertence ao relatório */
    body * {
        visibility: hidden;
    }
    
    /* 2. Exibe apenas a área do relatório de fluxo de caixa */
    #area-impressao, #area-impressao * {
        visibility: visible;
    }

    #area-impressao {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
    }

    /* Oculta botões, ações e filtros */
    .no-print {
        display: none !important;
    }

    /* REGRA: Esconder colunas dependendo do modo selecionado */
    body.print-apenas-entradas #col-saidas {
        display: none !important;
    }
    body.print-apenas-entradas #col-entradas {
        width: 100% !important;
    }

    body.print-apenas-saidas #col-entradas {
        display: none !important;
    }
    body.print-apenas-saidas #col-saidas {
        width: 100% !important;
    }

    /* Ajuste visual para papel */
    .card {
        border: 1px solid #ccc !important;
        box-shadow: none !important;
    }
}
#area-impressao-comanda {
    display: none;
}

/* SÓ É ATIVADO QUANDO CLICA EM IMPRIMIR COMANDA */
@media print {
    body.modo-impressao-comanda * {
        visibility: hidden !important;
    }

    body.modo-impressao-comanda #area-impressao-comanda,
    body.modo-impressao-comanda #area-impressao-comanda * {
        visibility: visible !important;
    }

    body.modo-impressao-comanda #area-impressao-comanda {
        display: block !important;
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        background: #fff !important;
    }

    /* Estilo visual da bobina */
    .comanda-corpo {
        width: 280px;
        font-family: 'Courier New', Courier, monospace !important;
        font-size: 13px !important;
        color: #000 !important;
        line-height: 1.2;
    }
    .comanda-cabecalho { text-align: center; border-bottom: 1px dashed #000; padding-bottom: 5px; margin-bottom: 5px; }
    .comanda-cabecalho h2 { font-size: 18px !important; margin: 0 0 4px 0 !important; }
    .comanda-secao { border-bottom: 1px dashed #000; padding-bottom: 5px; margin-bottom: 5px; }
    .comanda-secao p { margin: 2px 0 !important; }
    .comanda-itens { white-space: pre-wrap !important; font-weight: bold !important; margin-top: 3px; }
    .comanda-total { text-align: center; font-size: 14px !important; margin-top: 5px; }
    .comanda-rodape { text-align: center; border-top: 1px dashed #000; margin-top: 8px; padding-top: 5px; font-size: 11px !important; }

    @page {
        margin: 0;
    }
}
.modal-footer .text-muted, 
#subtotalItens, 
#linhaFrete {
    color: #e0e0e0 !important; /* Branco suave / Cinza claro */
    opacity: 1 !important;
}

#valorFrete {
    font-weight: bold;
}
/* Correção forçada para o fundo e textos do modal de histórico */
#modalMeusPedidos .modal-content {
    background-color: #1a1d20 !important;
    color: #ffffff !important;
}

#modalMeusPedidos .modal-body p {
    color: #ffffff !important;
}
/* ==========================================================
   AJUSTE DEFINITIVO DA LOGO NO TOPO (HEADER)
   ========================================================== */
.logo-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-bottom: 15px;
}

.img-logo-topo {
    max-height: 90px !important; /* Altura máxima controlada no computador */
    max-width: 100% !important;  /* Garante que nunca ultrapasse a largura da tela */
    width: auto !important;      /* Mantém a proporção correta sem distorcer */
    height: auto !important;     /* Mantém a proporção da altura */
    object-fit: contain;
}

/* Ajuste automático para celulares */
@media (max-width: 576px) {
    .img-logo-topo {
        max-height: 65px !important; /* Fica menor e proporcional no celular */
    }
}

/* Correção definitiva para textos acinzentados no tema escuro */
.text-muted {
    color: #b0b0b0 !important;
}