/* ==========================================================================
   Correcoes do cabecalho (topo, logo e menu)
   Carregado depois de responsive.css, portanto sobrescreve as regras do tema.
   ========================================================================== */

/* Os .outer-box tem a classe .clearfix, cujo ::after do Bootstrap vira um
   item flex invisivel e rouba espaco do space-between. Removido apenas onde o
   container virou flex (o clear deixa de ser necessario ali); no desktop o
   .header-upper .outer-box continua com float e precisa do clearfix. */
.header-top .outer-box::after {
    display: none;
}

/* --------------------------------------------------------------------------
   DESKTOP (>= 992px)
   -------------------------------------------------------------------------- */
@media only screen and (min-width: 992px) {

    /* --- Faixa preta: telefones, horario e redes sociais lado a lado --- */
    .header-top {
        padding: 8px 0;
    }
    .header-top .outer-box {
        display: flex;
        align-items: center;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 6px 30px;
        min-height: 26px;
        padding-left: 210px; /* espaco reservado para a logo sobreposta */
    }
    .header-top .top-left,
    .header-top .top-right {
        float: none !important;
    }

    .header-top .top-left .phone-number {
        display: flex;
        align-items: center;
        flex-wrap: wrap;
        gap: 4px 26px;
    }
    .header-top .top-left .phone-number br {
        display: none;
    }
    .header-top .top-left .phone-number .cel {
        display: inline-flex;
        align-items: center;
        white-space: nowrap;
    }

    .header-top .top-right {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 26px;
        width: auto;
        min-width: 0;
        max-width: none;
        margin-left: auto;   /* mantem a direita mesmo quando o topo quebra linha */
    }
    .header-top .top-right .working-hours {
        float: none;
        width: auto;
        max-width: none;
        margin: 0;
        padding-left: 0;
    }
    /* No HTML o texto do horario fica DENTRO de .icon, que era absoluto.
       Voltando para o fluxo normal ele para de sobrepor o resto. */
    .header-top .top-right .working-hours .icon {
        position: static;
        display: inline-flex;
        align-items: center;
        gap: 8px;
        color: #ababab;
        font-weight: 600;
        white-space: nowrap;
    }
    .header-top .top-right .social-links {
        float: none;
    }
    .header-top .top-right .social-links ul {
        display: flex;
        align-items: center;
        gap: 10px;
        margin: 0;
    }
    .header-top .top-right .social-links ul li {
        float: none;
        margin: 0;
    }

    /* --- Logo maior, alinhada pela base: nao invade mais o slider --- */
    .header-upper .outer-box {
        padding-left: 210px;
    }
    .header-upper .header-upper-left {
        top: auto;
        bottom: 0;   /* base da logo = base da faixa branca */
        left: 0;
    }
    .header-upper .header-upper-left .logo a img {
        display: block;
        height: 130px;
        width: auto;
    }
    /* Cartao branco atras da logo em CSS puro (o PNG nao acompanhava a escala) */
    .header-upper .header-upper-left .logo a:before {
        top: -14px;
        left: -14px;
        right: -14px;
        bottom: 0;
        background: #ffffff;
        box-shadow: 0 3px 12px rgba(0, 0, 0, 0.14);
    }

    /* --- Menu alinhado a direita --- */
    .header-upper .header-upper-right {
        padding: 24px 0;   /* altura suficiente para a logo maior caber */
        text-align: right;
    }
    .header-upper .header-upper-right .nav-outer,
    .header-upper .header-upper-right .main-menu {
        float: right;
    }
}

/* --------------------------------------------------------------------------
   TABLET E MOBILE (<= 991px)
   -------------------------------------------------------------------------- */
