/**
 * Estilos do Header e Menu de Categorias
 *
 * @package Colorindo_Sonhos
 */

/* Reset qualquer limite da página que possa estar afetando o cabeçalho */
body, html {
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

#page {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

/* Estilo do header */
.site-header {
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    background-color: #fff;
    position: relative;
    z-index: 999;
    padding: 15px 0;
    width: 100%;
    box-sizing: border-box;
    overflow: visible;
    margin: 0;
    left: 0;
    right: 0;
}

.header-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    width: 100%;
    box-sizing: border-box;
    padding: 0 35px;
    min-height: 50px;
    overflow: visible;
}

/* Botão de categorias */
.categorias-button {
    flex: 0 0 auto;
    z-index: 5;
}

.categorias-toggle {
    border: none;
    padding: 10px 15px;
    font-weight: bold;
    font-size: 15px;
    cursor: pointer;
    border-radius: 5px;
    display: flex;
    align-items: center;
    margin: 0;
    height: 38px;
    box-sizing: border-box;
}

.custom-button-categoria {
    /* Remover a cor fixa para permitir personalização */
}

.categorias-toggle i {
    margin-right: 8px;
}

.categorias-toggle .categorias-texto {
    display: inline;
}

/* Dropdown de categorias */
.categorias-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #fff;
    min-width: 300px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    display: none;
    border-radius: 5px;
    margin-top: 5px;
    max-height: 80vh;
    overflow-y: auto;
}

.categorias-dropdown.active {
    display: block;
}

/* Barra de busca para categorias */
.categorias-search {
    padding: 15px;
    border-bottom: 1px solid #eee;
}

.categorias-search input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

/* Lista de categorias */
.categorias-list {
    padding: 10px 0;
}

.categoria-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 15px;
    color: #333;
    text-decoration: none;
}

.categoria-nome {
    font-weight: 500;
}

.categoria-count {
    background-color: #47a7d8;
    color: #fff;
    border-radius: 15px;
    padding: 2px 10px;
    font-size: 12px;
    font-weight: bold;
}

/* Botão ver todas categorias */
.ver-todas-categorias {
    display: block;
    text-align: center;
    padding: 15px;
    background-color: #0079b3;
    color: #fff;
    text-decoration: none;
    text-transform: lowercase;
    font-weight: bold;
    font-size: 15px;
    transition: background-color 0.2s;
    margin-top: 10px;
}

.ver-todas-categorias i {
    margin-left: 5px;
}

.ver-todas-categorias:hover {
    background-color: #005d8c;
    color: #fff;
}

/* Logo do site */
.site-branding {
    flex: 1 1 auto;
    text-align: center;
    margin: 0 20px;
    max-width: 50%;
}

.site-branding img {
    max-height: 60px;
    width: auto;
    max-width: 100%;
}

.site-title {
    margin: 0;
    font-size: 28px;
}

.site-title a {
    text-decoration: none;
    color: #ff3a3a;
    font-weight: bold;
}

/* Formulário de busca */
.site-search {
    flex: 0 0 auto;
    z-index: 5;
}

.search-form {
    display: flex;
    align-items: center;
    margin: 0;
}

.search-field {
    border: 1px solid #ddd;
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 14px;
    margin: 0;
    height: 38px;
    box-sizing: border-box;
    width: 180px;
}

.search-submit {
    background-color: #008fd3;
    border: 1px solid #008fd3;
    padding: 8px 12px;
    border-radius: 5px;
    cursor: pointer;
    margin-left: 5px;
    height: 38px;
    width: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
}

.custom-button-search {
    background-color: #008fd3 !important;
    border: 1px solid #008fd3 !important;
}

.search-submit i,
.search-submit i.fas,
.search-submit i.fas.fa-search,
.search-submit .icon-search {
    color: white !important;
    fill: white !important;
}

/* Para garantir que o SVG interno também seja branco */
.search-submit svg,
.search-submit svg path {
    fill: white !important;
    color: white !important;
}

/* Regras específicas para o SVG de menu de categorias */
.icon-bars-svg {
    transition: color 0.3s ease;
}

