﻿/* RESET */
body {
    margin: 0;
    font-family: Arial, sans-serif;
    background: #f3f3f3;
}

/* HEADER */
.pos-header {
    background: #d32f2f;
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: bold;
}

.mode {
    background: #ffc107;
    color: black;
    padding: 4px 8px;
    border-radius: 6px;
    margin-left: 10px;
}

/* LAYOUT */
.pos-body {
    display: flex;
    height: calc(100vh - 60px);
    overflow: hidden;
}

/* PRODUTOS */
.products {
    width: 70%;
    padding: 15px;
    overflow-y: auto;
}

/* TOP BAR */
.top-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

/* SEARCH */
.search-box {
    flex: 1;
    position: relative;
}

.search-input {
    width: 100%;
    padding: 12px 40px;
    border-radius: 10px;
    border: 1px solid #ccc;
    background: #f9f9f9;
}

.search-icon {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
}

/* CATEGORIES */
.categories {
    display: flex;
    gap: 8px;
}

    .categories button {
        border: none;
        padding: 10px;
        border-radius: 8px;
        background: #eee;
        cursor: pointer;
    }

        .categories button.active {
            background: #ffc107;
        }

/* GRID */
.grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

/* CARD */
.card {
    background: white;
    border-radius: 12px;
    padding: 10px;
    transition: 0.2s;
    cursor: pointer;
}

    .card:hover {
        transform: scale(1.05);
    }

    .card img {
        width: 100%;
        height: 120px;
        object-fit: cover;
        border-radius: 10px;
    }

.img-box {
    position: relative;
}

.price {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: #ffc107;
    padding: 5px 10px;
    border-radius: 6px;
    font-weight: bold;
}

.stock.ok {
    color: green;
}

/* CARRINHO */
.cart {
    width: 30%;
    background: #ffffff;
    padding: 15px;
    border-left: 2px solid #ddd;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.cart-header {
    display: flex;
    justify-content: space-between;
    font-weight: bold;
    margin-bottom: 10px;
}

.btn-clear {
    background: #e53935;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 6px;
}

/* ITENS */
.cart-items {
    flex: 1;
    overflow-y: auto;
}

/* TOTAL */
.totals {
    margin-top: 10px;
}

    .totals p {
        display: flex;
        justify-content: space-between;
    }

.total-final {
    background: #d32f2f;
    color: white;
    padding: 10px;
    font-weight: bold;
    margin-top: 10px;
}

/* BOTÃO FINAL */
.btn-final {
    background: #2e7d32;
    color: white;
    padding: 15px;
    border: none;
    border-radius: 10px;
    margin-top: 10px;
    font-size: 16px;
}

/* MODAL */
.modal {
    display: none;
    position: fixed;
    z-index: 999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
}

.modal-content {
    background: #ffffff;
    color: #333;
    width: 800px; /* 🔥 MAIS LARGO */
    max-width: 95%;
    margin: 5% auto;
    padding: 20px;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.modal-body input {
    width: 100%;
    padding: 10px;
    margin-top: 5px;
    margin-bottom: 10px;
    border-radius: 6px;
    border: none;
}

.modal-footer {
    display: flex;
    justify-content: space-between;
}

.btn-cancel {
    background: #444;
    color: white;
    padding: 10px;
    border: none;
}

.btn-confirm {
    background: #2e7d32;
    color: white;
    padding: 10px;
    border: none;
}
.modal-body label {
    margin-top: 8px;
    display: block;
    font-size: 14px;
}
.stock-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.stock-card {
    background: white;
    padding: 15px;
    border-radius: 12px;
    text-align: center;
}

    .stock-card input {
        width: 100%;
        padding: 10px;
        font-size: 18px;
        margin: 10px 0;
    }

.actions button {
    width: 100%;
    padding: 12px;
    margin-top: 5px;
    font-size: 16px;
    border: none;
    border-radius: 8px;
}

    .actions button:first-child {
        background: green;
        color: white;
    }

    .actions button:last-child {
        background: red;
        color: white;
    }

.alert {
    color: red;
    font-weight: bold;
}

.btn-new-product {
    background: #1976d2;
    color: white;
    padding: 12px 18px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    cursor: pointer;
}

    .btn-new-product:hover {
        background: #125ea2;
    }


/* ========================= */
/* HEADER */
/* ========================= */
.stock-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

h2 {
    font-weight: 600;
    font-size: 18px;
    margin: 0;
}

/* ========================= */
/* BOTÃO NOVO */
/* ========================= */
.btn-new-product {
    background: #1976d2;
    color: white;
    padding: 8px 14px;
    border-radius: 8px;
    border: none;
    font-size: 14px;
    cursor: pointer;
    transition: 0.2s;
}

    .btn-new-product:hover {
        background: #125ea2;
    }

/* ========================= */
/* GRID */
/* ========================= */
.stock-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 12px;
}

