/* =========================================================
   CNX Projetos e Tecnologia · estrutura comum a todas as páginas
   Cabeçalho, menu, submenu Serviços, faixa de chamada final, rodapé e WhatsApp flutuante.
   ========================================================= */

/* ---------- Cabeçalho ---------- */
.site-header {
  position: fixed; inset: 0 0 auto; z-index: 100;
  height: var(--header-h);
  background: rgba(15, 27, 61, 0.0);
  transition: background-color .25s var(--ease), box-shadow .25s var(--ease);
}
.site-header.is-scrolled,
.site-header.is-open {
  background: rgba(15, 27, 61, 0.96);
  box-shadow: 0 1px 0 var(--line-dark);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
}
.site-header .container {
  height: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
}

.brand { display: inline-flex; align-items: center; gap: 14px; color: var(--white); text-decoration: none; }
.brand:hover { color: var(--white); }
.brand__logo { height: 44px; width: auto; flex: none; }
.brand__tag {
  padding-left: 14px; border-left: 1px solid rgba(232,237,243,.25);
  font-size: 0.6875rem; line-height: 1.3; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--on-dark-soft); font-weight: 600;
}
@media (max-width: 380px) { .brand__tag { display: none; } }

.nav { display: flex; align-items: center; gap: 32px; }
.nav__list { display: flex; align-items: center; gap: 24px; list-style: none; margin: 0; padding: 0; }
.nav__list > li > a {
  color: var(--on-dark-soft); text-decoration: none;
  font-size: 0.9375rem; font-weight: 600;
  padding: 8px 0; position: relative;
}
.nav__list > li > a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 2px;
  background: var(--cyan-400); transform: scaleX(0); transform-origin: left;
  transition: transform .25s var(--ease);
}
.nav__list > li > a:hover, .nav__list > li > a[aria-current="true"] { color: var(--white); }
.nav__list > li > a:hover::after, .nav__list > li > a[aria-current="true"]::after { transform: scaleX(1); }
.nav .btn { min-height: 44px; padding: 0 18px; font-size: 0.9rem; }

.nav-toggle {
  display: none;
  width: 48px; height: 48px; margin-right: -8px;
  background: transparent; border: 0; color: var(--white); cursor: pointer;
  border-radius: var(--radius-sm);
}
.nav-toggle svg { width: 26px; height: 26px; margin: auto; }
.nav-toggle .icon-close { display: none; }
.site-header.is-open .nav-toggle .icon-open { display: none; }
.site-header.is-open .nav-toggle .icon-close { display: block; }

@media (max-width: 1100px) {
  .nav-toggle { display: inline-flex; }
  .nav {
    position: fixed; top: var(--header-h); left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 8px;
    padding: 16px var(--gutter) 28px;
    background: var(--navy-900);
    border-top: 1px solid var(--line-dark);
    box-shadow: 0 24px 40px rgba(0,0,0,.25);
    visibility: hidden; opacity: 0; transform: translateY(-8px);
    transition: opacity .2s var(--ease), transform .2s var(--ease), visibility 0s linear .2s;
  }
  .site-header.is-open .nav {
    visibility: visible; opacity: 1; transform: none;
    transition: opacity .2s var(--ease), transform .2s var(--ease);
  }
  .nav__list { flex-direction: column; gap: 0; }
  .nav__list > li > a { display: block; padding: 14px 0; font-size: 1.0625rem; border-bottom: 1px solid var(--line-dark); }
  .nav__list > li > a::after { display: none; }
  .nav .btn { min-height: 52px; margin-top: 12px; font-size: 1rem; }
}

/* ---------- Submenu Serviços ---------- */
.nav__item--sub { position: relative; }
.nav__sub-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 0; background: none; border: 0; cursor: pointer;
  font: inherit; font-size: 0.9375rem; font-weight: 600; line-height: inherit; color: var(--on-dark-soft);
}
.nav__sub-toggle { position: relative; }
.nav__sub-toggle::after { /* mesmo sublinhado dos outros itens do menu */
  content: ""; position: absolute; left: 0; right: 22px; bottom: 2px; height: 2px;
  background: var(--cyan-400); transform: scaleX(0); transform-origin: left;
  transition: transform .25s var(--ease);
}
.nav__sub-toggle:hover, .nav__item--sub.is-open .nav__sub-toggle,
.nav__sub-toggle.is-current, .nav__sub-toggle.is-active { color: var(--white); }
.nav__sub-toggle:hover::after, .nav__sub-toggle.is-current::after, .nav__sub-toggle.is-active::after { transform: scaleX(1); }
.nav__caret { width: 16px; height: 16px; transition: transform .2s var(--ease); }
.nav__item--sub.is-open .nav__caret { transform: rotate(180deg); }