.icon-bars-path {
    transition: fill 0.3s ease;
}

.categorias-toggle:hover .icon-bars-svg {
    /* A cor será definida via inline style */
}

.categorias-toggle:hover .icon-bars-path {
    /* O fill será definido via inline style */
}

/* Específico para o texto "CATEGORIAS" no hover */
button#categorias-toggle:hover .categorias-texto,
#categorias-toggle:hover .categorias-texto,
.categorias-toggle:hover .categorias-texto {
    /* A cor será definida via inline style */
    transition: color 0.3s ease;
}

/* Responsividade */
@media (max-width: 992px) {
    .header-wrapper {
        padding: 0 25px;
        height: auto;
        min-height: 60px;
    }
    
    .site-branding {
        max-width: 60%;
        margin: 0 15px;
    }
}

/* Específico para dispositivos médios como iPad Air, Surface Pro */
@media (max-width: 820px) {
    .header-wrapper {
        padding: 0 20px;
    }
    
    .site-branding {
        max-width: 50%;
        margin: 0 10px;
    }
}

@media (max-width: 768px) {
    .site-header {
        padding: 10px 0;
    }
    
    .header-wrapper {
        height: auto;
        min-height: 50px;
        padding: 0 15px;
        position: relative;
        display: flex;
        align-items: center;
    }
    
    .categorias-button {
        position: absolute;
        left: 10px;
        top: 40%;
        transform: translateY(-50%);
    }
    
    .site-search {
        position: absolute;
        right: 15px;
        top: 50%;
        transform: translateY(-50%);
    }
    
    .categorias-toggle {
        padding: 0;
        width: 38px;
        height: 38px;
        justify-content: center;
        display: flex;
        align-items: center;
    }
    
    .categorias-toggle i,
    .categorias-toggle svg {
        margin-right: 0;
        font-size: 16px;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 100%;
    }
    
    /* Ajustar tamanho específico do SVG */
    .categorias-toggle .icon-bars-svg {
        width: 14px;
        height: 14px;
        max-width: 14px;
        max-height: 14px;
    }
    
    .categorias-toggle .categorias-texto {
        display: none !important;
        visibility: hidden !important;
        width: 0 !important;
        height: 0 !important;
        overflow: hidden !important;
    }
    
    .search-field {
        display: none;
        position: absolute;
        top: 45px;
        right: 0;
        width: 0;
        transition: width 0.3s ease;
        z-index: 10;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
        border-radius: 5px;
    }
    
    .search-form.active .search-field {
        display: block;
        width: 200px;
    }
    
    .search-submit {
        background-color: #008fd3;
        color: white;
        border: none;
        width: 38px;
        height: 38px;
        padding: 0;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .search-submit i,
    .search-submit i.fas,
    .search-submit i.fas.fa-search,
    .search-submit .icon-search {
        color: white !important;
        fill: white !important;
        font-size: 18px;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 100%;
    }
}

@media (max-width: 576px) {
    .header-wrapper {
        flex-direction: column;
        height: auto;
        padding: 10px;
    }
    
    .categorias-button, 
    .site-search {
        width: auto;
        margin: 5px 0;
    }
    
    .site-branding {
        padding: 10px 0;
        max-width: 70%;
    }
    
    .site-branding img {
        max-height: 40px;
    }
    
    .categorias-dropdown {
        width: calc(100vw - 30px);
        min-width: 250px;
        max-width: 90vw;
        left: 15px;
    }
    
    /* Ícone ainda menor para telas muito pequenas */
    .categorias-toggle .icon-bars-svg {
        width: 12px;
        height: 12px;
        max-width: 12px;
        max-height: 12px;
        transform: scale(0.85);
    }
}

/* Ajustes para dispositivos muito pequenos */
@media (max-width: 480px) {
    .categorias-toggle .icon-bars-svg {
        width: 12px;
        height: 12px;
        transform: scale(0.8);
    }
    
    .categorias-toggle {
        width: 32px;
        height: 32px;
    }
} 