/* ============================================================
   AutoCalcHub — Global Stylesheet
   assets/css/style.css
   ============================================================ */

:root {
  --navy: #0f1b2d;
  --navy-light: #1a2e45;
  --navy-mid: #243b55;
  --orange: #f47c20;
  --orange-light: #ffa64d;
  --orange-pale: #fff3e8;
  --white: #ffffff;
  --off-white: #f8f9fb;
  --charcoal: #1e1e1e;
  --mid: #5a6472;
  --light: #9aa3ad;
  --border: #e2e6ea;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--off-white);
  color: var(--charcoal);
  line-height: 1.6;
}

/* ── NAV ── */
nav {
  position: sticky; top: 0; z-index: 200;
  background: var(--navy);
  padding: 0 2rem;
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.logo {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.2rem; font-weight: 700;
  color: var(--white);
  text-decoration: none;
  flex-shrink: 0;
  letter-spacing: -0.02em;
}
.logo span { color: var(--orange); }

/* ── TOP-LEVEL NAV ── */
.nav-links {
  display: flex; gap: 0; list-style: none; align-items: center; height: 64px;
}
.nav-links > li {
  position: relative; height: 100%;
  display: flex; align-items: center;
}
.nav-links > li > a,
.nav-links > li > button {
  font-size: 0.875rem; font-weight: 500;
  color: rgba(255,255,255,0.75); text-decoration: none;
  background: none; border: none; cursor: pointer;
  font-family: 'Inter', sans-serif;
  padding: 0 1rem; height: 100%;
  display: flex; align-items: center; gap: 0.3rem;
  transition: color 0.2s;
  white-space: nowrap;
}
.nav-links > li > a:hover,
.nav-links > li > button:hover,
.nav-links > li > a.active { color: var(--orange); }

.nav-links > li > button::after {
  content: '▾';
  font-size: 0.7rem;
  transition: transform 0.2s;
}
.nav-links > li.open > button::after { transform: rotate(180deg); }

/* ── DROPDOWN ── */
.nav-dropdown {
  display: none;
  position: absolute; top: 100%;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  min-width: 240px;
  padding: 0.75rem 0;
  z-index: 300;
  white-space: nowrap;
}
.nav-has-dropdown:nth-child(1) .nav-dropdown { left: 0; }
.nav-has-dropdown:nth-child(2) .nav-dropdown { right: -80px; left: auto; max-height: 70vh; overflow-y: auto; }
.nav-links > li.open .nav-dropdown { display: block; }

.nav-dropdown-section { padding: 0.25rem 0; }
.nav-dropdown-section + .nav-dropdown-section {
  border-top: 1px solid var(--border);
  margin-top: 0.25rem; padding-top: 0.5rem;
}
.nav-dropdown-label {
  font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--light);
  padding: 0.25rem 1rem 0.4rem;
}
.nav-dropdown a {
  display: block;
  padding: 0.45rem 1.25rem;
  font-size: 0.85rem; color: var(--mid);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.nav-dropdown a:hover {
  background: var(--orange-pale);
  color: var(--orange);
}

/* ── BACK LINK ── */
.nav-back {
  font-size: 0.875rem; color: rgba(255,255,255,0.6); text-decoration: none;
  display: flex; align-items: center; gap: 0.4rem;
}
.nav-back:hover { color: var(--orange); }

/* ── FOOTER ── */
footer {
  background: var(--navy); color: rgba(255,255,255,0.5);
  padding: 2rem; margin-top: 4rem;
}
.footer-inner {
  max-width: 1100px; margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 1rem;
}
.footer-logo { font-family: 'Space Grotesk', sans-serif; font-size: 1.1rem; color: white; text-decoration: none; font-weight: 700; }
.footer-logo span { color: var(--orange); }
.footer-links { display: flex; gap: 1.5rem; }
.footer-links a { color: rgba(255,255,255,0.5); text-decoration: none; font-size: 0.85rem; transition: color 0.2s; }
.footer-links a:hover { color: var(--orange); }
.footer-copy { font-size: 0.8rem; }

/* ── HAMBURGER ── */
.nav-hamburger {
  display: none;
  flex-direction: column; justify-content: center; gap: 5px;
  width: 36px; height: 36px;
  background: none; border: none; cursor: pointer; padding: 4px;
  flex-shrink: 0;
}
.nav-hamburger span {
  display: block; height: 2px; width: 100%;
  background: white; border-radius: 2px;
  transition: all 0.25s; transform-origin: center;
}
.nav-hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-hamburger.open span:nth-child(2) { opacity: 0; }
.nav-hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── AD BANNER ── */
.ad-banner {
  background: var(--border); color: var(--light);
  text-align: center; padding: 1rem;
  font-size: 0.75rem; margin: 2rem auto;
  max-width: 728px; border-radius: 4px;
}

/* ── MOBILE ── */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .nav-hamburger { display: flex; }

  .nav-links.open {
    display: flex; flex-direction: column;
    position: absolute; top: 64px; left: 0; right: 0;
    background: var(--navy);
    border-bottom: 1px solid var(--navy-light);
    padding: 0.5rem 0 1rem; gap: 0; z-index: 199;
    max-height: calc(100vh - 64px); overflow-y: auto;
    height: auto; align-items: stretch;
  }
  .nav-links > li { height: auto; flex-direction: column; align-items: stretch; border-bottom: 1px solid var(--navy-light); }
  .nav-links > li:last-child { border-bottom: none; }
  .nav-links > li > a, .nav-links > li > button {
    padding: 0.875rem 1.5rem; font-size: 1rem;
    height: auto; justify-content: space-between; width: 100%;
  }
  .nav-dropdown {
    position: static; box-shadow: none; border: none; border-radius: 0;
    border-top: 1px solid var(--navy-light); padding: 0;
    background: var(--navy-light); white-space: normal; min-width: unset; width: 100%;
  }
  .nav-has-dropdown:nth-child(1) .nav-dropdown,
  .nav-has-dropdown:nth-child(2) .nav-dropdown { left: auto; right: auto; }
  .nav-links > li.open .nav-dropdown { display: block; }
  .nav-dropdown-label { padding: 0.625rem 1.5rem 0.25rem; color: rgba(255,255,255,0.4); }
  .nav-dropdown a { padding: 0.6rem 2rem; font-size: 0.9rem; color: rgba(255,255,255,0.7); white-space: normal; }
  .nav-dropdown a:hover { background: var(--navy-mid); color: var(--orange); }
}
