/* ================= HEADER (Unified) ================= */
:root {
  --header-height: 90px;
  --header-bg: #0b1d39;
  --header-bg-dark: #061021;
}

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

html,
body {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-height);
}

/* ── HEADER SHELL ── */
.header {
  width: 100%;
  min-height: var(--header-height);
  background: var(--header-bg);

  /* ✅ FIX: sticky → fixed so it never scrolls away on mobile */
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.18);
}

/* ✅ FIX: push page content down so it isn't hidden under fixed header */
body {
  padding-top: var(--header-height);
}

/* ── NAV WRAPPER ── */
.nav {
  width: 100%;
  max-width: 100%; /* Let it expand fully to the corners */
  margin: 0;
  min-height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 20px;
  padding: 0 30px; /* Space from the absolute edge */
}

/* ── LOGO ── */
.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  flex-shrink: 0;
}

.logo img {
  max-height: 85px;
  width: auto;
  flex-shrink: 0;
  object-fit: contain;
  transition: transform 0.3s ease;
  transform: scale(1.6);
  transform-origin: left center;
}

.logo:hover img {
  transform: scale(1.65);
}

.company-name {
  color: #ff9f1a;
  font-size: clamp(14px, 1.5vw, 20px);
  font-weight: 600;
  white-space: nowrap;
  overflow: visible;
  text-overflow: unset;
  max-width: none;
}

/* ── MENU (DESKTOP) ── */
.menu {
  list-style: none;
  display: flex;
  flex: 0 1 auto;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: nowrap;
  gap: 8px; /* Slightly larger gap between items */
  margin: 0 24px 0 auto; /* Push to the right, with gap before actions */
  padding: 0;
}

.menu a {
  text-decoration: none;
  color: #fff;
  font-size: 14.5px;
  font-weight: 500;
  padding: 8px 18px; /* Better pill shape */
  border-radius: 25px;
  transition: all 0.25s ease;
  white-space: nowrap;
}

.menu a:hover,
.menu a.active {
  background: #ff9f1a;
  color: #08142a;
  box-shadow: 0 4px 12px rgba(255, 159, 26, 0.25);
}

/* ── NAV ACTIONS (DESKTOP) ── */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.theme-toggle {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: #fff;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-1px);
}

/* ── MOBILE HAMBURGER ── */
.menu-toggle {
  display: none;
  font-size: 24px;
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
  margin-left: auto; /* Push to the right on mobile */
}

/* ── MOBILE-ONLY ACTIONS (inside menu) ── */
.mobile-actions {
  display: none;
  width: 100%;
  margin-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 16px;
}

.mobile-actions .theme-toggle {
  width: auto;
  min-width: 44px;
  padding: 10px 14px;
  border-radius: 30px;
}

/* ── DARK MODE ── */
body.dark .header {
  background: var(--header-bg-dark);
}

body.dark .theme-toggle {
  background: #ff9f1a;
  color: #08142a;
  border-color: transparent;
}

body.dark .menu {
  background: var(--header-bg-dark);
}

/* ── TABLET (≤ 992px) ── */
@media (max-width: 992px) {
  .nav {
    padding: 0 20px;
    gap: 16px;
  }

  .logo img {
    max-height: 60px;
  }

  .company-name {
    font-size: clamp(13px, 1.4vw, 17px);
    max-width: none;
  }

  .menu a {
    font-size: 14px;
    padding: 6px 12px;
  }
}

/* ── MOBILE (≤ 768px) ── */
@media (max-width: 768px) {
  .logo img {
    max-height: 52px;
  }

  .company-name {
    font-size: clamp(13px, 3vw, 16px);
    max-width: none;
  }

  /* show hamburger, hide desktop theme btn */
  .menu-toggle {
    display: block;
  }

  .nav-actions .theme-toggle {
    display: none;
  }

  /* slide-down mobile menu */
  .menu {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    width: 100vw;
    max-width: 100vw;
    height: auto !important;
    min-height: unset !important;
    max-height: calc(100vh - var(--header-height));
    background: var(--header-bg);
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    flex-wrap: nowrap;
    padding: 20px 20px 30px;
    gap: 14px;
    box-shadow: 0 12px 26px rgba(0, 0, 0, 0.25);
    transform: translateY(-110%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.35s ease, opacity 0.35s ease;
    overflow-y: auto;
    z-index: 9998;
  }

  .menu.show,
  .menu.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .menu li {
    width: 100%;
    text-align: center;
  }

  .menu a {
    display: block;
    padding: 12px 16px;
    font-size: 16px;
  }

  .mobile-actions {
    display: flex;
    justify-content: center;
  }
}

/* ── SMALL MOBILE (≤ 520px) ── */
@media (max-width: 520px) {
  .nav {
    padding: 0 16px;
  }

  .company-name {
    font-size: clamp(12px, 3.5vw, 15px);
    max-width: none;
  }
}