/* Shared header / nav styles — included on every page via <link>. */

/* ── Site header ──────────────────────────────── */
.site-header {
  display: flex;
  flex-direction: column;
  background: #0a2342;
  padding: 0.5rem 0.85rem 0.4rem;
  gap: 0.25rem;
  overflow: hidden;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  min-width: 0;
  overflow: hidden;
}

.nav-brand {
  flex: 1;
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.nav-brand:hover { opacity: 0.9; }

.nav-honest {
  color: #a0b4c8;
  font-size: 1.1rem;
  text-decoration: none;
  margin-left: auto;
  flex-shrink: 0;
  padding: 0.1rem 0.3rem;
}
.nav-honest:hover { color: #fff; }

#nav-strip {
  display: flex;
  flex-direction: column;
  width: 100%;
  gap: 0.2rem;
  padding-bottom: 0.3rem;
}

.nav-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.8rem;
  width: 100%;
}

/* ── Nav links ────────────────────────────────── */
.nav-link {
  color: #a0b4c8;
  text-decoration: none;
  font-size: 0.85rem;
  font-family: inherit;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.15rem 0;
  white-space: nowrap;
}
.nav-link:hover { color: #fff; }

.nav-find-parts {
  background: #1a3a5c;
  color: #fff !important;
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.82rem;
}

.nav-add {
  background: #0d3b6e;
  color: #fff !important;
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.82rem;
}

.nav-stock {
  background: #15375c;
  color: #fff !important;
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: 0.82rem;
}

.nav-logout {
  color: #a0b4c8;
  padding: 0.25rem 0.6rem;
  border: 1px solid #2a4a6a;
  border-radius: 6px;
  margin-left: auto;
}
.nav-logout:hover { color: #fff; border-color: #4a7aaa; }

.nav-link-admin {
  background: rgba(251,191,36,0.18);
  color: #fbbf24 !important;
  padding: 0.22rem 0.65rem;
  border-radius: 4px;
  text-decoration: none;
}
.nav-link-admin:hover { background: rgba(251,191,36,0.3); }

.nav-row-admin {
  border-top: 1px solid rgba(255,255,255,0.08);
  padding-top: 0.3rem;
  margin-top: 0.1rem;
}

.nav-row-admin .nav-link-admin {
  font-size: 0.82rem;
  font-weight: 600;
}

/* ── iPhone Safari fix ────────────────────────── */
@supports (-webkit-touch-callout: none) {
  .site-header { -webkit-text-size-adjust: 100%; }
  .nav-link { -webkit-tap-highlight-color: transparent; }
  button.nav-link {
    -webkit-appearance: none;
    appearance: none;
  }
}

/* ── Mobile: explicit column stack ───────────── */
@media (max-width: 899px) {
  .site-header {
    flex-direction: column;
  }
  #nav-strip {
    flex-direction: column;
    width: 100%;
  }
  .nav-row-2,
  .nav-row-3 {
    display: flex;
    flex-wrap: wrap;
    width: 100%;
    gap: 0.4rem 0.8rem;
  }
  .nav-row-2 {
    order: 1;
  }
  .nav-row-3 {
    order: 2;
  }
}

/* ── Desktop: everything on one line ─────────── */
@media (min-width: 900px) {
  .site-header {
    flex-direction: row;
    align-items: center;
    flex-wrap: nowrap;
    padding: 0.4rem 1.2rem;
  }
  .header-left {
    width: auto;
    flex-shrink: 0;
  }
  #nav-strip {
    flex-direction: row;
    flex: 1;
    justify-content: flex-end;
    align-items: center;
    gap: 0.4rem 0.8rem;
    padding-bottom: 0;
  }
  .nav-row {
    width: auto;
    gap: 0.4rem 0.8rem;
  }
  .nav-row-2,
  .nav-row-3 {
    display: contents;
  }
  .nav-logout {
    margin-left: 0.5rem;
  }
  .nav-honest {
    margin-left: 1rem;
  }
}

/* Subtle parent-site link, far left of header */
.nav-back-link {
  display: flex;
  align-items: center;
  text-decoration: none;
  flex-shrink: 0;
}
.nav-back-link:hover { opacity: 0.8; }

/* Logo image in nav */
.nav-logo-img {
  height: 32px;
  width: auto;
  object-fit: contain;
  display: block;
  margin-right: 0.35rem;
}
/* Text fallback — shown only when logo.png fails to load */
.nav-logo-fallback {
  font-size: 0.7rem;
  color: rgba(255,255,255,0.45);
  white-space: nowrap;
  letter-spacing: 0.01em;
}

/* Company footer — minimal bar used on every page */
.company-footer {
  text-align: center;
  padding: 1.5rem 1rem;
  font-size: 0.8rem;
  color: #888;
  border-top: 1px solid #eee;
  line-height: 1.8;
}
.company-footer a {
  color: #0a2342;
  text-decoration: none;
}
.company-footer a:hover { text-decoration: underline; }
.footer-tagline {
  display: block;
  font-size: 0.75rem;
  color: #aaa;
  margin-top: 0.2rem;
  cursor: pointer;
  text-decoration: none;
  transition: color 0.2s;
}
.footer-tagline:hover {
  color: #0a2342;
}

/* Company footer bar — embedded inside index.html's platform-statement footer */
.company-footer-bar {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.9rem;
  padding-top: 0.65rem;
  border-top: 1px solid #dde1e7;
  font-size: 0.75rem;
  color: #bbb;
}
.company-footer-bar a { color: #999; text-decoration: none; }
.company-footer-bar a:hover { text-decoration: underline; }
