/* ================================================================
   Meili Machining — Navigation & Footer
   Loaded on every page via <link> in <head>
   Do not put page-specific styles here.
   ================================================================ */

/* ── Nav shell ── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  height: 68px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(11,21,32,.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,.08);
  transition: height .3s, background .3s, box-shadow .3s;
}
.nav.scrolled {
  height: 60px;
  background: rgba(11,21,32,.98);
  box-shadow: 0 1px 20px rgba(0,0,0,.2);
}
.nav-inner {
  width: 100%; max-width: 1280px; padding: 0 36px;
  display: flex; align-items: center; gap: 0;
}

/* ── Logo ── */
.nav-logo {
  font-family: var(--font-display); font-weight: 700; font-size: 22px;
  color: #fff; text-decoration: none; letter-spacing: -.5px;
  margin-right: auto; flex-shrink: 0;
}
.nav-logo span { color: var(--copper-light) }

/* ── Menu list ── */
.nav-menu {
  display: flex; align-items: center; list-style: none;
  height: 68px; gap: 0;
}
.nav.scrolled .nav-menu { height: 60px }

/* ── Top-level items ── */
.nav-item {
  position: static; height: 100%;
  display: flex; align-items: center;
}
.nav-item > a {
  display: flex; align-items: center; gap: 5px;
  padding: 0 14px; height: 100%;
  font-size: 14px; font-weight: 500;
  color: rgba(255,255,255,.78); text-decoration: none;
  letter-spacing: .01em; cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color .18s, border-color .18s;
  white-space: nowrap;
}
.nav-item > a:hover,
.nav-item.active > a { color: #fff }
.nav-item.active > a { border-bottom-color: var(--copper) }

/* chevron */
.nav-item > a .chev {
  display: inline-block; width: 7px; height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
  opacity: .6; transition: transform .2s;
}
.nav-item.open > a .chev { transform: rotate(-135deg) translateY(1px) }

/* ── CTA button ── */
.nav-cta { margin-left: 16px; flex-shrink: 0 }
.nav-cta a {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--cta); color: #fff;
  padding: 10px 20px; border-radius: 7px;
  font-size: 13.5px; font-weight: 600; text-decoration: none;
  white-space: nowrap;
  transition: background .18s, transform .18s;
}
.nav-cta a:hover { background: var(--cta-hover); transform: translateY(-1px) }

/* ── Mega panel ── */
.mega {
  position: fixed; top: 68px; left: 0; right: 0;
  background: #fff;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 16px 48px rgba(11,21,32,.14);
  opacity: 0; visibility: hidden;
  transform: translateY(-6px);
  transition: opacity .22s, transform .22s, visibility .22s;
  z-index: 999;
}
.nav.scrolled .mega { top: 60px }
.nav-item.open > .mega {
  opacity: 1; visibility: visible; transform: translateY(0);
}

.mega-inner {
  max-width: 1280px; margin: 0 auto;
  padding: 32px 36px;
  display: grid; gap: 32px;
}
.mega-cols { grid-template-columns: 1.5fr 1fr }
.mega-single { grid-template-columns: 1.5fr 1fr }

/* link list */
.mega-list {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 4px 24px; align-content: start;
}
.mega-list.one-col { grid-template-columns: 1fr }

.mega-link {
  display: block; padding: 12px 14px;
  border-radius: 9px; text-decoration: none;
  transition: background .15s;
}
.mega-link:hover { background: var(--light) }
.mega-link-title {
  font-family: var(--font-display); font-size: 15px; font-weight: 600;
  color: var(--text); display: flex; align-items: center; gap: 8px;
}
.mega-link-title::before {
  content: '';
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--copper); flex-shrink: 0;
  opacity: 0; transition: opacity .15s;
}
.mega-link:hover .mega-link-title::before { opacity: 1 }
.mega-link-desc {
  font-size: 12.5px; color: var(--text-mid);
  margin-top: 2px; line-height: 1.45;
}

/* feature card */
.mega-card {
  background: var(--dark); border-radius: 12px;
  padding: 26px; color: #fff;
  display: flex; flex-direction: column; justify-content: space-between;
}
.mega-card-eye {
  font-family: var(--font-mono, monospace); font-size: 10.5px;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--copper-light); margin-bottom: 10px;
}
.mega-card h4 {
  font-family: var(--font-display); font-size: 18px;
  font-weight: 600; line-height: 1.25; margin-bottom: 8px;
}
.mega-card p {
  font-size: 13px; color: var(--text-light);
  line-height: 1.6; flex: 1;
}
.mega-card a {
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: 18px; font-size: 13px; font-weight: 600;
  color: var(--copper-light); text-decoration: none;
}

/* ── Mobile CTA: hidden on desktop, shown only in open mobile menu ── */
.nav-mobile-cta { display: none }