.subnav {
  position: absolute; top: calc(100% + 14px); left: -20px; z-index: 110;
  width: 380px; padding: 10px;
  background: var(--navy-900); border: 1px solid var(--line-dark); border-radius: var(--radius-lg);
  box-shadow: 0 24px 48px rgba(0,0,0,.35);
  visibility: hidden; opacity: 0; transform: translateY(-6px);
  transition: opacity .18s var(--ease), transform .18s var(--ease), visibility 0s linear .18s;
}
.nav__item--sub.is-open .subnav { visibility: visible; opacity: 1; transform: none; transition: opacity .18s var(--ease), transform .18s var(--ease); }
html:not(.js) .nav__item--sub:hover .subnav,
html:not(.js) .nav__item--sub:focus-within .subnav { visibility: visible; opacity: 1; transform: none; }
.subnav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.subnav__link {
  display: flex; align-items: center; gap: 14px; padding: 12px;
  border-radius: var(--radius); text-decoration: none; color: var(--white);
}
.subnav__link:hover, .subnav__link[aria-current="page"] { background: rgba(232,237,243,.07); color: var(--white); }
.subnav__link strong { display: block; font-family: var(--font-display); font-weight: 600; font-size: 0.975rem; }
.subnav__link small { display: block; color: var(--on-dark-soft); font-size: 0.8125rem; line-height: 1.4; margin-top: 2px; }
.subnav__icon {
  width: 40px; height: 40px; flex: none; border-radius: var(--radius-sm);
  display: grid; place-items: center; background: rgba(27,163,214,.14); color: var(--cyan-300);
}
.subnav__icon svg { width: 22px; height: 22px; }
.subnav__all {
  display: flex; width: 100%; align-items: center; gap: 8px; margin-top: 6px; padding: 12px;
  border-top: 1px solid var(--line-dark); color: var(--cyan-300); text-decoration: none;
  font-weight: 700; font-size: 0.9rem;
}
.subnav__all svg { width: 16px; height: 16px; }
.subnav__all:hover { color: var(--white); }

@media (max-width: 1100px) {
  .nav__sub-toggle::after { display: none; }
  .nav__sub-toggle {
    width: 100%; justify-content: space-between; padding: 14px 0; font-size: 1.0625rem;
    border-bottom: 1px solid var(--line-dark);
  }
  .subnav {
    position: static; width: auto; padding: 4px 0 8px; border: 0; border-radius: 0; box-shadow: none;
    background: transparent; display: none; visibility: visible; opacity: 1; transform: none; transition: none;
  }
  .nav__item--sub.is-open .subnav { display: block; }
  .subnav__link { padding: 10px 4px; }
  .subnav__all { border-top: 0; padding: 10px 4px; }
  .nav { max-height: calc(100dvh - var(--header-h)); overflow-y: auto; }
}

/* ---------- Chamada final ---------- */
.cta-band { position: relative; overflow: hidden; isolation: isolate; background: var(--navy-700); color: var(--white); padding-block: clamp(56px, 8vw, 88px); }
.cta-band::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(circle at 85% 20%, rgba(27,163,214,.35), transparent 45%),
    linear-gradient(120deg, var(--navy-900) 0%, var(--navy-700) 60%, var(--steel-500) 140%);
}
.cta-band .container { display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.cta-band h2 { font-size: clamp(1.625rem, 3.2vw, 2.375rem); margin: 0 0 8px; max-width: 640px; }
.cta-band p { color: var(--on-dark-soft); margin: 0; font-size: 1.0625rem; }
.cta-band__actions { display: flex; gap: 14px; flex-wrap: wrap; }
@media (max-width: 560px) { .cta-band__actions, .cta-band__actions .btn { width: 100%; } }

/* ---------- Rodapé ---------- */
.site-footer { background: #0A1330; color: var(--on-dark-soft); padding-top: 64px; font-size: 0.95rem; }
.footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 40px; padding-bottom: 48px; }
.footer-grid h2 { font-size: 0.8125rem; letter-spacing: .12em; text-transform: uppercase; color: var(--white); margin-bottom: 16px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer-grid a { color: var(--on-dark-soft); text-decoration: none; }
.footer-grid a:hover { color: var(--white); text-decoration: underline; }
.footer-about p { max-width: 340px; margin-top: 16px; }
.footer-bottom {
  border-top: 1px solid var(--line-dark); padding-block: 22px;
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: 0.875rem;
}
.footer-bottom a { color: var(--on-dark-soft); }
.footer-bottom a:hover { color: var(--white); }
@media (max-width: 960px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-grid { grid-template-columns: 1fr; gap: 32px; } }

/* ---------- WhatsApp flutuante ---------- */
.wa-float { /* fica acima do mascote */
  position: fixed; right: 26px; bottom: 108px; z-index: 90;
  width: 58px; height: 58px; border-radius: 50%;
  display: grid; place-items: center;
  background: #177A41; color: var(--white);
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
  transition: transform .2s var(--ease), background-color .2s var(--ease);
}
.wa-float:hover { transform: scale(1.06); background: #12693A; color: var(--white); }
.wa-float svg { width: 30px; height: 30px; }
