/* 1. RESET UNIVERSAL E CONFIGURAÇÃO DE TOPO */
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', Arial, sans-serif; }
body { background-color: #f8fafc; color: #1e293b;  line-height: 1.5; margin-top: 0 !important; }
.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 20px; }


/* 2. COMPONENTE: CABEÇALHO (header.php) */
.site-header {
    width: 100%;
    background-color: #ffffff;
    border-bottom: 1px solid #6c6c6c;
    box-shadow: 0 1px 8px rgba(0,0,0,0.3);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: padding 0.3s ease;
    padding: 20px 0;
}
.site-header.shrink {
    padding: 10px 0;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
}
.dashboard-header{margin-bottom: 20px;}
.header-wrap { display: flex; justify-content: space-between; align-items: center; }
.logo h1 { font-size: 22px; font-weight: 800; color: var(--cor-primaria); letter-spacing: -0.5px; }
.nav-menu { display: flex; align-items: center; gap: 25px; list-style: none; }
.nav-menu a { color: #475569; text-decoration: none; font-size: 14px; font-weight: 600; transition: color 0.2s; }
.nav-menu a:hover { color: #FF69B4; }
.btn-whats { background-color: #075E54; color: #ffffff !important; padding: 8px 16px; border-radius: 20px; display: inline-flex; align-items: center; gap: 8px; box-shadow: 0 2px 4px rgba(37, 211, 102, 0.2); transition: all 0.3s;}
.btn-whats:hover { background-color: #1ebd54;transition: all 0.3s;}
.btn-voltar { display: inline-block; padding: 8px 15px; background: #475569; color: #fff; border: 1px solid #ccc; border-radius: 4px; text-decoration: none; font-weight: 500; font-size: 13px; }
.btn-voltar:hover { background: #436aa1; border:1px solid #000;}
.menu-toggle { display: none; background: none; border: none; cursor: pointer; flex-direction: column; gap: 5px; padding: 5px; }
.menu-toggle span { width: 25px; height: 3px; background-color: #1e293b; border-radius: 2px; transition: 0.3s; }
@media (max-width: 768px) {
    .menu-toggle { display: flex; }
    .nav-menu { display: none; position: absolute; top: 100%; left: 0; width: 100%; background-color: #ffffff; flex-direction: column; padding: 20px; gap: 15px; border-bottom: 1px solid #e2e8f0; }
    .nav-menu.active { display: flex; }
    .menu-toggle.active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .menu-toggle.active span:nth-child(2) { opacity: 0; }
    .menu-toggle.active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
}

@media (min-width: 769px) { .desktop-only { display: inline; } }
@media (max-width: 768px) { .desktop-only { display: none; } }


/* 3. COMPONENTE: VITRINE (index.php) */
.hero-banner { background: linear-gradient(135deg, #fff0f5 0%, #ffe4e1 100%); padding: 60px 20px; border-radius: 12px; margin: 0; text-align: center; border: 1px solid #fce7f3; }
.hero-banner h2 { font-size: 28px; color: #0f172a; margin-bottom: 10px; font-weight: 800; }
.hero-banner p { color: #475569; font-size: 15px; }
.produtos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 20px; margin: 40px 0; width: 100%; align-items: stretch !important; }
.produto-card { display:flex !important; flex-direction: column !important; height: 100% !important; box-sizing: border-box !important; background: #fff; border-radius: 10px; border: 1px solid #e2e8f0; overflow: hidden; transition: transform 0.2s, box-shadow 0.2s;padding: 5px; margin-top: auto;}
.produto-card:hover { transform: translateY(-4px); box-shadow: 0 10px 15px -3px rgba(0,0,0,0.05); }
.produto-imagem-container { width: 100%; height: 220px; background: #fff; overflow: hidden; display: flex; align-items: center; justify-content: center; border-bottom: 1px solid #cbd5e1; }
.produto-img-tag { width: auto; height: 100%; background: #fff; object-fit: contain; }
.produto-info { padding: 15px; display: flex; flex-direction: column; flex-grow: 1; }
.produto-tag { display: inline-block; align-self: flex-start; background-color: #807bfc2b; border:1px solid #0b00ff61; color:#0b00ff61; font-size: 11px; font-weight: 700; padding: 4px 8px; border-radius: 6px; margin-bottom: 10px; text-transform: uppercase; }
.produto-nome { font-size: 14px; font-weight: 700; color: #0f172a; margin-bottom: 6px; min-height: 42px; line-height: 1.4; }
.produto-detalhes { display: flex; gap: 6px; font-size: 11px; color: #64748b; margin-bottom: 12px; }
.produto-preco { font-size: 18px; font-weight: 800; color: var(--cor-primaria); margin-top: auto; margin-bottom: 12px; }
.botoes-card-flex {display: flex;gap: 5px;}
.btn-compra-rapida {padding: 10px 5px; border-radius: 4px; background-color: #212d3f; color:#fff;border:none !important;transition: all 0.3s;}
.btn-compra-rapida:hover {background-color: #515254; color:#fff;}
@media (max-width: 768px){
    .produtos-grid{display: grid; grid-template-columns: repeat(2, minmax(120px, 1fr)) !important; gap: 8px; margin: 40px 0; width: 100%; align-items: stretch}
    .produto-info {padding: 5px; display: flex; flex-direction: column;flex-grow: 1;}
    .produto-nome {font-size: 0.83rem;}
    .btn-rosa {display: grid; place-items: center; padding: 10px 5px !important; font-size: 0.73rem;}
    .btn-compra-rapida {padding: 10px 5px}
    .botoes-card-flex {display: flex;gap: 5px;}
}
@media (max-width: 400px){
    .produtos-grid{display: grid; grid-template-columns: 1fr !important; gap: 5px; margin: 40px 0; width: 100%; }
    .produto-nome {font-size: 0.75rem;}
    .btn-rosa {width: 100%; padding: 5px; border-radius: 6px; font-size: 0.75rem; text-align: center; transition: background 0.2s; line-height: 2.5;}
}

/* 4. COMPONENTE: ESTRUTURA EM DUAS COLUNAS */
.layout-duas-colunas { display: flex; gap: 30px; flex-wrap: wrap; margin: 30px 0; align-items: flex-start; width: 100%; }
.coluna-principal { flex: 2 1 600px; }
.coluna-lateral { flex: 1 1 350px; }
.card-branco { background: #fff; border-radius: 10px; border: 1px solid #e2e8f0; padding: 25px; margin-bottom: 40px; width: 100%; }
.card-branco h3 { font-size: 16px; font-weight: 700; color: #0f172a; margin-bottom: 20px; border-bottom: 1px solid #f1f5f9; padding-bottom: 10px; }


/* 5. COMPONENTE: FORMULÁRIOS E BOTÕES */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-weight: 600; margin-bottom: 6px; color: #475569; font-size: 13px; }
.form-control { width: 100%; padding: 11px 14px; border: 1px solid #cbd5e1; border-radius: 6px; font-size: 13px; outline: none; background-color: #fff; }
.form-control:focus { border-color: #FF69B4; }
.btn-rosa { width: 100%; display: block; padding: 13px; border-radius: 6px; font-weight: 700; cursor: pointer; border: none; font-size: 14px; text-align: center; background-color: var(--cor-primaria); color: #fff; text-decoration: none; transition: background 0.2s; }
.btn-rosa:hover { background-color: var(--cor-primaria);opacity: 80%; }
.btn-cinza { background-color: #e2e8f0; color: #334155; }
.btn-cinza:hover { background-color: #cbd5e1; }


/* 6. COMPONENTE: DETALHES DO PRODUTO (produto.php) */
.specs-linha { display: flex; gap: 15px; margin-bottom: 25px; flex-wrap: wrap; list-style: none; }
.spec-box-mini { background: #f8fafc; padding: 10px 15px; border-radius: 6px; border: 1px solid #e2e8f0; text-align: center; min-width: 95px; flex: 1; }
.spec-box-mini small { color: #64748b; display: block; font-size: 11px; text-transform: uppercase; margin-bottom: 2px; font-weight: 600; }
.spec-box-mini strong { color: #334155; font-size: 13.5px; display: block; }

/* 7. COMPONENTE: TABELAS E CARRINHO (carrinho.php) */
.tabela-cliente { width: 100%; border-collapse: collapse; text-align: left; }
.tabela-cliente th { background-color: #f8fafc; padding: 14px 16px; font-weight: 600; color: #475569; border-bottom: 2px solid #edf2f7; font-size: 13px; }
.tabela-cliente td { padding: 14px 16px; border-bottom: 1px solid #edf2f7; color: #334155; font-size: 13px; vertical-align: middle; }
.tabela-cliente tr:hover { background-color: #f8fafc; }
.btn-lixeira { color: #dc2626; border: 1px solid #fecaca; background: none; padding: 6px 10px; border-radius: 4px; cursor: pointer; text-decoration: none; display: inline-block; }
.btn-lixeira:hover { background: #fef2f2; }


/* ===== ESTILOS AVANÇADOS: TOAST FLUTUANTE E BARRA DE FRETE GRÁTIS ======= */
/* 8 Toast Notificador Dinâmico */
#toast-wrapper-zone {
    position: fixed;
    top: 85px;
    right: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px; /* Distância exata entre um card de maquiagem e outro na fila */
    z-index: 99999;
    width: 320px;
    pointer-events: none; /* Impede que o container invisível bloqueie cliques na tela */
}
.toast-container {
    pointer-events: auto; /* Devolve o clique para o card se precisar */
    background: #f2f2f2;
    box-shadow: 0 10px 25px -5px rgba(0,0,0,0.08), 0 8px 10px -6px rgba(0,0,0,0.05);
    border-radius: 8px; 
    padding: 15px; 
    display: flex; 
    align-items: center; 
    gap: 12px;
    border: 1px solid #8e9eb1;
    position: relative;
    overflow: hidden;
    /* Animação modificada para surgir deslizando elegantemente da direita para a esquerda */
    animation: slideInToastTopo 0.3s ease-out forwards;
}
.toast-thumb { width: 45px; height: 45px; object-fit: cover; border-radius: 4px; background: #f8fafc; }
.toast-content { flex-grow: 1; }
.toast-content h5 { font-size: 13px; font-weight: 700; color: #0f172a; margin-bottom: 2px; }
.toast-content p { font-size: 11px; color: #64748b; }
.toast-progress-wrapper { width: 100%; height: 4px; background: #e2e8f0; position: absolute; bottom: 0; left: 0; }
.toast-progress-bar { height: 100%; width: 100%; animation: shrinkBar 4s linear forwards; }

@keyframes slideInToastTopo { 
    from { transform: translateX(50px); opacity: 0; } 
    to { transform: translateX(0); opacity: 1; } 
}
@keyframes shrinkBar { 
    0% { width: 100%; background-color: #00ff00; } 
    33% { background-color: #ffff00; } 
    66% { background-color: #ffaa00; } 
    100% { width: 0%; background-color: #ff0000; } 
}

/* 8.1 Barra de Progresso do Frete Grátis (Vermelho -> Verde) */
.frete-barra-container { width: 100%; background: #f1f5f9; height: 8px; border-radius: 4px; margin: 12px 0; overflow: hidden; position: relative; }
.frete-barra-progresso { height: 100%; border-radius: 4px; transition: width 0.4s ease, background-color: 0.4s ease; }

/* 8.3 Container de ofertas acoplado ao Toast */
.toast-main-alert { display: flex; align-items: center; gap: 12px; padding-bottom: 10px; }
.toast-cross-selling-offers { border-top: 1px dashed #ffb3d9; padding-top: 10px; margin-top: 5px; display: flex; flex-direction: column; gap: 8px; }
.toast-rel-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; background: #fff0f5; padding: 6px 10px; border-radius: 6px; border: 1px solid #ffe6f2; }
.toast-rel-thumb { width: 35px; height: 35px; object-fit: cover; border-radius: 4px; background: #ffffff; }
.toast-rel-info { flex: 1; min-width: 0; }
.toast-rel-info h6 { font-size: 12px; margin: 0; font-weight: 700; color: #1e293b; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toast-rel-info p { font-size: 11px; margin: 0; color: #FF69B4; font-weight: 800; }





/* 9 COMPONENTES EXCLUSIVOS DA TELA DE LOGIN ADMINISTRATIVO (login.php) */
/* Centralização mestre do card de login no centro da tela */
body:has(.login-card) {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #f8fafc 0%, #fff0f5 100%);
    padding: 20px;
}

/* Estrutura do Card de Autenticação */
.login-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 35px 30px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.03);
    text-align: center;
}
.login-card h2 {
    font-size: 24px;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}
.login-card p {
    font-size: 13.5px;
    color: #64748b;
    margin-bottom: 25px;
    line-height: 1.4;
}

/* Alinhamento dos inputs dentro do card */
.login-card .form-group {
    text-align: left;
    margin-bottom: 20px;
}

/* Botão Oficial de Entrada no Painel (Rosa Premium) */
.btn-login {
    width: 100%;
    display: block;
    padding: 13px;
    border-radius: 6px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    font-size: 14px;
    text-align: center;
    background-color: #FF69B4;
    color: #ffffff;
    transition: background 0.2s ease;
    margin-top: 10px;
    margin-bottom: 20px;
}
.btn-login:hover {
    background-color: #ff4da6;
}

/* Alertas de Erro ou Contas Inativas */
.alert-danger {
    background-color: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
    padding: 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 20px;
    text-align: center;
}

/* Link Inferior de Retorno para o E-commerce */
.back-store {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #64748b;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: color 0.2s ease;
}
.back-store:hover {
    color: #FF69B4;
}




/* === DESIGN DA SIDEBAR ADMINISTRATIVA (includes/sidebar.php) ===== */
.sidebar-admin {
    width: 260px;
    background-color: #1e293b; /* Cinza Escuro Moderno */
    color: #f8fafc;
    min-height: 100vh;
    padding: 25px 15px;
    position: fixed;
    top: 0;
    left: 0;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    z-index: 100;
}
.sidebar-brand {
    font-size: 18px;
    font-weight: 700;
    color: #FF69B4; /* Rosa Maquiagem Premium */
    text-align: center;
    margin-bottom: 35px;
    padding-bottom: 15px;
    border-bottom: 1px solid #334155;
}
.sidebar-menu-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    color: #94a3b8;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 500;
    font-size: 13.5px;
    transition: background 0.2s, color 0.2s;
}
.sidebar-link i {
    font-size: 16px;
    width: 20px;
    text-align: center;
}
.sidebar-link:hover {
    background-color: #334155;
    color: #f8fafc;
}
.sidebar-link.active-menu-item {
    background-color: #FF69B4;
    color: #fff;
    box-shadow: 0 4px 12px rgba(255, 105, 180, 0.2);
}
.sidebar-logout-btn {
    margin-top: auto;
    border-top: 1px solid #334155;
    padding-top: 15px;
}

/* Grelha mestre dividida em duas colunas simétricas no Desktop */
.panel-grid {
    display: flex;
    gap: 25px;
    flex-wrap: wrap;
    align-items: flex-start;
    width: 100%;
    box-sizing: border-box;
}

/* Coluna do Formulário Esquerdo (Enxuta e Compacta) */
.col-form {
    flex: 1 1 320px;
    max-width: 380px; /* Impede o formulário de esticar e vazar espaço no monitor grande */
    box-sizing: border-box;
}

/* Coluna da Árvore de Listagem Direita (Expandida) */
.col-table {
    flex: 2 1 500px;
    box-sizing: border-box;
}

/* Container de Listagem Flexbox Vertical */
.flex-list-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

/* Card Individual de Item da Árvore */
.flex-cat-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    padding: 5px 3px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.4);
    box-sizing: border-box;
    transition: all 0.2s ease-in-out;
}
.flex-cat-card:hover {
    border-color: #ffb3d9;
    box-shadow: 0 4px 12px rgba(255, 105, 180, 0.03);
}

/* RECUOS COMPACTOS DE HIERARQUIA (ÁRVORE DENTADA SMART) */
.indent-subcategoria {
    padding: 5px 10px;
    border-left: 5px solid #ffb406;
    background: #fafae8;
    border-radius: 8px 0 0 8px;
}
.indent-segmento {
    margin-left: 40px;
    border-left: 5px dashed #FF00FF;
    background: #fff0f5;
    border-radius: 0 0 0 6px;
}

/* Etiquetas de Identificação de Nível */
.badge-nivel {
    font-size: 10.5px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 5px;
    text-transform: uppercase;
    letter-spacing: 0.2px;
    display: inline-flex;
    align-items: center;
}
.badge-p { background: #f1f5f9; color: #475569; }
.badge-s { background: #e0f2fe; color: #0369a1; border: 1px solid #bae6fd; }
.badge-g { background: #fff0f5; color: #b30059; border: 1px solid #ffe6f2; }

/* Auxiliar Ocultador Utilitário */
.d-none { display: none !important; }

/* Tablets e Telas Médias */
@media (max-width: 991px) {
    .col-form {
        max-width: 100%; /* Permite o formulário assumir o topo cobrindo a largura útil */
        flex: 1 1 100%;
    }
    .col-table {
        flex: 1 1 100%;
    }
}

/* Smartphones (Celulares de Baixa Resolução) */
@media (max-width: 575px) {
    .panel-grid {
        gap: 12px;
    }

    /* Mantém o card alinhado na horizontal com altura mínima, sem empilhar tudo */
    .flex-cat-card {
        padding: 8px 12px !important; /* Enxuga o preenchimento interno mestre */
        flex-direction: row !important; /* Tranca os dados e as ações lado a lado */
        justify-content: space-between !important;
        align-items: center !important;
        gap: 2px !important;
    }

    /* Enxuga o tamanho do contador de ordem para não esticar a altura da linha */
    .flex-list-container .product-stock-badge {
        width: 26px !important;
        height: 26px !important;
        font-size: 11px !important;
        min-width: 26px !important;
    }

    /* Ajusta a caixa de metadados para não dar salto vertical */
    .flex-list-container .product-metadata-box {
        gap: 2px !important;
    }

    /* Reduz o tamanho das fontes e dos badges no celular para achatar o card */
    .flex-list-container .product-title-txt {
        font-size: 13.5px !important;
        line-height: 1.2 !important;
    }
    .flex-list-container .badge-nivel {
        font-size: 9px !important;
        padding: 1px 5px !important;
    }
    .flex-list-container .product-category-code {
        font-size: 10px !important;
        padding: 2px 5px !important;
    }

    /* Lado Direito: Status e Ações na mesma linha horizontal de forma slim */
    .flex-list-container .product-card-right {
        width: auto !important;
        display: flex !important;
        flex-direction: row !important; /* Empilha o micro status acima dos botões de forma colada */
        align-items: flex-end !important;
        border-top: none !important;
        padding-top: 0 !important;
        margin-top: 0 !important;
        gap: 4px !important;
    }

    /* Cluster de Ações com botões pequenos e ergonômicos */
    .product-actions-cluster {
        display: flex !important;
        gap: 4px !important;
    }
    .product-actions-cluster .actions-btn {
        padding: 4px 10px !important; /* Botões menores e mais finos */
        font-size: 11px !important;
        border-radius: 5px !important;
    }

    /* Reduz ligeiramente os recuos no mobile para sobrar espaço horizontal para os títulos */
    .indent-subcategoria { margin-left: 8px !important; }
    .indent-segmento { margin-left: 16px !important; }

}


