/* --- VARIÁVEIS DE CORES E FONTES --- */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;800;900&display=swap');

:root {
    --amarelo: #FFD700;
    --preto: #000000;
    --branco: #ffffff;
    --cinza-fundo: #f4f4f4;
    --sucesso: #27ae60;
    --erro: #e74c3c;
}

/* --- RESET BÁSICO --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
    -webkit-tap-highlight-color: transparent; /* Remove brilho de toque no mobile */
}

body {
    background-color: var(--amarelo);
    color: var(--preto);
    line-height: 1.4;
}

/* --- HEADER (LOGO PRETA EM FUNDO AMARELO) --- */
header {
    background-color: var(--amarelo);
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 3px solid var(--preto);
    height: 70px;
}

.img-logo {
    height: 55px;
    width: auto;
    object-fit: contain;
}

/* Adiciona borda branca no contorno da arte (Logo) */
header img {
    filter: drop-shadow(0 0 2px #ffffff);
}

/* --- STATUS DA LOJA NO TOPO --- */
.status-loja-caixa {
    background: var(--preto);
    color: var(--branco);
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 8px;
}

.bolinha { height: 10px; width: 10px; border-radius: 50%; }
.online { background: #00ff00; box-shadow: 0 0 8px #00ff00; }
.offline { background: #ff0000; box-shadow: 0 0 8px #ff0000; }

/* --- BOTÃO INSTALAR APP --- */
.btn-instalar {
    background: var(--branco);
    color: var(--preto);
    border: 2px solid var(--preto);
    padding: 6px 12px;
    border-radius: 12px;
    font-weight: 900;
    cursor: pointer;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

/* --- CONTEÚDO PRINCIPAL --- */
main {
    max-width: 600px;
    margin: 20px auto;
    padding: 0 15px;
}

h2 {
    text-transform: uppercase;
    font-weight: 900;
    margin-bottom: 20px;
    text-align: center;
    font-size: 1.4rem;
}

/* --- ITENS DO CARDÁPIO (STREET FOOD STYLE) --- */
.item-cardapio {
    background: var(--branco);
    border: 3px solid var(--preto);
    border-radius: 20px;
    padding: 12px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 6px 6px 0px var(--preto); /* Efeito 3D */
    transition: transform 0.2s;
}

.item-cardapio:active {
    transform: translate(3px, 3px);
    box-shadow: 3px 3px 0px var(--preto);
}

.item-cardapio img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 12px;
    border: 2px solid #eee;
}

.item-info { flex: 1; }
.item-info h4 { font-weight: 800; font-size: 1rem; margin-bottom: 2px; }
.item-info p { font-size: 0.75rem; color: #555; margin-bottom: 8px; }
.preco { font-weight: 900; font-size: 1.1rem; color: var(--preto); display: block; }

/* CONTROLES DE QUANTIDADE */
.controles {
    display: flex;
    align-items: center;
    background: var(--preto);
    border-radius: 25px;
    padding: 4px;
}

.controles button {
    background: var(--amarelo);
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-weight: 900;
    font-size: 1.2rem;
    cursor: pointer;
}

.qtd {
    color: var(--branco);
    margin: 0 12px;
    font-weight: 800;
    min-width: 20px;
    text-align: center;
}

/* --- CARRINHO FIXO NO RODAPÉ --- */
#carrinho-fixo {
    position: fixed;
    bottom: 0;
    width: 100%;
    background: var(--preto);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 4px solid var(--amarelo);
    z-index: 2000;
}

.info-carrinho {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--branco);
}

.bag-icon { font-size: 1.6rem; color: var(--amarelo); }

.btn-finalizar {
    background: var(--amarelo);
    color: var(--preto);
    border: none;
    padding: 10px 18px;
    border-radius: 12px;
    font-weight: 900;
    cursor: pointer;
    font-size: 0.9rem;
    text-transform: uppercase;
}

/* --- FILA DE ESPERA --- */
#fila-section {
    background: var(--branco);
    border: 3px solid var(--preto);
    border-radius: 20px;
    padding: 20px;
    margin-top: 30px;
    box-shadow: 6px 6px 0px var(--preto);
}

.busca-pedido {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.busca-pedido input {
    flex: 1;
    padding: 12px;
    border: 2px solid var(--preto);
    border-radius: 12px;
    font-weight: 700;
    outline: none;
}

.busca-pedido button {
    background: var(--preto);
    color: var(--amarelo);
    border: none;
    padding: 0 20px;
    border-radius: 12px;
    font-weight: 800;
    cursor: pointer;
}

/* --- MODAIS (GERAL) --- */
.modal {
    display: none;
    position: fixed;
    z-index: 3000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--branco);
    margin: 10% auto;
    padding: 25px;
    border-radius: 25px;
    width: 90%;
    max-width: 450px;
    position: relative;
    border: 4px solid var(--preto);
}

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 2rem;
    font-weight: 900;
    cursor: pointer;
}