/* ── Hamburger ── */
.nav-toggle {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer;
  padding: 6px; margin-left: 12px;
}
.nav-toggle span {
  width: 22px; height: 2px; background: #fff;
  transition: transform .25s, opacity .25s;
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg) }
.nav-toggle.open span:nth-child(2) { opacity: 0 }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg) }

/* ── Footer ── */
.site-footer {
  background: #070D16;
  padding: 64px 36px 32px;
  color: rgba(255,255,255,.45);
  font-size: 13px;
}
.site-footer-inner {
  max-width: 1280px; margin: 0 auto;
}
.site-footer-top {
  display: grid;
  grid-template-columns: 1.8fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.footer-brand-name {
  font-family: var(--font-display); font-weight: 700;
  font-size: 22px; color: #fff;
  letter-spacing: -.5px; margin-bottom: 12px;
}
.footer-brand-name span { color: var(--copper-light) }
.footer-brand p { line-height: 1.7; max-width: 30ch }
.footer-col h5 {
  font-size: 11px; font-weight: 600; letter-spacing: .12em;
  text-transform: uppercase; color: var(--copper-light);
  margin-bottom: 16px;
}
.footer-col a {
  display: block; color: rgba(255,255,255,.5);
  text-decoration: none; margin-bottom: 10px;
  font-size: 13.5px; transition: color .15s;
}
.footer-col a:hover { color: #fff }
.site-footer-bottom {
  display: flex; justify-content: space-between;
  align-items: center; gap: 16px; flex-wrap: wrap;
  padding-top: 24px;
}
.site-footer-bottom p { font-size: 12px }

/* ── Responsive ── */
@media (max-width: 1024px) {
  .nav-inner { padding: 0 24px }
  .mega-inner { padding: 28px 24px }
  .mega-list { grid-template-columns: 1fr }
  .mega-cols { grid-template-columns: 1fr }
  .mega-card { display: none }
  .site-footer-top { grid-template-columns: 1fr 1fr; gap: 32px }
}
@media (max-width: 768px) {
  /* Hide desktop menu + standalone CTA; toggle shows menu below */
  .nav-menu { display: none }
  .nav-cta  { display: none }          /* standalone CTA hidden at mobile */
  .nav-toggle { display: flex }

  /* Open state: full-screen panel */
  .nav-menu.is-open {
    display: flex; flex-direction: column;
    position: fixed; top: 60px; left: 0; right: 0; bottom: 0;
    background: var(--dark); padding: 20px 24px 32px;
    overflow-y: auto; gap: 0; align-items: stretch;
    height: calc(100vh - 60px); z-index: 998;
  }
  .nav-menu.is-open .nav-item {
    height: auto; flex-direction: column; align-items: stretch;
    border-bottom: 1px solid rgba(255,255,255,.07);
  }
  .nav-menu.is-open .nav-item > a {
    height: auto; padding: 16px 4px; border-bottom: none;
    justify-content: space-between;
  }
  /* Mega panel becomes inline accordion on mobile */
  .nav-menu.is-open .mega {
    position: static; opacity: 1; visibility: visible;
    transform: none; box-shadow: none; border: none;
    background: transparent; display: none;
  }
  .nav-menu.is-open .nav-item.open > .mega { display: block }
  .nav-menu.is-open .mega-inner { padding: 0 0 12px 8px; gap: 0 }
  .nav-menu.is-open .mega-cols,
  .nav-menu.is-open .mega-single { grid-template-columns: 1fr }
  .nav-menu.is-open .mega-card { display: none }
  .nav-menu.is-open .mega-list { grid-template-columns: 1fr }
  .nav-menu.is-open .mega-link { padding: 10px 12px }
  .nav-menu.is-open .mega-link-title { color: rgba(255,255,255,.82); font-size: 14px }
  .nav-menu.is-open .mega-link-desc  { color: rgba(255,255,255,.42) }
  .nav-menu.is-open .mega-link:hover { background: rgba(255,255,255,.05) }

  /* ── Request a Quote CTA inside the open mobile menu ── */
  /* Injected by nav.js as .nav-mobile-cta at bottom of .nav-menu */
  .nav-mobile-cta {
    display: block; margin-top: auto; padding-top: 28px;
  }
  .nav-mobile-cta a {
    display: block; text-align: center;
    background: var(--cta); color: #fff;
    padding: 16px 24px; border-radius: 8px;
    font-size: 15px; font-weight: 600; text-decoration: none;
  }

  .site-footer-top { grid-template-columns: 1fr }
  .site-footer-bottom { flex-direction: column; text-align: center }
}
@media (prefers-reduced-motion: reduce) {
  .nav, .mega, .nav-item > a, .mega-link { transition: none }
}
