/* ================= Header ================= */
#site-header { min-height: 0; }

.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  height: var(--header-h);
  display: flex;
  align-items: center;
  transition: background 0.4s var(--ease), box-shadow 0.4s var(--ease), height 0.4s var(--ease), transform 0.5s var(--ease);
  animation: headerDrop 0.9s var(--ease) backwards;
}
@keyframes headerDrop { from { transform: translateY(-100%); opacity: 0; } to { transform: none; opacity: 1; } }

.site-header.scrolled {
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  box-shadow: 0 1px 0 var(--line), 0 10px 30px -18px rgba(0, 40, 140, 0.25);
  height: 68px;
}
.site-header.hidden { transform: translateY(-110%); }

.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; }

.brand { position: relative; display: block; width: 150px; height: 48px; flex-shrink: 0; }
.brand img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; transition: opacity 0.4s, transform 0.4s var(--ease); }
.brand .logo-dark { opacity: 0; }
.site-header.scrolled .brand .logo-light { opacity: 0; }
.site-header.scrolled .brand .logo-dark { opacity: 1; }
.brand:hover img { transform: scale(1.04); }

/* Nav */
.main-nav { display: flex; align-items: center; }
.nav-list { display: flex; align-items: center; gap: 4px; }
.nav-list > li { position: relative; }

.nav-link {
  position: relative;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 10px 16px;
  border-radius: 100px;
  background: none; border: 0; cursor: pointer;
  font-family: var(--font-head);
  font-weight: 500;
  font-size: 0.96rem;
  color: rgba(255, 255, 255, 0.86);
  transition: color 0.3s, background 0.3s;
}
.nav-link i { font-size: 0.65rem; transition: transform 0.35s var(--ease); }
.nav-link::after {
  content: "";
  position: absolute; left: 50%; bottom: 3px;
  width: 5px; height: 5px; border-radius: 50%;
  background: currentColor;
  transform: translateX(-50%) scale(0);
  transition: transform 0.35s var(--ease-back);
}
.nav-link:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.nav-link.active { color: #fff; }
.nav-link.active::after { transform: translateX(-50%) scale(1); }

.site-header.scrolled .nav-link { color: var(--ink-2); }
.site-header.scrolled .nav-link:hover { color: var(--primary); background: var(--primary-50); }
.site-header.scrolled .nav-link.active { color: var(--primary); }

/* Dropdowns */
.dropdown {
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 30px 70px -20px rgba(4, 10, 35, 0.35);
  padding: 12px;
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, 12px) scale(0.97);
  transform-origin: top center;
  transition: opacity 0.3s var(--ease), transform 0.35s var(--ease), visibility 0.3s;
}
.dropdown::before { content: ""; position: absolute; left: 0; right: 0; top: -16px; height: 16px; }

.has-dropdown:hover > .dropdown,
.has-dropdown.open > .dropdown { opacity: 1; visibility: visible; transform: translate(-50%, 0) scale(1); }
.has-dropdown:hover > .dd-toggle i,
.has-dropdown.open > .dd-toggle i { transform: rotate(180deg); }