/* ========================= */
/* CARD */
/* ========================= */
.stock-card {
    background: white;
    border-radius: 12px;
    padding: 10px;
    text-align: center;
    box-shadow: 0 3px 8px rgba(0,0,0,0.06);
    transition: 0.2s;
}

    .stock-card:hover {
        transform: translateY(-3px);
    }

/* ========================= */
/* IMAGE */
/* ========================= */
.img-box img {
    width: 100%;
    height: 110px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 6px;
}

/* ========================= */
/* TEXT */
/* ========================= */
.stock-card h4 {
    font-size: 14px;
    margin: 4px 0;
}

.stock-card small {
    font-size: 12px;
    color: #777;
}

/* ========================= */
/* STOCK */
/* ========================= */
.stock {
    display: block;
    margin: 6px 0;
    font-size: 13px;
    font-weight: 500;
}

    .stock.ok {
        color: #2e7d32;
    }

    .stock.warning {
        color: #f9a825;
    }

    .stock.danger {
        color: #c62828;
    }

/* ========================= */
/* INPUT */
/* ========================= */
.stock-card input {
    width: 100%;
    padding: 8px;
    font-size: 14px;
    text-align: center;
    border-radius: 8px;
    border: 1px solid #ddd;
    margin: 6px 0;
}

/* ========================= */
/* BUTTONS */
/* ========================= */
.actions {
    display: flex;
    gap: 6px;
}

    .actions button {
        flex: 1;
        padding: 8px;
        font-size: 13px;
        border: none;
        border-radius: 8px;
        cursor: pointer;
    }

/* BOTÕES CORES */
.btn-in {
    background: #2e7d32;
    color: white;
}

.btn-out {
    background: #c62828;
    color: white;
}

/* ========================= */
/* MODAL */
/* ========================= */
.modal-content {
    background: #ffffff;
    color: #333;
    width: 800px; /* 🔥 MAIS LARGO */
    max-width: 95%;
    margin: 5% auto;
    padding: 20px;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.modal-body input {
    border: 1px solid #ccc;
    padding: 8px;
    border-radius: 6px;
    margin-bottom: 8px;
}

/* BOTÕES MODAL */
.btn-confirm {
    background: #2e7d32;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
}

.btn-cancel {
    background: #999;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
}

.dashboard-container {
    padding: 20px;
}

.dashboard-cards {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.card-metric {
    flex: 1;
    background: white;
    padding: 15px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
}

    .card-metric span {
        font-size: 22px;
        font-weight: bold;
    }

/* SECTIONS */
.dashboard-section {
    margin-top: 20px;
    background: white;
    padding: 15px;
    border-radius: 12px;
}

/* TABLE */
.table {
    width: 100%;
    margin-top: 10px;
}

    .table th {
        text-align: left;
    }

/* LAYOUT */
.app-container {
    display: flex;
    height: 100vh;
    overflow: hidden;
}

/* SIDEBAR */
.sidebar {
    width: 220px;
    background: #1e1e2f;
    color: white;
    padding: 15px;
    display: flex;
    flex-direction: column;
}

/* LOGO */
.logo img {
    width: 80px !important;
    height: auto !important;
    max-width: 100% !important;
    display: block;
    margin: 0 auto;
}


/* MENU */
.menu {
    list-style: none;
    padding: 0;
}

    .menu li {
        margin-bottom: 10px;
    }

    .menu a {
        display: block;
        padding: 10px;
        border-radius: 8px;
        color: white;
        text-decoration: none;
        transition: 0.2s;
    }

        .menu a:hover {
            background: #2c2c40;
        }

        /* ACTIVE */
        .menu a.active {
            background: #1976d2;
        }

/* CONTENT */
.main-content {
    flex: 1;
    padding: 15px;
    overflow-y: auto;
    background: #f5f6fa;
}
.card.disabled {
    opacity: 0.5;
    pointer-events: none; /* 🔥 BLOQUEIA CLIQUE */
    filter: grayscale(100%);
    cursor: not-allowed;
    position: relative;
}

    /* LABEL "SEM STOCK" */
    .card.disabled::after {
        content: "SEM STOCK";
        position: absolute;
        top: 10px;
        left: 10px;
        background: #c62828;
        color: white;
        padding: 5px 10px;
        font-size: 12px;
        border-radius: 6px;
        font-weight: bold;
    }
select.form-control {
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #ccc;
    background: #f9f9f9;
}
/* ENCOMENDAS */
.order-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: white;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 6px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    font-size: 14px;
}

    /* HOJE DESTACADO */
    .order-line.today {
        border-left: 4px solid #ff9800;
        background: #fff8e1;
        font-weight: bold;
    }
.encomenda-container {
    padding: 20px;
}

.encomenda-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 15px;
}

