/* =========================
   RESET GLOBAL
========================= */
* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: Arial, sans-serif;
    overflow: hidden;
}

/* =========================
   BODY
========================= */
body.modo-caixa {
    background: #111;
    color: #fff;
    text-align: center;
    height: calc(var(--vh, 1vh) * 100);
}

/* =========================
   CONTAINER
========================= */



/* =========================
   CONTAINER PRINCIPAL (CORREÇÃO)
========================= */
.caixa-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 10px;
}

/* =========================
   ÁREA PRINCIPAL PDV
========================= */
.pdv-desktop {
    flex: 1; /* 🔥 ESSA É A CHAVE */
    
    display: grid;
    grid-template-columns: 1.3fr 0.7fr;

    gap: 15px;

    min-height: 0; /* 🔥 evita bug de overflow */
}

/* =========================
   CARRINHO
========================= */
.pdv-desktop #carrinho {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* lista ocupa tudo */
.lista-produtos {
    flex: 1;
    overflow-y: auto;
}

/* =========================
   LOGO AREA
========================= */
.logo-area {
    display: flex;
    justify-content: center;
    align-items: center;

    background: #000;
    border-radius: 10px;

    height: 100%;
}

/* logo gigante responsivo */
.logo-area img {
    width: 100%;
    height: 100%;
    object-fit: contain;

    padding: 20px;
}

/* =========================
   RESPONSIVO
========================= */

/* 🖥️ monitor grande */
@media(min-width: 1400px){
    .pdv-desktop {
        grid-template-columns: 1fr 1fr;
    }
}

/* 💻 notebook */
@media(max-width: 1200px){
    .pdv-desktop {
        grid-template-columns: 1.5fr 0.5fr;
    }
}

/* 📱 mobile */
@media(max-width: 768px){
    .pdv-desktop {
        display: block;
    }

    .logo-area {
        display: none;
    }
}

/* =========================
   TÍTULO
========================= */
h1 {
    font-size: 20px;
    margin: 5px 0 10px;
}

/* =========================
   BOTÕES
========================= */
button {
    background: #28a745;
    border: none;
    padding: 14px;
    font-size: 16px;
    border-radius: 10px;
    cursor: pointer;
}

#btn-scan {
    width: 100%;
    max-width: 400px;
    margin: 0 auto 10px;
}

/* =========================
   INPUT
========================= */
.linha-codigo {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

#codigo-manual {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    border: none;
    text-align: center;
}

input {
    width: 80%;
    text-align: center;
}

/* =========================
   RESULTADO
========================= */
#resultado {
    margin: 10px 0;
}

/* =========================
   GRID
========================= */
.pdv-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    height: 60vh;
}

/* =========================
   SCANNER
========================= */
#scanner-container {
    width: 100%;
    height: 100%;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    display: none;
}

#scanner-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

#scanner-container canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* =========================
   CARRINHO
========================= */
#carrinho {
    background: #111;
    border-radius: 10px;
    padding: 10px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#carrinho h2 {
    font-size: 16px;
    margin-bottom: 8px;
}

.lista-produtos {
    flex: 1;
    overflow-y: auto;
    text-align: left;
}

.lista-produtos li {
    font-family: monospace;
    border-bottom: 1px dashed #333;
    padding: 5px 0;
}

/* =========================
   TOTAL FIXO
========================= */
#total-fixo {
    position: fixed;
    bottom: 80px;
    left: 0;
    width: 100%;
    background: #000;
    color: #00ff88;
    font-size: 18px;
    font-weight: bold;
    padding: 10px;
    text-align: center;
    z-index: 10000;
}

/* =========================
   FOOTER
========================= */
#pagamentos {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #000;
    padding: 10px;
    display: flex;
    justify-content: center;
    z-index: 9999;
}

.btn-pagamento {
    width: 100%;
    max-width: 400px;
    background: #007bff;
}

/* =========================
   BOTÃO VER LISTA
========================= */
#btn-ver-lista {
    position: fixed;
    bottom: 140px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10000;
    width: 90%;
    max-width: 400px;
}

/* =========================
   LOGO (DESKTOP PERFEITO)
========================= */
#logo-pdv {
    position: fixed;
    top: 15px;
    right: 20px;

    height: 50px;
    max-width: 180px;

    object-fit: contain;

    z-index: 10000;

    /* 🔥 alinhamento bonito */
    display: block;

    /* 🔥 visual premium */
    opacity: 0.95;
    filter: drop-shadow(0 2px 6px rgba(0,0,0,0.6));
}

