/* ── Variáveis (mesmo padrão de pedidos_abertos.css) ─────── */
:root {
    --po-surface:      #ffffff;
    --po-surface2:     #f8fafc;
    --po-surface3:     #f1f5f9;
    --po-border:       #e2e8f0;
    --po-border2:      #cbd5e1;
    --po-text:         #1e293b;
    --po-muted:        #64748b;
    --po-accent:       #FFBE4A;   /* cor primária do base.css */
    --po-accent-dark:  #c99600;

    --po-s-pendente-bg:   #f1f5f9;
    --po-s-em_preparo-bg: #fef3c7;
    --po-s-pronto-bg:     #dcfce7;
    --po-s-entregue-bg:   #dbeafe;

    --po-s-pendente:   #64748b;
    --po-s-em_preparo: #d97706;
    --po-s-pronto:     #16a34a;
    --po-s-entregue:   #2563eb;
}

/* ── Layout global ───────────────────────────────────────── */
/* O bloco content já está dentro de .container (base.html) que é flex.
   Ocupamos toda a largura com flex: 1 1 100%. */
.po-header,
.po-layout {
    flex: 1 1 100%;
    width: 100%;
}

body > div.container > div.po-header {
    height: fit-content;
    margin-top: 0px;
}

body > div.container > div.po-layout {
    min-height: 68vh !important;
    height: fit-content;
}

/* ── Header ──────────────────────────────────────────────── */
.po-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    background: var(--po-surface);
    border-bottom: 1px solid var(--po-border);
    position: sticky;
    top: 0;
    z-index: 10;
}

.po-back-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid var(--po-border2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--po-muted);
    font-size: 16px;
    text-decoration: none;
    flex-shrink: 0;
    transition: background .15s;
}

.po-back-btn:hover { background: var(--po-surface3); }

.po-header-info h1 {
    font-size: 16px;
    font-weight: 600;
    color: var(--po-text);
    margin: 0;
}

/* ── Dois painéis ────────────────────────────────────────── */
.po-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    height: calc(100vh - 113px);
    overflow: hidden;
}

/* ── Esquerda ────────────────────────────────────────────── */
.po-left {
    overflow-y: auto;
    background: var(--po-surface3);
    padding: 16px;
}

.po-section-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--po-muted);
    text-transform: uppercase;
    letter-spacing: .06em;
    margin-bottom: 10px;
}

/* Tabs cardápio */
.po-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 14px;
}

.po-tab {
    padding: 7px 16px;
    border-radius: 8px;
    border: 1px solid var(--po-border2);
    background: var(--po-surface);
    font-size: 13px;
    cursor: pointer;
    color: var(--po-muted);
    font-weight: 500;
    transition: all .15s;
}

.po-tab:hover { background: var(--po-surface2); }

.po-tab.active {
    background: #fff8e1;
    border-color: var(--po-accent);
    color: #92400e;
}

/* Grid produtos */
.po-produtos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.po-produto-card {
    background: var(--po-surface);
    border: 1px solid var(--po-border);
    border-radius: 10px;
    padding: 10px;
    cursor: pointer;
    transition: border-color .15s, box-shadow .15s;
}

.po-produto-card:hover {
    border-color: var(--po-accent);
    box-shadow: 0 2px 8px rgba(255,190,74,.15);
}

.po-produto-img-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: 8px;
}

.po-produto-img {
    width: fit-content;
    margin: auto;
    height: 70px;
    border-radius: 8px;
    object-fit: cover;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-bottom: 8px;
    overflow: hidden;
}

.po-produto-img-placeholder {
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    background: var(--po-surface3);
    border-radius: 8px;
}

.po-produto-nome {
    font-size: 13px;
    font-weight: 600;
    color: var(--po-text);
    margin-bottom: 2px;
}

.po-produto-preco {
    font-size: 12px;
    color: var(--po-muted);
}

.po-add-btn {
    margin-top: 8px;
    width: 100%;
    padding: 5px;
    border-radius: 6px;
    border: 1px solid var(--po-accent);
    background: #fff8e1;
    color: #92400e;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: background .15s;
}

