/* ============================================================
   VARIÁVEIS E BASE
   ============================================================ */
:root {
    --primary: #27ae60;
    --dark: #0f172a;
    --text: #475569;
    --light: #f8fafc;
    --white: #ffffff;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Plus Jakarta Sans', sans-serif; }
body { background: var(--white); color: var(--text); overflow-x: hidden; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 25px; }

/* NAVBAR */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    height: 80px;
    position: sticky;
    top: 0; z-index: 1100;
    display: flex; align-items: center;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}
.nav-wrapper { display: flex; justify-content: space-between; align-items: center; width: 100%; }
.logo img { height: 50px; }
.nav-links { display: flex; list-style: none; gap: 30px; }
.nav-links a { text-decoration: none; color: var(--dark); font-weight: 700; transition: var(--transition); font-size: 0.9rem; }
.nav-links a.active { color: var(--primary); }

.header-right { display: flex; align-items: center; gap: 10px; }

.btn-primary-mini { 
    background: var(--primary); color: white; border: none; padding: 8px 18px; 
    border-radius: 10px; font-weight: 800; cursor: pointer; display: flex; 
    align-items: center; gap: 5px; z-index: 1200;
}

/* BOTÃO MOBILE */
.btn-mobile { display: none; background: none; border: none; cursor: pointer; padding: 10px; z-index: 1300; width: 40px; height: 40px; }
#hamburger { display: block; width: 25px; height: 2px; background: var(--dark); position: relative; transition: 0.3s; }
#hamburger::after, #hamburger::before { content: ''; display: block; width: 25px; height: 2px; background: var(--dark); position: absolute; transition: 0.3s; }
#hamburger::before { top: -8px; } 
#hamburger::after { bottom: -8px; }

/* LAYOUT CATALOGO DESKTOP */
.catalogo-layout { display: flex; gap: 40px; margin-top: 40px; }


/* Localize e substitua estes blocos no seu CSS */

.sidebar { 
    width: 240px; 
    flex-shrink: 0; 
}

.sidebar-sticky { 
    position: sticky; 
    top: 110px; 
    display: flex; /* Adicionado */
    flex-direction: column; /* Adicionado */
}

/* O segredo está aqui: Garantir que ele seja um bloco abaixo da lista */
/* No seu arquivo CSS, remova as repetições e deixe apenas este: */
#sub-filtros-container {
    display: none; 
    flex-wrap: wrap;
    gap: 8px;
    margin: 10px 0; /* Espaçamento entre o botão pai e os próximos */
    padding: 15px;
    background: #f1f5f9; /* Um cinza bem clarinho para destacar que é sub-menu */
    border-radius: 12px;
    width: 100%;
    order: 0; /* Garante que respeite a posição do JS */
}

/* Garante que o container ocupe a linha toda mesmo sendo flex */
a {
    display: flex;
    flex-direction: column;
}

/* Ajuste das Pills para não ficarem gigantes */
.sub-filter-pills {
    background: #f1f2f6; 
    border: 1px solid #dfe6e9;
    padding: 6px 12px; 
    border-radius: 20px;
    font-size: 0.7rem; /* Diminuído um pouco */
    font-weight: 700; 
    cursor: pointer;
    color: var(--text); 
    transition: 0.2s;
    white-space: nowrap; /* Evita que o texto quebre linha dentro da pill */
}



.sidebar-title { font-size: 1.1rem; font-weight: 800; color: var(--dark); margin-bottom: 20px; }

.filter-btn { 
    background: transparent; border: 1px solid transparent; text-align: left;
    padding: 12px 16px; border-radius: 12px; cursor: pointer;
    font-weight: 700; color: var(--text); transition: var(--transition); width: 100%;
}
.filter-btn:hover { background: var(--light); color: var(--primary); }
.filter-btn.active { background: var(--primary); color: white; }

/* SUB-FILTROS (PILLS) - CORREÇÃO PC */
/* No seu arquivo CSS, localize ou adicione: */
#sub-filtros-container {
    display: none; /* Começa escondido, JS ativa */
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
    width: 100%;
}

/* No mobile ele some para não bugar o grid lateral */
@media (max-width: 1024px) {
    #sub-filtros-container {
        display: none !important;
    }
}