/* --- ESTILOS PARA FORMULÁRIOS --- */
label { display: block; margin-top: 15px; font-weight: 800; font-size: 0.85rem; }
input, textarea, select {
    width: 100%;
    padding: 12px;
    margin-top: 5px;
    border: 2px solid var(--preto);
    border-radius: 12px;
    font-size: 1rem;
}

.btn-enviar {
    width: 100%;
    padding: 16px;
    background: var(--sucesso);
    color: white;
    border: none;
    border-radius: 15px;
    font-weight: 900;
    margin-top: 20px;
    font-size: 1rem;
    cursor: pointer;
}

/* --- RESPONSIVIDADE ADICIONAL --- */
@media (max-width: 480px) {
    header { padding: 10px; }
    .img-logo { height: 45px; }
    h2 { font-size: 1.2rem; }
    .item-cardapio { gap: 10px; padding: 10px; }
    .item-cardapio img { width: 70px; height: 70px; }
}

/* --- CLASSES DE UTILIDADE PARA ADMIN --- */
.bg-preto { background: var(--preto) !important; color: var(--amarelo) !important; }
.bg-amarelo { background: var(--amarelo) !important; color: var(--preto) !important; }

/* --- POP-UP DE SUCESSO PERSONALIZADO --- */
#success-popup-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.6);
    z-index: 4000;
    animation: popup-fade-in 260ms ease-out;
}

#success-popup {
    background: var(--branco);
    border: 4px solid var(--preto);
    border-radius: 18px;
    padding: 22px 20px;
    width: 92%;
    max-width: 420px;
    text-align: center;
    box-shadow: 0 18px 40px rgba(0,0,0,0.35);
    transform: translateY(18px) scale(0.98);
    animation: popup-scale-in 360ms cubic-bezier(.2,.9,.26,1) forwards;
}

#success-popup img.popup-logo {
    height: 120px; /* Aumentado conforme solicitado */
    width: auto;
    margin-bottom: 12px;
    border-radius: 12px;
    object-fit: contain;
    box-shadow: 0 6px 18px rgba(0,0,0,0.25);
}

#success-popup h3 { margin: 8px 0; font-size: 1.12rem; font-weight: 900; }
#success-popup p { margin-top: 6px; color: #555; font-weight: 700; }

.popup-actions { margin-top: 14px; display:flex; gap:10px; justify-content:center; }
.popup-actions button {
    padding: 10px 14px;
    border-radius: 12px;
    border: none;
    font-weight: 800;
    cursor: pointer;
}
.popup-close { background: var(--preto); color: var(--amarelo); }
.popup-track { background: var(--sucesso); color: white; }

@keyframes popup-scale-in {
    from { transform: translateY(18px) scale(0.98); opacity: 0; }
    to   { transform: translateY(0) scale(1); opacity: 1; }
}

@keyframes popup-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes popup-fade-out {
    from { opacity: 1; }
    to { opacity: 0; }
}

/* --- LOGIN PAGE --- */
.login-container {
    max-width: 400px;
    margin: 40px auto;
    background: var(--branco);
    padding: 30px;
    border: 4px solid var(--preto);
    border-radius: 20px;
    text-align: center;
    box-shadow: 8px 8px 0px var(--preto);
}

.btn-link {
    background: none;
    border: none;
    color: var(--preto);
    text-decoration: underline;
    font-weight: 800;
    cursor: pointer;
    margin-top: 15px;
    display: inline-block;
    font-size: 0.9rem;
}

/* --- MEUS PEDIDOS --- */
.card-pedido {
    background: var(--branco);
    border: 3px solid var(--preto);
    border-radius: 15px;
    padding: 15px;
    margin-bottom: 20px;
    box-shadow: 6px 6px 0px var(--preto);
    position: relative;
}

.data-pedido {
    font-size: 0.8rem;
    color: #555;
    margin: 8px 0;
    font-style: italic;
}

.itens-pedido {
    background: var(--cinza-fundo);
    padding: 10px;
    border-radius: 8px;
    font-size: 0.9rem;
    margin-bottom: 10px;
    border: 1px solid #ddd;
}

.total-pedido { font-weight: 900; font-size: 1.2rem; text-align: right; color: var(--preto); }

