/*
 * Site header — top bar, main bar, mega menu, mobile drawer.
 *
 * Breakpoint is 768px: desktop chrome above, drawer below.
 *
 * @package Slyfox_Digital
 */

.sf-header {
  font-family: var(--sf-font-head);
  width: 100%;
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--sf-white);
}

/* Keep in-page destinations visible below the sticky desktop header. */
#sf-main, #quote { scroll-margin-top: 160px; }

/* --------------------------------------------------------------------------
 * Top bar
 * ------------------------------------------------------------------------ */
.sf-topbar {
  background: var(--sf-navy);
  color: var(--sf-white);
  font-family: var(--sf-font-body);
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 40px;
  gap: 16px;
}
.sf-topbar__contact { display: flex; gap: 20px; }
.sf-topbar a { color: var(--sf-white); text-decoration: none; }
.sf-topbar a:hover { color: var(--sf-orange); }

/* --------------------------------------------------------------------------
 * Main bar
 * ------------------------------------------------------------------------ */
.sf-bar {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  padding: 0 40px;
  height: 120px;
  border-bottom: 1px solid var(--sf-border);
}
.sf-bar__logo { display: flex; align-items: center; }
.sf-bar__logo img { height: 104px; width: auto; }
.sf-bar__cta { display: flex; align-items: center; }

.sf-nav { display: flex; align-items: stretch; gap: 4px; }
.sf-nav__list { display: flex; align-items: stretch; gap: 4px; list-style: none; margin: 0; padding: 0; }
.sf-nav__item { display: flex; }
.sf-nav__link {
  position: relative;
  display: flex; align-items: center; gap: 6px;
  padding: 0 16px;
  font-family: var(--sf-font-head);
  font-weight: 700; font-size: 15px; letter-spacing: .01em;
  color: var(--sf-navy);
  text-decoration: none;
  background: none; border: 0; cursor: pointer;
  transition: color var(--sf-t);
}
.sf-nav__caret { font-size: 9px; opacity: .55; transform: translateY(1px); transition: transform var(--sf-t); }
.sf-nav__link::after {
  content: ""; position: absolute; left: 16px; right: 16px; bottom: 0;
  height: 3px; background: var(--sf-orange);
  opacity: 0; transition: opacity var(--sf-t);
}
.sf-nav__link[aria-current="page"]::after { opacity: 1; }
.sf-nav__item--open > .sf-nav__link,
.sf-nav__link:hover { color: var(--sf-orange); }
.sf-nav__item--open > .sf-nav__link::after,
.sf-nav__link:hover::after { opacity: 1; }
.sf-nav__item--open .sf-nav__caret { transform: rotate(180deg); }

/* --------------------------------------------------------------------------
 * Mega menu
 * ------------------------------------------------------------------------ */
.sf-barwrap { position: relative; }
.sf-mega {
  position: absolute; top: 100%; left: 0; right: 0;
  background: var(--sf-white);
  border-bottom: 1px solid var(--sf-border);
  box-shadow: var(--sf-shadow-mega);
  z-index: 70;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  /*
   * visibility is delayed to the END of the fade on close, and switched
   * instantly on open. Putting it in the transition list unqualified delays it
   * both ways, which leaves the panel non-interactive for the whole fade-in.
   */
  transition: opacity var(--sf-t), transform var(--sf-t), visibility 0s var(--sf-t);
}
.sf-nav__item--open .sf-mega {
  opacity: 1; visibility: visible; transform: none;
  transition: opacity var(--sf-t), transform var(--sf-t), visibility 0s;
}

.sf-mega__inner {
  max-width: var(--sf-max-mega); margin: 0 auto;
  padding: 36px 40px 40px;
  display: flex; gap: 48px; align-items: stretch;
}
.sf-mega__intro {
  flex: 0 0 260px;
  display: flex; flex-direction: column; gap: 12px;
  padding-right: 40px; border-right: 1px solid var(--sf-border);
}
.sf-mega__intro .sf-eyebrow { margin: 0; }
.sf-mega__title { font-size: 26px; line-height: 1.15; letter-spacing: -.01em; }
.sf-mega__desc { font-family: var(--sf-font-body); font-size: 15px; line-height: 1.55; color: var(--sf-ink); opacity: .85; margin: 0; }
.sf-mega__cta {
  margin-top: auto; color: var(--sf-navy); text-decoration: none;
  font-weight: 700; font-size: 14px;
  display: inline-flex; gap: 6px; align-items: center;
}
.sf-mega__cta span { color: var(--sf-orange); }