.po-add-btn:hover { background: #fef3c7; }

/* ── Marmita ─────────────────────────────────────────────── */
.po-marmita-box {
    background: var(--po-surface);
    border: 1px solid var(--po-border);
    border-radius: 10px;
    padding: 14px;
}

.po-pratos-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.po-tam-btn {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--po-border2);
    background: transparent;
    cursor: pointer;
    font-size: 13px;
    color: var(--po-muted);
    text-align: center;
    transition: all .15s;
}

.po-tam-btn:hover { background: var(--po-surface2); }

.po-tam-btn.sel {
    background: #dcfce7;
    border-color: #86efac;
    color: #15803d;
    font-weight: 600;
}

.po-tam-label { font-size: 11px; margin-top: 3px; opacity: .8; }

.po-tamanhos-container {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.po-tam-btn-card {
    flex: 1;
    padding: 12px 8px;
    border-radius: 8px;
    border: 1px solid var(--po-border2);
    background: transparent;
    cursor: pointer;
    text-align: center;
    transition: all .15s;
}

.po-tam-btn-card:hover { background: var(--po-surface2); }

.po-tam-btn-card.sel {
    background: #dcfce7;
    border-color: #86efac;
    color: #15803d;
    font-weight: 600;
}

.po-tam-nome { display: block; font-size: 18px; font-weight: 700; }
.po-tam-preco { display: block; font-size: 12px; margin-top: 4px; }

.po-itens-label {
    font-size: 12px;
    color: var(--po-muted);
    margin: 10px 0 6px;
}

.po-itens-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 6px;
}

.po-item-btn {
    padding: 7px 5px;
    border-radius: 8px;
    border: 1px solid var(--po-border);
    background: var(--po-surface3);
    font-size: 12px;
    cursor: pointer;
    text-align: center;
    color: #444;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: all .15s;
}

.po-item-btn:hover { border-color: var(--po-border2); }
.po-item-btn.sel   { background: #dcfce7; border-color: #86efac; color: #15803d; font-weight: 500; }
.po-item-btn.extra { background: #fff8e1; border-color: #fde68a; color: #b45309; font-weight: 500; }

.po-item-img-small {
    width: 36px;
    height: 36px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 4px;
}

.po-item-img-placeholder {
    font-size: 22px;
    margin-bottom: 4px;
}

.po-item-text { font-size: 11px; line-height: 1.3; }

.po-add-marmita-btn {
    width: 100%;
    margin-top: 14px;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #86efac;
    background: #dcfce7;
    color: #15803d;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}

.po-add-marmita-btn:hover { background: #bbf7d0; }

/* ── Direita ──────────────────────────────────────────────── */
.po-right {
    background: var(--po-surface);
    border-left: 1px solid var(--po-border);
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Dados do cliente (collapsible) */
.po-cliente-wrap {
    border-bottom: 1px solid var(--po-border);
    flex-shrink: 0;
}

.po-cliente-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: var(--po-text);
    user-select: none;
}

.po-cliente-toggle:hover { background: var(--po-surface2); }

.po-toggle-icon { font-size: 11px; color: var(--po-muted); }

.po-cliente-body {
    padding: 0 14px 12px;
}

.po-field-pair {
    display: flex;
    gap: 8px;
    margin-bottom: 0;
}

.po-field {
    display: flex;
    flex-direction: column;
    flex: 1;
    margin-bottom: 8px;
}

.po-field-sm { flex: 0 0 80px; }

.po-field label {
    font-size: 11px;
    color: var(--po-muted);
    margin-bottom: 3px;
    font-weight: 500;
}

.po-field input,
.po-field textarea,
.po-field select {
    border: 1px solid var(--po-border2);
    border-radius: 6px;
    padding: 6px 8px;
    font-size: 12px;
    outline: none;
    background: var(--po-surface);
    color: var(--po-text);
    width: 100%;
    box-sizing: border-box;
}

.po-field input:focus,
.po-field textarea:focus,
.po-field select:focus {
    border-color: var(--po-accent);
}

/* Cabeçalho do resumo */
.po-right-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--po-border);
    flex-shrink: 0;
}

.po-right-header h2 {
    font-size: 13px;
    font-weight: 600;
    color: var(--po-text);
    margin: 0;
}

/* Lista de itens */
.po-items-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 16px;
}

.po-empty {
    text-align: center;
    padding: 2rem 0;
    color: var(--po-muted);
    font-size: 13px;
}

.po-pedido-item {
    padding: 10px 0;
    border-bottom: 1px solid var(--po-surface3);
}

.po-pedido-item:last-child { border-bottom: none; }

.po-pi-top {
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.po-pi-info { flex: 1; }

.po-pi-nome {
    font-size: 13px;
    font-weight: 600;
    color: var(--po-text);
}

.po-pi-sub {
    font-size: 11px;
    color: var(--po-muted);
    margin-top: 2px;
    line-height: 1.4;
}

.po-pi-preco {
    font-size: 13px;
    font-weight: 600;
    color: var(--po-text);
    white-space: nowrap;
}

.po-pi-bottom {
    display: flex;
    align-items: center;
    margin-top: 8px;
}

.po-qty-ctrl {
    display: flex;
    align-items: center;
    gap: 6px;
}

.po-qty-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid var(--po-border2);
    background: transparent;
    cursor: pointer;
    font-size: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--po-text);
    transition: background .12s;
}