/* CARD */
.encomenda-card {
    background: white;
    border-radius: 12px;
    padding: 15px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
    transition: 0.2s;
}

    .encomenda-card:hover {
        transform: translateY(-5px);
    }

/* HEADER */
.card-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

/* STATUS */
.status {
    padding: 5px 10px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: bold;
}

/* CORES POR ESTADO */
.encomenda-card.pendente .status {
    background: #fff3cd;
    color: #856404;
}

.encomenda-card.entregue .status {
    background: #d4edda;
    color: #155724;
}

/* FOOTER */
.card-footer button {
    width: 100%;
    padding: 10px;
    border: none;
    border-radius: 8px;
    background: #2e7d32;
    color: white;
    cursor: pointer;
}
/* HEADER */
.encomenda-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

/* BOTÃO NOVA ENCOMENDA */
.btn-new-order {
    background: linear-gradient(45deg, #ff9800, #ffb74d);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 10px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
}

    .btn-new-order:hover {
        transform: scale(1.05);
        box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    }
.modal-body h4 {
    margin-top: 15px;
    font-size: 14px;
    color: #555;
}
#tipoVenda, #tipoEntrega {
    width: 100%;
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 8px;
}
/* GRID CHECKOUT */
.grid-checkout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

    /* COLUNAS */
    .grid-checkout .left,
    .grid-checkout .right {
        display: flex;
        flex-direction: column;
    }

/* INPUTS MAIS BONITOS */
.modal-body input,
.modal-body select {
    width: 100%;
    padding: 12px;
    margin-bottom: 10px;
    border-radius: 10px;
    border: 1px solid #ddd;
    font-size: 15px;
}

/* TITULOS */
.modal-body h4 {
    margin-top: 10px;
    color: #444;
}
.btn-new-client {
    margin-top: 10px;
    padding: 10px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(45deg, #1976d2, #42a5f5);
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: 0.2s;
}

    .btn-new-client:hover {
        transform: scale(1.05);
        box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    }

.order-line {
    background: white;
    padding: 12px;
    border-radius: 10px;
    margin-bottom: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.order-header {
    font-size: 15px;
    margin-bottom: 5px;
}

.order-items {
    font-size: 13px;
    margin-bottom: 8px;
}

.item {
    display: flex;
    justify-content: space-between;
}

.order-values p {
    margin: 2px 0;
    font-size: 13px;
}
.order-group {
    background: white;
    padding: 15px;
    border-radius: 12px;
    margin-bottom: 15px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.05);
}

    .order-group h4 {
        margin-bottom: 10px;
        color: #d32f2f;
    }

.order-line {
    padding: 8px 0;
}

.order-items {
    font-size: 13px;
}

.item {
    display: flex;
    justify-content: space-between;
}

.order-values {
    font-size: 13px;
    margin-top: 5px;
}
.modal-lg {
    width: 700px;
    max-width: 90%;
}

.order-card {
    background: white;
    padding: 15px;
    border-radius: 12px;
    cursor: pointer;
    transition: 0.2s;
}

    .order-card:hover {
        transform: scale(1.02);
    }

/* STATUS */
.status {
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 12px;
}

    .status.pendente {
        background: orange;
        color: white;
    }

    .status.pago {
        background: green;
        color: white;
    }
.cliente-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    margin-bottom: 8px;
}

    .cliente-info span:first-child {
        font-weight: bold;
    }

    .cliente-info span:last-child {
        color: #666;
    }
/* ENCOMENDAS */
.card-metric.encomenda {
    border-left: 5px solid #ff9800;
}

/* TOTAL GERAL */
.card-metric.total-geral {
    border-left: 5px solid #2e7d32;
    background: #f1fff3;
}

/* TABELA */
.touch-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

/* LINHAS */
.touch-row {
    border-bottom: 1px solid #ececec;
}

/* PRODUTO */
.product-cell {
    padding: 14px 10px;
}

/* INFO */
.product-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

/* TOPO */
.product-top {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* QUANTIDADE */
.product-qty {
    font-size: 18px;
    font-weight: 600;
    color: #444;
}

/* NOME */
.product-name {
    font-size: 22px;
    font-weight: 700;
    color: #222;
}

/* PREÇO UNITÁRIO */
.product-each {
    font-size: 16px;
    color: #777;
}

/* AÇÕES */
.actions-cell {
    padding: 14px 10px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-content: center;
    gap: 10px;
    white-space: nowrap;
}

/* PREÇO */
.price {
    font-size: 24px;
    font-weight: 700;
    color: #111;
}

/* CONTROLOS */
.qty-box {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* BOTÕES + E - */
.qty-btn {
    width: 34px;
    height: 34px;
    border: 1px solid #dcdcdc;
    background: #fff;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.15s;
}

    .qty-btn:hover {
        background: #f5f5f5;
    }

    .qty-btn:active {
        transform: scale(0.92);
    }

/* BOTÃO APAGAR */
.remove-btn {
    width: 34px;
    height: 34px;
    border: none;
    background: #fff0f0;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    transition: 0.15s;
}

    .remove-btn:hover {
        background: #ffdede;
    }

    .remove-btn:active {
        transform: scale(0.92);
    }



/* =========================
   MODAL BASE
========================= */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0,0,0,0.45);
    padding: 16px;
    overflow-y: auto;
}

