/* ═══════════════════════════════════════════════════════════
   SOLVE CORPORATE - NAVIGATION SYSTEM
   White editorial header · structured mega-menu
   100% Fully Responsive (Desktop, Laptop, Tablet, Mobile)
═══════════════════════════════════════════════════════════ */

/* ── BASE ── */
*,
*::before,
*::after { box-sizing: border-box; }

/* ── HEADER ── */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 72px;
  display: flex;
  align-items: center;
  padding: 0 clamp(18px, 4vw, 72px);
  gap: 0;
  z-index: 900;
  background: #ffffff;
  border: 0;
  transition: box-shadow 180ms cubic-bezier(0.23, 1, 0.32, 1), background 180ms ease, transform 220ms cubic-bezier(0.23, 1, 0.32, 1);
}

.nav.is-scrolled {
  background: #ffffff;
  box-shadow: 0 8px 24px rgba(18, 58, 99, 0.08);
}

/* Usado na página Soluções: o header principal desliza para fora de
   vista quando a barra de pills (.sol-nav) fica colada no topo e
   assume visualmente o lugar do header. */
.nav.nav--hidden {
  transform: translateY(-100%);
}

.nav.menu-open {
  background: #ffffff;
  box-shadow: 0 10px 28px rgba(18, 58, 99, 0.08);
}

/* ── LOGO ── */
.nbrand {
  display: flex;
  align-items: center;
  text-decoration: none;
  line-height: 0;
  flex-shrink: 0;
  margin-right: clamp(20px, 3vw, 44px);
  opacity: 1;
  transition: opacity 160ms cubic-bezier(0.23, 1, 0.32, 1);
}
.nbrand:hover { opacity: 0.72; }
.nbrand-logo {
  height: 42px;
  width: auto;
  object-fit: contain;
  display: block;
  filter: none;
}

/* ── DESKTOP NAV ── */
.nlinks {
  display: flex;
  align-items: center;
  gap: 0;
  flex: 1;
}

.nlink {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: #17202b;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .01em;
  text-decoration: none;
  padding: 0 clamp(10px, 1.2vw, 16px);
  height: 72px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  line-height: 1;
  white-space: nowrap;
  transition: color 160ms cubic-bezier(0.23, 1, 0.32, 1);
}
.nlink:hover {
  color: #123a63;
}
.nlink.is-current {
  color: #123a63;
}

/* Underline indicator */
.nlink::after {
  content: '';
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 25px;
  height: 2px;
  border-radius: 2px;
  background: #123a63;
  opacity: 0;
  transform: scaleX(0);
  transform-origin: center;
  pointer-events: none;
  transition: transform 240ms cubic-bezier(0.23, 1, 0.32, 1), opacity 200ms cubic-bezier(0.23, 1, 0.32, 1);
}

.nlink[aria-expanded="true"]::after {
  opacity: 1;
  transform: scaleX(1);
}

.nlink[aria-expanded="true"] { color: #123a63; }

/* ── RIGHT ACTIONS ── */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex-shrink: 0;
}

.nav-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 12px;
  border: none;
  background: transparent;
  color: #34424f;
  font-size: 14px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  border-radius: 6px;
  white-space: nowrap;
  text-decoration: none;
  transition: color 160ms cubic-bezier(0.23, 1, 0.32, 1), background 160ms cubic-bezier(0.23, 1, 0.32, 1), transform 120ms cubic-bezier(0.23, 1, 0.32, 1);
}
.nav-action-btn:hover {
  color: #123a63;
  background: #f1f4f5;
}
.nav-action-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

/* Primary CTA */
.nav-action-btn.is-primary {
  background: #123a63;
  color: #ffffff;
  padding: 0 18px;
  border-radius: 6px;
  font-weight: 600;
  font-size: 14px;
  border: none;
}
.nav-action-btn.is-primary:hover {
  background: #0d2c4b;
  color: #ffffff;
}

/* ── LANGUAGE TOGGLE ── */
.nav-lang-btn {
  gap: 6px;
  margin-right: 2px;
}
.nav-lang-btn svg { width: 17px; height: 17px; }
.nav-lang-label {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  min-width: 20px;
  text-align: center;
}