.sf-mega__groups { flex: 1 1 auto; display: flex; gap: 40px; flex-wrap: wrap; }
.sf-mega__group { flex: 1 1 180px; min-width: 180px; display: flex; flex-direction: column; gap: 4px; }
.sf-mega__grouptitle {
  font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--sf-navy); opacity: .55; margin-bottom: 8px;
}
.sf-mega__list { list-style: none; margin: 0; padding: 0; }
.sf-mega__link {
  display: block;
  color: var(--sf-navy); text-decoration: none;
  font-family: var(--sf-font-body); font-weight: 600; font-size: 16px;
  padding: 7px 10px; margin-left: -10px;
  border-radius: var(--sf-r-btn);
  transition: background var(--sf-t), color var(--sf-t);
}
.sf-mega__link:hover { background: var(--sf-surface); color: var(--sf-orange); }

.sf-mega__featured {
  flex: 0 0 260px; position: relative;
  border-radius: var(--sf-r-card); overflow: hidden;
  text-decoration: none; color: var(--sf-white);
  display: flex; align-items: flex-end; min-height: 220px;
  background: var(--sf-navy);
}
.sf-mega__featured img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .8; }
.sf-mega__scrim { position: absolute; inset: 0; background: linear-gradient(to top, rgba(38, 50, 76, .95), rgba(38, 50, 76, .1) 60%); }
.sf-mega__caption { position: relative; padding: 20px; font-weight: 800; font-size: 17px; line-height: 1.3; }

/* --------------------------------------------------------------------------
 * Mobile bar + drawer
 * ------------------------------------------------------------------------ */
.sf-mobilebar { display: none; align-items: center; justify-content: space-between; padding: 14px 20px; border-bottom: 1px solid var(--sf-border); }
.sf-mobilebar img { height: 72px; width: auto; }
.sf-burger {
  width: var(--sf-tap); height: var(--sf-tap);
  border: 0; background: var(--sf-navy); border-radius: var(--sf-r-btn);
  display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 5px;
  cursor: pointer;
}
.sf-burger span { width: 20px; height: 2px; background: var(--sf-white); display: block; }

.sf-backdrop {
  position: fixed; inset: 0;
  background: rgba(32, 40, 58, .55);
  opacity: 0; pointer-events: none;
  transition: opacity .35s;
  z-index: 80;
}
.sf-backdrop.is-open { opacity: 1; pointer-events: auto; }

.sf-drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(320px, 86vw);
  background: var(--sf-navy);
  padding: 8px 20px 32px;
  box-shadow: var(--sf-shadow-drawer);
  transform: translateX(105%);
  transition: transform var(--sf-t-drawer);
  z-index: 90;
  overflow-y: auto;
}
.sf-drawer.is-open { transform: translateX(0); }
.sf-drawer__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.sf-drawer__head img { height: 48px; width: auto; }
.sf-drawer__close {
  width: var(--sf-tap); height: var(--sf-tap);
  border: 0; background: rgba(255, 255, 255, .1);
  color: var(--sf-white); border-radius: var(--sf-r-btn);
  font-size: 22px; cursor: pointer;
}
.sf-drawer__item { border-bottom: 1px solid rgba(255, 255, 255, .12); }
.sf-drawer__row { display: flex; align-items: center; justify-content: space-between; min-height: 48px; }
.sf-drawer__row > a {
  color: var(--sf-white); text-decoration: none;
  font-family: var(--sf-font-head); font-weight: 700; font-size: 17px;
  flex: 1; padding: 12px 0;
}
.sf-drawer__toggle {
  width: var(--sf-tap); height: var(--sf-tap);
  border: 0; background: transparent; color: var(--sf-orange);
  font-size: 20px; cursor: pointer;
}
.sf-drawer__panel { padding: 0 0 14px 12px; display: none; flex-direction: column; gap: 14px; }
.sf-drawer__item.is-open .sf-drawer__panel { display: flex; }
.sf-drawer__grouptitle {
  font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--sf-orange); margin-bottom: 4px;
}
.sf-drawer__panel ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.sf-drawer__panel a {
  color: var(--sf-white); text-decoration: none;
  font-family: var(--sf-font-body); font-size: 16px;
  padding: 9px 0; opacity: .92; display: block;
}
.sf-drawer__cta { margin-top: 16px; }
.sf-drawer__social { margin-top: 20px; display: flex; justify-content: center; }
.sf-drawer__contact { display: flex; flex-direction: column; gap: 4px; margin-top: 20px; font-family: var(--sf-font-body); font-size: 15px; }
.sf-drawer__contact a {
  color: var(--sf-white); text-decoration: none;
  display: flex; gap: 10px; align-items: center; min-height: var(--sf-tap);
}
.sf-drawer__contact svg { width: 18px; height: 18px; flex: none; }

/* --------------------------------------------------------------------------
 * Breakpoint swap
 * ------------------------------------------------------------------------ */
@media (max-width: 768px) {
  .sf-topbar, .sf-barwrap { display: none; }
  .sf-mobilebar { display: flex; }
  #sf-main, #quote { scroll-margin-top: 100px; }
}
@media (min-width: 769px) {
  .sf-backdrop, .sf-drawer { display: none; }
}
