/* cores principais */
:root{
  --roxo:#6a0dad;
  --roxo-2:#5c07bf;
  --amarelo:#ffcc00;
  --branco:#0bea3b;
  --header-deep:#310651;
}

/* barras */
.site-header .topbar{
  background:var(--roxo);
  color:#fff;
}
.site-header .menubar{
  background:var(--roxo-2);
}

/* topo */
.topo-flex{
  display:flex;
  align-items:flex-start;
  justify-content:flex-start;
  gap:14px;
  padding:10px 0;
  flex-wrap:wrap;
}

/* marca */
.brand{
  display:flex;
  align-items:center;
  gap:12px;
  min-width:220px;
  flex:0 0 auto;
}
.brand-logo img{
  display:block;
  width:56px;
  height:auto;
}
.brand-text{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  line-height:1.05;
  text-align:center;
}
.brand-title{
  font-weight:800;
  font-size:26px;
  color:#0bea3b;
  letter-spacing:.2px;
  white-space:nowrap;
}
.brand-subtitle{
  margin-top:2px;
  font-weight:600;
  font-size:14px;
  color:#fff;
  opacity:.95;
  display:block;
  width:100%;
  text-align:center;
}

/* busca */
.busca{
  flex:1 1 420px;
  max-width:560px;
  display:flex;
  gap:8px;
  align-items:center;
}
.busca input{
  flex:1 1 auto;
  padding:10px 12px;
  border-radius:6px;
  border:0;
}
.busca button{
  background:var(--amarelo);
  color:var(--roxo);
  font-weight:700;
  border:0;
  border-radius:6px;
  padding:10px 14px;
  cursor:pointer;
}

/* menu topo (desktop) */
.menu-topo{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:8px;
  margin-left:auto;
  flex-wrap:wrap;
  white-space:normal;
  max-width:420px;
}
.menu-topo a{
  color:#fff;
  text-decoration:none;
  font-weight:600;
  margin:0;
  padding:6px 8px;
  border-radius:6px;
  display:inline-flex;
  align-items:center;
  gap:6px;
  line-height:1;
}
.menu-topo a:hover{
  background:rgba(255,255,255,.12);
}

.cart-badge{
  background:#ff4d4f;
  color:#fff;
  border-radius:999px;
  padding:2px 6px;
  font-size:.8rem;
  margin-left:4px;
}

/* ações do topo */
.topbar-actions{
  display:flex;
  align-items:center;
  justify-content:center;
  flex:0 0 auto;
  margin-left:8px;
}

/* botão do tema */
.theme-round{
  width:38px;
  height:38px;
  min-width:38px;
  min-height:38px;
  border-radius:999px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:2px solid rgba(255,255,255,.7);
  background:transparent;
  color:#fff;
  cursor:pointer;
  font-size:18px;
  line-height:1;
  flex:0 0 38px;
  margin:0;
  vertical-align:middle;
}
.theme-round:hover{
  background:rgba(255,255,255,.12);
}
html[data-theme="dark"] .theme-round{
  border-color:#b58df0;
  color:#b58df0;
}

/* ícones de alerta desktop */
.nb-item{
  position:relative;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:15px;
  height:15px;
  border-radius:50%;
  background:#fff;
  border:1px solid #eee;
  box-shadow:0 1px 4px rgba(0,0,0,.05);
  text-decoration:none;
}
.nb-ico{
  font-size:16px;
}
.nb-dot{
  position:absolute;
  top:-4px;
  right:-4px;
  background:#e11d48;
  color:#fff;
  font-size:11px;
  min-width:18px;
  height:18px;
  border-radius:999px;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:0 5px;
  border:2px solid #fff;
  z-index:3;
}

/* botão de avisos mobile */
.mobile-alert-link{
  position:relative;
  display:none;
  align-items:center;
  justify-content:center;
  width:38px;
  height:38px;
  border-radius:999px;
  border:2px solid rgba(255,255,255,.7);
  background:transparent;
  color:#fff;
  text-decoration:none;
}
.mobile-alert-link:hover{
  background:rgba(255,255,255,.12);
}
.mobile-alert-link .nb-ico{
  font-size:18px;
  line-height:1;
}
.mobile-alert-link .nb-dot{
  top:-4px;
  right:-4px;
  z-index:4;
}
html[data-theme="dark"] .mobile-alert-link{
  border-color:#b58df0;
  color:#b58df0;
}

