/* Cabeçalho público compartilhado — usado por index.php e vitrine.php */
.shared-header{
  --shared-header-wine:#5d0c27;
  --shared-header-text:#4f2835;
  --shared-header-line:#eaded8;
  position:sticky;
  top:0;
  z-index:60;
  background:rgba(255,255,255,.98);
  border-bottom:1px solid #f0e7e2;
  color:var(--shared-header-text);
  backdrop-filter:blur(10px);
}
.shared-header *{box-sizing:border-box}
.shared-header__container{width:calc(100% - 58px);max-width:none;margin:0 auto}
.shared-header__inner{
  min-height:100px;
  display:grid;
  grid-template-columns:320px minmax(0,1fr) 360px auto;
  align-items:center;
  gap:24px;
}
.shared-header__brand{display:block;text-decoration:none;min-width:0}
.shared-header__brand img{display:block;width:300px;max-width:100%;height:auto}
.shared-header__nav{display:flex;align-items:center;justify-content:center;gap:30px;min-width:0}
.shared-header__nav a{
  text-decoration:none;
  color:var(--shared-header-wine);
  font:400 16px/1.15 Georgia,"Times New Roman",serif;
  white-space:nowrap;
}
.shared-header__nav a:hover{color:#8b294b}
.shared-header__search{
  display:flex;
  align-items:center;
  gap:10px;
  height:48px;
  min-width:0;
  border:1px solid #e7d9d3;
  border-radius:10px;
  padding:0 14px;
  background:#fff;
}
.shared-header__search-icon{display:inline-flex;width:18px;height:18px;color:#8a5a68;flex:0 0 auto}
.shared-header__search-icon svg{width:100%;height:100%}
.shared-header__search input[type="search"]{
  width:100%;
  min-width:0;
  border:0;
  outline:0;
  background:transparent;
  color:#563542;
  font:400 14px/1.2 Arial,Helvetica,sans-serif;
}
.shared-header__search input::placeholder{color:#aa9199;opacity:1}
.shared-header__actions{display:flex;align-items:center;justify-content:flex-end;gap:18px}
.shared-header__actions>a{
  position:relative;
  display:inline-flex;
  width:27px;
  height:27px;
  color:var(--shared-header-wine);
  text-decoration:none;
}
.shared-header svg{
  display:block;
  width:100%;
  height:100%;
  fill:none;
  stroke:currentColor;
  stroke-width:1.8;
  stroke-linecap:round;
  stroke-linejoin:round;
}
.shared-header__cart>span{
  position:absolute;
  top:-8px;
  right:-9px;
  min-width:18px;
  height:18px;
  padding:0 4px;
  border-radius:999px;
  background:var(--shared-header-wine);
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  font:700 10px/1 Arial,Helvetica,sans-serif;
}
.shared-header__menu-button{
  display:none;
  width:30px;
  height:30px;
  padding:3px;
  border:0;
  background:transparent;
  color:var(--shared-header-wine);
  cursor:pointer;
}
.shared-header__mobile{display:none;border-top:1px solid var(--shared-header-line);background:#fff}
.shared-header__mobile-nav{display:flex;flex-direction:column;padding:8px 20px 16px}
.shared-header__mobile-nav a{
  padding:11px 4px;
  border-bottom:1px solid #f3ebe7;
  text-decoration:none;
  color:var(--shared-header-wine);
  font:400 15px/1.2 Georgia,"Times New Roman",serif;
}
.shared-header__mobile-nav a:last-child{border-bottom:0}

@media(max-width:1260px){
  .shared-header__inner{grid-template-columns:270px minmax(0,1fr) 310px auto;gap:18px}
  .shared-header__brand img{width:250px}
  .shared-header__nav{gap:20px}
  .shared-header__nav a{font-size:14px}
}
@media(max-width:1050px){
  .shared-header__inner{min-height:84px;grid-template-columns:minmax(220px,1fr) minmax(260px,360px) auto;gap:16px}
  .shared-header__brand img{width:230px}
  .shared-header__nav{display:none}
  .shared-header__menu-button{display:inline-flex}
  .shared-header__mobile:not([hidden]){display:block}
}
@media(max-width:720px){
  .shared-header__container{width:calc(100% - 24px)}
  .shared-header__inner{min-height:72px;grid-template-columns:minmax(155px,1fr) auto;gap:12px}
  .shared-header__brand img{width:190px}
  .shared-header__search{grid-column:1/-1;height:44px;margin-bottom:10px}
  .shared-header__actions{gap:12px}
  .shared-header__actions>a{width:24px;height:24px}
}


/* 0.8.39 — ações reais de Favoritos e Sacola de Interesse */
.shared-header__actions>a,
.shared-header__shop-action{
  position:relative;
  display:inline-flex;
  width:27px;
  height:27px;
  padding:0;
  border:0;
  background:transparent;
  color:var(--shared-header-wine);
  text-decoration:none;
  cursor:pointer;
}
.shared-header__shop-count{
  position:absolute;
  top:-8px;
  right:-9px;
  min-width:18px;
  height:18px;
  padding:0 4px;
  border-radius:999px;
  background:var(--shared-header-wine);
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  font:700 10px/1 Arial,Helvetica,sans-serif;
}
.shared-header__shop-count[hidden]{display:none!important}
@media(max-width:720px){
  .shared-header__actions>a,
  .shared-header__shop-action{width:24px;height:24px}
}

/* 0.8.48 — ajuste fino do cabeçalho compartilhado no mobile */
.shared-header__shop-count{right:-6px;top:-7px}
@media(max-width:720px){
  .shared-header__container{width:100%;max-width:100%;padding:0 10px}
  .shared-header__inner{
    position:relative;
    min-height:82px;
    grid-template-columns:1fr;
    gap:10px;
    padding:12px 0 10px;
  }
  .shared-header__brand{
    display:flex;
    justify-content:center;
    padding:0 88px 0 88px;
  }
  .shared-header__brand img{width:220px;max-width:100%;margin:0 auto}
  .shared-header__actions{
    position:absolute;
    top:18px;
    left:0;
    right:0;
    display:flex;
    align-items:center;
    justify-content:flex-end;
    gap:14px;
    padding:0 12px;
    min-width:0;
    pointer-events:none;
  }
  .shared-header__actions > *,
  .shared-header__actions > a,
  .shared-header__shop-action,
  .shared-header__menu-button{pointer-events:auto}
  .shared-header__menu-button{
    display:inline-flex;
    order:-1;
    margin-right:auto;
    width:29px;
    height:29px;
    padding:2px;
  }
  .shared-header__actions>a,
  .shared-header__shop-action{width:26px;height:26px}
  .shared-header__search{grid-column:1;height:42px;margin:0 0 6px}
  .shared-header__mobile:not([hidden]){display:block}
}
@media(max-width:390px){
  .shared-header__container{padding:0 8px}
  .shared-header__brand{padding:0 82px}
  .shared-header__brand img{width:204px}
  .shared-header__actions{gap:12px;padding:0 10px}
  .shared-header__actions>a,
  .shared-header__shop-action{width:25px;height:25px}
  .shared-header__menu-button{width:28px;height:28px}
}

/* 0.8.49 — CORREÇÃO FINAL do cabeçalho mobile compartilhado.
   Evita logo comprimida e impede o menu hambúrguer de sobrepor a sacola. */
@media(max-width:720px){
  .shared-header__container{
    width:100%!important;
    max-width:100%!important;
    padding:0 14px!important;
    margin:0!important;
  }
  .shared-header__inner{
    position:relative!important;
    display:block!important;
    min-height:84px!important;
    height:84px!important;
    padding:0!important;
  }
  .shared-header__brand{
    position:absolute!important;
    left:50%!important;
    top:50%!important;
    transform:translate(-50%,-50%)!important;
    width:auto!important;
    min-width:0!important;
    max-width:none!important;
    margin:0!important;
    padding:0!important;
    z-index:2!important;
  }
  .shared-header__brand img{
    display:block!important;
    width:180px!important;
    max-width:44vw!important;
    height:auto!important;
    margin:0!important;
  }
  .shared-header__nav,
  .shared-header__search{
    display:none!important;
  }
  .shared-header__actions{
    position:absolute!important;
    inset:0 14px!important;
    width:auto!important;
    height:84px!important;
    display:flex!important;
    align-items:center!important;
    justify-content:flex-end!important;
    gap:14px!important;
    margin:0!important;
    padding:0!important;
    z-index:3!important;
    pointer-events:none!important;
  }
  .shared-header__actions > *,
  .shared-header__actions > a,
  .shared-header__shop-action,
  .shared-header__menu-button{
    pointer-events:auto!important;
  }
  .shared-header__menu-button{
    position:static!important;
    inset:auto!important;
    transform:none!important;
    display:inline-flex!important;
    order:-1!important;
    margin:0 auto 0 0!important;
    width:30px!important;
    height:30px!important;
    padding:2px!important;
  }
  .shared-header__actions > a,
  .shared-header__shop-action{
    position:relative!important;
    width:27px!important;
    height:27px!important;
    flex:0 0 27px!important;
  }
  .shared-header__shop-count{
    top:-7px!important;
    right:-6px!important;
  }
  .shared-header__mobile{
    position:absolute!important;
    top:84px!important;
    left:0!important;
    right:0!important;
    z-index:70!important;
  }
  .shared-header__mobile:not([hidden]){display:block!important}
}
@media(max-width:390px){
  .shared-header__container{padding:0 12px!important}
  .shared-header__brand img{width:170px!important;max-width:44vw!important}
  .shared-header__actions{inset:0 12px!important;gap:12px!important}
  .shared-header__actions > a,
  .shared-header__shop-action{width:26px!important;height:26px!important;flex-basis:26px!important}
  .shared-header__menu-button{width:29px!important;height:29px!important}
}

/* 0.8.50 — cabeçalho mobile compartilhado estável: menu | logo | ações.
   Aplicado igualmente em index.php e vitrine.php sem alterar desktop. */
@media(max-width:720px){
  .shared-header__container{
    width:100%!important;
    max-width:100%!important;
    margin:0!important;
    padding:0 12px!important;
  }
  .shared-header__inner{
    position:relative!important;
    display:grid!important;
    grid-template-columns:34px minmax(0,1fr) auto!important;
    grid-template-rows:78px!important;
    align-items:center!important;
    gap:8px!important;
    min-height:78px!important;
    height:auto!important;
    padding:0!important;
  }
  .shared-header__menu-button{
    position:static!important;
    display:inline-flex!important;
    grid-column:1!important;
    grid-row:1!important;
    align-self:center!important;
    justify-self:start!important;
    order:initial!important;
    margin:0!important;
    transform:none!important;
    width:30px!important;
    height:30px!important;
    padding:2px!important;
  }
  .shared-header__brand{
    position:static!important;
    grid-column:2!important;
    grid-row:1!important;
    align-self:center!important;
    justify-self:center!important;
    transform:none!important;
    width:100%!important;
    min-width:0!important;
    max-width:178px!important;
    margin:0!important;
    padding:0!important;
    z-index:auto!important;
  }
  .shared-header__brand img{
    display:block!important;
    width:178px!important;
    max-width:100%!important;
    height:auto!important;
    margin:0 auto!important;
  }
  .shared-header__nav,
  .shared-header__search{
    display:none!important;
  }
  .shared-header__actions{
    position:static!important;
    grid-column:3!important;
    grid-row:1!important;
    display:flex!important;
    align-items:center!important;
    justify-content:flex-end!important;
    align-self:center!important;
    justify-self:end!important;
    gap:9px!important;
    width:auto!important;
    height:auto!important;
    min-width:0!important;
    margin:0!important;
    padding:0!important;
    inset:auto!important;
    z-index:auto!important;
    pointer-events:auto!important;
  }
  .shared-header__actions > a,
  .shared-header__shop-action{
    position:relative!important;
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    width:25px!important;
    height:25px!important;
    flex:0 0 25px!important;
    margin:0!important;
  }
  .shared-header__shop-count{
    top:-7px!important;
    right:-7px!important;
    min-width:17px!important;
    height:17px!important;
    padding:0 4px!important;
    font-size:9px!important;
  }
  .shared-header__mobile{
    position:static!important;
    top:auto!important;
    left:auto!important;
    right:auto!important;
    z-index:auto!important;
  }
  .shared-header__mobile:not([hidden]){display:block!important}
}
@media(max-width:390px){
  .shared-header__container{padding:0 10px!important}
  .shared-header__inner{
    grid-template-columns:32px minmax(0,1fr) auto!important;
    grid-template-rows:74px!important;
    min-height:74px!important;
    gap:7px!important;
  }
  .shared-header__menu-button{width:28px!important;height:28px!important}
  .shared-header__brand{max-width:166px!important}
  .shared-header__brand img{width:166px!important}
  .shared-header__actions{gap:8px!important}
  .shared-header__actions > a,
  .shared-header__shop-action{width:24px!important;height:24px!important;flex-basis:24px!important}
}

/* 0.8.50 — faixa intermediária: mantém o novo botão de menu sem deslocar os demais itens. */
@media(min-width:721px) and (max-width:1050px){
  .shared-header__inner{
    grid-template-columns:36px minmax(210px,1fr) minmax(260px,360px) auto!important;
    gap:14px!important;
  }
  .shared-header__menu-button{
    display:inline-flex!important;
    position:static!important;
    width:30px!important;
    height:30px!important;
    margin:0!important;
  }
  .shared-header__brand{position:static!important;padding:0!important;transform:none!important}
  .shared-header__actions{position:static!important;inset:auto!important;padding:0!important}
}

/* 0.8.51 — respiro lateral real no cabeçalho mobile compartilhado */
@media(max-width:720px){
  .shared-header__container{
    padding-left:clamp(20px,5.5vw,26px)!important;
    padding-right:clamp(20px,5.5vw,26px)!important;
  }
  .shared-header__shop-count{
    right:-2px!important;
  }
}
@media(max-width:360px){
  .shared-header__container{
    padding-left:18px!important;
    padding-right:18px!important;
  }
}
