/* ============================================================
    NEXUS - GLOBAL.CSS (O Coração do Site)
    Base: Variáveis + Reset + Header/Footer Robusto (Versão 12.0 - INTEGRAL)
    Ajuste: Unificação Total Mobile + Correção de CEP + Sem Resumos
    Status: COMPLETO E DETALHADO
   ============================================================ */

/* --- 1. VARIÁVEIS E DNA DA MARCA --- */
:root {
    --verde-nexus: #00e0b3;
    --preto-deep: #1a1a1a;
    --preto-light: #2c2c2c;
    --branco: #ffffff;
    --off-white-secao: #f0f2f5; 
    --cinza-fundo: #ffffff;      
    --cinza-texto: #555555;
    --vermelho-oferta: #e63946;
}

/* --- 2. RESET E CONFIGURAÇÕES BASE --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--cinza-fundo);
    color: var(--preto-deep);
    line-height: 1.6;
    padding-top: 0 !important; 
    margin: 0;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- 3. HEADER (ESTRUTURA E LOGO) --- */
header {
    position: relative !important; 
    width: 100%;
    z-index: 1000;
    background: var(--branco);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    display: block;
}

.main-header {
    background-color: var(--off-white-secao) !important;
    padding: 10px 0;
    border-bottom: 2px solid var(--verde-nexus);
}

.header-grid {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 25px; 
}

/* AJUSTE: Largura fixa para alinhar com o CEP abaixo */
.logo-area {
    display: flex;
    align-items: center;
    gap: 15px; 
    flex-shrink: 0;
    width: 210px; 
    padding-left: 5px; 
}

/* Botão Menu Sanduíche (Hamburguer) */
#btn-mobile-menu {
    display: none; 
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--preto-deep);
    cursor: pointer;
    padding: 5px;
    outline: none;
}

.main-logo-img {
    height: 42px; 
    width: auto;
    object-fit: contain;
    display: block;
    opacity: 1; 
}

.brand-name {
    font-size: 1.2rem;
    font-weight: 900;
    color: #1a1a1a !important;
    letter-spacing: -0.5px;
    display: flex;
    flex-direction: column;
    line-height: 1;
    text-decoration: none;
}

.tag-oficial {
    font-size: 9px;
    color: var(--verde-nexus);
    font-weight: 700;
    letter-spacing: 1px;
}

/* --- 4. BARRA DE BUSCA E SUGESTÕES --- */
.search-container {
    height: 40px !important; 
    flex-grow: 1;
    display: flex;
    max-width: 650px; 
    align-items: center;
    position: relative; 
    margin: 0;
}

.search-input-wrapper {
    display: flex;
    width: 100%;
    border: 1px solid #ccc;
    border-radius: 6px; 
    overflow: hidden;
    background: white;
}

.search-container input {
    width: 100%;
    padding: 10px 15px;
    border: none;
    outline: none;
    font-size: 0.95rem;
}

.search-btn {
    background-color: var(--verde-nexus);
    border: none;
    padding: 0 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
}

#suggestion-box {
    position: absolute !important;
    top: 100% !important; 
    left: 0 !important;
    width: 100% !important;
    background: #ffffff !important;
    border-radius: 0 0 10px 10px !important;
    box-shadow: 0 8px 16px rgba(0,0,0,0.15) !important;
    z-index: 99999 !important; 
    overflow: hidden !important;
    border: 1px solid #ddd !important;
    border-top: none !important;
}

.suggestion-item {
    padding: 12px 15px !important;
    border-bottom: 1px solid #f0f0f0 !important;
    cursor: pointer !important;
    font-size: 0.9rem !important;
    color: #333 !important;
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    background: #fff !important;
    transition: background 0.2s !important;
}

