:root {
    --primary: #000000;
    --accent: #FFD700;
    --highlight: #FE2C55;
    --bg: #F9FAFB;
    --white: #FFFFFF;
    --text: #333;
    --border: #E5E7EB;
    
    /* CORES DAS LOJAS */
    --shopee: #ee4d2d;
    --magalu: #0086ff;
    --tiktok: #000000;
    --amazon: #ff9900;
    --shein: #000000;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body { 
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', sans-serif; 
    background-color: var(--bg); 
    margin: 0; 
    /* Aumentei para 90px para compensar a barra dupla (Créditos + Zap) */
    padding-bottom: 90px;
    color: var(--text);
    line-height: 1.6;
}

/* ============================================
   HEADER AJUSTADO (CENTRALIZADO + MÓBILE SEGURO)
   ============================================ */

header { 
    background: var(--primary); 
    position: sticky; 
    top: 0; 
    z-index: 200; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    
    /* FLEXBOX para centralizar o "envelope" na tela */
    display: flex; 
    justify-content: center; 
    align-items: center;
    
    /* AJUSTE MOBILE: Altura mínima maior e padding para não cortar texto */
    min-height: 80px; 
    padding: 10px 0; 
}

/* NOVO: Envelope que segura o conteúdo no meio */
.header-content-wrapper {
    width: 100%;
    max-width: 1100px; /* Limita a largura no PC para não espalhar demais */
    display: flex;
    align-items: center;
    justify-content: space-between; /* Logo na ponta, Busca na outra */
    gap: 30px;
    padding: 0 20px; /* Margem lateral interna */
}

.header-top { 
    display: flex; 
    flex-direction: column; 
    align-items: flex-start; 
    justify-content: center;
    flex-shrink: 0; /* Impede que o logo seja esmagado */
}

.brand-name { 
    font-size: 1.1rem; 
    font-weight: 800; 
    margin: 0 0 2px 0; 
    color: var(--white); 
    text-transform: uppercase; 
    letter-spacing: 1px; 
    line-height: 1.2; /* Aumentado para evitar corte */
}

.disclaimer-text { 
    font-size: 0.55rem; 
    color: #bbb; 
    margin: 0; 
    text-align: left; 
    font-weight: 400;
    line-height: 1.1;
    max-width: 160px; 
}

/* BARRA DE BUSCA */
.search-container { 
    position: relative; 
    
    /* AJUSTE DESKTOP: Ocupa 60% do espaço disponível */
    width: 60%; 
    max-width: 600px; /* Mas não passa de 600px para não ficar gigante */
}

.search-input { 
    width: 100%; 
    padding: 10px 20px 10px 40px; /* Mais gordinho e confortável */
    border-radius: 30px; /* Mais arredondado */
    border: none; 
    background-color: #f5f5f5; 
    outline: none; 
    transition: all 0.3s;
    font-size: 0.9rem; 
    height: 40px; /* Altura fixa melhor */
}

.search-input:focus { 
    background: white;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.2);
}

.search-icon { 
    position: absolute; 
    left: 14px; 
    top: 50%; 
    transform: translateY(-50%); 
    opacity: 0.6;
    font-size: 1rem;
    color: #333;
}

/* ============================================
   SECTIONS / BLOCOS
   ============================================ */

.section-block { 
    background: var(--white); 
    margin: 20px auto; 
    padding: 25px 15px; 
    max-width: 1400px; 
    border-radius: 16px; 
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    width: 100%; 
}

/* Garante que a vitrine empurre o footer para baixo */
#secao-vitrine {
    flex-grow: 1;
}

@media (min-width: 768px) { 
    .section-block { 
        padding: 40px 35px; 
        margin: 35px auto;
    } 
}

.section-title { 
    font-size: 1.2rem; 
    font-weight: 800; 
    color: #1a1a1a; 
    margin: 0 0 20px 0; 
    padding-left: 0;
    text-transform: uppercase; 
    letter-spacing: 0.5px;
}

.section-banner-img { 
    width: 100%; 
    height: auto; 
    max-height: 120px; 
    object-fit: contain; 
    margin-bottom: 25px; 
    border-radius: 12px;
}

