﻿/* ===== VARIÁVEIS E ESTILOS BASE ===== */
:root {
    --color-primary: #28a745;
    --color-danger: #d9534f;
    --color-text: #333;
    --color-text-light: #666;
    --color-border: #ddd;
    --color-bg-light: #f8f8f8;
    --shadow-default: 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* ===== ESTRUTURA PRINCIPAL ===== */
.sidebar-pedido {
    position: fixed;
    top: 0;
    right: -400px; /* Mudança principal: usar valor fixo em vez de -100% */
    width: 100%;
    max-width: 400px;
    height: 100vh; /* Mudança: usar 100vh em vez de 100% */
    background: #fff;
    box-shadow: -4px 0 10px rgba(0, 0, 0, 0.2);
    z-index: 1060; /* Aumentado para garantir que fique acima de outros elementos */
    display: flex;
    flex-direction: column;
    font-family: Arial, sans-serif;
    transition: right 0.3s cubic-bezier(0.25, 0.1, 0.25, 1); /* Transição mais suave */
    overflow: hidden; /* Evita scroll horizontal */
}

    .sidebar-pedido.active {
        right: 0;
    }

/* Overlay para fechar a sidebar quando clicar fora */
.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1055;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

    .sidebar-overlay.active {
        opacity: 1;
        visibility: visible;
    }

/* ===== CABEÇALHO ===== */
.sidebar-pedido-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 1rem;
    background: #fff;
    border-bottom: 1px solid var(--color-border);
    font-size: 1.2em;
    font-weight: bold;
    color: var(--color-text);
    line-height: 1.2;
    flex-shrink: 0; /* Não permite que o header encolha */
}

    .sidebar-pedido-header button {
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0.5rem;
        background: none;
        border: none;
        font-size: 1.2em;
        cursor: pointer;
        color: var(--color-danger);
        line-height: 1;
        border-radius: 50%;
        transition: background-color 0.2s ease;
    }

        .sidebar-pedido-header button:hover {
            background-color: rgba(217, 83, 79, 0.1);
        }

    .sidebar-pedido-header h3 {
        margin: 0;
    }

/* ===== CONTEÚDO ===== */
.sidebar-pedido-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background: var(--color-bg-light);
}

.lista-pedidos-pedido {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ===== ITENS DO PEDIDO ===== */
.pedido-item-pedido {
    background: #fff;
    padding: 0.75rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow-default);
    border: 1px solid var(--color-border);
}

.pedido-item-header {
    display: flex;
    gap: 1rem;
    position: relative;
}

    .pedido-item-header img {
        width: 70px;
        height: 70px;
        border-radius: 0.75rem;
        object-fit: cover;
        flex-shrink: 0;
    }

.pedido-info-pedido {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.pedido-info-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    width: 100%;
    margin-bottom: 0.5rem;
    gap: 0.5rem;
}

    .pedido-info-top strong {
        flex: 1;
        font-size: 1rem;
        color: var(--color-text);
        line-height: 1.3;
        word-break: break-word;
    }

.acoes-pedido {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
    align-items: flex-start;
}

    .acoes-pedido .editar-container,
    .acoes-pedido .lixeira-container {
        cursor: pointer;
        user-select: none;
        padding: 0.25rem;
        border-radius: 50%;
        transition: background-color 0.2s ease;
    }

        .acoes-pedido .editar-container:hover {
            background-color: rgba(40, 167, 69, 0.1);
        }

        .acoes-pedido .lixeira-container:hover {
            background-color: rgba(217, 83, 79, 0.1);
        }

    .acoes-pedido i {
        font-size: 1rem;
        transition: color 0.3s;
    }

    .acoes-pedido .text-success {
        color: var(--color-primary) !important;
    }

    .acoes-pedido .text-danger {
        color: var(--color-danger) !important;
    }

/* ===== DETALHES (SABORES, ADICIONAIS, ETC.) ===== */
details {
    margin: 0.5rem 0;
}

    details summary {
        font-weight: bold;
        cursor: pointer;
        background-color: var(--color-bg-light);
        padding: 0.5rem;
        border-radius: 0.5rem;
        font-size: 0.9rem;
        color: var(--color-text);
        transition: background-color 0.2s ease;
    }

        details summary:hover {
            background-color: #e9ecef;
        }

    details[open] summary {
        border-bottom: 1px solid var(--color-border);
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
    }

