/* ==========================================================================
   SUPERDATA - LAYOUT
   Header, navegação e footer (pill flutuante fiel ao ProcessWire).
   ========================================================================== */

/* --- Header --- */
.site-header {
  position: relative;
  z-index: 10;
  height: var(--header-height-mobile);
  min-height: var(--header-height-mobile);
}

.header-bg {
  position: absolute;
  inset: 0;
  background: #0048ff;
  z-index: 0;
}

.header-shell {
  position: fixed;
  top: var(--header-shell-top);
  left: 0;
  right: 0;
  margin-inline: auto;
  z-index: var(--header-z-shell);
  display: flex;
  align-items: center;
  width: calc(100vw - 24px);
  max-width: calc(var(--header-nav-width) + var(--header-logo-size) - 3.5rem);
}

.header-logo {
  position: relative;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 var(--header-logo-size-mobile);
  width: var(--header-logo-size-mobile);
  height: var(--header-logo-size-mobile);
  margin-right: -3.1rem;
}

.header-logo-circle {
  position: absolute;
  inset: -4px;
  background: url("../img/logos/logo-bg-circle.png") center / contain no-repeat;
  pointer-events: none;
}

.header-logo img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.header-nav {
  position: static;
  z-index: 2;
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  height: var(--header-capsule-h-mobile);
  margin-left: -1.75rem;
  padding: 0 3.25rem 0 3.9rem;
  background: #ffffff;
  border: 3px solid var(--header-capsule-border);
  border-radius: 66px;
  box-shadow: 0 4px 12px -1px #132951;
}

.header-nav-links {
  display: none;
  list-style: none;
  margin: 0;
  padding: 0;
}

.header-nav-links li {
  list-style: none;
  margin: 0;
  padding: 0;
}

.header-nav-links a {
  color: #132951;
  font-family: "Amaranth", sans-serif;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}

.header-nav-links a:hover,
.header-nav-links a:focus-visible {
  opacity: 0.75;
}

/* Dropdown legado removido — mobile usa sidebar lateral (ver bloco @media ≤899px) */

.header-menu-toggle {
  position: absolute;
  right: 0.85rem;
  top: 50%;
  transform: translateY(-50%);
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  cursor: pointer;
}

.header-menu-toggle::before {
  content: "";
  display: block;
  width: 22px;
  height: 3px;
  border-radius: 2px;
  background: #132951;
  box-shadow:
    0 -8px 0 #132951,
    0 8px 0 #132951;
}

.header-menu-toggle[aria-expanded="true"]::before {
  box-shadow: none;
  transform: rotate(45deg);
}

.header-menu-toggle[aria-expanded="true"]::after {
  content: "";
  position: absolute;
  width: 22px;
  height: 3px;
  border-radius: 2px;
  background: #132951;
  transform: rotate(-45deg);
}

/* --- Footer (pill flutuante "Entre em contato!", fiel ao ProcessWire) ---
   No PW este elemento vive dentro de .contact (position: relative) para que
   o position:absolute funcione; por isso o partial contato.php inclui o
   footer.php internamente, e não front-page.php/get_footer() diretamente. */
.site-footer {
  position: absolute;
  left: max(1rem, calc((100% - var(--container)) / 2 + var(--footer-pill-x)));
  bottom: 1.5rem;
  padding: 0;
}

/* ==========================================================================
   SIDEBAR MOBILE PROFISSIONAL — 2026-07-08
   Painel lateral deslizante com branding, close button e animação stagger.
   ========================================================================== */