/* Banner de Categoria Selecionada */
.category-banner {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 30px 20px;
    text-align: center;
    border-radius: 16px;
    margin-bottom: 25px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.category-banner h2 {
    font-size: 1.8rem;
    font-weight: 900;
    color: white;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

@media (max-width: 768px) {
    .category-banner h2 { font-size: 1.4rem; }
}

/* ============================================
   CARROSSEL (Estilo Shopee)
   ============================================ */

#secao-destaque-topo { 
    margin: 15px auto 25px; 
    max-width: 1400px;
    padding: 0 15px;
    width: 100%;
}

.carousel-shopee-style {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 15px;
    min-height: 300px;
}

@media (max-width: 1024px) {
    .carousel-shopee-style {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto;
    }
}

.main-carousel {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    min-height: 200px;
}

.side-banners {
    display: grid;
    grid-template-rows: 1fr 1fr;
    gap: 15px;
}

@media (max-width: 1024px) {
    .side-banners { 
        grid-template-rows: none;
        grid-template-columns: 1fr 1fr;
    }
}

.side-banner {
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    min-height: 100px;
    position: relative;
}

.side-banner:hover {
    transform: scale(1.02);
}

.side-banner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: absolute;
    top: 0;
    left: 0;
}

.slider-wrapper { 
    width: 100%; 
    height: 100%;
    display: flex; 
    overflow-x: auto; 
    scroll-snap-type: x mandatory; 
    scrollbar-width: none; 
}

.slider-wrapper::-webkit-scrollbar { display: none; }

.slider-track { 
    display: flex; 
    width: 100%; 
    height: 100%;
}

.slide { 
    min-width: 100%; 
    scroll-snap-align: start; 
    display: flex;
    height: 100%;
}

.slide img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
}

/* ============================================
   CATEGORIAS (Ajustado)
   ============================================ */

.categories-container { 
    padding: 10px 0; 
    display: flex; 
    gap: 15px; 
    overflow-x: auto; 
    justify-content: flex-start;
    scrollbar-width: thin;
    padding-bottom: 15px; 
}

@media (min-width: 768px) {
    .categories-container {
        justify-content: center;
        flex-wrap: wrap;
    }
}

.categories-container::-webkit-scrollbar { 
    height: 4px; 
}

.categories-container::-webkit-scrollbar-thumb { 
    background: #ddd; 
    border-radius: 3px; 
}

.cat-item { 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    width: 90px; 
    min-width: 90px;
    cursor: pointer; 
    opacity: 0.85; 
    transition: all 0.3s;
}

.cat-item:hover, .cat-item.active { 
    opacity: 1; 
    transform: translateY(-3px);
}