/* Mobile drawer language row */
.mob-lang-btn {
  width: 100%;
  background: transparent;
  border: 0;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  padding: 14px 8px;
  color: #1a1a2a;
  border-radius: 8px;
  transition: color 0.15s, background 0.15s;
}
.mob-lang-btn:hover { color: #123a63; background: #f4f6f8; }
.mob-lang-btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: #6d7882;
}
.mob-lang-btn span[data-lang-label] {
  font-size: 15.5px;
  font-weight: 600;
  flex: 1;
}

/* ── KEYWORD SEARCH ── */
.site-search-inline {
  position: absolute;
  inset: 0 clamp(18px, 4vw, 72px) 0 calc(clamp(18px, 4vw, 72px) + 140px);
  z-index: 2;
  display: none;
  align-items: center;
  gap: 12px;
  padding-right: 0;
  background: #fff;
  color: #123a63;
}
.site-search-inline.is-open { display: flex; }
.site-search-inline > svg { width: 19px; height: 19px; flex: 0 0 auto; }
.site-search-inline input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #17202b;
  font: 500 15px/1.4 inherit;
}
.site-search-inline input::placeholder { color: #78828b; }
.site-search-close {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #52606d;
  cursor: pointer;
  font: 600 13px/1 inherit;
  padding: 8px 12px;
}
.site-search-close:hover { color: #123a63; background: #f1f4f5; }
.site-search-results {
  position: fixed;
  top: 72px;
  left: calc(clamp(18px, 4vw, 72px) + 140px);
  z-index: 899;
  display: none;
  width: min(560px, calc(100vw - clamp(36px, 8vw, 144px) - 140px));
  overflow: hidden;
  border-radius: 0 0 8px 8px;
  background: #fff;
  box-shadow: 0 18px 34px rgba(18, 58, 99, .14);
}
.site-search-results.is-open { display: block; }
.site-search-result,
.site-search-empty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 0;
  padding: 14px 18px;
  color: #17202b;
  font-size: 14px;
  text-decoration: none;
}
.site-search-result:hover { color: #123a63; background: #f4f6f7; }
.site-search-result b { color: var(--blue); font-size: 16px; }
.site-search-empty { color: #697582; }

/* ══════════════════════════════════════════
   MEGA-MENU
══════════════════════════════════════════ */
.nav-overlay {
  position: fixed;
  top: 72px;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 890;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 260ms cubic-bezier(0.23, 1, 0.32, 1), visibility 260ms linear;
}
.nav-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.nav-overlay-panel {
  width: 100%;
  min-height: fit-content;
  margin: 0;
  background: #ffffff;
  border: 0;
  border-bottom: 1px solid #dfe3e6;
  padding: 0;
  box-shadow: 0 18px 34px rgba(18, 58, 99, 0.12);
  transform: translateY(-12px);
  transition: transform 340ms cubic-bezier(0.23, 1, 0.32, 1);
}
.nav-overlay.is-open .nav-overlay-panel {
  transform: translateY(0);
}

.nav-overlay-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 28px clamp(18px, 4vw, 72px) 44px;
}

.nav-overlay::after {
  content: '';
  position: fixed;
  top: 72px; left: 0; right: 0; bottom: 0;
  background: rgba(13, 44, 75, 0.24);
  z-index: -1;
  opacity: 0;
  transition: opacity 0.28s;
  pointer-events: none;
}
.nav-overlay.is-open::after {
  opacity: 1;
  pointer-events: auto;
}

.nav-overlay-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 8px;
}
.nav-overlay-section-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #6d7882;
  margin: 0;
}
.nav-overlay-page-link {
  font-size: 14px;
  font-weight: 600;
  color: #123a63;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: color 0.16s;
}
.nav-overlay-page-link:hover { color: #0d2c4b; }
.nav-overlay-page-link svg {
  width: 13px;
  height: 13px;
  transition: transform 0.16s;
}
.nav-overlay-page-link:hover svg { transform: translateX(3px); }

.nav-close {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: #6b7280;
  cursor: pointer;
  transition: color 0.16s, background 0.16s;
}
.nav-close:hover {
  color: #1a1a2a;
  background: #f3f4f6;
}

/* ── PANEL CONTENT ── */
.nav-menu-content { display: none; }
.nav-menu-content.is-active { display: block; }

.nav-menu-columns {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}

.nav-menu-columns > div {
  padding: 2px clamp(14px, 2vw, 32px);
}
.nav-menu-columns > div:first-child {
  padding-left: 0;
}
.nav-menu-columns > div:last-child {
  padding-right: 0;
}

.nav-menu-col-title {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #697582;
  margin: 0 0 10px;
  padding-bottom: 8px;
}

.nav-menu-col-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.nav-menu-link {
  display: block;
  font-size: 14px;
  font-weight: 400;
  color: #33414e;
  text-decoration: none;
  padding: 6px 0;
  line-height: 1.4;
  border-bottom: none;
  transition: color 200ms cubic-bezier(0.23, 1, 0.32, 1),
              transform 200ms cubic-bezier(0.23, 1, 0.32, 1);
}
.nav-menu-link:hover {
  color: #123a63;
  transform: translateX(4px);
}
.nav-menu-link.is-featured {
  color: #123a63;
  font-weight: 600;
}
.nav-menu-link.is-featured:hover { color: #0d2c4b; }

/* ══════════════════════════════════════════
   MOBILE TOGGLE & DRAWER
══════════════════════════════════════════ */
.mob-toggle {
  display: none;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  width: 44px;
  height: 44px;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  margin-left: auto;
  border-radius: 6px;
  transition: background 160ms cubic-bezier(0.23, 1, 0.32, 1), transform 120ms cubic-bezier(0.23, 1, 0.32, 1);
  position: relative;
  z-index: 950;
}
.mob-toggle:hover { background: rgba(0, 0, 0, 0.05); }
.mob-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #1a1a2a;
  border-radius: 2px;
  transition: transform 200ms cubic-bezier(0.23, 1, 0.32, 1), opacity 160ms cubic-bezier(0.23, 1, 0.32, 1);
  transform-origin: center;
}
.mob-toggle.is-active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.mob-toggle.is-active span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.mob-toggle.is-active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.mob-menu {
  position: fixed;
  top: 64px;
  left: 0; right: 0;
  background: #ffffff;
  border: 0;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.12);
  padding: 16px 20px 32px;
  display: flex;
  flex-direction: column;
  gap: 0;
  transform: translateY(-110%);
  opacity: 0;
  visibility: hidden;
  transition: transform 240ms cubic-bezier(0.23, 1, 0.32, 1), opacity 200ms cubic-bezier(0.23, 1, 0.32, 1), visibility 200ms linear;
  z-index: 880;
  max-height: calc(100dvh - 64px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.mob-menu.is-open {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

.mob-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 16px;
  font-weight: 700;
  color: #1a1a2a;
  text-decoration: none;
  padding: 14px 8px;
  border-radius: 8px;
  transition: color 0.15s, background 0.15s;
}
.mob-link:hover { color: #123a63; background: #f4f6f8; }
.mob-link-arrow {
  color: #9ca3af;
  font-size: 16px;
}

/* ── Mobile Accordions (Multi-choice) ── */
.mob-acc {
  border-bottom: 1px solid #edf0f2;
}
.mob-acc:last-of-type {
  border-bottom: none;
}
.mob-acc-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: transparent;
  border: 0;
  padding: 16px 10px;
  font-family: inherit;
  cursor: pointer;
  border-radius: 8px;
  text-align: left;
  transition: color .18s, background .18s;
  -webkit-tap-highlight-color: transparent;
}
.mob-acc-title {
  font-size: 16.5px;
  font-weight: 700;
  color: #17202b;
  letter-spacing: -.01em;
}
.mob-acc-icon {
  width: 18px;
  height: 18px;
  color: #8c9ba5;
  transition: transform .25s cubic-bezier(0.23, 1, 0.32, 1), color .18s;
  flex-shrink: 0;
}
.mob-acc-head:hover,
.mob-acc.is-open .mob-acc-head {
  background: #f4f7fa;
}
.mob-acc.is-open .mob-acc-title {
  color: #123a63;
}
.mob-acc.is-open .mob-acc-icon {
  transform: rotate(180deg);
  color: #123a63;
}

.mob-acc-body {
  display: none;
  padding: 6px 12px 18px 12px;
  flex-direction: column;
  gap: 16px;
  background: #f8fafc;
  border-radius: 10px;
  margin-bottom: 10px;
}
.mob-acc.is-open .mob-acc-body {
  display: flex;
}

.mob-acc-col {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.mob-cat-title {
  margin: 6px 0 6px 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #123a63;
}
.mob-item-link {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  font-size: 14.5px;
  font-weight: 500;
  color: #374151;
  text-decoration: none;
  border-radius: 6px;
  min-height: 44px;
  background: #ffffff;
  border: 1px solid #eef2f5;
  transition: color .15s, background .15s, border-color .15s, transform .15s;
}
.mob-item-link:hover,
.mob-item-link:active {
  color: #1661d8;
  background: #ffffff;
  border-color: #1661d8;
  transform: translateX(4px);
}
.mob-cat-overview {
  display: inline-block;
  margin-top: 4px;
  padding: 10px 12px;
  font-size: 13.5px;
  font-weight: 700;
  color: #123a63;
  text-decoration: none;
  border-radius: 6px;
  background: rgba(18, 58, 99, 0.06);
  text-align: center;
  transition: background .15s, color .15s;
}
.mob-cat-overview:hover {
  background: #123a63;
  color: #ffffff;
}

.mob-divider {
  height: 1px;
  background: #e5e7eb;
  margin: 12px 0;
}

.mob-cta-link {
  display: block;
  background: #123a63;
  color: #ffffff !important;
  font-weight: 700;
  font-size: 15px;
  text-align: center;
  text-decoration: none;
  padding: 14px;
  border-radius: 8px;
  margin-top: 14px;
  box-shadow: 0 4px 12px rgba(18, 58, 99, 0.2);
  transition: background 0.18s, transform 0.15s;
}
.mob-cta-link:hover { background: #0d2c4b; transform: translateY(-1px); }

/* Focus styles */
.nav :is(a, button):focus-visible,
.mob-menu a:focus-visible {
  outline: 2px solid var(--blue, #123a63);
  outline-offset: 3px;
}
.nav-action-btn:active,
.mob-toggle:active,
.nav-close:active { transform: scale(.97); }

@media (hover: hover) and (pointer: fine) {
  .nbrand:hover { opacity: .76; }
}

/* ══════════════════════════════════════════
   RESPONSIVE BREAKPOINTS
══════════════════════════════════════════ */
@media (max-width: 1140px) and (min-width: 961px) {
  .nav-menu-columns {
    grid-template-columns: repeat(3, 1fr);
  }
  .nav-menu-columns > div { padding: 2px 20px; }
  .nlink { font-size: 13.5px; padding: 0 10px; }
}

@media (max-width: 960px) {
  .nav-overlay {
    top: 64px;
    max-height: calc(100dvh - 64px);
    background: rgba(13, 44, 75, 0.4);
    -webkit-overflow-scrolling: touch;
  }
  .nav-overlay::after {
    top: 64px;
  }
  .nav-overlay-panel {
    max-height: calc(100dvh - 64px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .nav-overlay-inner {
    padding: 16px 20px 40px;
  }
  .nav-menu-columns {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }
  .nav-menu-columns > div {
    padding: 0 !important;
    border-bottom: 1px solid rgba(6, 26, 52, 0.06);
    padding-bottom: 16px !important;
  }
  .nav-menu-columns > div:last-child {
    border-bottom: none;
    padding-bottom: 0 !important;
  }
  .nav-menu-link {
    padding: 8px 10px;
    font-size: 14.5px;
  }
  .nlinks { display: none !important; }
  .nav-actions { display: flex !important; margin-left: auto; gap: 2px; order: 3; }
  .nav-action-btn.is-primary { display: none; }
  .nav-search-trigger { width: 38px; justify-content: center; padding: 0; }
  .nav { height: 64px; padding: 0 16px !important; }
  /* No telemovel: logo + botao de menu juntos a esquerda,
     pesquisa e idioma empurrados para a direita. */
  .nbrand { order: 1; margin-right: 0; }
  .mob-toggle { order: 2; margin-left: 14px; }
  .nbrand-logo { height: 36px !important; }
  .mob-toggle { display: flex; }
  .mob-menu { top: 64px; max-height: calc(100dvh - 64px); }
  .site-search-inline {
    inset: 0 0 0 0;
    padding: 0 16px;
  }
  .site-search-results {
    top: 64px;
    left: 16px;
    width: calc(100vw - 32px);
  }
}

@media (max-width: 480px) {
  .nav { padding: 0 12px !important; }
  .nbrand-logo { height: 32px !important; }
  .nav-action-btn { padding: 0 8px; }
}

@media (prefers-reduced-motion: reduce) {
  .nav, .nav-overlay, .nav-overlay-panel,
  .mob-menu, .nlink, .nlink::after, .nav-menu-link { transition: none; }
}