.po-qty-btn:hover { background: var(--po-surface3); }

.po-qty-btn-remove {
    background: #fee2e2;
    border-color: #fca5a5;
    color: #dc2626;
    font-size: 12px;
}

.po-qty-val {
    font-size: 13px;
    font-weight: 600;
    min-width: 18px;
    text-align: center;
}

/* Footer totais + salvar */
.po-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--po-border);
    flex-shrink: 0;
}

.po-totais { margin-bottom: 10px; }

.po-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: var(--po-muted);
    margin-bottom: 6px;
}

.po-total-row.main {
    font-size: 15px;
    font-weight: 700;
    color: var(--po-text);
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--po-border);
    margin-bottom: 0;
}

.po-val-input {
    width: 88px;
    padding: 3px 8px;
    border-radius: 6px;
    border: 1px solid var(--po-border2);
    background: var(--po-surface2);
    font-size: 13px;
    color: var(--po-text);
    text-align: right;
    outline: none;
}

.po-val-input:focus {
    border-color: var(--po-accent);
    background: var(--po-surface);
}

.po-confirmar-btn {
    width: 100%;
    padding: 11px;
    border-radius: 8px;
    border: none;
    background: #3f3f3f;   /* mesmo fundo da navbar do base.css */
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    transition: background .15s;
}

.po-confirmar-btn:hover    { background: #1e1e1e; }
.po-confirmar-btn:disabled { background: #94a3b8; cursor: not-allowed; }

/* ── Toast ───────────────────────────────────────────────── */
.po-toast {
    position: fixed;
    bottom: 24px;
    height: fit-content !important;
    left: 50%;
    transform: translateX(-50%);
    background: var(--po-text);
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    box-shadow: 0 10px 15px rgba(0,0,0,.2);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s;
    white-space: nowrap;
}

.po-toast.show { opacity: 1; }
.po-toast.erro { background: #dc2626; }

/* ── Responsivo ──────────────────────────────────────────── */
@media (max-width: 960px) {
    .po-layout {
        grid-template-columns: 1fr;
        height: auto;
        overflow: visible;
    }

    .po-right {
        border-left: none;
        border-top: 1px solid var(--po-border);
    }

    .po-items-list {
        max-height: 300px;
    }
}

@media (max-width: 768px) {
    body > div.container > div.po-header {
        min-height: unset;
        height: fit-content !important;
    }

    body > div.container > div {
        width: 100% !important;
    }

    .po-toast.erro {
        height: fit-content !important;
    }

    .pc-card {
        width: 100% !important;
    }

    #mp-pratos-list {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }

    .po-tam-btn {
        width: 38%;
    }
}