.cat-item.active .cat-img { 
    border-color: var(--primary); 
    border-width: 3px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.cat-img { 
    width: 80px; 
    height: 80px; 
    border-radius: 50%; 
    object-fit: cover; 
    border: 2px solid var(--border); 
    margin-bottom: 8px; 
    background-color: #fff; 
    padding: 3px;
    transition: all 0.3s;
}

.cat-name { 
    font-size: 0.75rem; 
    font-weight: 600; 
    color: #555; 
    text-align: center;
    width: 100%;
    line-height: 1.2;
    word-wrap: break-word; 
    white-space: normal;
}

/* ============================================
   MAIS VENDIDOS
   ============================================ */

.best-sellers-window { 
    width: 100%; 
    overflow-x: auto; 
    padding: 10px 0 20px;
    scrollbar-width: thin;
}

.best-sellers-window::-webkit-scrollbar { 
    height: 6px; 
}

.best-sellers-window::-webkit-scrollbar-thumb { 
    background: #ddd; 
    border-radius: 4px; 
}

.best-sellers-track { 
    display: inline-flex; 
    gap: 15px; 
    padding: 5px;
}

/* ============================================
   GRIDS
   ============================================ */

.products-grid { 
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    justify-items: center;
}

@media (min-width: 640px) {
    .products-grid { 
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}

@media (min-width: 1024px) {
    .products-grid { 
        grid-template-columns: repeat(4, 1fr);
        gap: 25px;
    }
}

@media (min-width: 1280px) {
    .products-grid { 
        grid-template-columns: repeat(5, 1fr);
    }
}

.offers-grid { 
    display: grid; 
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    max-height: none;
}

@media (min-width: 640px) {
    .offers-grid { 
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .offers-grid { 
        grid-template-columns: repeat(4, 1fr);
        gap: 25px;
    }
}

@media (min-width: 1280px) {
    .offers-grid { 
        grid-template-columns: repeat(5, 1fr);
    }
}

.offers-grid .card:nth-child(n+16) {
    display: none;
}

/* ============================================
   CARDS
   ============================================ */

.card {
    background: white; 
    border: 1px solid var(--border);
    border-radius: 12px; 
    overflow: hidden; 
    display: flex; 
    flex-direction: column;
    cursor: pointer; 
    transition: all 0.3s;
    box-shadow: 0 2px 6px rgba(0,0,0,0.04);
    height: 100%; 
    width: 100%; 
}

.card:hover { 
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
    border-color: #ccc;
}

.card-shopee:hover { border-color: var(--shopee); }
.card-magalu:hover { border-color: var(--magalu); }
.card-tiktok:hover { border-color: var(--tiktok); }
.card-amazon:hover { border-color: var(--amazon); }
.card-shein:hover { border-color: var(--shein); }

.card-img-container { 
    position: relative; 
    padding-top: 100%;
    background: #fafafa;
}

.card-img { 
    position: absolute; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%; 
    object-fit: cover;
    transition: transform 0.3s;
}

.card:hover .card-img {
    transform: scale(1.05);
}

.card-body { 
    padding: 12px; 
    display: flex; 
    flex-direction: column; 
    flex-grow: 1;
    min-height: 130px; 
}

.card-title { 
    font-size: 0.85rem; 
    margin: 0 0 6px 0; 
    color: #1a1a1a; 
    line-height: 1.3; 
    font-weight: 700; 
    display: -webkit-box; 
    -webkit-line-clamp: 2; 
    -webkit-box-orient: vertical; 
    overflow: hidden;
    min-height: 2.6em; 
}

.card-desc { 
    font-size: 0.7rem; 
    color: #666; 
    margin-bottom: 8px; 
    line-height: 1.4; 
    display: -webkit-box; 
    -webkit-line-clamp: 2; 
    -webkit-box-orient: vertical; 
    overflow: hidden;
    flex-grow: 1;
}

.price-row { 
    display: flex; 
    flex-direction: column;
    gap: 2px;
    margin-top: auto;
    padding-top: 8px;
    border-top: 1px solid #f0f0f0;
}

.old-price { 
    font-size: 0.7rem; 
    text-decoration: line-through; 
    color: #999; 
}

.new-price { 
    font-size: 1rem; 
    font-weight: 900; 
    color: var(--highlight);
}

.store-footer {
    padding: 8px 10px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-shopee .store-footer { background: var(--shopee); color: white; }
.card-magalu .store-footer { background: var(--magalu); color: white; }
.card-tiktok .store-footer { background: var(--tiktok); color: white; }
.card-amazon .store-footer { background: var(--amazon); color: #000; }
.card-shein .store-footer { background: var(--shein); color: white; }

/* Cards Mais Vendidos - Menores */
.best-sellers-track .card {
    width: 160px;
    flex-shrink: 0;
}

/* ============================================
   BOTAO VER MAIS
   ============================================ */

.btn-load-more { 
    display: block; 
    margin: 30px auto 0; 
    padding: 12px 35px; 
    background: white; 
    border: 2px solid var(--primary); 
    color: var(--primary); 
    font-weight: 700; 
    border-radius: 30px; 
    cursor: pointer; 
    transition: all 0.3s;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-load-more:hover { 
    background: var(--primary); 
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* ============================================
   FOOTER DUAS PARTES (FIXO + SCROLL)
   ============================================ */

/* Container Principal */
#mainFooter {
    width: 100%;
    z-index: 999;
    /* Começa sem posição definida, o JS controla */
}

/* --- PARTE 1: BARRA FIXA (ESTILO TEMA CLARO) --- */
.footer-bar {
    position: fixed; /* Fixo por padrão */
    bottom: 0;
    left: 0;
    width: 100%;
    
    /* Configuração Tema Claro */
    background-color: #ffffff; 
    color: #333333;
    border-top: 1px solid #e5e5e5;
    
    padding: 10px 20px;
    box-shadow: 0 -4px 10px rgba(0,0,0,0.05); /* Sombra mais leve */
    z-index: 1000;
    transition: transform 0.3s ease;
}

.footer-bar-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    /* ALTERAÇÃO: Stack Vertical (Coluna) para por WhatsApp embaixo */
    flex-direction: column; 
    align-items: center;
    justify-content: center; 
    gap: 5px; 
}

.footer-bar-logo {
    height: 40px; 
    width: auto;
    object-fit: contain;
}

.footer-bar-text p {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0.9;
}

/* --- PARTE 2: DETALHES (TEMA CLARO/CINZA) --- */
.footer-details {
    background-color: #f8f9fa; /* Fundo cinza bem claro */
    color: #444; /* Fonte cinza escuro */
    padding: 40px 20px 20px;
    width: 100%;
}

.footer-grid {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    text-align: center;
}

.footer-col h4 {
    color: #000; /* Títulos em preto */
    margin-bottom: 15px;
    font-size: 1.1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-contact-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.footer-contact-item a {
    color: #555; /* Links cinza */
    text-decoration: none;
    transition: color 0.2s;
}

.footer-contact-item a:hover {
    color: #000; /* Link hover preto */
}

.social-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: center;
}

.social-links a {
    color: #555;
    text-decoration: none;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: opacity 0.2s;
}

.social-links a:hover {
    opacity: 0.8;
    color: #000;
}

.footer-bottom-msg {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid rgba(0,0,0,0.1); /* Divisória sutil */
    text-align: center;
    font-size: 0.75rem;
    opacity: 0.6;
}

/* --- CLASSE MÁGICA (Controlada pelo JS) --- */
/* Quando essa classe é adicionada ao #mainFooter, a barra deixa de ser fixa */
#mainFooter.docked {
    position: relative; /* Volta ao fluxo normal */
}

#mainFooter.docked .footer-bar {
    position: relative; 
    bottom: auto;
    left: auto;
    box-shadow: none; 
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

/* ============================================
   RESPONSIVO - MOBILE (AJUSTADO)
   ============================================ */

@media (max-width: 639px) {
    .products-grid,
    .offers-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px;
    }
}

@media (max-width: 768px) {
    header {
        min-height: 80px; /* Garante altura suficiente no topo */
    }

    .header-content-wrapper {
        gap: 15px; /* Menos espaço entre logo e busca */
        padding: 0 15px;
    }
    
    .search-container {
        width: auto; /* No mobile, volta ao automático */
        flex-grow: 1; /* Ocupa o resto do espaço */
    }
    
    .brand-name {
        font-size: 0.95rem; /* Levemente menor para caber melhor */
    }
    
    .disclaimer-text {
        font-size: 0.5rem;
        max-width: 130px;
    }
    
    .search-input {
        padding-left: 35px;
        font-size: 0.85rem;
    }
}

/* ============================================
   AJUSTE RODAPÉ (LOGO + 2 LINHAS)
   ============================================ */

.dev-credits-wrapper {
    display: flex;
    align-items: center; /* Centraliza verticalmente a logo com o bloco de texto */
    justify-content: center;
    gap: 12px; /* Espaço entre a logo e o texto */
}

.dev-logo-large {
    height: 38px; /* Altura suficiente para cobrir as duas linhas */
    width: auto;
    opacity: 0.9;
}

.dev-text-column {
    display: flex;
    flex-direction: column; /* Empilha os textos um sobre o outro */
    align-items: flex-start; /* Alinha o texto à esquerda (perto da logo) */
    justify-content: center;
}

.whatsapp-footer-link {
    display: flex; 
    align-items: center; 
    color: #25D366; 
    text-decoration: none; 
    font-weight: 700; 
    font-size: 0.85rem; 
    margin-top: 2px;
}

/* Ajuste fino para o texto de copyright caber melhor em telas minúsculas */
#footerCopyright {
    font-size: 0.8rem !important;
}