.sabores-container-pedido,
.adicionais-container-pedido,
.observacoes-container-pedido {
    background: var(--color-bg-light);
    padding: 0.5rem;
    border-bottom-left-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
}

    .sabores-container-pedido ul,
    .adicionais-container-pedido ul,
    .observacoes-container-pedido ul {
        list-style: none;
        padding: 0;
        margin: 0;
    }

    .sabores-container-pedido li,
    .adicionais-container-pedido li,
    .observacoes-container-pedido li {
        font-size: 0.875rem;
        color: var(--color-text);
        padding: 0.2rem 0;
        word-break: break-word;
    }

/* ===== DETALHES DE PREÇO ===== */
.preco-detalhado-pedido {
    background: var(--color-bg-light);
    padding: 0.75rem;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

    .preco-detalhado-pedido p {
        display: flex;
        justify-content: space-between;
        margin: 0.25rem 0;
        color: var(--color-text);
        flex-wrap: nowrap;
    }

        .preco-detalhado-pedido p strong {
            white-space: nowrap;
            margin-right: 0.5rem;
        }

.subtotal {
    font-weight: bold;
    font-size: 1rem;
    color: var(--color-danger);
}

/* ===== RODAPÉ ===== */
.sidebar-pedido-footer {
    padding: 1rem;
    border-top: 1px solid var(--color-border);
    background: #fff;
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.05);
    flex-shrink: 0;
}

.resumo-minimo {
    margin-bottom: 0.5rem;
    color: #c0392b;
    font-size: 0.9rem;
}

    .resumo-minimo p {
        margin: 0;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

.resumo-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    color: var(--color-text);
    font-weight: bold;
}

    .resumo-total strong {
        font-size: 1.25rem;
        color: var(--color-primary);
    }

.btn-finalizar-pedido {
    width: 100%;
    padding: 0.75rem;
    background: var(--color-primary);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

    .btn-finalizar-pedido:hover {
        background: #218838;
        transform: translateY(-1px);
    }

    .btn-finalizar-pedido.disabled {
        opacity: 0.6;
        cursor: not-allowed;
        background-color: #ccc;
        transform: none;
    }

        .btn-finalizar-pedido.disabled:hover {
            background-color: #ccc;
        }

/* ===== RESPONSIVIDADE ===== */
@media (max-width: 768px) {
    .sidebar-pedido {
        width: 100%;
        max-width: 100%;
        right: -100%;
    }

        .sidebar-pedido.active {
            right: 0;
        }

    .pedido-item-header {
        gap: 0.75rem;
    }

        .pedido-item-header img {
            width: 60px;
            height: 60px;
        }

    .pedido-info-top strong {
        font-size: 0.95rem;
    }

    .sidebar-pedido-header h3 {
        font-size: 1.1rem;
    }
}
/* ===== AJUSTES PARA COMBOS ===== */
.combo-pedido {
    background: #fff;
    padding: 0.75rem;
    border-radius: 0.75rem;
    box-shadow: var(--shadow-default);
    border: 1px solid var(--color-border);
}

.combo-header {
    display: flex;
    gap: 1rem;
    position: relative;
}

    .combo-header .combo-image {
        width: 70px;
        height: 70px;
        border-radius: 0.75rem;
        object-fit: cover;
        flex-shrink: 0;
    }

    .combo-header .combo-title {
        font-size: 1rem;
        color: var(--color-text);
        line-height: 1.3;
        word-break: break-word;
    }

.combo-itens-detalhes summary.combo-summary {
    font-weight: bold;
    cursor: pointer;
    background-color: var(--color-bg-light);
    padding: 0.5rem;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    color: var(--color-text);
    transition: background-color 0.2s ease;
}

.combo-itens-detalhes[open] summary.combo-summary {
    border-bottom: 1px solid var(--color-border);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

.combo-itens-container {
    background: var(--color-bg-light);
    padding: 0.5rem;
    border-bottom-left-radius: 0.5rem;
    border-bottom-right-radius: 0.5rem;
}

.combo-item-individual {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 0.5rem;
    padding: 0.5rem;
    margin-bottom: 0.5rem;
}

.combo-item-header {
    display: flex;
    gap: 0.75rem;
}

.combo-item-image {
    width: 60px;
    height: 60px;
    border-radius: 0.5rem;
    object-fit: cover;
    flex-shrink: 0;
}

.combo-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.875rem;
}

.combo-item-nome {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: bold;
    color: var(--color-text);
}

.combo-item-list {
    list-style: none;
    padding-left: 0;
    margin: 0;
}

    .combo-item-list li {
        font-size: 0.875rem;
        color: var(--color-text);
        padding: 0.2rem 0;
        word-break: break-word;
    }

.combo-item-subtotal {
    font-size: 0.85rem;
    color: var(--color-text);
}

.combo-preco {
    margin-top: 0.5rem;
}
