/* ===== HEADER OTIMIZADO ===== */
.topbar {
  background: var(--menu-bg);
  box-shadow: var(--menu-shadow);
  position: sticky;
  top: 0;
  z-index: 9999; /* Set to a very high value */
}

.topbar .container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  height: var(--menu-height);
  padding: 0 var(--container-padding);
  position: relative;
  box-sizing: border-box;
}

/* Logo com dimensões explícitas */
.topbar .logo {
  position: absolute;
  left: var(--container-padding);
}

.topbar .logo img {
  height: var(--logo-height);
  width: auto; /* Mantém proporção */
  aspect-ratio: auto;
  /* PREVINE LAYOUT SHIFT */
  display: block;
}

/* Menu desktop */
.topbar .main-menu {
  list-style: none;
  display: flex;
  flex-direction: row;
  gap: var(--menu-gap);
  margin: 0 auto;
  padding: 0;
  width: fit-content;
}

.topbar .main-menu li {
  position: relative;
  display: inline-block !important;
  float: none !important;
}

.topbar .main-menu a {
  color: #003152;
  font-size: 0.95rem;
  padding: 24px 0;
  display: block; /* Changed from inline-block to block */
  transition: color 0.3s ease;
  pointer-events: auto; /* Explicitly enable pointer events */
  text-decoration: none;
}

.topbar #serinox-menu[aria-hidden="false"] {
  display: block;
}

/* Garantir visibilidade do menu desktop */
@media (min-width: 769px) {
  .topbar #serinox-menu {
    display: block !important;
    position: static;
    width: auto;
    height: auto;
    background: transparent;
    box-shadow: none;
  }
  
  .topbar #serinox-menu[aria-hidden="true"] {
    /* No mobile, esconde o menu, mas no desktop deve estar visível */
    display: block !important;
  }
}

/* Botão hamburger otimizado */
.topbar .serinox-burger {
  visibility: hidden; /* Changed from display: none; */
  pointer-events: none; /* Added to prevent clicks */
  position: absolute;
  right: 16px;
  width: 44px; /* Tamanho mínimo para touch */
  height: 44px;
  background: none;
  border: none;
  color: #003152;
  font-size: 24px;
  cursor: pointer;
  border-radius: 4px;
  transition: background-color 0.3s ease;
}

.topbar .serinox-burger:hover {
  background-color: rgba(0, 49, 82, 0.1);
}

.topbar .serinox-burger:focus {
  outline: 2px solid #003152;
  outline-offset: 2px;
}

/* ===== RESPONSIVIDADE MOBILE ===== */
@media (max-width: 768px) {
  .topbar .serinox-burger {
    display: flex;
    visibility: visible; /* Added to make it visible */
    pointer-events: auto; /* Added to make it clickable */
  }

  .topbar #serinox-menu {
    position: fixed;
    top: 70px;
    left: -100%;
    width: 100%;
    height: calc(100vh - 70px);
    background: #fff;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    z-index: 1001;
    /* ACESSIBILIDADE */
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  }

  .topbar #serinox-menu.active {
    left: 0;
  }

  .topbar .main-menu {
    flex-direction: column;
    width: 100%;
    gap: 0;
  }

  .topbar .main-menu li {
    width: 100%;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  }

  .topbar .main-menu a {
    display: block;
    width: 100%;
    padding: 15px 20px;
    color: #003152;
    transition: background-color 0.3s ease;
  }

  .topbar .main-menu a:hover {
    background-color: rgba(0, 49, 82, 0.05);
  }

  .topbar .main-menu li a::after {
    display: none;
  }
}