/* ==========================================
   TEMA AURA TECH - CSS GLOBAL
========================================== */

:root {
    /* Suas variáveis originais Aura Tech */
    --aura-gold: #f9c855;
    --aura-purple: #9e54e4;
    --aura-dark-bg: #0d0d0d;
    --aura-panel-bg: #151515;
    --aura-text: #f5f5f5;
    --aura-glow: 0 0 15px rgba(158, 84, 228, 0.6);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--aura-dark-bg);
    color: var(--aura-text);
    overflow-x: hidden;
}

/* --- Cabeçalho --- */
header {
    position: fixed;
    top: 0; width: 100%; padding: 20px 50px;
    display: flex; justify-content: space-between; align-items: center;
    background: rgba(13, 13, 13, 0.8);
    backdrop-filter: blur(10px);
    z-index: 1000;
    border-bottom: 1px solid rgba(158, 84, 228, 0.2);
}

.logo h1 {
    font-size: 1.8em; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; margin: 0;
    background: linear-gradient(45deg, var(--aura-gold), var(--aura-purple));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

nav ul { list-style: none; display: flex; gap: 30px; }
nav a { color: var(--aura-text); text-decoration: none; font-weight: 500; transition: color 0.3s; }
nav a:hover { color: var(--aura-gold); text-shadow: 0 0 8px rgba(249, 200, 85, 0.5); }

/* --- Seção Hero (Canvas 3D) --- */
#hero {
    position: relative; height: 100vh; display: flex; align-items: center; justify-content: flex-start; padding-left: 10%;
}
#canvas-container { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: -1; }
.hero-content { max-width: 600px; z-index: 10; pointer-events: none; }
.hero-content h2 { font-size: 4em; line-height: 1.1; margin-bottom: 20px; text-transform: uppercase; }
.hero-content p { font-size: 1.2em; color: #aaa; margin-bottom: 40px; }

/* --- Filtros --- */
.filtros { display: flex; justify-content: center; gap: 15px; margin-bottom: 40px; }
.btn-filtro {
    background: transparent; color: var(--aura-text); border: 2px solid var(--aura-purple);
    padding: 10px 25px; font-weight: bold; cursor: pointer; border-radius: 4px; transition: all 0.3s ease;
}
.btn-filtro:hover, .btn-filtro.active {
    background: var(--aura-purple); color: #fff; box-shadow: var(--aura-glow);
}

/* --- Produtos (PHP Integrado) --- */
#products { padding: 80px 10%; background: linear-gradient(to bottom, transparent, #000); }
.section-title { text-align: center; font-size: 2.5em; margin-bottom: 40px; color: var(--aura-gold); }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 40px; }

.card {
    background: var(--aura-panel-bg); border: 1px solid rgba(249, 200, 85, 0.2);
    border-radius: 10px; transition: transform 0.3s, box-shadow 0.3s, opacity 0.4s;
    position: relative; overflow: hidden; display: flex; flex-direction: column;
}
.card::before {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 4px;
    background: linear-gradient(90deg, var(--aura-gold), var(--aura-purple)); z-index: 2;
}
.card:hover { transform: translateY(-10px); box-shadow: 0 10px 30px rgba(158, 84, 228, 0.3); border-color: var(--aura-purple); }

.card-img-wrapper { width: 100%; height: 220px; background: #0a0a0a; display: flex; align-items: center; justify-content: center; overflow: hidden;}
.card-img-wrapper img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; }
.card:hover .card-img-wrapper img { transform: scale(1.05); }