.suggestion-item:hover { background: #f4f4f4 !important; }
.hidden { display: none !important; }

/* --- 5. MENU, LINKS, AVATAR E CARRINHO --- */

.location-container {
    width: 210px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

/* Novos estilos para os textos de localização que você usou */
.location-texts { display: flex; flex-direction: column; line-height: 1.2; }
.loc-label { font-size: 11px; color: #666; }
.loc-address { font-size: 12px; color: #333; font-weight: 600; }

.nav-categories {
    display: flex;
    gap: 20px;
    flex: 1;
    align-items: center;
}

.user-menu {
    display: flex;
    gap: 15px;
    align-items: center;
    flex-shrink: 0;
}

.user-auth-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
}

.user-avatar-container {
    position: relative;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #ddd;
}

.user-status-dot {
    position: absolute;
    bottom: 1px;
    right: 1px;
    width: 11px;
    height: 11px;
    background-color: #2ecc71;
    border: 2px solid #fff;
    border-radius: 50%;
    z-index: 2;
}

.user-name-text {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
}

.nav-link {
    padding: 3px 10px !important;
    font-size: 0.85rem !important;
    color: var(--preto-deep) !important;
    text-decoration: none;
    font-weight: 500;
}

.cart-container {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    text-decoration: none;
    margin-left: 5px;
}

.cart-icon { font-size: 1.4rem; color: #333; }

.cart-quantity {
    position: absolute;
    top: -8px;      
    right: -10px;
    background: var(--verde-nexus) !important; 
    color: #000000 !important; 
    font-size: 11px; 
    font-weight: 800; 
    min-width: 18px;
    height: 18px;
    border-radius: 50%; 
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    border: 1.5px solid #fff;
    z-index: 10;
}

/* --- 6. VITRINE DE PRODUTOS (GLOBAL) --- */
.product-showcase { padding: 30px 0; }
.section-title { 
    margin-bottom: 25px; 
    font-size: 1.6rem; 
    font-weight: 800; 
    color: var(--preto-deep); 
    padding: 0 15px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); 
    gap: 20px;
    padding: 0 15px;
}

/* --- 7. CARD DE PRODUTO (GLOBAL) --- */
.product-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 15px;
    transition: 0.3s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card:hover { 
    transform: translateY(-5px); 
    box-shadow: 0 8px 20px rgba(0,0,0,0.08); 
}

.product-image {
    width: 100%;
    height: 230px; 
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image img { 
    max-width: 95%; 
    max-height: 95%; 
    object-fit: contain; 
}

.product-brand { font-size: 11px; color: #888; text-transform: uppercase; }
.product-title { 
    font-size: 14px; 
    color: #333; 
    margin: 10px 0; 
    height: 40px; 
    overflow: hidden; 
    line-height: 1.4; 
}

.product-price { display: flex; flex-direction: column; gap: 2px; }
.old-price { font-size: 12px; color: #999; text-decoration: line-through; }
.current-price { 
    font-size: 24px; 
    font-weight: 800; 
    color: var(--preto-deep); 
}

.installments { 
    font-size: 12.5px; 
    color: #00a650; 
    font-weight: 600; 
}

.view-details {
    margin-top: 15px;
    text-align: center;
    padding: 8px;
    border-top: 1px solid #f0f0f0;
    color: var(--verde-nexus);
    font-weight: 700;
    font-size: 13px;
}

/* --- 8. SIDEBAR (MENU LATERAL PREMIUM) --- */
#mobile-sidebar {
    position: fixed;
    top: 0;
    left: -280px; 
    width: 280px;
    height: 100%;
    background: var(--off-white-secao);
    z-index: 9999;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 5px 0 15px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
}

#mobile-sidebar.active { left: 0; }

#menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    z-index: 9998;
    display: none;
    backdrop-filter: blur(2px);
}

#menu-overlay.active { display: block; }

.sidebar-header {
    background: #e4e6e9;
    padding: 25px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #ddd;
}

.sidebar-nav {
    list-style: none;
    padding: 15px 0;
    overflow-y: auto;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 25px;
    color: var(--preto-deep) !important; 
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid #e0e0e0;
    transition: 0.2s;
}

.sidebar-nav a:hover {
    background: #ddd;
    color: var(--preto-deep) !important;
}

.sidebar-nav i { 
    width: 20px; 
    font-size: 1.1rem; 
    color: #444;
}

/* --- 9. WHATSAPP FLOAT --- */
.whatsapp-float-container {
    position: fixed;
    bottom: 15px;
    right: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 2000;
}

.wa-main-btn {
    background-color: #25d366;
    color: white;
    width: 42px; 
    height: 42px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    text-decoration: none;
    transition: transform 0.3s ease;
}

.wa-main-btn:hover { transform: scale(1.1); }

.wa-tooltip {
    background-color: #fff;
    color: #333;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    white-space: nowrap;
}

/* --- 10. RODAPÉ (FOOTER PREMIUM) --- */
.main-footer {
    background: #f5f5f5; 
    color: #000000;      
    padding: 50px 0 30px 0;
    margin-top: 50px;
    border-top: 1px solid #ddd; 
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

.footer-col h4 {
    color: #000000;      
    font-size: 0.85rem;
    margin-bottom: 15px;
    font-weight: 700;    
    text-transform: uppercase;
}

.footer-col ul { list-style: none; }
.footer-col ul li a {
    color: #333333;      
    text-decoration: none;
    font-size: 0.8rem;    
    transition: 0.2s;
}

.footer-col ul li a:hover { color: var(--verde-nexus); }

.social-icons {
    display: flex;
    gap: 15px;
    font-size: 1.3rem; 
    align-items: center;
}

.social-icons .fa-instagram { color: #E1306C !important; }
.social-icons .fa-whatsapp { color: #25D366 !important; }
.social-icons .fa-x-twitter { color: #000000 !important; }

.payment-icons {
    display: flex;
    gap: 15px;
    font-size: 2.2rem; 
    color: #444;      
    flex-wrap: wrap;
}

.footer-bottom {
    text-align: center;
    border-top: 1px solid #e5e5e5;
    padding-top: 25px;
    margin-top: 20px;
}

.company-info { font-size: 0.75rem; color: #666; }

/* --- 11. RESPONSIVIDADE (ESTILO MERCADO LIVRE - SEM RESUMOS) --- */

@media (max-width: 1024px) {
    .brand-name { display: none !important; } 
}

@media (max-width: 768px) {
    .header-grid {
        display: flex !important;
        flex-wrap: wrap !important; /* Permite que os itens quebrem linha se necessário */
        justify-content: space-between !important;
        align-items: center !important;
        gap: 10px !important;
        padding: 5px 15px;
    }

    /* Ajuste da Logo para não sumir */
    .logo-area {
        display: flex !important; 
        order: 2;
        padding: 0;
        width: auto !important; 
    }
    
    .main-logo-img { height: 30px; }

    /* Itens que DEVEM sumir no mobile para dar espaço */
    .brand-name, .tag-oficial, .user-name-text, .nav-link, .user-auth-wrapper, .nav-categories { 
        display: none !important; 
    }

    /* O CEP agora REAPARECE aqui, mas com estilo mobile */
    .location-container { 
        display: flex !important; 
        order: 5; /* Vai para baixo da busca */
        width: 100% !important;
        margin-top: 5px;
        background: rgba(0,0,0,0.03);
        padding: 5px 10px !important;
        border-radius: 4px;
    }

    /* Barra de Busca */
    .search-container {
        order: 4; 
        flex: 1 1 100% !important; /* Ocupa a largura toda na linha de baixo */
        max-width: none !important;
        margin: 5px 0 !important;
        height: 38px !important;
    }

    /* Menu do Usuário (Carrinho) */
    .user-menu {
        order: 3; 
        display: flex !important;
        gap: 12px !important;
        align-items: center !important;
        flex-shrink: 0;
    }

    /* Menu Hamburguer */
    #btn-mobile-menu { 
        display: block !important; 
        order: 1;
        font-size: 1.3rem;
    }

    .cart-container { order: 2; }
    .user-avatar-container { display: none !important; }
    .cart-icon { font-size: 1.3rem !important; }
    
    /* Vitrine Mobile - 2 Colunas */
    .products-grid { 
        grid-template-columns: repeat(2, 1fr) !important; 
        gap: 10px !important; 
    }

    .footer-grid { 
        grid-template-columns: 1fr 1fr; 
        text-align: left; 
        gap: 20px;
        padding: 0 15px;
    }

    .footer-col h4 { font-size: 0.75rem; }
    .footer-col ul li a { font-size: 0.7rem; }

    .social-icons { justify-content: flex-start; }
    .payment-icons { justify-content: flex-start; font-size: 1.5rem; }

    #prev-banner, #next-banner { display: none !important; }
}

@media (max-width: 480px) {
    .wa-tooltip { display: none !important; }
    .search-btn { padding: 0 12px; }
    .footer-grid { gap: 15px; }
    .footer-col h4 { font-size: 0.7rem; }
}

/* Reforço para evitar o efeito escadinha */
.main-footer .footer-grid {
    display: grid !important; 
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)) !important;
    align-items: start;
}

/* No Mobile, para não ficar apertado, manter 2 colunas */
@media (max-width: 768px) {
    .main-footer .footer-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 20px !important;
    }
}