@media only screen and (max-width: 991px) {

    /* --- Faixa preta empilhada e centralizada, sem larguras fixas --- */
    .header-top {
        padding: 12px 0;
    }
    .header-top .outer-box {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 8px;
        padding-left: 0;
        text-align: center;
    }
    .header-top .top-left,
    .header-top .top-right {
        float: none !important;
        width: 100%;
        min-width: 0;      /* removia o min-width:300px que estourava a tela */
        max-width: none;
        margin: 0;
    }
    .header-top .top-left .phone-number {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 4px;
    }
    .header-top .top-left .phone-number br {
        display: none;
    }
    .header-top .top-left .phone-number .cel {
        display: inline-flex;
        align-items: center;
        width: auto;
    }
    .header-top .top-right {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
    .header-top .top-right .working-hours {
        float: none;
        width: auto;
        max-width: none;
        margin: 0;
        padding-left: 0;
        font-size: 0.9em;
    }
    .header-top .top-right .working-hours .icon {
        position: static;
        display: inline-flex;
        align-items: center;
        gap: 8px;
        color: #ababab;
        font-weight: 600;
    }
    .header-top .top-right .social-links {
        float: none;
        padding-top: 0;   /* removia o espaco morto de 30px */
    }
    .header-top .top-right .social-links ul {
        display: flex;
        justify-content: center;
        gap: 10px;
        margin: 0;
    }
    .header-top .top-right .social-links ul li {
        float: none;
        margin: 0;
    }

    /* --- Logo a esquerda, botao do menu a direita, na mesma linha ---
       display:contents faz o botao e o menu virarem itens diretos do flex de
       .outer-box: o botao fica na linha da logo e o menu aberto quebra para a
       linha de baixo, ocupando a largura toda. */
    .header-upper .outer-box {
        position: relative;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
        gap: 0 15px;
        padding-left: 0;
        padding-top: 0;
    }
    .header-upper .outer-box::after {
        display: none;   /* aqui o container e flex, o clearfix vira item fantasma */
    }
    .header-upper .header-upper-left {
        position: static;
        float: none !important;
        flex: 0 0 auto;
        width: auto;
        padding: 12px 0;
    }
    .header-upper .header-upper-left .logo {
        text-align: left;
    }
    .header-upper .header-upper-left .logo a:before {
        display: none;   /* o cartao branco nao faz sentido sobre fundo branco */
    }
    .header-upper .header-upper-left .logo a img {
        display: block;
        height: 88px;
        width: auto;
    }
    .header-upper .header-upper-right,
    .header-upper .nav-outer,
    .header-upper .main-menu {
        display: contents;
    }
    .main-menu .navbar-header {
        width: auto;
        float: none !important;
        text-align: right;
        margin: 0 0 0 auto;   /* encosta o botao na direita */
        order: 1;
    }
    .header-upper .header-upper-left {
        order: 0;
    }
    .main-header .main-menu .navbar-collapse {
        order: 2;
    }
    .main-menu .navbar-header .navbar-toggle {
        margin: 0;
    }
    .main-header .main-menu .navbar-collapse {
        flex: 0 0 100%;
        width: 100%;
        max-width: 100%;
        margin-bottom: 0;
    }
}

@media only screen and (max-width: 479px) {
    .header-upper .header-upper-left .logo a img {
        height: 74px;
    }
    .header-top .top-left .phone-number .cel,
    .header-top .top-right .working-hours {
        font-size: 0.88em;
    }
}

/* --------------------------------------------------------------------------
   Icones do topo (Font Awesome 5) - tamanho e alinhamento consistentes
   -------------------------------------------------------------------------- */
.header-top .icone {
    position: relative;
    top: 0;
    margin-left: 0;
    margin-right: 8px;
    color: #009FE3;
    font-size: 16px;
    line-height: 1;
}
.header-top .top-right .working-hours .icon .icone {
    font-size: 15px;
    margin-right: 0;
}

/* --------------------------------------------------------------------------
   Sticky header (barra que aparece ao rolar a pagina)
   Usa a logo completa; a altura acompanha para o texto caber inteiro.
   So aparece a partir de 992px (abaixo disso o tema ja o esconde).
   -------------------------------------------------------------------------- */
.sticky-header {
    padding: 10px 0;
}
.sticky-header .container > .clearfix {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
/* o ::after do clearfix viraria um item flex fantasma */
.sticky-header .container > .clearfix::after {
    display: none;
}
.sticky-header .logo,
.sticky-header .right-col {
    float: none !important;
}
.sticky-header .logo a {
    display: block;
}
.sticky-header .logo a img {
    display: block;
    height: 72px;
    width: auto;
}
/* o menu ja tem 75px de altura propria; zerando o respiro extra dele
   a barra fica com a altura da logo */
.sticky-header .right-col .main-menu .navigation > li > a {
    padding-top: 18px;
    padding-bottom: 15px;
}