/* barra principal */
.menu-principal{
  background:var(--header-deep);
}
.menu-principal nav{
  max-width:1200px;
  margin:0 auto;
  padding:10px 12px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  flex-wrap:wrap;
}
.menu-principal nav a,
.menu-principal .dropdown.categorias > .cat-btn,
.menu-principal .dropdown.categorias > button{
  background:transparent;
  color:#fff;
  text-decoration:none;
  font-weight:700;
  font-size:.95rem;
  padding:8px 14px;
  border:1px solid rgba(255,255,255,.28);
  border-radius:12px;
  display:inline-flex;
  align-items:center;
  gap:8px;
  line-height:1;
  cursor:pointer;
  transition:.2s ease;
  white-space:nowrap;
  flex:0 1 auto;
}
.menu-principal nav a:hover,
.menu-principal .dropdown.categorias > .cat-btn:hover,
.menu-principal .dropdown.categorias > button:hover{
  background:rgba(255,255,255,.10);
  border-color:rgba(255,255,255,.6);
}

/* dropdown categorias */
.dropdown{
  position:relative;
}
.dropdown .dropdown-menu{
  position:absolute;
  top:calc(100% + 8px);
  left:0;
  min-width:220px;
  background:#fff;
  color:#222;
  border-radius:10px;
  box-shadow:0 10px 24px rgba(0,0,0,.18);
  padding:8px;
  display:none;
  z-index:50;
}
.dropdown.open .dropdown-menu{
  display:block;
}
.dropdown .dropdown-menu a{
  display:block;
  padding:8px 10px;
  border-radius:8px;
  color:#222;
  text-decoration:none;
}
.dropdown .dropdown-menu a:hover{
  background:#f2f3ff;
}

/* menu toggle mobile */
.menu-toggle{
  background:transparent;
  border:0;
  color:#fff;
  font-size:26px;
  cursor:pointer;
  display:none;
}

/* drawer mobile */
.drawer{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.4);
  z-index:9999;
}
.drawer[hidden]{
  display:none !important;
}
.drawer-panel{
  position:absolute;
  right:0;
  top:0;
  height:100%;
  width:78%;
  max-width:340px;
  background:#fff;
  color:#333;
  padding:16px;
  box-shadow:-2px 0 12px rgba(0,0,0,.2);
}
.drawer-header{
  display:flex;
  justify-content:flex-end;
}
.drawer-close{
  background:transparent;
  border:0;
  font-size:22px;
  cursor:pointer;
}
.menu-mobile a{
  display:block;
  padding:10px;
  margin-bottom:6px;
  color:#333;
  text-decoration:none;
  border-radius:6px;
  font-weight:600;
}
.menu-mobile a:hover{
  background:#f3e9ff;
  color:var(--roxo-2);
}

/* badges */
.qa-badge{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:18px;
  height:18px;
  padding:0 6px;
  border-radius:999px;
  font-size:12px;
  line-height:18px;
  font-weight:700;
  vertical-align:middle;
  margin-left:6px;
  user-select:none;
}
.qa-badge--muted{
  background:#cbd5e1;
  color:#334155;
}
.qa-badge--alert{
  background:#e11d48;
  color:#fff;
  box-shadow:0 0 0 2px #fff inset;
  animation:qaPulse 1.2s ease-in-out infinite;
}
@keyframes qaPulse{
  0%,100%{ transform:scale(1); }
  50%{ transform:scale(1.06); }
}

/* desktop médio */
@media (max-width: 1280px){
  .menu-topo{
    gap:8px;
    max-width:400px;
  }
  .busca{
    flex-basis:500px;
  }
}
@media (max-width: 1100px){
  .menu-topo{
    gap:6px;
    max-width:360px;
  }
  .busca{
    flex-basis:440px;
  }
  .menu-topo a{
    padding:5px 7px;
    font-size:14px;
  }
}

/* desktop: mostra só o tema na topbar-actions */
@media (min-width: 901px){
  .topbar-actions{
    order:4;
    align-self:flex-start;
  }

  .topbar-actions .mobile-alert-link,
  .topbar-actions #menu-toggle{
    display:none !important;
  }

  .topbar-actions #themeSwitch{
    display:inline-flex !important;
  }
}

/* mobile: manter simples e deixar o header.ejs controlar o topo */
@media (max-width: 900px){
  .menu-topo{
    display:none !important;
  }
  .menu-toggle{
    display:inline-flex;
  }
  .busca{
    max-width:none;
  }
}

/* barra principal no mobile */
@media (max-width: 768px){
  .menu-principal nav{
    gap:6px;
    padding:6px 8px;
  }
  .menu-principal nav a,
  .menu-principal .dropdown.categorias > .cat-btn,
  .menu-principal .dropdown.categorias > button{
    font-size:.62rem;
    padding:6px 10px;
    border-radius:10px;
  }
  .dropdown .dropdown-menu{
    min-width:190px;
  }
}

/* telas muito estreitas */
@media (max-width: 380px){
  .brand-logo img{
    width:40px;
  }
  .brand-title{
    font-size:18px;
  }
  .brand-subtitle{
    font-size:11px;
  }
}

/* claro: categorias sempre brancas */
html:not([data-theme="dark"]) .menu-principal .dropdown.categorias .cat-btn,
html:not([data-theme="dark"]) .menu-principal .dropdown.categorias .cat-btn *{
  color:#fff !important;
}