/* ===== RESET / GLOBAL ===== */
body {
    background-color: #f5f5f5; /* fundo neutro, sem imagem */
    font-family: "Inter", sans-serif;
    margin: 0;
    padding: 0;
}

/* ===== TOP BAR (pesquisa) ===== */
.div_menu_search {
    position: relative;
    width: 100%;
    padding: 1rem;
    background-color: white;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
    z-index: 10;
}

/* Botão hambúrguer (mobile) */
.div_btn_categoria_mobile {
    display: none; /* só aparece no mobile via media query */
    background-color: white;
    border-radius: 0.5rem;
    padding: 1rem;
    border: 2px solid #f08080;
    cursor: pointer;
    margin-right: 1rem;
    transition: 0.2s;
}
.div_btn_categoria_mobile i {
    font-size: 1.5rem;
    color: #f08080;
}
.div_btn_categoria_mobile:hover {
    background-color: #ffe0e0;
}

.div_search_bar {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
}
.search_bar {
    width: 100%;
    padding: 0.9rem 1rem;
    background-color: #f0f0f0;
    border: none;
    border-radius: 2rem;
    font-size: 1rem;
    font-family: "Inter", sans-serif;
    transition: all 0.2s;
}
.search_bar:focus {
    background-color: #e4e4e4;
    outline: none;
}
.search_button {
    position: absolute;
    right: 0.8rem;
    background: transparent;
    border: none;
    cursor: pointer;
}
.search_button i {
    font-size: 1.3rem;
    color: #888;
}

/* ===== LAYOUT PRINCIPAL (grid) ===== */
.main-layout {
    max-width: 1600px;
    margin: 2rem auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 2rem;
}

/* Sidebar de categorias (DESKTOP) */
.categories-desktop {
    background: white;
    border-radius: 1rem;
    padding: 1.5rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    align-self: start;
    position: sticky;
    top: 2rem;
}
.categories-desktop .gray_sub_title {
    font-size: 1.4rem;
    font-weight: 500;
    margin-top: 0;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #eee;
}

/* Árvore de categorias – estilos comuns (desktop e mobile) */
.category-tree {
    list-style: none;
    padding-left: 0;
    margin: 0;
}
.cat-parent {
    margin-top: 0.8rem;
    list-style: none;
}
.cat-parent-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #1e1e1e;
    display: block;
    padding: 0.3rem 0;
    letter-spacing: -0.2px;
    /* não é clicável */
}
.cat-parent .category-tree {
    padding-left: 1.2rem;
    margin-top: 0.2rem;
}
.cat-child {
    list-style: none;
    margin: 0.2rem 0;
    padding: 0.3rem 0.5rem;
    font-size: 0.9rem;
    color: #2c2c2c;
    cursor: pointer;
    border-radius: 0.5rem;
    transition: color 0.2s, background 0.2s;
}
.cat-child:hover {
    color: #666;
    background: #f9f9f9;
}
.cat-child span {
    display: block;
}

/* Área dos produtos */
.products-area {
    min-width: 0; /* evita overflow */
}
.section_list_produtos {
    background-color: #fafafa; /* fundo claro para contraste */
    border-radius: 1rem;
    padding: 1rem;
}
.div_list_produtos {
    display: flex;
    flex-flow: row wrap;
    gap: 1.5rem;
    justify-content: flex-start;
    padding: 1rem;
    background: #fafafa;
}
.container_item_produto {
    width: calc(25% - 1.5rem);
    background: white;
    border-radius: 1rem;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: box-shadow 0.2s ease;
    cursor: pointer;
    text-decoration: none;
    border: 1px solid #eaeaea;
}
.container_item_produto:hover {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}
.img_item_produto {
    width: 100%;
    aspect-ratio: 1 / 1;
    background-size: cover;
    background-position: center;
    background-color: #fff;
}
.p_item_produto {
    font-size: 0.9rem;
    text-align: center;
    padding: 0.8rem;
    margin: 0;
    color: #222;
    font-weight: 500;
    letter-spacing: normal;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.container_item_produto i {
    position: absolute;
    top: 0.8rem;
    right: 0.8rem;
    color: #f08080;
    opacity: 0;
    transition: opacity 0.2s;
}
.container_item_produto:hover i {
    opacity: 1;
}

/* Paginação */
.pagination_container {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
}
.pagination a, .pagination_current, .pagination_arrow {
    width: 2.2rem;
    height: 2.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0 0.2rem;
    border-radius: 50%;
    font-size: 1rem;
    text-decoration: none;
    background: #eee;
    color: #333;
}
.pagination_current {
    background: #aaa;
    color: white;
}
.pagination a:hover {
    background: #ddd;
}
.pagination_arrow.disabled {
    opacity: 0.4;
    pointer-events: none;
}

.section_title {
    text-align: center;
    font-weight: 400;
    margin: 2rem 0 1rem;
}

/* ===== SIDE-NAV (MOBILE ONLY) ===== */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    opacity: 0;
    visibility: hidden;
    transition: 0.2s;
    z-index: 1000;
}
.overlay.active {
    opacity: 1;
    visibility: visible;
}
.side-nav {
    position: fixed;
    top: 0;
    left: -320px;
    width: 280px;
    height: 100%;
    background: white;
    z-index: 1001;
    padding: 1.5rem;
    overflow-y: auto;
    transition: left 0.25s ease;
    box-shadow: 2px 0 8px rgba(0,0,0,0.1);
}
.side-nav.active {
    left: 0;
}
.side-nav img {
    width: 80%;
    margin-bottom: 1rem;
}
.close-icon {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.8rem;
    cursor: pointer;
    color: #999;
}
.side-nav .gray_sub_title {
    margin-top: 2rem;
    font-size: 1.3rem;
}
.side-nav .category-tree {
    margin-top: 1rem;
}
.side-nav .cat-parent-name {
    font-size: 1rem;
}
.side-nav .cat-child {
    font-size: 0.85rem;
}

/* ===== RESPONSIVIDADE ===== */
@media (max-width: 1024px) {
    .main-layout {
        grid-template-columns: 240px 1fr;
        gap: 1.2rem;
        padding: 0 1rem;
    }
    .container_item_produto {
        width: calc(33.33% - 1rem);
    }
}
@media (max-width: 768px) {
    .div_btn_categoria_mobile {
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .categories-desktop {
        display: none; /* esconde sidebar fixa no mobile */
    }
    .main-layout {
        display: block;
        margin: 1rem;
        padding: 0;
    }
    .div_list_produtos {
        justify-content: center;
    }
    .container_item_produto {
        width: calc(50% - 1rem);
    }
    .div_menu_search {
        top: auto;
        position: sticky;
    }
    .pagination a, .pagination_current, .pagination_arrow {
        width: 2rem;
        height: 2rem;
        font-size: 0.9rem;
    }
}