/* =========================
   MOBILE
========================= */
@media(max-width: 768px){

    .pdv-grid {
        display: flex;
        flex-direction: column;
        height: 100vh;
    }

    #scanner-container {
        height: 30vh;
    }

    #carrinho {
        height: 60vh;
    }

    #logo-pdv {
        display: none;
    }
}

/* =========================
   ESCONDER OPENCART
========================= */
header,
#top,
.navbar,
.breadcrumb,
footer {
    display: none !important;
}

/* =========================
   DESKTOP: LAYOUT PDV
========================= */
/* =========================
   CONTAINER PRINCIPAL
========================= */
.caixa-container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    padding: 10px;
}

/* =========================
   ÁREA PRINCIPAL PDV
========================= */
.pdv-desktop {
    flex: 1;

    display: grid;
    grid-template-columns: 1.3fr 0.7fr;

    gap: 15px;

    min-height: 0; /* 🔥 ESSENCIAL */
}

/* =========================
   CARRINHO (OCUPA TUDO)
========================= */
.pdv-desktop #carrinho {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.lista-produtos {
    flex: 1;
    overflow-y: auto;
}

/* =========================
   LOGO AREA (OCUPA TUDO)
========================= */
.logo-area {
    display: flex;
    justify-content: center;
    align-items: center;

    background: #000;
    border-radius: 10px;

    height: 100%;
}

/* LOGO RESPONSIVO GRANDE */
.logo-area img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 20px;
}

/* =========================
   RESPONSIVIDADE
========================= */

/* 🖥️ MONITOR GRANDE */
@media(min-width: 1400px){
    .pdv-desktop {
        grid-template-columns: 1fr 1fr;
    }
}

/* 💻 NOTEBOOK */
@media(max-width: 1200px){
    .pdv-desktop {
        grid-template-columns: 1.5fr 0.5fr;
    }
}

/* 📱 MOBILE */
@media(max-width: 768px){
    .pdv-desktop {
        display: block;
    }

    .logo-area {
        display: none;
    }
}
/* =========================
   MOBILE
========================= */
@media(max-width: 768px){
    .pdv-desktop {
        display: block;
    }

    .logo-area {
        display: none;
    }
}
/* 🔥 FORÇA esconder QUALQUER logo no mobile */
@media(max-width: 768px){

    #logo-pdv {
        display: none !important;
    }

    .logo-area {
        display: none !important;
    }

}

/* 🔥 corrige input de quantidade */
#quantidade,
#nova-quantidade {
    width: 100% !important;
    font-size: 20px;
    padding: 12px;
}

.popup {
    display: none; /* começa escondido */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;

    background: rgba(0,0,0,0.7);

    justify-content: center;
    align-items: center;

    z-index: 9999; /* 🔥 ESSENCIAL */
}

.popup-conteudo {
    background: #222;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
}

.lista-produtos {
    max-height: 300px; /* altura máxima do container */
    overflow-y: auto;  /* ativa o scroll vertical */
    padding-right: 5px; /* opcional, evita que o scroll sobreponha o conteúdo */
    border: 1px solid #ccc; /* opcional, só pra visualizar */
}

/* =========================
   PDV CSS - MODO CAIXA
   Sobrescreve cores e estilos apenas dentro de .modo-caixa
========================= */

/* Corpo do PDV */
.modo-caixa {
    background-color: #121212; /* fundo escuro */
    color: #fff;               /* texto padrão branco */
    font-family: Arial, sans-serif;
}

/* Cabeçalhos */
.modo-caixa h1,
.modo-caixa h2 {
    color: #fff;   /* branco, sobrescreve #333 da stylesheet global */
    font-weight: bold;
    margin-bottom: 10px;
}

/* Botões */
.modo-caixa .btn,
.modo-caixa .btn-pagamento,
.modo-caixa #btn-scan,
.modo-caixa #btn-manual {
    background-color: #1a73e8;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 10px 15px;
    font-size: 16px;
    cursor: pointer;
    transition: 0.2s all ease-in-out;
}

.modo-caixa .btn:hover,
.modo-caixa .btn-pagamento:hover,
.modo-caixa #btn-scan:hover,
.modo-caixa #btn-manual:hover {
    background-color: #1664c1;
}

/* Inputs */
.modo-caixa input[type="number"],
.modo-caixa input[type="tel"] {
    padding: 8px;
    font-size: 16px;
    border-radius: 4px;
    border: 1px solid #555;
    background-color: #1e1e1e;
    color: #fff;
}