/* =========================
   CONTEÚDO
========================= */
.modal-content {
    background: #fff;
    width: 100%;
    max-width: 1000px;
    margin: 30px auto;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 35px rgba(0,0,0,0.2);
}

/* =========================
   HEADER
========================= */
.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 22px;
    border-bottom: 1px solid #ececec;
}

    .modal-header h3 {
        margin: 0;
        font-size: 22px;
    }

.close {
    font-size: 22px;
    cursor: pointer;
}

/* =========================
   BODY
========================= */
.modal-body {
    padding: 20px;
}

/* GRID */
.grid-checkout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

/* COLUNAS */
.left,
.right {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* =========================
   INPUTS
========================= */
label {
    font-size: 14px;
    font-weight: 600;
    color: #444;
}

input,
select {
    width: 100%;
    height: 42px;
    border: 1px solid #dcdcdc;
    border-radius: 10px;
    padding: 0 12px;
    font-size: 15px;
    outline: none;
    transition: 0.15s;
}

    input:focus,
    select:focus {
        border-color: #999;
    }

/* =========================
   FOOTER
========================= */
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 18px 22px;
    border-top: 1px solid #ececec;
}

/* =========================
   BOTÕES
========================= */
.btn-cancel,
.btn-confirm,
.btn-new-client {
    border: none;
    border-radius: 10px;
    padding: 12px 18px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: 0.15s;
}

/* CANCELAR */
.btn-cancel {
    background: #ececec;
}

/* CONFIRMAR */
.btn-confirm {
    background: #111;
    color: #fff;
}

/* NOVO CLIENTE */
.btn-new-client {
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* HOVER */
.btn-confirm:hover {
    opacity: 0.92;
}

.btn-cancel:hover,
.btn-new-client:hover {
    background: #e2e2e2;
}

/* =========================
   MOBILE / TABLET
========================= */
@media(max-width:768px) {

    .modal {
        padding: 10px;
    }

    .modal-content {
        margin: 10px auto;
        border-radius: 14px;
    }

    /* GRID VIRA COLUNA */
    .grid-checkout {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .modal-header {
        padding: 16px;
    }

        .modal-header h3 {
            font-size: 18px;
        }

    .modal-body {
        padding: 16px;
    }

    .modal-footer {
        flex-direction: column;
        padding: 16px;
    }

    .btn-cancel,
    .btn-confirm,
    .btn-new-client {
        width: 100%;
    }

    input,
    select {
        height: 44px;
        font-size: 16px;
    }
}

/* =========================
   MOBILE PEQUENO
========================= */
@media(max-width:480px) {

    .modal-content {
        border-radius: 12px;
    }

    .modal-header h3 {
        font-size: 17px;
    }

    .close {
        font-size: 20px;
    }

    .modal-body {
        padding: 14px;
    }

    .modal-footer {
        gap: 10px;
    }

    label {
        font-size: 13px;
    }

    input,
    select {
        font-size: 15px;
    }
}

/* MOBILE */
@media(max-width:768px) {

    .product-name {
        font-size: 18px;
    }

    .price {
        font-size: 20px;
    }

    .qty-btn,
    .remove-btn {
        width: 30px;
        height: 30px;
        font-size: 16px;
    }
}

/* RESPONSIVO */
@media (max-width: 768px) {
    .product-name {
        font-size: 14px;
    }

    .btn-touch {
        min-width: 40px;
        min-height: 40px;
    }
}
/* RESPONSIVO */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
    }

    .grid-checkout {
        grid-template-columns: 1fr;
    }
}
/* ========================= */
/* 📱 TABLET */
/* ========================= */
@media (max-width: 1024px) {
    .pos-body {
        flex-direction: column;
    }

    .products, .cart {
        width: 100%;
    }

    .grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ========================= */
/* 📱 MOBILE */
/* ========================= */
@media (max-width: 768px) {

    .grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .card img {
        height: 100px;
    }
}

/* ========================= */
/* 📱 MOBILE PEQUENO */
/* ========================= */
@media (max-width: 480px) {

    .grid {
        grid-template-columns: 1fr;
    }

    .pos-header {
        flex-direction: column;
        align-items: flex-start;
    }
}