/* Badges de Status (Compartilhado com Admin) */
.badge { padding: 4px 10px; border-radius: 6px; font-size: 0.75rem; font-weight: 800; text-transform: uppercase; display: inline-block; border: 2px solid rgba(0,0,0,0.1); }
.st-Pendente { background: var(--amarelo); color: #000; }
.st-Preparando { background: #f39c12; color: #fff; }
.st-Saiu { background: #3498db; color: #fff; }
.st-Entregue { background: #27ae60; color: #fff; }

/* --- PERFIL --- */
.perfil-img-container {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 20px;
}

.perfil-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--preto);
    background: var(--cinza-fundo);
}

.btn-upload-icon {
    position: absolute;
    bottom: 0;
    right: 0;
    background: var(--amarelo);
    border: 2px solid var(--preto);
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-upload-icon:hover { transform: scale(1.1); }

.msg-box { padding: 10px; border-radius: 10px; margin-bottom: 15px; font-weight: 700; border: 2px solid rgba(0,0,0,0.1); }
.msg-box.sucesso { background: #d4edda; color: #155724; }
.msg-box.erro { background: #f8d7da; color: #721c24; }

/* --- ADMIN DASHBOARD --- */
.admin-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    max-width: 800px;
    margin: 40px auto;
}

.admin-card {
    background: var(--branco);
    border: 4px solid var(--preto);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    text-decoration: none;
    color: var(--preto);
    box-shadow: 8px 8px 0px var(--preto);
    transition: transform 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.admin-card:hover {
    transform: translate(4px, 4px);
    box-shadow: 4px 4px 0px var(--preto);
    background: var(--cinza-fundo);
}

.admin-card i {
    font-size: 3rem;
    color: var(--amarelo);
    text-shadow: 2px 2px 0px var(--preto);
}

.admin-card h3 {
    font-weight: 900;
    text-transform: uppercase;
    font-size: 1.1rem;
}

/* --- TABELAS ADMIN --- */
.table-container {
    overflow-x: auto;
    background: var(--branco);
    border: 4px solid var(--preto);
    border-radius: 20px;
    padding: 20px;
    box-shadow: 8px 8px 0px var(--preto);
    margin-bottom: 30px;
}

table { width: 100%; border-collapse: collapse; min-width: 600px; }
th, td { padding: 12px; text-align: left; border-bottom: 2px solid #eee; }
th { background: var(--preto); color: var(--amarelo); font-weight: 900; text-transform: uppercase; }
tr:hover { background: var(--cinza-fundo); }

.user-foto-mini { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 2px solid var(--preto); vertical-align: middle; margin-right: 10px; }

/* --- NOTIFICAÇÕES (TOASTS) --- */
#notificacoes-container {
    position: fixed;
    top: 80px; /* Abaixo do header */
    right: 20px;
    z-index: 5000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none; /* Permite clicar através do container vazio */
}

.toast-notificacao {
    background: var(--branco);
    border: 3px solid var(--preto);
    border-radius: 12px;
    padding: 15px;
    width: 280px;
    box-shadow: 6px 6px 0px var(--preto);
    animation: slideIn 0.5s ease-out;
    pointer-events: auto;
    position: relative;
}

.toast-header {
    font-weight: 900;
    color: var(--amarelo);
    background: var(--preto);
    padding: 5px 10px;
    border-radius: 6px;
    margin-bottom: 8px;
    display: inline-block;
    font-size: 0.8rem;
    text-transform: uppercase;
}

.toast-body { font-size: 0.95rem; color: var(--preto); }

@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

.toast-notificacao.hide { animation: slideOut 0.5s ease-in forwards; }
@keyframes slideOut { from { transform: translateX(0); opacity: 1; } to { transform: translateX(100%); opacity: 0; } }

/* --- ADMIN NAV & KITCHEN --- */
.admin-nav { display: flex; gap: 15px; }
.nav-link { color: var(--preto); font-weight: 800; text-decoration: none; font-size: 0.9rem; text-transform: uppercase; display: flex; align-items: center; gap: 5px; }
.nav-link:hover { text-decoration: underline; }
.btn-sair { background: var(--preto); color: var(--amarelo) !important; padding: 8px 15px; border-radius: 8px; font-weight: 900; text-decoration: none; font-size: 0.8rem; }
.btn-refresh { background: var(--branco); border: 2px solid var(--preto); padding: 5px 10px; border-radius: 8px; color: var(--preto); text-decoration: none; font-weight: 800; }

.kitchen-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 20px; margin-top: 20px; }
.kitchen-card { background: var(--branco); border: 4px solid var(--preto); border-radius: 15px; padding: 15px; box-shadow: 6px 6px 0px rgba(0,0,0,0.2); display: flex; flex-direction: column; position: relative; overflow: hidden; }
.kitchen-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px dashed #ddd; padding-bottom: 10px; margin-bottom: 10px; }
.k-id { font-size: 1.5rem; font-weight: 900; color: var(--preto); }
.k-time { font-size: 1rem; font-weight: 700; color: #666; }
.k-itens { background: var(--cinza-fundo); padding: 10px; border-radius: 8px; margin: 10px 0; font-size: 0.95rem; line-height: 1.5; border: 1px solid #eee; }
.k-obs { color: #e74c3c; font-style: italic; margin-bottom: 10px; background: #fff5f5; padding: 5px; border-radius: 5px; border: 1px solid #ffcccc; }
.k-total { font-weight: 900; text-align: right; font-size: 1.1rem; margin-bottom: 15px; }
.kitchen-actions { display: flex; gap: 8px; margin-top: auto; }
.btn-status { flex: 1; border: none; padding: 12px; border-radius: 8px; font-weight: 900; cursor: pointer; color: white; text-transform: uppercase; font-size: 0.9rem; transition: transform 0.1s; }
.btn-status:active { transform: scale(0.95); }
.st-Cancelado { background: #e74c3c; flex: 0 0 40px; }
.status-badge { position: absolute; top: 0; right: 0; padding: 5px 10px; font-size: 0.7rem; font-weight: 900; color: white; border-bottom-left-radius: 10px; }