/*
 * Shared header — byte-for-byte geometry with the marketing site's Navbar
 * (alexawebservers-staging/src/components/layout/Navbar.tsx).
 *
 * Breakpoints, deliberately identical to Tailwind's used on the LP:
 *   nav visible  : min-width 1280px  (LP: hidden xl:flex)
 *   burger       : max-width 1279.98px (LP: xl:hidden)
 *   account icon : min-width 768px   (LP: hidden md:inline-flex)
 * Anything that changes here must change in Navbar.tsx in the same commit.
 */

.aws-hdr {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.95);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
}

.aws-hdr__container {
  width: min(calc(100% - 32px), 1280px);
  margin: 0 auto;
}

.aws-hdr__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

/* ── Brand ── */
.aws-hdr__brand {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  text-decoration: none;
}
.aws-hdr__brand img {
  display: block;
  height: 36px;
  width: auto;
}
.aws-hdr__brand-name {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #0f172a;
  white-space: nowrap;
}

/* ── Desktop nav (>= 1280px) ── */
.aws-hdr__nav {
  display: none;
  flex: 1;
  align-items: center;
  justify-content: space-between;
  margin: 0 16px;
}

.aws-hdr__nav > a,
.aws-hdr__group > a {
  display: flex;
  flex: 1;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 600;
  color: #1d4ed8;
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.aws-hdr__nav > a:hover,
.aws-hdr__group > a:hover,
.aws-hdr__nav > a[aria-current="page"] {
  border-bottom-color: #2563eb;
}
.aws-hdr__group > a svg {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
}

/* Divider between items — same gradient as the LP's .nav-divider */
.aws-hdr__divider {
  width: 1px;
  height: 34px;
  align-self: center;
  flex-shrink: 0;
  background: linear-gradient(to bottom, #ffffff 0%, #2563eb 45%, #16a34a 55%, #ffffff 100%);
}

/* ── Services dropdown (hover, like the LP) ── */
.aws-hdr__group {
  position: relative;
  display: flex;
  flex: 1;
}
.aws-hdr__dropdown {
  display: none;
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  padding-top: 8px;
  z-index: 60;
}
.aws-hdr__group:hover .aws-hdr__dropdown,
.aws-hdr__group:focus-within .aws-hdr__dropdown {
  display: block;
}
.aws-hdr__dropdown-inner {
  width: max-content;
  padding: 8px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 24px 48px -24px rgba(15, 23, 42, 0.35);
}
.aws-hdr__dropdown-inner a {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #1d4ed8;
  text-decoration: none;
  white-space: nowrap;
}
.aws-hdr__dropdown-inner a:hover {
  background: #eff6ff;
  color: #1e40af;
}

/* ── Burger: the LP's 36px borderless control ── */
.aws-header-burger {
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  padding: 8px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #64748b;
  box-shadow: none;
}
.aws-header-burger:hover {
  border: 0;
  background: #f1f5f9;
  color: #334155;
}
.aws-header-burger__open,
.aws-header-burger__close,
.aws-header-burger svg {
  width: 20px;
  height: 20px;
}

/* ── Right cluster ── */
.aws-hdr__right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.aws-hdr__avatar {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid #e2e8f0;
  background: transparent;
  color: #64748b;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: border-color 0.2s ease, color 0.2s ease;
}
.aws-hdr__avatar:hover {
  border-color: #2563eb;
  color: #2563eb;
}
.aws-hdr__avatar svg {
  width: 20px;
  height: 20px;
}

/* The logged-in trigger shares the avatar look */
.aws-account-menu .aws-account-menu__trigger.aws-hdr__avatar {
  display: none;
}

/* ── Burger (geometry set in the block above) ── */
.aws-header-burger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* ── Mobile panel ── */
.aws-hdr__mobile {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 1px solid #f1f5f9;
  border-bottom: 1px solid #e2e8f0;
  box-shadow: 0 18px 40px -18px rgba(15, 23, 42, 0.25);
  padding: 16px;
  max-height: calc(100vh - 64px);
  overflow-y: auto;
}
.aws-hdr__mobile.is-open {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.aws-hdr__mobile a {
  display: flex;
  align-items: center;
  padding: 12px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  color: #334155;
  text-decoration: none;
}
.aws-hdr__mobile a:hover {
  color: #1d4ed8;
  background: #eff6ff;
}
/* current section: the LP's blue-50 fill plus its 1px blue-200 ring */
.aws-hdr__mobile a.is-active {
  color: #1d4ed8;
  background: #eff6ff;
  font-weight: 600;
  box-shadow: 0 0 0 1px #bfdbfe;
}
.aws-hdr__mobile-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  line-height: 20px;
  color: #334155;
  cursor: pointer;
  text-align: left;
}
.aws-hdr__mobile-toggle:hover {
  background: #f8fafc;
}
.aws-hdr__mobile-toggle svg {
  width: 16px;
  height: 16px;
  transition: transform 0.2s ease;
}
.aws-hdr__mobile-toggle[aria-expanded="true"] svg {
  transform: rotate(180deg);
}

.aws-hdr__mobile-sub {
  display: none;
  margin: 0 0 4px 12px;
  padding-left: 12px;
  border-left: 2px solid #f1f5f9;
}
.aws-hdr__mobile-sub.is-open {
  display: block;
}
.aws-hdr__mobile-sub a {
  padding: 9px 12px;
  font-weight: 500;
  color: #475569;
}
/* login row outranks the generic item rule above (same specificity trap as the burger) */
.aws-hdr__mobile a.aws-hdr__mobile-login {
  justify-content: center;
  gap: 8px;
  margin-top: 0;
  padding: 12px 0;
  border: 2px solid #e2e8f0;
  font-weight: 700;
  color: #334155;
}
.aws-hdr__mobile-login svg {
  width: 16px;
  height: 16px;
}
.aws-hdr__mobile-lang {
  display: flex;
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid #f1f5f9;
}
.aws-hdr__mobile-lang a {
  flex: 1;
  justify-content: center;
  gap: 8px;
  padding: 8px;
  background: #f1f5f9;
  color: #475569;
  font-size: 14px;
  font-weight: 700;
}
.aws-hdr__mobile-lang a.is-active {
  background: #2563eb;
  color: #fff;
}
.aws-hdr__mobile-lang img {
  width: 20px;
  height: 15px;
  border-radius: 2px;
}

/* ── Breakpoints (identical to the LP) ── */
@media (min-width: 768px) {
  .aws-hdr__avatar,
  .aws-account-menu .aws-account-menu__trigger.aws-hdr__avatar {
    display: inline-flex;
  }
}

@media (min-width: 1024px) {
  .aws-hdr__nav {
    margin: 0 24px;
  }
}

@media (min-width: 1280px) {
  .aws-hdr__nav {
    display: flex;
  }
  .aws-header-burger {
    display: none;
  }
  .aws-hdr__mobile {
    display: none !important;
  }
}

@media (max-width: 1279.98px) {
  .aws-header-burger {
    display: inline-flex;
  }
}

@media (max-width: 420px) {
  .aws-hdr__brand-name {
    display: none;
  }
}
