/* =====================================================
   SITE HEADER — Complete Rewrite
   ===================================================== */

/* ---------- Header bar ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10100;
  background: #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,.1);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 40px;
  height: 72px;
}

/* ---------- Logo ---------- */
.site-header__logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  text-decoration: none;
  gap: 12px;
}

.site-header__logo:hover,
.site-header__logo:focus {
  text-decoration: none;
}

.site-header__logo img {
  height: 44px;
  width: auto;
  display: block;
}

/* ---------- USP tagline ---------- */
.site-header__usp {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
  border-left: 2px solid #E8531E;
  padding-left: 12px;
}

.site-header__usp strong {
  font-size: 13px;
  font-weight: 700;
  color: #E8531E;
  letter-spacing: .3px;
  text-transform: uppercase;
}

.site-header__usp > span {
  font-size: 11px;
  font-weight: 400;
  color: #666;
  white-space: nowrap;
}

/* ---------- Desktop nav ---------- */
.site-header__nav {
  display: flex;
  align-items: center;
}

.site-nav {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
  gap: 0;
}

.site-nav > li {
  position: relative;
}

.site-nav > li > a {
  display: block;
  padding: 24px 14px;
  font-size: 14px;
  font-weight: 600;
  color: #333;
  text-transform: uppercase;
  letter-spacing: .5px;
  text-decoration: none;
  white-space: nowrap;
  transition: color .2s;
}

.site-nav > li > a:hover,
.site-nav > li > a:focus {
  color: #e74c3c;
}

/* ---------- 1st-level dropdown ---------- */
.site-nav > li > .dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 230px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  border-radius: 0 0 4px 4px;
  padding: 6px 0;
  margin: 0;
  list-style: none;
  z-index: 10000;
}

.dropdown > li > a {
  display: block;
  padding: 9px 20px;
  font-size: 13px;
  font-weight: 500;
  color: #444;
  text-decoration: none;
  white-space: normal;
  transition: background .2s, color .2s;
}

.dropdown > li > a:hover {
  background: #f5f5f5;
  color: #e74c3c;
}

/* ---------- 2nd-level fly-out ---------- */
.dropdown > li.has-dropdown {
  position: relative;
}

.dropdown > li.has-dropdown > a i {
  float: right;
  margin-left: 8px;
  line-height: inherit;
}

.dropdown > li.has-dropdown > .dropdown {
  display: none;
  position: absolute;
  top: 0;
  left: 100%;
  min-width: 300px;
  background: #fff;
  box-shadow: 4px 4px 16px rgba(0,0,0,.10);
  border-radius: 0 4px 4px 0;
  padding: 6px 0;
  margin: 0;
  list-style: none;
  z-index: 10001;
}

/* ---------- Hamburger button ---------- */
/* Hide dropdown toggle buttons on desktop */
.dropdown-toggle {
  display: none;
}

.site-header__hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  z-index: 10110;
  position: relative;
}

.site-header__hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: #333;
  border-radius: 2px;
  transition: transform .3s, opacity .3s;
  margin: 3px 0;
}

/* Hamburger → X animation */
.site-header__hamburger.is-active span:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
.site-header__hamburger.is-active span:nth-child(2) {
  opacity: 0;
}
.site-header__hamburger.is-active span:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* ---------- Desktop hover dropdowns (min 992px only) ---------- */
@media (min-width: 992px) {
  .site-nav > li:hover > .dropdown {
    display: block;
  }
  .dropdown > li.has-dropdown:hover > .dropdown {
    display: block;
  }
}

/* ==========================================================
   MOBILE  (≤ 991px)
   ========================================================== */

/* Dark overlay — covers ENTIRE screen */
.nav-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,.5);
  z-index: 10050;
}

.nav-overlay.is-visible {
  display: block;
}

