/* ================= American Book Founders header (scoped: .wa- / #wa-header) ================= */
#wa-header, #wa-drawer {
  --wa-navy: #33394B;
  --wa-navy-deep: #272C3B;
  --wa-orange: #F7782D;
  --wa-orange-dark: #E2661D;
  --wa-ink: #232838;
  --wa-mut: #6B7280;
  --wa-line: #ECEEF3;
  --wa-tint: #FFF4EC;
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
/* zero-specificity resets so component classes always win */
:where(#wa-header, #wa-drawer), :where(#wa-header, #wa-drawer) * { box-sizing: border-box; margin: 0; padding: 0; }
:where(#wa-header, #wa-drawer) a { text-decoration: none; }
:where(#wa-header, #wa-drawer) ul { list-style: none; margin: 0; padding: 0; }
:where(#wa-header, #wa-drawer) p { margin: 0; }
:where(#wa-header, #wa-drawer) button { font-family: inherit; background: none; border: 0; cursor: pointer; color: inherit; }
:where(#wa-header, #wa-drawer) img { max-width: none; }
#wa-header a:focus-visible, #wa-header button:focus-visible,
#wa-drawer a:focus-visible, #wa-drawer button:focus-visible {
  outline: 2px solid var(--wa-orange); outline-offset: 3px; border-radius: 4px;
}

#wa-header { position: sticky; top: 0; z-index: 1100; width: 100%; }
.wa-shell { max-width: 1320px; margin: 0 auto; padding: 0 24px; }

/* ---------- Top utility bar ---------- */
.wa-topbar {
  background: var(--wa-navy); color: #fff;
  max-height: 44px; overflow: hidden;
  transition: max-height .35s ease, opacity .3s ease;
}
#wa-header.wa-stuck .wa-topbar { max-height: 0; opacity: 0; }
.wa-topbar-in { display: flex; align-items: center; justify-content: space-between; gap: 16px; height: 44px; }
.wa-topbar a {
  display: inline-flex; align-items: center; gap: 8px;
  color: rgba(255,255,255,.85); font-size: 13px; font-weight: 500; letter-spacing: .01em;
  transition: color .2s ease;
}
.wa-topbar a:hover { color: var(--wa-orange); }
.wa-topbar svg { width: 14px; height: 14px; flex: none; }
.wa-topbar-left, .wa-topbar-right { display: flex; align-items: center; gap: 26px; }
.wa-top-cta {
  color: #fff !important; font-weight: 600 !important;
  padding: 5px 14px; border-radius: 999px;
  background: rgba(247,120,45,.18); border: 1px solid rgba(247,120,45,.55);
  transition: background .2s ease, border-color .2s ease;
}
.wa-top-cta:hover { background: var(--wa-orange); border-color: var(--wa-orange); }

/* ---------- Main bar ---------- */
.wa-main {
  position: relative;
  background: rgba(255,255,255,.94);
  -webkit-backdrop-filter: blur(14px) saturate(1.4); backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--wa-line);
  transition: box-shadow .3s ease;
}
#wa-header.wa-stuck .wa-main { box-shadow: 0 12px 34px -18px rgba(21,27,40,.35); }
.wa-main-in { display: flex; align-items: center; gap: 20px; height: 82px; }

.wa-brand { display: inline-flex; align-items: center; flex: none; }
.wa-brand img { height: 64px; width: auto; display: block; transition: height .3s ease; }
#wa-header.wa-stuck .wa-brand img { height: 54px; }

/* ---------- Desktop nav ---------- */
.wa-nav { flex: 1 1 auto; display: flex; justify-content: center; align-items: stretch; align-self: stretch; min-width: 0; }
.wa-menu { display: flex; align-items: stretch; gap: 4px; margin: 0; padding: 0; height: 100%; }
.wa-mega-col ul, .wa-acc-in ul { margin: 0; }
.wa-item { display: flex; align-items: center; }
.wa-item.wa-has-panel { position: relative; }
.wa-item.wa-has-mega { position: static; }

.wa-link {
  position: relative; display: inline-flex; align-items: center;
  padding: 10px 13px; color: var(--wa-ink);
  font-size: 14.5px; font-weight: 600; letter-spacing: .005em; white-space: nowrap;
  transition: color .2s ease;
}
.wa-link::after {
  content: ''; position: absolute; left: 13px; right: 13px; bottom: 4px; height: 2px;
  border-radius: 2px; background: var(--wa-orange);
  transform: scaleX(0); transform-origin: left; transition: transform .25s ease;
}
.wa-item:hover > .wa-link, .wa-item.wa-open > .wa-link,
.wa-item:focus-within > .wa-link, .wa-item.wa-active > .wa-link { color: var(--wa-orange); }
.wa-item:hover > .wa-link::after, .wa-item.wa-open > .wa-link::after,
.wa-item.wa-active > .wa-link::after { transform: scaleX(1); }

.wa-caret { display: inline-flex; align-items: center; padding: 10px 8px 10px 0; margin-left: -9px; color: var(--wa-mut); }
.wa-caret svg { width: 13px; height: 13px; transition: transform .25s ease, color .2s ease; }
.wa-item:hover .wa-caret svg, .wa-item.wa-open .wa-caret svg { transform: rotate(180deg); color: var(--wa-orange); }

/* ---------- Panels (shared) ---------- */
.wa-panel {
  position: absolute; top: 100%; z-index: 50;
  opacity: 0; visibility: hidden; pointer-events: none;
  transform: translateY(14px);
  transition: opacity .25s ease, transform .25s ease, visibility 0s linear .25s;
}
.wa-panel::before { /* hover bridge */
  content: ''; position: absolute; left: 0; right: 0; top: -14px; height: 14px;
}
.wa-item.wa-open > .wa-panel, .wa-item:focus-within > .wa-panel {
  opacity: 1; visibility: visible; pointer-events: auto; transform: translateY(0);
  transition: opacity .25s ease, transform .25s ease, visibility 0s;
}
.wa-card {
  background: #fff; border: 1px solid var(--wa-line); border-radius: 14px;
  box-shadow: 0 30px 70px -22px rgba(21,27,40,.38);
  overflow: hidden;
}

/* Simple dropdown */
.wa-drop { left: 50%; transform: translateY(14px) translateX(-50%); margin-top: 14px; }
.wa-item.wa-open > .wa-drop, .wa-item:focus-within > .wa-drop {
  transform: translateY(0) translateX(-50%);
}
.wa-drop .wa-card { min-width: 262px; padding: 10px; }
.wa-drop a {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 9px 13px; border-radius: 8px;
  color: var(--wa-ink); font-size: 13.5px; font-weight: 500; white-space: nowrap;
  transition: background .18s ease, color .18s ease, padding-left .18s ease;
}
.wa-drop a svg { width: 13px; height: 13px; opacity: 0; transform: translateX(-4px); transition: opacity .18s ease, transform .18s ease; color: var(--wa-orange); }
.wa-drop a:hover { background: var(--wa-tint); color: var(--wa-orange); padding-left: 17px; }
.wa-drop a:hover svg { opacity: 1; transform: translateX(0); }
.wa-drop .wa-overview {
  margin-bottom: 8px; padding-bottom: 12px; padding-top: 11px;
  border-bottom: 1px solid var(--wa-line); border-radius: 8px 8px 0 0;
  font-weight: 600; color: var(--wa-navy);
}

/* Mega menu */
.wa-mega { left: 50%; transform: translateY(14px) translateX(-50%); margin-top: 14px; width: min(1150px, calc(100vw - 40px)); }
.wa-item.wa-open > .wa-mega, .wa-item:focus-within > .wa-mega {
  transform: translateY(0) translateX(-50%);
}
.wa-mega-grid {
  display: grid; grid-template-columns: repeat(4, 1fr) 268px; gap: 8px 26px;
  padding: 28px 30px 26px;
}
.wa-mega-hd {
  font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--wa-mut); padding: 0 10px 10px; margin: 0 0 6px;
  border-bottom: 1px solid var(--wa-line);
}
.wa-mega-col a {
  display: block; padding: 7px 10px; border-radius: 7px;
  color: var(--wa-ink); font-size: 13.5px; font-weight: 500;
  transition: background .18s ease, color .18s ease, padding-left .18s ease;
}
.wa-mega-col a:hover { background: var(--wa-tint); color: var(--wa-orange); padding-left: 15px; }

.wa-mega-feature {
  display: flex; flex-direction: column; justify-content: center; gap: 10px;
  background: linear-gradient(150deg, var(--wa-navy) 0%, var(--wa-navy-deep) 100%);
  border-radius: 12px; padding: 26px 24px; color: #fff;
}
.wa-feature-kicker { margin: 0; font-size: 10.5px; font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--wa-orange); }
.wa-feature-title { margin: 0; font-size: 19px; font-weight: 700; line-height: 1.3; }
.wa-feature-text { margin: 0; font-size: 12.5px; line-height: 1.6; color: rgba(255,255,255,.72); }
.wa-feature-link {
  display: inline-flex; align-items: center; gap: 7px; margin-top: 2px;
  color: #fff; font-size: 13px; font-weight: 600; transition: color .2s ease;
}
.wa-feature-link svg { width: 14px; height: 14px; transition: transform .2s ease; }
.wa-feature-link:hover { color: var(--wa-orange); }
.wa-feature-link:hover svg { transform: translateX(4px); }

/* ---------- CTAs ---------- */
.wa-actions { display: flex; align-items: center; gap: 14px; flex: none; }
.wa-phone {
  display: inline-flex; align-items: center; gap: 9px;
  color: var(--wa-ink); font-size: 14px; font-weight: 600; white-space: nowrap;
  transition: color .2s ease;
}
.wa-phone svg { width: 17px; height: 17px; color: var(--wa-orange); }
.wa-phone:hover { color: var(--wa-orange); }

.wa-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 24px; border-radius: 999px;
  font-size: 14px; font-weight: 600; letter-spacing: .01em; white-space: nowrap;
  transition: background .2s ease, transform .2s ease, box-shadow .2s ease, color .2s ease;
}
.wa-btn-solid { background: var(--wa-orange); color: #fff !important; box-shadow: 0 8px 20px -8px rgba(247,120,45,.55); }
.wa-btn-solid:hover { background: var(--wa-orange-dark); transform: translateY(-1px); box-shadow: 0 12px 26px -8px rgba(247,120,45,.6); }
.wa-btn svg { width: 15px; height: 15px; }

/* ---------- Burger ---------- */
.wa-burger {
  display: none; position: relative; width: 44px; height: 44px; flex: none;
  border-radius: 10px; transition: background .2s ease;
}
.wa-burger:hover { background: var(--wa-tint); }
.wa-burger span {
  position: absolute; left: 11px; width: 22px; height: 2px; border-radius: 2px;
  background: var(--wa-ink); transition: transform .3s ease, opacity .2s ease, top .3s ease;
}
.wa-burger span:nth-child(1) { top: 15px; }
.wa-burger span:nth-child(2) { top: 21px; }
.wa-burger span:nth-child(3) { top: 27px; }
.wa-burger[aria-expanded="true"] span:nth-child(1) { top: 21px; transform: rotate(45deg); }
.wa-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.wa-burger[aria-expanded="true"] span:nth-child(3) { top: 21px; transform: rotate(-45deg); }

/* ---------- Mobile drawer ---------- */
.wa-backdrop {
  position: fixed; inset: 0; z-index: 1190;
  background: rgba(21,25,38,.55);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
  opacity: 0; visibility: hidden; transition: opacity .3s ease, visibility 0s linear .3s;
}
.wa-backdrop.wa-show { opacity: 1; visibility: visible; transition: opacity .3s ease, visibility 0s; }

#wa-drawer {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1200;
  width: 100%; max-height: min(86vh, 720px);
  display: flex; flex-direction: column;
  background: #fff; border-radius: 22px 22px 0 0;
  box-shadow: 0 -24px 60px -18px rgba(21,27,40,.45);
  transform: translateY(105%); transition: transform .38s cubic-bezier(.22,.8,.26,1);
  touch-action: none;
}
#wa-drawer .wa-drawer-body, #wa-drawer .wa-drawer-foot { touch-action: auto; }
#wa-drawer.wa-show { transform: translateY(0); }
.wa-drawer-grip {
  position: absolute; top: 9px; left: 50%; transform: translateX(-50%);
  width: 46px; height: 5px; border-radius: 999px;
  background: rgba(255,255,255,.4); pointer-events: none;
}
html.wa-lock, html.wa-lock body { overflow: hidden !important; }

.wa-drawer-head {
  position: relative;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 20px 14px; background: var(--wa-navy); flex: none;
  border-radius: 22px 22px 0 0;
  cursor: grab;
}
.wa-drawer-head img { height: 44px; width: auto; display: block; }
.wa-drawer-close {
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 10px; flex: none;
  /* explicit reset: the :where() header reset has zero specificity, so the
     global `button {padding:10px 20px}` in home-optimized.css wins over it
     and crushes the 38px button's content box to 0 (invisible icon) */
  padding: 0; border: 0;
  color: #fff; background: rgba(255,255,255,.14); transition: background .2s ease;
}
.wa-drawer-close:hover { background: var(--wa-orange); }
.wa-drawer-close svg {
  display: block; width: 16px; height: 16px;
  stroke: #fff !important; fill: none !important;
}

.wa-drawer-body { flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; padding: 10px 14px 20px; }

.wa-acc { border-bottom: 1px solid var(--wa-line); }
.wa-acc-btn {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  padding: 15px 8px; color: var(--wa-ink); font-size: 15px; font-weight: 600; text-align: left;
  transition: color .2s ease;
}
.wa-acc-btn svg { width: 14px; height: 14px; color: var(--wa-mut); transition: transform .3s ease, color .2s ease; }
.wa-acc.wa-open > .wa-acc-btn { color: var(--wa-orange); }
.wa-acc.wa-open > .wa-acc-btn svg { transform: rotate(180deg); color: var(--wa-orange); }
.wa-acc-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .32s ease; }
.wa-acc.wa-open > .wa-acc-body { grid-template-rows: 1fr; }
.wa-acc-in { overflow: hidden; }
.wa-acc-in ul { padding: 2px 4px 14px; }
.wa-acc-in a {
  display: block; padding: 8px 12px; border-radius: 8px;
  color: #4B5263; font-size: 14px; font-weight: 500;
  transition: background .18s ease, color .18s ease;
}
.wa-acc-in a:hover { background: var(--wa-tint); color: var(--wa-orange); }
.wa-acc-group {
  padding: 12px 12px 5px; font-size: 10.5px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; color: var(--wa-mut);
}
.wa-drawer-link {
  display: block; padding: 15px 8px; border-bottom: 1px solid var(--wa-line);
  color: var(--wa-ink); font-size: 15px; font-weight: 600; transition: color .2s ease;
}
.wa-drawer-link:hover { color: var(--wa-orange); }

