/* public_html/assets/css/header.css */

/* =========================================================
   1) HEADER BASE (minimal + mais baixo)
   ========================================================= */
.site-header{
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 6px 0;               /* menos alto */
  background: transparent;
}

/* Barra (sem pill exagerado, sem blur, sem sombras) */
.header__bar{
  position: relative;
  background: rgba(255,255,255,.96);
  border: 1px solid var(--line);
  border-radius: 12px;          /* antes era 999px */
}

/* layout */
.header__wrap{
  display: grid;
  align-items: center;
  grid-template-columns: auto 1fr auto;
  gap: 12px;

  padding: 8px 10px;            /* mais compacto */
  min-height: 64px;             /* bem mais baixo */
}

.header__left{
  display: flex;
  align-items: center;
  gap: 10px;
}

.header__center{
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.header__right{
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

/* =========================================================
   2) HELPERS (VISIBILIDADE)
   ========================================================= */
.desktop-only{ display: inline-flex; }
.mobile-only{ display: none; }

/* =========================================================
   3) LOGOS (menores)
   ========================================================= */
.logo,
.logo-text{
  display: flex;
  align-items: center;
  line-height: 0;
  text-decoration: none;
}

/* logo lateral (desktop) */
.logo__img{
  width: 110px;                 /* antes: 135 */
  height: 44px;                 /* antes: 80 */
  object-fit: contain;
  display: block;
}

/* logo central (mobile) */
.logo-text__img{
  width: 180px;                 /* antes: 210 */
  height: 44px;                 /* antes: 60 */
  object-fit: contain;
  display: block;
}

/* =========================================================
   4) BOTÕES / ÍCONES (flat, sem sombras)
   ========================================================= */
.icon-btn,
.nav-toggle,
.account__btn{
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 10px;          /* sem “bolacha” */
  cursor: pointer;
  text-decoration: none;
  transition: background .2s ease, border-color .2s ease;
}

.icon-btn:hover,
.nav-toggle:hover,
.account__btn:hover{
  background: rgba(0,0,0,.03);
  border-color: rgba(0,0,0,.12);
}

/* carrinho */
.icon-btn{
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;                  /* menor */
  height: 40px;
}

.icon-btn svg{
  width: 20px;
  height: 20px;
  display: block;
  stroke: rgba(27,20,18,.82);
}

/* badge carrinho (mais discreto) */
.cart-badge{
  position: absolute;
  top: -6px;
  right: -6px;

  min-width: 18px;
  height: 18px;
  padding: 0 6px;

  display: flex;
  align-items: center;
  justify-content: center;

  border-radius: 999px;
  background: var(--pitanga-wine);
  color: #fff;

  font-size: 11px;
  line-height: 1;
}

/* toggle menu */
.nav-toggle{
  display: none;
  width: 44px;
  height: 44px;
  padding: 6px;

  align-items: center;
  justify-content: center;
}

.nav-toggle__img{
  width: 34px;                  /* menor */
  height: 34px;
  object-fit: contain;
  display: block;
}

/* conta */
.account{ position: relative; }

.account__btn{
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;            /* menor */
}

.account__btn svg{
  width: 18px;
  height: 18px;
  stroke: rgba(27,20,18,.82);
}

.account__name{
  font-size: 14px;
  color: rgba(27,20,18,.82);
  white-space: nowrap;
}

/* dropdown conta (sem sombra) */
.account__menu{
  position: absolute;
  right: 0;
  top: calc(100% + 10px);

  width: 210px;
  padding: 8px;

  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;

  display: none;
  z-index: 80;
}

.account__menu.is-open{ display: block; }

.account__menu a{
  display: block;
  padding: 10px 10px;
  border-radius: 10px;

  font-size: 14px;
  text-decoration: none;
  color: rgba(27,20,18,.86);
}

.account__menu a:hover{
  background: rgba(0,0,0,.03);
}

.account__line{
  height: 1px;
  background: var(--line);
  margin: 6px 0;
}

.account__menu .danger{ color: var(--pitanga-wine); }

/* =========================================================
   5) NAV (DESKTOP)
   ========================================================= */
.nav{
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
}

.nav__link{
  font-size: 16px;              /* antes: 19 */
  font-weight: 600;
  color: rgba(27,20,18,.85);

  padding: 8px 12px;            /* menor */
  border-radius: 10px;
  border: 1px solid transparent;

  text-decoration: none;
  white-space: nowrap;

  transition: background .2s ease, border-color .2s ease;
}

.nav__link:hover{
  background: rgba(0,0,0,.03);
  border-color: rgba(0,0,0,.10);
}

.danger-link{ color: var(--pitanga-wine); }

.nav--desktop{
  position: static;
  padding: 0;
  margin: 0;
}

/* Mobile nav escondido no desktop */
.nav--mobile{ display: none; }

.nav__divider{
  height: 1px;
  background: var(--line);
  margin: 8px 6px;
  width: 100%;
}

/* =========================================================
   6) RESPONSIVO — MOBILE (<= 860px)
   ========================================================= */
   
@media (max-width: 860px){

  /* helpers */
  .desktop-only{ display: none !important; }
  .mobile-only{ display: inline-flex !important; }

  /* HEADER sólido e sempre visível no mobile */
  .site-header{
    padding: 0;
    background: #fff;
  }

  .header__bar{
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);

    background: #fff;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  .header__wrap{
    min-height: 56px;
    padding: 8px 12px;
  }

  /* toggle aparece */
  .nav-toggle{ display: inline-flex; }

  /* logo grande some */
  .header__left .logo{ display: none; }

  /* logo central */
  .logo-text__img{
    margin-top: 0;
    width: 160px;
    height: 40px;
  }

  /* NAV mobile dropdown */
  .nav--mobile{
    position: absolute;
    left: 12px;
    right: 12px;
    top: calc(100% + 10px);

    background: #fff;
    border: 1px solid var(--line);
    border-radius: 12px;

    padding: 10px;
    display: none;

    flex-direction: column;
    gap: 6px;

    z-index: 60;
  }

  .nav--mobile.is-open{ display: flex; }
  .nav--mobile .nav__link{ width: 100%; }
}

/* =========================================================
   7) RESPONSIVO — MOBILE PEQUENO (<= 520px)
   ========================================================= */
@media (max-width: 520px){
  .logo-text__img{
    width: 148px;
    height: 38px;
  }
}

/* =========================================================
   8) DESKTOP (>= 861px) — FULL-BLEED (mais clean)
   ========================================================= */
@media (min-width: 861px){
  .site-header{ padding: 0; }

  .header__bar{
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);

    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  .header__wrap{
    max-width: 1400px;
    margin: 0 auto;
    padding-left: 24px;
    padding-right: 24px;
  }
}

/* FIX definitivo: nunca mostrar "mobile-only" no desktop */
.desktop-only { display: inline-flex !important; }
.mobile-only  { display: none !important; }

/* No mobile, inverte */
@media (max-width: 860px){
  .desktop-only { display: none !important; }
  .mobile-only  { display: inline-flex !important; }
}

.nav-toggle {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
}

.nav-toggle__icon {
  width: 32px;
  height: 32px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}