@media (max-width: 991px) {

  .site-header__inner {
    height: 62px;
    padding: 0 16px;
  }

  .site-header__logo {
    flex-direction: column;
    align-items: flex-start;
    gap: 2px;
  }

  .site-header__logo img {
    height: 30px;
  }

  .site-header__usp {
    border-left: none;
    padding-left: 0;
    line-height: 1.2;
  }

  .site-header__usp strong {
    font-size: 9px;
    letter-spacing: .2px;
  }

  .site-header__usp > span {
    font-size: 8px;
    white-space: nowrap;
  }

  /* Show hamburger */
  .site-header__hamburger {
    display: flex;
  }

  /* Nav panel — slides from right, above overlay */
  .site-header__nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: #fff;
    box-shadow: -4px 0 20px rgba(0,0,0,.15);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transition: right .3s ease;
    z-index: 10005;
    display: block;
    padding-top: 56px;
  }

  .site-header__nav.is-open {
    right: 0;
  }

  /* Ensure all nav items are tappable on touch devices */
  .site-header__nav a,
  .site-header__nav button {
    pointer-events: auto;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(0,0,0,.1);
    cursor: pointer;
  }

  .site-header__nav * {
    pointer-events: auto;
  }

  /* Mobile nav list */
  .site-nav {
    flex-direction: column;
    padding: 12px 0;
    gap: 0;
  }

  .site-nav > li {
    width: 100%;
    border-bottom: 1px solid #f0f0f0;
  }

  .site-nav > li > a {
    padding: 16px 20px;
    font-size: 15px;
  }

  /* Dropdown toggle button — sits beside the link */
  .has-dropdown {
    position: relative;
  }

  .has-dropdown > .dropdown-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 0;
    right: 0;
    width: 52px;
    height: 100%;
    background: none;
    border: none;
    border-left: 1px solid #f0f0f0;
    cursor: pointer;
    font-size: 18px;
    color: #666;
    transition: background .2s, color .2s, transform .2s;
    padding: 0;
    z-index: 2;
  }

  .has-dropdown > .dropdown-toggle:hover,
  .has-dropdown > .dropdown-toggle:active {
    background: #f5f5f5;
    color: #E8531E;
  }

  .has-dropdown.is-open > .dropdown-toggle {
    color: #E8531E;
    background: #fafafa;
  }

  .has-dropdown.is-open > .dropdown-toggle i {
    transform: rotate(180deg);
  }

  .has-dropdown > a {
    padding-right: 60px !important;
  }

  /* Dropdowns — hidden by default, shown via JS .is-open */
  .site-nav > li > .dropdown,
  .dropdown > li.has-dropdown > .dropdown {
    position: static !important;
    box-shadow: none;
    border-radius: 0;
    min-width: 100%;
    display: none;
    padding: 0;
    background: #fafafa;
  }

  .site-nav > li > .dropdown.is-open,
  .dropdown > li.has-dropdown > .dropdown.is-open {
    display: block;
  }

  .dropdown > li > a {
    padding: 12px 20px 12px 32px;
    font-size: 13px;
  }

  .dropdown > li.has-dropdown > .dropdown > li > a {
    padding-left: 48px;
  }

  .dropdown > li.has-dropdown > a i {
    transition: transform .2s;
  }

  .dropdown > li.has-dropdown > .dropdown.is-open ~ a i,
  li.has-dropdown.is-open > a i {
    transform: rotate(90deg);
  }

  /* Prevent body scroll when nav open */
  body.nav-open {
    overflow: hidden;
  }
}

@media (max-width: 480px) {
  .site-header__logo img {
    height: 26px;
  }
  .site-header__usp strong {
    font-size: 8px;
  }
  .site-header__usp > span {
    font-size: 7px;
  }
  .site-header__nav {
    width: 260px;
  }
}

/* ---------- Large screens — extra padding ---------- */
@media (min-width: 1200px) {
  .site-header__inner {
    padding: 0 60px;
  }
}

@media (min-width: 1600px) {
  .site-header__inner {
    padding: 0 90px;
  }
}

/* ---------- Page offset for fixed header ---------- */
#header-placeholder {
  display: block;
}

/* Override theme's built-in fixed-header offset — our JS handles it */
.c-layout-header-fixed .c-layout-page,
.c-layout-header-fixed.c-layout-header-topbar .c-layout-page {
  margin-top: 0 !important;
}