/* Lista de produtos */
.modo-caixa .lista-produtos {
    max-height: 70%; /* faz scroll */
    overflow-y: auto;
    background-color: #1a1a1a;
    padding: 10px;
    border-radius: 6px;
}

.modo-caixa .lista-produtos li {
    padding: px;
    border-bottom: 1px solid #333;
    color: #fff;
    cursor: pointer;
}

.modo-caixa .lista-produtos li:last-child {
    border-bottom: none;
}

/* Carrinho */
.modo-caixa #carrinho {
    background-color: #1a1a1a;
    padding: 15px;
    border-radius: 8px;
}

/* Popup de alteração/exclusão */
.modo-caixa .popup {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.75);
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.modo-caixa .popup-conteudo {
    background-color: #222;
    padding: 20px;
    border-radius: 8px;
    color: #fff;
}

/* Total fixo */
.modo-caixa #total-fixo {
    margin-top: 15px;
    font-size: 18px;
    font-weight: bold;
    color: #fff;
}

/* Logo */
.modo-caixa .logo-area img {
    max-width: 120px;
    filter: brightness(1);
}

/* Scrollbar personalizada */
.modo-caixa .lista-produtos::-webkit-scrollbar {
    width: 8px;
}

.modo-caixa .lista-produtos::-webkit-scrollbar-thumb {
    background-color: #555;
    border-radius: 4px;
}

.modo-caixa .lista-produtos::-webkit-scrollbar-track {
    background-color: #1a1a1a;
}

.modo-caixa #pdv-botoes {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.modo-caixa #pdv-botoes .btn-pagamento {
    flex: 1; /* ambos os botões ocupam o mesmo espaço */
    min-width: 120px; /* evita ficar muito pequeno no mobile */
}
.modo-caixa #pdv-botoes button {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

#pdv-botoes {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;

    display: flex;
    flex-direction: column;
    gap: 8px;

    padding: 10px;
    background: #222;
    z-index: 999;
}

/* linha horizontal */
.linha-botoes {
    display: flex;
    gap: 8px;
}

/* divide espaço igual */
.linha-botoes button {
    flex: 1;
}

/* botão principal grande */
.btn-pagamento {
    width: 100%;
    background: #28a745;
    color: #fff;
    padding: 16px;
    font-size: 18px;
    border-radius: 10px;
    border: none;
}

/* botões secundários */
.btn-secundario {
    background: #444;
    color: #fff;
    padding: 12px;
    border-radius: 8px;
    border: none;
}
body.modo-caixa {
    padding-bottom: 120px; /* espaço pros botões */
}

html, body {
    height: 100%;
    overflow-y: auto;
}

.linha-botoes {
    display: flex;
    gap: 8px;
}

.linha-botoes button {
    flex: 1;
}

.linha-botoes button {
    flex: 1 !important;
    width: auto !important;
    display: block;
}

#pdv-botoes .linha-botoes button {
    flex: 1 !important;
    width: 50% !important;
    max-width: 50% !important;
}

/* container geral */
#pdv-botoes {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;

    display: flex;
    flex-direction: column;
    gap: 8px;

    padding: 10px;
    background: #222;
    z-index: 999;
}

/* linha horizontal (ver lista + continuar) */
.linha-botoes {
    display: flex;
    gap: 8px;
}

/* 🔥 SOMENTE esses dividem */
.linha-botoes button {
    flex: 1 !important;
    width: auto !important;
    max-width: 100% !important;
}

/* 🔥 botão FINALIZAR separado */
#pdv-botoes .btn-pagamento {
    width: 100% !important;
    display: block;
    background: #28a745;
    color: #fff;
    padding: 16px;
    font-size: 18px;
    border-radius: 10px;
    border: none;
}

/* botões secundários */
.btn-secundario {
    background: #444;
    color: #fff;
    padding: 12px;
    border-radius: 8px;
    border: none;
}

/* 🔥 RESET TOTAL dentro do PDV */
#pdv-botoes button {
    width: auto !important;
    display: block;
}

/* 🔥 linha horizontal funcionando */
#pdv-botoes .linha-botoes {
    display: flex;
    gap: 8px;
}

#pdv-botoes .linha-botoes button {
    flex: 1 !important;
    width: 0 !important; /* 🔥 truque chave */
}

/* 🔥 botão FINALIZAR grande */
#pdv-botoes .btn-pagamento {
    width: 100% !important;
}