.dropdown.list { width: 310px; display: grid; }
.dropdown.list a {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px;
  border-radius: 12px;
  color: var(--ink-2);
  font-weight: 500;
  font-size: 0.93rem;
  transition: background 0.25s, color 0.25s, transform 0.25s var(--ease);
}
.dropdown.list a i { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--primary-50); color: var(--primary); font-size: 0.85rem; transition: background 0.25s, color 0.25s; }
.dropdown.list a:hover { background: var(--bg-soft); color: var(--primary); transform: translateX(4px); }
.dropdown.list a:hover i { background: var(--primary); color: #fff; }

.dropdown.mega { width: 600px; padding: 14px; }
.mega-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.mega-item {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 14px;
  border-radius: 14px;
  color: var(--ink-2);
  transition: background 0.25s, transform 0.3s var(--ease);
}
.mega-item:hover { background: var(--bg-soft); transform: translateY(-2px); }
.mega-item strong { display: block; font-family: var(--font-head); color: var(--ink); font-size: 0.98rem; font-weight: 600; }
.mega-item strong .ext { font-size: 0.6rem; color: var(--muted); margin-left: 3px; vertical-align: 2px; }
.mega-item small { color: var(--muted); font-size: 0.83rem; line-height: 1.4; display: block; margin-top: 2px; }
.mi-icon {
  flex-shrink: 0;
  width: 44px; height: 44px; border-radius: 12px;
  display: grid; place-items: center;
  background: var(--grad); color: #fff; font-size: 1.05rem;
  box-shadow: 0 8px 18px -8px rgba(0, 67, 209, 0.7);
  transition: transform 0.4s var(--ease-back);
}
.mi-icon.wa { background: linear-gradient(135deg, #0043d1, #25d366); }
.mega-item:hover .mi-icon { transform: rotate(-8deg) scale(1.08); }
.mega-foot {
  margin-top: 8px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--bg-soft);
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px;
  font-size: 0.85rem;
}
.mega-foot span { color: var(--muted); font-weight: 500; }
.mega-foot a { font-weight: 600; }
.mega-foot a:hover { text-decoration: underline; }

/* Actions */
.header-actions { display: flex; align-items: center; gap: 12px; }
.burger {
  display: none;
  width: 46px; height: 46px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
  position: relative;
  z-index: 2;
}
.burger span {
  position: absolute; left: 13px; right: 13px;
  height: 2px; border-radius: 2px;
  background: #fff;
  transition: transform 0.4s var(--ease), opacity 0.3s, top 0.4s var(--ease), background 0.3s;
}
.burger span:nth-child(1) { top: 16px; }
.burger span:nth-child(2) { top: 22px; }
.burger span:nth-child(3) { top: 28px; }
.site-header.scrolled .burger { border-color: var(--line); background: #fff; }
.site-header.scrolled .burger span { background: var(--ink); }
.menu-open .burger span { background: var(--ink); }
.menu-open .burger span:nth-child(1) { top: 22px; transform: rotate(45deg); }
.menu-open .burger span:nth-child(2) { opacity: 0; transform: translateX(10px); }
.menu-open .burger span:nth-child(3) { top: 22px; transform: rotate(-45deg); }

.mobile-only { display: none; }

/* ---------- Mobile ---------- */
@media (max-width: 1080px) {
  .burger { display: block; }
  .header-cta { display: none; }

  .main-nav {
    position: fixed;
    inset: 0;
    background: #fff;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: calc(var(--header-h) + 20px) 24px 32px;
    overflow-y: auto;
    clip-path: circle(0% at calc(100% - 44px) 38px);
    transition: clip-path 0.7s var(--ease);
    visibility: hidden;
  }
  .menu-open .main-nav { clip-path: circle(150% at calc(100% - 44px) 38px); visibility: visible; }
  .menu-open .brand .logo-light { opacity: 0; }
  .menu-open .brand .logo-dark { opacity: 1; }
  .brand, .header-actions { position: relative; z-index: 2; }

  .nav-list { flex-direction: column; align-items: stretch; gap: 2px; }
  .nav-list > li {
    opacity: 0; transform: translateY(20px);
    transition: opacity 0.4s, transform 0.5s var(--ease);
  }
  .menu-open .nav-list > li { opacity: 1; transform: none; }
  .menu-open .nav-list > li:nth-child(1) { transition-delay: 0.15s; }
  .menu-open .nav-list > li:nth-child(2) { transition-delay: 0.2s; }
  .menu-open .nav-list > li:nth-child(3) { transition-delay: 0.25s; }
  .menu-open .nav-list > li:nth-child(4) { transition-delay: 0.3s; }
  .menu-open .nav-list > li:nth-child(5) { transition-delay: 0.35s; }
  .menu-open .nav-list > li:nth-child(6) { transition-delay: 0.4s; }

  .nav-link, .site-header.scrolled .nav-link {
    width: 100%;
    justify-content: space-between;
    color: var(--ink);
    font-size: 1.35rem;
    font-weight: 600;
    padding: 14px 6px;
    border-radius: 0;
    border-bottom: 1px solid var(--line);
  }
  .nav-link:hover, .site-header.scrolled .nav-link:hover { background: none; color: var(--primary); }
  .nav-link.active { color: var(--primary); }
  .nav-link::after { display: none; }
  .nav-link i { font-size: 0.85rem; }

  .dropdown, .dropdown.mega, .dropdown.list {
    position: static;
    width: 100%;
    transform: none;
    opacity: 1;
    visibility: visible;
    box-shadow: none;
    border: 0;
    padding: 0;
    display: grid;
    grid-template-rows: 0fr;
    transition: grid-template-rows 0.45s var(--ease);
  }
  .dropdown > * { overflow: hidden; min-height: 0; }
  .has-dropdown:hover > .dropdown { transform: none; }
  .has-dropdown:hover > .dd-toggle i { transform: none; }
  .has-dropdown.open > .dropdown { grid-template-rows: 1fr; }
  .has-dropdown.open > .dd-toggle i { transform: rotate(180deg); }
  .dropdown.list { display: grid; }
  .dropdown.list > a { overflow: hidden; }
  .dropdown.list { grid-template-rows: none; max-height: 0; overflow: hidden; transition: max-height 0.5s var(--ease); }
  .has-dropdown.open > .dropdown.list { max-height: 520px; padding: 8px 0; }
  .dropdown.mega { grid-template-rows: none; max-height: 0; overflow: hidden; transition: max-height 0.5s var(--ease); }
  .has-dropdown.open > .dropdown.mega { max-height: 760px; padding: 8px 0; }
  .mega-grid { grid-template-columns: 1fr; }
  .mega-item { padding: 10px 6px; }

  .mobile-only { display: grid; }
  .mobile-contact { gap: 12px; margin-top: 28px; }
  .mobile-contact a {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 18px; border-radius: 14px;
    background: var(--bg-soft); color: var(--ink); font-weight: 500;
  }
  .mobile-contact i { color: var(--primary); }
}

@media (max-width: 680px) {
  .brand { width: 128px; height: 41px; }
}