.card-body { padding: 30px; display: flex; flex-direction: column; flex-grow: 1; justify-content: space-between; }
.card h3 { font-size: 1.5em; margin-bottom: 10px; color: var(--aura-gold); }
.card p { color: #ccc; margin-bottom: 20px; line-height: 1.5; font-size: 0.95em; }
.price-container { display: flex; justify-content: space-between; align-items: center; margin-top: auto; }
.price { font-size: 1.5em; font-weight: bold; color: var(--aura-purple); }

/* Botão Sincronizar */
.btn-adicionar-carrinho {
    padding: 10px 20px; background: transparent; color: var(--aura-text);
    border: 1px solid var(--aura-purple); font-weight: bold; cursor: pointer; border-radius: 4px; transition: all 0.3s;
}
.btn-adicionar-carrinho:hover { background: var(--aura-purple); box-shadow: var(--aura-glow); }

/* --- Carrinho Flutuante Aura --- */
.carrinho-container { position: fixed; bottom: 30px; right: 30px; z-index: 1000; display: flex; flex-direction: column; align-items: flex-end; }
.btn-flutuante { 
    background: var(--aura-dark-bg); border: 2px solid var(--aura-gold); color: var(--aura-gold);
    border-radius: 50%; width: 65px; height: 65px; font-size: 1.5rem; cursor: pointer; 
    box-shadow: 0 0 15px rgba(249, 200, 85, 0.3); transition: all 0.3s; position: relative;
}
.btn-flutuante:hover { transform: scale(1.1); box-shadow: 0 0 25px rgba(249, 200, 85, 0.6); }
.badge { position: absolute; top: -5px; right: -5px; background: var(--aura-purple); color: white; width: 24px; height: 24px; border-radius: 50%; display: flex; justify-content: center; align-items: center; font-weight: bold; font-size: 0.85rem;}

.painel-carrinho { 
    background: var(--aura-panel-bg); border: 1px solid var(--aura-purple); width: 350px; border-radius: 8px; 
    box-shadow: 0 10px 40px rgba(0,0,0,0.8); margin-bottom: 20px; display: flex; flex-direction: column; 
    transition: opacity 0.3s, transform 0.3s; transform-origin: bottom right; 
}
.painel-carrinho.escondido { opacity: 0; transform: scale(0.5); pointer-events: none; }
.carrinho-header { padding: 15px; display: flex; justify-content: space-between; border-bottom: 1px solid rgba(158, 84, 228, 0.2); }
.btn-fechar { background: transparent; color: var(--aura-gold); border: none; font-size: 1.5rem; cursor: pointer; }
.carrinho-body { padding: 15px; max-height: 300px; overflow-y: auto; }
#lista-carrinho { list-style: none; }
#lista-carrinho li { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,0.05); }
.carrinho-footer { padding: 20px; border-top: 1px solid rgba(158, 84, 228, 0.2); }
.btn-finalizar { width: 100%; padding: 15px; background: var(--aura-gold); color: #000; border: none; font-weight: bold; cursor: pointer; border-radius: 4px; transition: 0.3s;}
.btn-finalizar:hover { background: #fff; box-shadow: 0 0 15px var(--aura-gold); }

/* Animação Fantasma Carrinho */
.fantasma-carrinho {
    position: fixed; z-index: 9999; width: 30px; height: 30px; border-radius: 50%;
    background: var(--aura-purple); box-shadow: var(--aura-glow); pointer-events: none;
    transition: left 0.8s cubic-bezier(0.2, 1, 0.3, 1), top 0.8s cubic-bezier(0.5, 0, 1, 0.5), opacity 0.8s, transform 0.8s;
}
/* --- HUD de Controle de Mídia (3D / 2D) --- */
.hud-toggle-midia {
    position: absolute;
    top: 10px;
    right: 10px;
    display: flex;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid var(--aura-purple);
    border-radius: 4px;
    z-index: 999; /* <-- MÁXIMA PRIORIDADE NA TELA */
    overflow: hidden;
    backdrop-filter: blur(5px);
    pointer-events: auto; /* <-- FORÇA O NAVEGADOR A LER O CLIQUE AQUI */
}

.btn-toggle-midia {
    background: transparent;
    color: #888;
    border: none;
    padding: 5px 12px;
    font-size: 0.8rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    outline: none;
}

.btn-toggle-midia.active {
    background: var(--aura-purple);
    color: #fff;
    box-shadow: 0 0 10px rgba(158, 84, 228, 0.5);
}

/* Transição das mídias (Opacidade em vez de display:none para não quebrar o 3D) */
.midia-produto {
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.midia-produto.hidden {
    opacity: 0;
    pointer-events: none;
    transform: scale(0.95);
    z-index: 1;
}

.midia-produto.active {
    opacity: 1;
    pointer-events: auto;
    transform: scale(1);
    z-index: 5;
}
/* ==========================================
   PAINEL ADMIN - ESTILIZAÇÃO AURA TECH
========================================== */

/* Container Principal das Telas Admin */
.admin-container { 
    max-width: 1000px; 
    margin: 0 auto; 
    background: var(--aura-panel-bg); 
    padding: 30px; 
    border-radius: 8px; 
    border: 1px solid rgba(158, 84, 228, 0.2); 
    box-shadow: 0 10px 30px rgba(0,0,0,0.5); 
}
.admin-container h2 { color: var(--aura-gold); margin-bottom: 20px; }

/* Formulários (Cadastrar/Editar Produto) */
.form-admin .grupo-form { margin-bottom: 20px; }
.form-admin label { display: block; margin-bottom: 8px; color: var(--aura-text); font-weight: bold; font-size: 0.95rem;}
.form-admin input[type="text"], 
.form-admin input[type="number"], 
.form-admin textarea, 
.form-admin select { 
    width: 100%; padding: 12px; background: #0a0a0a; border: 1px solid rgba(255,255,255,0.1); 
    color: var(--aura-text); border-radius: 4px; outline: none; transition: 0.3s; 
}
.form-admin input:focus, .form-admin textarea:focus, .form-admin select:focus { 
    border-color: var(--aura-purple); box-shadow: 0 0 10px rgba(158, 84, 228, 0.3); 
}
.form-admin small { color: #666; font-size: 0.8rem; margin-top: 5px; display: block;}

/* Botões do Admin */
.btn-salvar { 
    background: var(--aura-purple); color: #fff; border: none; padding: 12px 25px; 
    border-radius: 4px; font-weight: bold; cursor: pointer; transition: 0.3s; font-size: 1rem; width: 100%; text-transform: uppercase; letter-spacing: 1px;
}
.btn-salvar:hover { background: var(--aura-gold); color: #000; box-shadow: 0 0 15px rgba(249, 200, 85, 0.5); }

/* Dashboard: Cards de Métricas */
.grid-metricas { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 20px; margin-bottom: 30px; }
.card-metrica { 
    background: #0a0a0a; padding: 20px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.05); 
    display: flex; align-items: center; transition: 0.3s; 
}
.card-metrica:hover { border-color: var(--aura-purple); transform: translateY(-5px); box-shadow: 0 5px 15px rgba(158, 84, 228, 0.15);}
.metrica-icone { 
    width: 60px; height: 60px; background: rgba(158, 84, 228, 0.1); border-radius: 50%; 
    display: flex; justify-content: center; align-items: center; font-size: 1.8rem; margin-right: 20px; border: 1px solid var(--aura-purple); 
}
.metrica-info h3 { font-size: 0.9rem; color: #888; margin-bottom: 5px; font-weight: normal; text-transform: uppercase;}
.metrica-info p { font-size: 2rem; font-weight: bold; color: var(--aura-gold); margin: 0; }

/* Dashboard: Área do Gráfico */
.grafico-container {
    background: var(--aura-panel-bg); padding: 20px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.05); margin-top: 30px;
}
/* ==========================================================================
   BLINDAGEM DO CANVAS 3D (THREE.JS)
   ========================================================================== */
#hero {
    position: relative;
    overflow: hidden; /* Corta imediatamente qualquer coisa que tentar vazar da tela */
    width: 100%;
}

#canvas-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0; /* Joga o 3D lá para o fundo */
}

/* Força o elemento gerado pelo JavaScript a respeitar a tela */
#canvas-container canvas {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover; /* Faz o 3D se comportar como uma imagem de fundo */
    pointer-events: none; /* Impede que o 3D roube os cliques do usuário no celular */
}

.hero-content {
    position: relative;
    z-index: 2; /* Traz o texto e o botão "Visitar Catálogo" para a frente, permitindo o clique */
}
/* ==========================================================================
   MÓDULO DE RESPONSIVIDADE (MOBILE & TABLETS)
   ========================================================================== */
@media (max-width: 768px) {
    #hero {
        padding: 130px 20px 0 20px !important; /* Desce o texto para não bater no menu */
        justify-content: center !important;
        align-items: flex-start !important;
        text-align: center;
    }
    /* --- 1. CABEÇALHO E NAVEGAÇÃO DA MATRIZ --- */
    header {
        flex-direction: column;
        text-align: center;
        padding: 15px;
    }
    header nav ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
        padding: 10px 0 0 0;
    }
    header nav ul li a {
        font-size: 0.9rem;
        padding: 5px;
    }

    /* --- 2. HERO SECTION (TELA INICIAL) --- */
    .hero-content h2 {
        font-size: 2rem;
        line-height: 1.2;
    }
    .hero-content p {
        font-size: 0.95rem;
        padding: 0 15px;
    }

    /* --- 3. VITRINE DE PRODUTOS (O Grid) --- */
    .filtros {
        flex-direction: column;
        gap: 10px;
        padding: 0 15px;
    }
    .btn-filtro {
        width: 100%;
    }
    .grid {
        grid-template-columns: 1fr !important; /* Força 1 coluna apenas no celular */
        gap: 20px;
        padding: 10px;
    }

    /* --- 4. MÓDULO DE CARGA (CARRINHO) --- */
    .painel-carrinho {
        width: 100% !important; /* Ocupa 100% da tela do celular */
        max-width: 100% !important;
        border-left: none !important;
        border-top: 2px solid var(--aura-purple);
    }
    .btn-flutuante {
        bottom: 15px;
        right: 15px;
        width: 50px;
        height: 50px;
    }
    .btn-flutuante span:first-child {
        font-size: 1.5rem !important; /* Diminui um pouco o ícone ⬡ */
    }

    /* --- 5. PAINEL ADMIN (GESTÃO DE OPERAÇÕES) --- */
    body {
        flex-direction: column; /* Joga a barra lateral para o topo */
    }
    .sidebar {
        width: 100% !important;
        height: auto;
        position: relative;
        padding: 15px;
        border-right: none;
        border-bottom: 1px solid rgba(158, 84, 228, 0.2);
    }
    .nav-admin {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
    }
    .nav-admin li {
        margin-bottom: 0;
        flex: 1 1 calc(50% - 10px); /* Botões lado a lado */
    }
    .nav-admin a {
        justify-content: center;
        font-size: 0.85rem;
        padding: 10px;
    }
    .admin-main-content {
        margin-left: 0 !important;
        width: 100% !important;
        padding: 15px;
    }
    
    /* Blinda a tabela de pedidos para não quebrar a tela */
    .tabela-admin {
        display: block;
        width: 100%;
        overflow-x: auto; /* Permite arrastar a tabela para os lados */
        white-space: nowrap; 
    }
    .tabela-admin th, 
    .tabela-admin td {
        padding: 12px 10px !important;
    }
}