/* Overlay de fundo — criado via JS */
.sidebar-overlay {
  position: fixed;
  inset: 0;
  background: rgba(5, 15, 40, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  cursor: pointer;
}

.sidebar-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

/* Animação de entrada dos itens */
@keyframes sidebar-item-in {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (max-width: 899px) {
  /* --- Painel lateral --- */
  .header-nav-links {
    display: flex !important;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: auto;
    width: min(300px, 88vw);
    flex-direction: column;
    gap: 0;
    margin: 0;
    padding: 0;
    background: linear-gradient(165deg, #0d1f42 0%, #132951 55%, #0c2254 100%);
    border: 0;
    border-left: 1px solid rgba(78, 95, 125, 0.45);
    border-radius: 0;
    box-shadow:
      -16px 0 60px rgba(0, 0, 0, 0.65),
      -1px 0 0 rgba(0, 72, 255, 0.18);
    z-index: 999;
    overflow-y: auto;
    overscroll-behavior: contain;
    visibility: hidden;
    pointer-events: none;
    transform: translateX(105%);
    transition:
      transform 0.32s cubic-bezier(0.4, 0, 0.2, 1),
      visibility 0s 0.32s;
  }

  /* --- Aberto (classe no próprio painel — funciona quando movido para body) --- */
  .header-nav-links.is-open,
  .header-shell.is-open .header-nav-links {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: auto;
    width: min(300px, 88vw);
    visibility: visible;
    pointer-events: auto;
    transform: translateX(0);
    transition:
      transform 0.32s cubic-bezier(0.4, 0, 0.2, 1),
      visibility 0s 0s;
  }

  /* Remove pseudo-elements antigos */
  .header-nav-links::before,
  .header-nav-links::after {
    display: none;
  }

  /* --- Cabeçalho do sidebar (injetado via JS) --- */
  .sidebar-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 16px 18px;
    background: rgba(0, 0, 0, 0.22);
    border-bottom: 1px solid rgba(255, 255, 255, 0.09);
    flex-shrink: 0;
  }

  .sidebar-brand__logo {
    width: 46px;
    height: 46px;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.4));
  }

  .sidebar-brand__text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    line-height: 1.15;
  }

  .sidebar-brand__text strong {
    font-family: "Anton", sans-serif;
    font-size: 17px;
    color: #ffffff;
    font-weight: 400;
    letter-spacing: 0.05em;
    text-transform: uppercase;
  }

  .sidebar-brand__text span {
    font-family: "Roboto", sans-serif;
    font-size: 10px;
    color: rgba(255, 255, 255, 0.42);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-top: 2px;
  }

  /* Botão fechar */
  .sidebar-close {
    width: 36px;
    height: 36px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.07);
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    padding: 0;
    transition:
      background 0.15s ease,
      color 0.15s ease,
      border-color 0.15s ease;
  }

  .sidebar-close:hover,
  .sidebar-close:focus-visible {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border-color: rgba(255, 255, 255, 0.32);
  }

  /* Espaçamento superior dos links */
  .header-nav-links > li:first-of-type,
  .header-nav-links > a:first-of-type {
    margin-top: 10px;
  }

  /* --- Links e itens de lista --- */
  .header-nav-links li,
  .header-shell.is-open .header-nav-links li {
    list-style: none;
    margin: 0;
    padding: 3px 12px;
  }

  .header-nav-links a,
  .header-shell.is-open .header-nav-links a {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 13px 16px;
    color: rgba(255, 255, 255, 0.82);
    font-family: "Amaranth", sans-serif;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-radius: 10px;
    border-left: 3px solid transparent;
    text-align: left;
    text-decoration: none;
    white-space: nowrap;
    transition:
      background 0.18s ease,
      color 0.18s ease,
      border-color 0.18s ease,
      padding-left 0.18s ease;
  }

  .header-nav-links a:hover,
  .header-nav-links a:focus-visible,
  .header-shell.is-open .header-nav-links a:hover,
  .header-shell.is-open .header-nav-links a:focus-visible {
    background: rgba(0, 72, 255, 0.16);
    color: #ffffff;
    padding-left: 22px;
    border-left-color: #0048ff;
    opacity: 1;
  }

  /* --- Animação stagger de entrada --- */
  .header-nav-links.is-open li,
  .header-nav-links.is-open > a,
  .header-shell.is-open .header-nav-links li,
  .header-shell.is-open .header-nav-links > a {
    animation: sidebar-item-in 0.32s cubic-bezier(0.4, 0, 0.2, 1) both;
    animation-delay: calc(0.06s + var(--stagger-i, 0) * 0.055s);
  }

  /* --- Rodapé do sidebar (injetado via JS) --- */
  .sidebar-footer {
    margin-top: auto;
    padding: 16px 24px 28px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
    flex-shrink: 0;
  }

  .sidebar-footer p {
    font-family: "Roboto", sans-serif;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.2);
    margin: 0;
    letter-spacing: 0.04em;
    text-align: center;
  }
}