.sub-filter-pills {
    background: #f1f2f6; border: 1px solid #dfe6e9;
    padding: 6px 12px; border-radius: 20px;
    font-size: 0.75rem; font-weight: 700; cursor: pointer;
    color: var(--text); transition: 0.2s;
}
.sub-filter-pills:hover { background: #dfe6e9; }
.sub-filter-pills.active { background: var(--dark); color: white; border-color: var(--dark); }

/* GRID DE PRODUTOS */
.promo-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; flex-grow: 1; }
.promo-card { background: white; border-radius: 18px; border: 1px solid #eee; display: flex; flex-direction: column; transition: var(--transition); height: 100%; overflow: hidden; }
.promo-img { height: 180px; background-size: contain; background-repeat: no-repeat; background-position: center; margin: 15px; }
.p-content { padding: 15px; flex-grow: 1; display: flex; flex-direction: column; }
.p-content h3 { font-size: 0.95rem; font-weight: 800; color: var(--dark); margin-bottom: 12px; min-height: 2.5em; line-height: 1.3; cursor: pointer; }
.p-desc { font-size: 0.75rem; color: var(--text); margin-bottom: 18px; line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.new-price { font-size: 1.2rem; color: var(--primary); font-weight: 800; margin-bottom: 12px; display: block; }

.p-variations { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.var-pill { background: #f1f2f6; border: 1px solid #dfe6e9; padding: 4px 10px; border-radius: 6px; font-size: 0.7rem; font-weight: 700; cursor: pointer; }
.var-pill.active { background: var(--dark); color: white; }

.qty-control { display: flex; align-items: center; gap: 10px; background: var(--light); border-radius: 10px; padding: 5px; margin-bottom: 10px; justify-content: center; }
.qty-control button { border: none; background: white; width: 28px; height: 28px; border-radius: 6px; cursor: pointer; font-weight: 800; }
.qty-control input { width: 35px; text-align: center; border: none; background: transparent; font-weight: 700; }
.btn-add { background: var(--dark); color: white; border: none; padding: 12px; border-radius: 12px; font-weight: 700; cursor: pointer; }

/* BOTÃO VOLTAR MOBILE */
.btn-voltar { background: var(--dark) !important; color: white !important; font-size: 0.7rem; font-weight: 800; margin-bottom: 10px; }

/* ============================================================
   RESPONSIVO MOBILE
   ============================================================ */
@media (max-width: 1024px) {
    #mobile-menu { display: none; position: absolute; top: 80px; left: 0; width: 100%; background: white; padding: 20px; box-shadow: 0 10px 15px rgba(0,0,0,0.1); z-index: 1100; }
    #mobile-menu.active { display: block; }
    .nav-links { flex-direction: column; gap: 15px; }
    .btn-mobile { display: flex !important; align-items: center; justify-content: center; }
    
    .catalogo-layout { display: flex; flex-direction: row; gap: 12px; margin-top: 15px; }
    .sidebar { width: 85px; flex-shrink: 0; position: sticky; top: 90px; }
    .sidebar-title { display: none; }
    .filter-btn { padding: 10px 5px; font-size: 0.65rem; text-align: center; background: var(--light); min-height: 55px; display: flex; align-items: center; justify-content: center; border-radius: 8px; border: 1px solid #eee; }

    .promo-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
    .promo-card { border-radius: 10px; }
    .promo-img { height: 100px; margin: 8px; }
    .p-content { padding: 8px; }
    .p-content h3 { font-size: 0.75rem; margin-bottom: 6px; min-height: 2.8em; }
    .p-desc, .p-variations { display: none; } 
    .new-price { font-size: 0.9rem; margin-bottom: 6px; }
    .qty-control { scale: 0.85; margin-bottom: 5px; }
    .btn-add { padding: 8px 4px; font-size: 0.7rem; border-radius: 8px; }

    /* No Mobile, as subcategorias aparecem dentro do fluxo que o JS cria (limpando a tela) */
    #sub-filtros-container { display: none !important; } 
}

/* CARRINHO */
.cart-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.4); backdrop-filter: blur(4px); visibility: hidden; opacity: 0; z-index: 1500; transition: 0.3s; }
.cart-overlay.active { visibility: visible; opacity: 1; }
.cart-sidebar { position: fixed; right: -100%; top: 0; width: 320px; height: 100%; background: white; z-index: 1600; transition: 0.4s; padding: 20px; display: flex; flex-direction: column; }
.cart-sidebar.active { right: 0; }

.search-container {
    position: relative;
    margin-bottom: 25px;
    width: 100%;
}

#input-busca {
    width: 100%;
    padding: 15px 45px 15px 20px;
    border-radius: 12px;
    border: 1px solid #dfe6e9;
    background: #f8fafc;
    font-size: 1rem;
    outline: none;
    transition: var(--transition);
}

#input-busca:focus {
    border-color: var(--primary);
    background: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

.search-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    pointer-events: none;
}

/* Ajuste Mobile */
@media (max-width: 1024px) {
    #input-busca {
        padding: 12px 40px 12px 15px;
        font-size: 0.9rem;
    }
}