.wa-drawer-foot { flex: none; padding: 16px 20px 22px; border-top: 1px solid var(--wa-line); background: #FAFBFC; }
.wa-drawer-foot .wa-btn { width: 100%; justify-content: center; margin-bottom: 14px; }
.wa-drawer-contact { display: flex; flex-direction: column; gap: 8px; }
.wa-drawer-contact a {
  display: inline-flex; align-items: center; gap: 10px;
  color: #4B5263; font-size: 13.5px; font-weight: 500; transition: color .2s ease;
}
.wa-drawer-contact a:hover { color: var(--wa-orange); }
.wa-drawer-contact svg { width: 15px; height: 15px; color: var(--wa-orange); }

/* ---------- Responsive ---------- */
@media (min-width: 1561px) {
  .wa-shell { max-width: 1580px; padding-inline: 32px; }
  .wa-main-in { gap: 28px; }
  .wa-menu { gap: 6px; }
}
@media (max-width: 1560px) {
  .wa-link { padding: 10px 10px; font-size: 13.5px; }
  .wa-link::after { left: 10px; right: 10px; }
  .wa-menu { gap: 2px; }
  .wa-main-in { gap: 14px; }
  .wa-phone span { display: none; }
  .wa-phone {
    width: 42px; height: 42px; justify-content: center;
    border-radius: 50%; background: var(--wa-tint);
    transition: background .2s ease, color .2s ease;
  }
  .wa-phone:hover { background: var(--wa-orange); }
  .wa-phone:hover svg { color: #fff; }
}
@media (max-width: 1199.98px) {
  .wa-nav, .wa-phone { display: none; }
  .wa-burger { display: block; }
  .wa-actions { margin-left: auto; }
  .wa-main-in { height: 68px; }
  .wa-brand img { height: 48px; }
  #wa-header.wa-stuck .wa-brand img { height: 44px; }
}
@media (max-width: 991.98px) { .wa-topbar { display: none; } }
@media (max-width: 575.98px) {
  .wa-shell { padding: 0 16px; }
  .wa-actions .wa-btn { padding: 9px 16px; font-size: 13px; }
  .wa-main-in { height: 62px; gap: 12px; }
  .wa-brand img { height: 42px; }
  #wa-header.wa-stuck .wa-brand img { height: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  #wa-header *, #wa-drawer *, .wa-backdrop, #wa-drawer { transition: none !important; }
}
