/* ============================================================
   Postbox Services header styles (matches staging.postboxservices.com)
   Load in <head>: <link rel="stylesheet" href="/nav.css">
   Requires: <meta name="viewport" content="width=device-width, initial-scale=1.0">
   ============================================================ */

:root {
  --navy:       #0A2540;
  --navy-dark:  #1a1a2e;
  --cyan:       #00D4FF;
  --purple:     #7C3AED;
  --gradient-primary: linear-gradient(135deg, #00D4FF, #7C3AED);
  --gradient-dark:    linear-gradient(135deg, #0A2540 0%, #1a1a2e 100%);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  /* two-tone like the main site: topbar stays solid #0A2540, the nav row shows
     the dark brand gradient (what production renders behind its translucent header) */
  background: linear-gradient(135deg, #0A2540 0%, #1a1a2e 100%);
  border-bottom: 1px solid rgba(0, 212, 255, 0.15);
}

.site-header a { text-decoration: none; }
.site-header ul { margin: 0; padding: 0; }

/* --- Topbar --- */
.topbar {
  background: #0A2540;
  border-bottom: 1px solid rgba(0, 212, 255, 0.1);
  font-family: 'Times New Roman', Times, serif;
}

.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.3rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
}

.topbar-socials {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.topbar-socials a {
  display: inline-flex;
  align-items: center;
  color: rgba(255, 255, 255, 0.65);
  transition: color 0.2s, transform 0.2s;
}

.topbar-socials a:hover {
  color: #00D4FF;
  transform: translateY(-1px);
}

.topbar-contact {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.topbar-contact a {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.75);
  transition: color 0.2s;
}

.topbar-contact a:hover { color: #00D4FF; }

/* --- Main nav row --- */
.nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav-logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.nav-logo img {
  height: 38px;
  width: auto;
}

ul.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  margin-left: auto;
}

.nav-links > li {
  display: flex;
  align-items: center;
}

.nav-link {
  font-family: 'Times New Roman', Times, serif;
  font-size: 0.95rem;
  font-weight: 400;
  line-height: 1.2;
  color: #00D4FF;
  margin: 0;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  transition: color 0.2s;
  background: none;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-link:hover,
.nav-link.active {
  color: #e53e3e;
  background: transparent;
}

.caret { font-size: 0.7em; line-height: 1; }

/* --- Dropdowns (desktop: open on hover) --- */
.has-dropdown { position: relative; }

ul.dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 280px;
  background: #0A2540;
  border: 1px solid rgba(0, 212, 255, 0.2);
  border-radius: 0 0 10px 10px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
  list-style: none;
  padding: 0.5rem 0;
  margin: 0;
}

@media (min-width: 901px) {
  .has-dropdown:hover .dropdown,
  .has-dropdown:focus-within .dropdown {
    display: block;
  }
}

.nav-links > li.mobile-cta-item { display: none; }

.dropdown-link {
  display: block;
  font-family: 'Times New Roman', Times, serif;
  font-size: 0.9rem;
  color: #00D4FF;
  padding: 0.5rem 1.1rem;
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
}

.dropdown-link:hover {
  color: #e53e3e;
  background: rgba(0, 212, 255, 0.06);
}

.nav-cta {
  font-family: 'Times New Roman', Times, serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--navy);
  background: var(--gradient-primary);
  padding: 0.5rem 1.25rem;
  border-radius: 6px;
  flex-shrink: 0;
  transition: opacity 0.2s, transform 0.2s;
}

.nav-cta:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  margin-left: auto;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform 0.3s;
}

/* --- Mobile: hamburger + accordion groups --- */
@media (max-width: 900px) {
  ul.nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--navy);
    flex-direction: column;
    padding: 1rem 1.5rem 1.5rem;
    border-bottom: 1px solid rgba(0, 212, 255, 0.15);
    gap: 0.25rem;
    max-height: calc(100vh - 96px);
    overflow-y: auto;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links > li {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .nav-link {
    width: 100%;
    text-align: left;
    padding: 0.6rem 0.5rem;
    font-size: 1.05rem;
  }

  .nav-toggle {
    display: flex;
    margin-left: auto;
  }

  .nav-cta {
    display: none;
  }

  /* On mobile, dropdowns are collapsed accordions toggled by tap */
  .has-dropdown .drop-trigger {
    width: 100%;
    justify-content: space-between;
    cursor: pointer;
  }

  .caret {
    transition: transform 0.2s;
  }

  .has-dropdown.open .caret {
    transform: rotate(180deg);
  }

  ul.dropdown {
    display: none;
    position: static;
    min-width: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0 0 0.25rem 1rem;
  }

  .has-dropdown.open .dropdown {
    display: block;
  }

  .dropdown-link {
    white-space: normal;
    padding: 0.5rem;
    font-size: 1rem;
  }

  .nav-links > li.mobile-cta-item {
    display: flex;
    margin-top: 0.75rem;
  }

  .mobile-cta {
    display: block;
    width: 100%;
    text-align: center;
    font-family: 'Times New Roman', Times, serif;
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    border: 1px solid #fff;
    border-radius: 8px;
    padding: 0.7rem 1rem;
  }

  .topbar-inner { justify-content: center; gap: 1rem; flex-wrap: wrap; }
}

/* --- Floating WhatsApp button (same as postboxservices.com) --- */
.whatsapp-float {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 90;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.wa-bubble {
  font-family: 'Times New Roman', Times, serif;
  background: #25D366;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  padding: 10px 16px;
  border-radius: 10px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  white-space: nowrap;
  opacity: 0;
  transform: translateX(8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}

.whatsapp-float:hover .wa-bubble,
.whatsapp-float:focus .wa-bubble {
  opacity: 1;
  transform: translateX(0);
}

.wa-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #25D366;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.whatsapp-float:hover .wa-icon {
  transform: scale(1.08);
  box-shadow: 0 10px 28px rgba(37, 211, 102, 0.45);
}

@media (max-width: 600px) {
  /* sit above mobile browser bottom bars */
  .whatsapp-float { right: 14px; bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
  .wa-icon { width: 50px; height: 50px; }
}
