/* ==========================================================================
   1. CONFIGURAÇÕES GERAIS & VARIÁVEIS
   ========================================================================== */
:root {
    /* Cores da Identidade Visual */
    --brand-orange-start: #ffffff;
    --brand-orange-end: #F2A900;   /* Laranja da Logo */
    --brand-blue: #006080;         /* Azul da Logo */
    --brand-brown: #6d3b00;        /* Sombra/Contorno */
    
    /* Cores de Fundo e Texto */
    --bg-main: #212121;
    --bg-card: #333333;
    --text-light: #ffffff;
    
    /* Cores do Admin */
    --admin-bg: #f0f2f5;
    --admin-sidebar: #2c3e50;
}

body { 
    font-family: 'Montserrat', sans-serif; 
    background-color: var(--bg-main); 
    color: var(--text-light); 
    margin: 0; 
    padding-bottom: 80px; 
}

/* ==========================================================================
   2. HEADER E LOGO
   ========================================================================== */
header { 
    background-color: #000; 
    padding: 10px 20px; 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    border-bottom: 3px solid var(--brand-orange-end); 
    box-shadow: 0 4px 10px rgba(0,0,0,0.5);
}

.logo-container { display: flex; align-items: center; }
.logo-img { max-height: 110px; width: auto; object-fit: contain; }
.info-header { font-size: 0.8rem; color: #ccc; text-align: right; }

/* Títulos com Degradê */
h1, h2, .intro-title h2 {
    background: linear-gradient(to bottom, var(--brand-orange-start) 20%, var(--brand-orange-end) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(1px 2px 0px var(--brand-brown));
    text-transform: uppercase;
    font-weight: 900;
}

.container { max-width: 600px; margin: 0 auto; padding: 20px; }

/* Animações */
.step { display: none; animation: fadeIn 0.5s; }
.step.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ==========================================================================
   3. COMPONENTES DO CLIENTE (DESIGN IFOOD)
   ========================================================================== */

/* Hero Banner (Foto de Capa) */
.hero-banner {
    background: linear-gradient(rgba(0,0,0,0.7), rgba(0,0,0,0.7)), 
                url('imagens/fundo-site.jpg');
    background-size: cover;
    background-position: center;
    padding: 60px 20px;
    border-radius: 0 0 20px 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
}

/* Cards de Produtos (Lista Moderna) */
.menu-item-card {
    display: flex;
    align-items: center;
    background: #2a2a2a;
    padding: 12px;
    margin-bottom: 12px;
    border-radius: 12px;
    border: 1px solid #333;
    transition: transform 0.2s;
    cursor: pointer;
    position: relative;
}

.menu-item-card:active { transform: scale(0.98); background: #333; }

.item-thumb {
    width: 80px; height: 80px; border-radius: 8px;
    object-fit: cover; margin-right: 15px; background-color: #444;
}

.item-details { flex: 1; }
.item-details h4 { margin: 0 0 5px 0; font-size: 16px; color: #fff; }
.item-details p { margin: 0 0 5px 0; font-size: 12px; color: #aaa; line-height: 1.4; }
.item-price { font-weight: bold; color: #2ecc71; }

/* Cards de Categorias e Tamanhos (Antigos) */
.categories-grid, .sizes-grid, .drink-grid { display: grid; gap: 15px; margin-top: 20px; }
.categories-grid, .drink-grid { grid-template-columns: repeat(2, 1fr); }

.category-card, .size-card, .drink-card { 
    background: var(--bg-card); padding: 20px; border-radius: 15px; 
    border: 2px solid #444; transition: all 0.3s ease; cursor: pointer; 
    text-align: center; box-shadow: 0 4px 6px rgba(0,0,0,0.3);
}
.size-card { display: flex; justify-content: space-between; align-items: center; text-align: left; }

.category-card:hover, .size-card:hover, .drink-card:hover {
    border-color: var(--brand-orange-end); background-color: #3a3a3a;
    transform: translateY(-3px);
}

.cat-icon { font-size: 40px; display: block; margin-bottom: 10px; }
.size-price { font-size: 1.1rem; font-weight: bold; color: var(--brand-blue); }

/* Ícone de Check (Selecionado) */
.check-icon {
    display: none; width: 25px; height: 25px; border-radius: 50%;
    background-color: var(--brand-orange-end); color: var(--brand-brown);
    font-weight: bold; align-items: center; justify-content: center;
    position: absolute; top: -8px; right: -8px; box-shadow: 0 2px 5px rgba(0,0,0,0.3);
}
.menu-item-card.selected, .flavor-item.selected {
    border: 2px solid #e67e22; background: #2d2520;
}
.menu-item-card.selected .check-icon, .flavor-item.selected .check-icon {
    display: flex;
}

/* ==========================================================================
   4. BOTÕES E MODAL
   ========================================================================== */
.btn-large, .btn-primary, #intro-btn {
    width: 100%; padding: 15px; font-size: 1.1rem;
    background: linear-gradient(to right, var(--brand-orange-end), #ffc107);
    color: var(--brand-brown); border: none; border-radius: 30px;
    font-weight: 900; text-transform: uppercase; cursor: pointer; 
    box-shadow: 0 4px 0px #b37400; transition: all 0.1s;
}
.btn-large:active, .btn-primary:active { transform: translateY(4px); box-shadow: none; }

/* ==========================================================================
   BARRA DE AÇÃO FIXA (BOTÕES AVANÇAR/VOLTAR)
   ========================================================================== */

.action-footer {
    position: fixed;        /* Fixa na tela */
    bottom: 0;              /* Cola no fundo */
    left: 0;
    width: 100%;            /* Largura total */
    background-color: #222; /* Fundo escuro para destacar do conteúdo */
    padding: 15px 20px;     /* Espaçamento interno */
    
    display: flex;          /* Mantém os botões lado a lado */
    gap: 15px;              /* Espaço entre Voltar e Avançar */
    
    box-shadow: 0 -4px 20px rgba(0,0,0,0.5); /* Sombra forte para separar da lista */
    z-index: 1000;          /* Garante que fique por cima da lista */
    box-sizing: border-box; /* Evita que estoure a tela */
    
    /* Efeito de vidro (Opcional, fica chique) */
    backdrop-filter: blur(10px);
    background-color: rgba(34, 34, 34, 0.95);
}

/* Ajuste para o botão não cobrir o último sabor da lista */
#flavors-list, .flavors-scroll {
    padding-bottom: 100px !important; /* Cria um espaço vazio no final da lista */
}

/* Ajuste específico para os botões dentro dessa barra */
.action-footer .btn-primary {
    flex: 2; /* O botão Avançar ocupa o dobro do espaço (mais destaque) */
    box-shadow: none; /* Remove sombra excessiva */
}

.action-footer .btn-secondary {
    flex: 1; /* O botão Voltar fica menor */
    background-color: #444;
    border: 1px solid #555;
}
.btn-secondary { flex: 1; padding: 15px; background: #555; color: white; border: none; border-radius: 8px; cursor: pointer; }

/* Carrinho Flutuante */
#cart-btn { 
    position: fixed; bottom: 40px; right: 20px; 
    background: var(--brand-orange-end); color: var(--brand-brown); 
    padding: 15px; border-radius: 50%; font-size: 24px; 
    cursor: pointer; box-shadow: 0 4px 0px #b37400; z-index: 100; 
}


.modal { 
    display: none; 
    position: fixed; 
    z-index: 10000; 
    left: 0; top: 0; 
    width: 100%; height: 100%; 
    background: rgba(0,0,0,0.8); 
    backdrop-filter: blur(5px); 
}
.modal-content { 
    background: #222; margin: 5% auto; padding: 20px; width: 90%; max-width: 400px; 
    border-radius: 12px; color: white; max-height: 85vh; overflow-y: auto; padding-bottom: 50px;
}
.close { float: right; font-size: 28px; cursor: pointer; }

/* Inputs do Cliente */
input, select { width: 100%; padding: 12px; margin: 5px 0; background: #333; border: 1px solid #444; color: white; border-radius: 5px; box-sizing: border-box; }
.btn-success { width: 100%; padding: 15px; background: #25D366; color: white; border: none; border-radius: 8px; font-weight: bold; cursor: pointer; margin-top: 10px; }

/* Rodapé */
.dev-footer { position: fixed; bottom: 10px; left: 0; width: 100%; text-align: center; color: rgba(255, 255, 255, 0.2); font-size: 0.7rem; pointer-events: none; }

/* ==========================================================================
   5. ADMIN PANEL (ESTILO E LAYOUT)
   ========================================================================== */
.admin-body { background-color: var(--admin-bg); color: #333; display: flex; height: 100vh; overflow: hidden; }
.admin-container { display: flex; width: 100%; }

/* --- MENU LATERAL (SIDEBAR) --- */
.sidebar { 
    width: 250px; background-color: var(--admin-sidebar); color: white; 
    padding: 20px; display: flex; flex-direction: column; 
    transition: width 0.3s ease, padding 0.3s ease;
    white-space: nowrap; overflow: hidden;
}
.sidebar h2 { margin-bottom: 30px; text-align: center; color: var(--brand-orange-end); }
.sidebar ul { list-style: none; padding: 0; }
.sidebar li { margin-bottom: 15px; }
.sidebar a { color: #ecf0f1; text-decoration: none; font-size: 16px; display: block; padding: 10px; border-radius: 5px; }
.sidebar a:hover, .sidebar a.active { background-color: #34495e; border-left: 4px solid var(--brand-orange-end); }

/* Botão Hambúrguer */
.btn-toggle-menu {
    background: none; border: none; color: var(--brand-orange-end);
    font-size: 28px; cursor: pointer; margin-bottom: 10px; width: 100%; text-align: left; transition: 0.3s;
}

/* Sidebar Recolhida (Classe .closed) */
.sidebar.closed { width: 80px; }
.sidebar.closed h2 { display: none; }
.sidebar.closed .btn-toggle-menu { text-align: center; padding: 0; margin-bottom: 20px; }
.sidebar.closed ul li a { 
    font-size: 0 !important; padding: 15px 0; text-align: center; display: block; 
}
.sidebar.closed ul li a::first-letter { font-size: 24px !important; visibility: visible; }

/* Conteúdo Principal */
.content { flex: 1; padding: 30px; overflow-y: auto; }

/* Cards Admin */
.kpi-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 20px; margin-bottom: 30px; }
.kpi-card, .card { background: white; padding: 20px; border-radius: 10px; box-shadow: 0 2px 5px rgba(0,0,0,0.05); border-top: 4px solid var(--brand-orange-end); }
.kpi-card { display: flex; align-items: center; gap: 20px; }
.kpi-card .icon { font-size: 2.5rem; background: #fff3e0; padding: 15px; border-radius: 50%; width: 60px; height: 60px; display: flex; align-items: center; justify-content: center; }

/* Área de Configuração */
#config-area { background-color: #f4f4f4; color: #333; padding: 20px; border-radius: 10px; }
#config-area h3 { color: var(--brand-blue); border-bottom: 2px solid var(--brand-orange-end); padding-bottom: 5px; margin-top: 25px; }

/* Estilo das Linhas de Configuração */
.config-item { display: flex; gap: 10px; margin-bottom: 10px; padding: 10px; background: #ffffff; border: 1px solid #ddd; border-radius: 8px; align-items: center; }

/* Forçar Inputs Brancos no Admin */
.config-item input, .new-item-area input, .new-item-area select, #config-area input {
    background-color: #ffffff !important; color: #000000 !important; border: 1px solid #ccc !important; padding: 8px; border-radius: 4px;
}

/* Tabelas */
table { width: 100%; border-collapse: collapse; margin-top: 15px; }
table th, table td { text-align: left; padding: 12px; border-bottom: 1px solid #eee; }

/* --- NOTIFICAÇÃO TOAST (ESTILO APP) --- */
#toast-container {
    position: fixed;
    bottom: 80px; /* Acima da barra do carrinho */
    left: 50%;
    transform: translateX(-50%);
    z-index: 9999;
    width: 90%;
    max-width: 400px;
    text-align: center;
}

.toast {
    background-color: #333;
    color: #fff;
    padding: 12px 20px;
    border-radius: 50px;
    margin-top: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5);
    border: 1px solid var(--brand-orange-end);
    font-size: 14px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   BARRA DE CARRINHO (ESTILO IFOOD) - ADICIONAR NO FINAL DO ARQUIVO
   ========================================================================== */

/* 1. Esconde o botão de bolinha antigo */
#cart-btn {
    display: none !important;
}

/* 2. Estilo da Barra Fixa Nova */
#bottom-cart-bar {
    position: fixed;        /* Fixa na tela */
    bottom: 0;              /* Cola no rodapé */
    left: 0;
    width: 100%;            /* Ocupa toda a largura */
    height: 60px;           /* Altura fixa */
    
    background-color: var(--brand-orange-end); /* Laranja */
    color: #3e2723;         /* Marrom escuro para texto (contraste) */
    
    display: none;          /* Começa invisível (o JS mostra quando tiver item) */
    justify-content: space-between; /* Separa Texto do Preço */
    align-items: center;    /* Centraliza verticalmente */
    
    padding: 0 20px;        /* Espaçamento interno */
    box-sizing: border-box; /* Garante que não estoure a tela */
    z-index: 9999;          /* Fica por cima de tudo */
    cursor: pointer;        /* Mãozinha de clique */
    box-shadow: 0 -4px 15px rgba(0,0,0,0.3); /* Sombra para cima */
    
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
}

/* Efeito ao clicar */
#bottom-cart-bar:active {
    background-color: #d49000;
}

/* Área da Esquerda (Bolinha + Texto) */
.cart-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Bolinha da Quantidade */
.cart-qty {
    background-color: white;
    color: var(--brand-orange-end);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 900;
}

/* Texto "Ver Sacola" */
.cart-text {
    font-size: 14px;
    text-transform: uppercase;
}

/* Preço na Direita */
.cart-total {
    font-size: 16px;
}
/* ==========================================================================
   AJUSTE DE SOBREPOSIÇÃO (BOTÕES x CARRINHO)
   ========================================================================== */

/* Quando o carrinho estiver ativo, empurra os botões de ação para cima */
body.cart-active .action-footer {
    bottom: 60px !important; /* Altura da barra do carrinho */
    transition: bottom 0.3s ease; /* Sobe suavemente */
    border-bottom: 1px solid #444; /* Uma linha para separar visualmente */
}

/* Garante que o rodapé não esconda o último item da lista */
body.cart-active #flavors-list, 
body.cart-active #drinks-list {
    padding-bottom: 160px !important; /* Aumenta o espaço extra no final da rolagem */
}

/* Cores dos Status de Pedido */
.status-badge { padding: 5px 10px; border-radius: 15px; font-weight: bold; font-size: 12px; color: white; }
.st-Pendente { background-color: #e74c3c; } /* Vermelho */
.st-Preparando { background-color: #f39c12; } /* Laranja */
.st-Saiu { background-color: #3498db; } /* Azul */
.st-Concluído { background-color: #27ae60; } /* Verde */


/* ==========================================================================
   CORREÇÃO DE CORES: MODAL DE DELIVERY
   ========================================================================== */

/* Força o texto a ser PRETO dentro do modal de detalhes */
#order-detail-modal .modal-content {
    background-color: #ffffff !important; /* Fundo Branco */
    color: #333333 !important;            /* Texto Cinza Escuro */
}

/* Garante que os títulos e negritos fiquem bem visíveis */
#order-detail-modal strong, 
#order-detail-modal h2 {
    color: #000000 !important;
}

/* Corrige a cor da tabela de itens */
#order-detail-modal table th,
#order-detail-modal table td {
    color: #333333 !important;
    border-color: #ddd !important;
}

/* Corrige a cor do cabeçalho da tabela */
#order-detail-modal table thead tr {
    background-color: #eeeeee !important;
    color: #000000 !important;
}

/* Corrige o select de mudar status para não ficar branco no branco */
#od-status-select {
    background-color: #fff !important;
    color: #333 !important;
    border: 1px solid #ccc !important;
}