/* /css/style.css (VERSÃO COMPLETA E FINAL COM CORREÇÃO DO MEGA MENU) */

/* ------------------- */
/* RESET E BOX-SIZING */
/* ------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* ------------------- */
/* TEMA DE CORES */
/* ------------------- */
:root {
    --cor-primaria: #0a2342;
    --cor-secundaria: #ffffff;
    --cor-fundo: #f4f7f6;
    --cor-destaque: #ff6b35;
    --cor-borda: #dddddd;
}

/* ------------------- */
/* ESTILOS GERAIS */
/* ------------------- */
body {
    font-family: 'Roboto', sans-serif;
    margin: 0;
    background-color: var(--cor-fundo);
    color: #333;
}
a { color: var(--cor-destaque); text-decoration: none; }
a:hover { text-decoration: underline; }
main { max-width: 1200px; margin: 20px auto; padding: 0 20px; }
h1, h2 { color: var(--cor-primaria); }

/* ------------------- */
/* HEADER */
/* ------------------- */
header {
    background-color: #ffffff;
    padding: 15px 30px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: relative;
    z-index: 100;
}
.header-top { display: flex; justify-content: space-between; align-items: center; width: 100%; gap: 20px; }
header .logo img { max-height: 80px; display: block; }
header .search-bar { flex-grow: 1; }
header .search-bar form { display: flex; max-width: 500px; margin: 0 auto; }
header .search-bar input[type="search"] { padding: 10px; border: 1px solid #DCDADA; border-radius: 5px 0 0 5px; width: 100%; }
header .search-bar button { padding: 10px 15px; border: none; background-color: var(--cor-destaque); color: var(--cor-secundaria); cursor: pointer; border-radius: 0 5px 5px 0; }

/* ------------------- */
/* MENU DE NAVEGAÇÃO PRINCIPAL (COM A CORREÇÃO) */
/* ------------------- */
.main-navigation {
    background-color: #fff;
    border-bottom: 1px solid var(--cor-borda);
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    position: relative; /* ADICIONADO: Este elemento agora é a referência de posicionamento do menu */
}
.nav-container { max-width: 1200px; margin: 0 auto; }
.desktop-nav { list-style: none; margin: 0; padding: 0; display: flex; justify-content: center; }
.desktop-nav > li > a { display: block; padding: 15px 20px; color: var(--cor-primaria); font-weight: bold; text-transform: uppercase; text-decoration: none; font-size: 0.9rem; }
.desktop-nav > li:hover > a { color: var(--cor-destaque); }

/* --- MEGA MENU --- */
.megamenu-panel {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: #fff;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    z-index: 1000;
    border-top: 3px solid var(--cor-destaque);
    padding: 30px 20px;
}
.megamenu-trigger:hover .megamenu-panel { display: block; }
.megamenu-content { max-width: 1200px; margin: 0 auto; display: flex; gap: 30px; }
.megamenu-column { flex: 1; }
.megamenu-column .column-title { font-size: 1.1rem; font-weight: bold; color: var(--cor-primaria); padding-bottom: 10px; margin-bottom: 10px; border-bottom: 2px solid var(--cor-borda); display: block; }
.megamenu-column > ul { list-style: none; padding: 0; margin: 0; }
.megamenu-column > ul > li > a { display: block; padding: 10px 0; color: #333; font-weight: bold; }
.megamenu-column > ul > li > a:hover { color: var(--cor-destaque); }
.submenu-level3 { list-style: none; padding-left: 15px !important; }
.submenu-level3 li a { font-weight: normal; font-size: 0.9rem; color: #555; padding: 6px 0; }

/* ------------------- */
/* MENU HAMBÚRGUER E MOBILE NAV */
/* ------------------- */
.hamburger-menu {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 210;
}
.hamburger-menu span {
    width: 100%;
    height: 3px;
    background-color: var(--cor-primaria);
    border-radius: 5px;
}
.mobile-nav {
    position: fixed;
    top: 0;
    left: 0;
    width: 80%;
    max-width: 300px;
    height: 100%;
    background-color: var(--cor-primaria);
    box-shadow: 2px 0 10px rgba(0,0,0,0.3);
    transform: translateX(-100%);
    transition: transform 0.3s ease-in-out;
    z-index: 200;
    padding: 80px 20px 20px 20px;
    overflow-y: auto;
}
.mobile-nav.is-active {
    transform: translateX(0);
}
.mobile-nav ul {
    list-style: none;
    padding: 0;
}
.mobile-nav ul li a {
    color: white;
    display: block;
    padding: 15px 0;
    font-size: 1.1rem;
    border-bottom: 1px solid #3a506b;
    text-decoration: none;
}
.mobile-nav ul li a:hover {
    color: var(--cor-destaque);
}
.mobile-nav .menu-divider {
    padding: 20px 0 10px;
    color: var(--cor-destaque);
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.9rem;
    border-bottom: 1px solid #3a506b;
}
/* ------------------- */
/* GRADE DE PRODUTOS */
/* ------------------- */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 25px; }
.product-card { background-color: #fff; border: 1px solid var(--cor-borda); border-radius: 8px; padding: 15px; text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,0.05); transition: transform 0.2s, box-shadow 0.2s; }
.product-card:hover { transform: translateY(-5px); box-shadow: 0 4px 10px rgba(0,0,0,0.1); }
.product-card a { text-decoration: none; color: inherit; }
.product-card img { max-width: 100%; height: 180px; object-fit: contain; margin-bottom: 15px; }
.product-card h3 { font-size: 1rem; height: 3.2em; overflow: hidden; margin: 0 0 10px 0; }
.product-card .price { font-size: 1.2rem; font-weight: bold; color: var(--cor-primaria); margin-bottom: 15px; }
.product-card .product-buttons { display: flex; justify-content: space-between; gap: 10px; }
.product-card .buy-button, .product-card .details-button { flex: 1; padding: 8px 10px; font-size: 0.9rem; border-radius: 5px; font-weight: bold; }
.product-card .buy-button { background-color: var(--cor-destaque); color: white; }
.product-card .details-button { background-color: #fff; color: var(--cor-destaque); border: 1px solid var(--cor-destaque); }

/* ------------------- */
/* PÁGINA DE DETALHES DO PRODUTO */
/* ------------------- */
.product-detail-layout { display: flex; gap: 40px; background-color: #fff; padding: 30px; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.product-image-column { flex: 1; text-align: center; }
.product-image-column img { max-width: 100%; max-height: 400px; object-fit: contain; }
.product-info-column { flex: 1.5; }
.product-info-column h1 { margin-top: 0; font-size: 2.2rem; }
.detail-price { font-size: 2.5rem; font-weight: bold; color: var(--cor-primaria); margin: 20px 0; }
.detail-buy-button { display: block; width: 100%; background-color: var(--cor-destaque); color: white; text-align: center; padding: 20px; font-size: 1.5rem; font-weight: bold; border-radius: 8px; text-decoration: none; margin-bottom: 30px; transition: background-color 0.2s; }
.detail-buy-button:hover { background-color: #e65c2e; text-decoration: none; }
.detail-description p { line-height: 1.6; color: #555; }
.related-products { margin-top: 50px; border-top: 1px solid var(--cor-borda); padding-top: 30px; }

/* ------------------- */
/* PÁGINA DE CATEGORIA */
/* ------------------- */
.subcategory-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; margin-top: 20px; }
.subcategory-card { display: block; padding: 25px; background-color: #fff; border: 1px solid var(--cor-borda); border-radius: 8px; text-align: center; font-size: 1.1rem; font-weight: bold; color: var(--cor-primaria); text-decoration: none; transition: all 0.2s; }
.subcategory-card:hover { background-color: var(--cor-primaria); color: white; transform: translateY(-3px); box-shadow: 0 4px 10px rgba(0,0,0,0.1); text-decoration: none; }

/* ------------------- */
/* PAGINAÇÃO */
/* ------------------- */
.pagination { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 60px; padding: 20px 0; }
.pagination a { color: var(--cor-primaria); background-color: #ffffff; padding: 12px 18px; border: 1px solid var(--cor-borda); border-radius: 8px; text-decoration: none; font-weight: bold; font-size: 1rem; transition: all 0.2s ease-in-out; box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.pagination a:hover { background-color: var(--cor-fundo); border-color: #bbb; transform: translateY(-2px); box-shadow: 0 4px 8px rgba(0,0,0,0.1); text-decoration: none; }
.pagination a.active { background-color: var(--cor-primaria); color: white; border-color: var(--cor-primaria); cursor: default; transform: none; box-shadow: none; }

/* ------------------- */
/* BANNERS E FOOTER */
/* ------------------- */
.banner-space { background-color: #e0e0e0; display: flex; align-items: center; justify-content: center; margin: 30px 0; min-height: 150px; border-radius: 8px; font-size: 1.5rem; color: #999; }
footer { background-color: var(--cor-primaria); color: var(--cor-secundaria); text-align: center; padding: 20px; margin-top: 40px; }

/* ------------------- */
/* RESPONSIVIDADE (MOBILE) */
/* ------------------- */
@media (max-width: 992px) {
    header { padding: 15px; }
    .header-top { flex-wrap: wrap; }
    .logo { flex-grow: 1; }
    .search-bar { order: 3; width: 100%; margin-top: 15px; }
    header .search-bar input[type="search"] { min-width: 0; width: 100%; }
    .hamburger-menu { display: flex; }
    .main-navigation { display: none; }
    main { margin-top: 15px; padding: 0 15px; }
    .product-detail-layout { flex-direction: column; }
    .product-info-column h1 { font-size: 1.8rem; }
    .detail-price { font-size: 2rem; }
}