header.css
/* ==========================================
HEADER MULTITELA 2.0
========================================== */
.header{
position:sticky;
top:0;
left:0;
width:100%;
z-index:9999;
background:#0d0d0d;
border-bottom:1px solid #1d1d1d;
}
/* ==========================================
CONTAINER
========================================== */
.header .container{
max-width:1450px;
margin:auto;
padding:16px 24px;
display:flex;
align-items:center;
gap:30px;
}
/* ==========================================
LOGO
========================================== */
.logo{
flex-shrink:0;
}
.logo img{
height:42px;
display:block;
}
/* ===========================
MENU DESKTOP
=========================== */
.menu{
display:flex;
align-items:center;
gap:22px;
margin-left:20px;
}
.menu a{
color:#fff;
text-decoration:none;
font-size:15px;
font-weight:500;
transition:.25s;
}
.menu a:hover{
color:#00b8a6;
}
/* ==========================================
BUSCA
========================================== */
.header-search{
margin-left:auto;
position:relative;
width:340px;
}
#campoBusca{
width:100%;
height:46px;
border:none;
outline:none;
background:#1c1c1c;
color:#fff;
border-radius:30px;
padding:0 58px 0 20px;
font-size:15px;
}
#campoBusca::placeholder{
color:#8b8b8b;
}
#campoBusca:focus{
box-shadow:0 0 0 2px #00b8a6;
}
#btnBusca{
position:absolute;
top:4px;
right:4px;
width:38px;
height:38px;
border:none;
border-radius:50%;
background:#009687;
color:white;
cursor:pointer;
transition:.25s;
}
#btnBusca:hover{
background:#00b8a6;
}
/* ==========================================
AUTOCOMPLETE
========================================== */
#autocompleteBusca{
position:absolute;
top:52px;
left:0;
width:100%;
background:#171717;
border-radius:14px;
overflow:hidden;
box-shadow:0 15px 40px rgba(0,0,0,.45);
z-index:99999;
}
/* ==========================================
BOTÃO MOBILE
========================================== */
.menu-toggle{
display:none;
background:none;
border:none;
color:white;
font-size:34px;
cursor:pointer;
margin-left:auto;
}
/* ==========================================
TABLET
========================================== */
@media(max-width:1100px){
.header .container{
flex-wrap:wrap;
}
.menu{
gap:16px;
}
.header-search{
width:100%;
order:4;
}
}
/* ==========================================
CELULAR
========================================== */
@media(max-width:768px){
.header .container{
display:grid;
grid-template-columns:auto 1fr auto;
align-items:center;
gap:15px;
}
/* LOGO */
.logo{
order:2;
justify-self:center;
}
.logo img{
height:38px;
}
/* BOTÃO */
.menu-toggle{
display:block;
order:1;
font-size:32px;
background:none;
border:none;
color:#fff;
cursor:pointer;
}
/* BUSCA */
.header-search{
order:3;
grid-column:1 / span 3;
width:100%;
}
#campoBusca{
width:100%;
}
/* MENU LATERAL */
.menu{
position:fixed;
top:0;
left:-320px;
width:300px;
height:100vh;
background:#111;
display:flex;
flex-direction:column;
align-items:flex-start;
gap:0;
padding-top:90px;
transition:.35s;
z-index:999999;
box-shadow:15px 0 40px rgba(0,0,0,.45);
}
/* MENU ABERTO */
.menu.ativo{
left:0;
}
/* LINKS */
.menu a{
width:100%;
padding:18px 30px;
border-bottom:1px solid #222;
font-size:17px;
}
/* OVERLAY */
.menu::after{
content:"";
position:fixed;
inset:0;
background:rgba(0,0,0,.65);
z-index:-1;
opacity:0;
pointer-events:none;
transition:.35s;
}
.menu.ativo::after{
opacity:1;
pointer-events:auto;
}
}