/* ==============================================================================
   SYNERGY ENERGY SOLUTIONS — HEADER STYLES
   ==============================================================================
   
   Styles for the master site header: announcement bar, sticky header, logo,
   main navigation (desktop), nav dropdowns, the Get Quote button, mobile
   responsive states, and print rules.
   
   DEPENDENCIES: foundation.css must be loaded FIRST. Foundation provides
   the design tokens (CSS variables), base reset, typography, container,
   and skip-link styles — all of which are USED but not REDEFINED here.
   
   See functions.php for the wp_enqueue_style() chain that ensures load order.
   ============================================================================== */

/* ===== ANNOUNCEMENT BAR ===== */
  .announce {
    background: var(--ink); color: #fff; font-size: 0.85rem;
    padding: 10px 0; text-align: center;
  }
  .announce a { color: #fff; text-decoration: underline; }
  .announce strong { color: var(--brand-primary-light); }

  /* ===== SITE HEADER ===== */
  .site-header {
    position: sticky; top: 0; z-index: 100;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
  }
  .header-inner {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 0; gap: 20px;
  }
  .logo img { height: 48px; width: auto; display: block; }

  /* ===== MAIN NAV (DESKTOP) ===== */
  .main-nav { display: flex; gap: 30px; align-items: center; }
  .main-nav > a,
  .main-nav > .nav-item > a {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 0.92rem;
    color: #6c6c6c;
    padding: 8px 0;
    position: relative;
    letter-spacing: 0.01em;
    transition: color 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
  }
  .main-nav > a:hover,
  .main-nav > .nav-item > a:hover,
  .main-nav > .nav-item:hover > a {
    color: var(--brand-primary);
  }
  /* Active page state (added per-page by WP/PHP) */
  .main-nav > a.is-active,
  .main-nav > .nav-item.is-active > a {
    color: var(--brand-primary);
  }
  .main-nav > a.is-active::after,
  .main-nav > .nav-item.is-active > a::after {
    content: '';
    position: absolute; left: 0; right: 0; bottom: -2px;
    height: 2px;
    background: var(--brand-primary);
    border-radius: 2px;
  }

  /* ===== MOBILE NAV TOGGLE BUTTON ===== */
  .nav-toggle {
    display: none;
    background: none; border: 0; cursor: pointer;
    padding: 8px; color: var(--ink);
  }

  /* ===== NAV DROPDOWNS ===== */
  .nav-item { position: relative; }
  .nav-item > a .nav-caret {
    display: inline-flex; align-items: center; justify-content: center;
    width: 10px; height: 10px;
    color: var(--brand-primary);
    transition: transform 0.25s ease;
  }
  .nav-item > a .nav-caret svg { width: 100%; height: 100%; display: block; }
  .nav-item:hover > a .nav-caret { transform: rotate(180deg); }

  .nav-dropdown {
    position: absolute; top: calc(100% + 8px); left: 50%;
    transform: translateX(-50%) translateY(6px);
    min-width: 220px; padding: 10px 0; margin: 0;
    background: #fff; list-style: none;
    border-radius: 8px;
    box-shadow: 0 12px 28px rgba(0,0,0,0.10), 0 2px 6px rgba(0,0,0,0.05);
    opacity: 0; visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    z-index: 1000;
  }
  .nav-dropdown::before {
    content: ''; position: absolute; top: -6px; left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 12px; height: 12px;
    background: #fff;
    box-shadow: -2px -2px 4px rgba(0,0,0,0.04);
  }
  .nav-item:hover > .nav-dropdown,
  .nav-item:focus-within > .nav-dropdown {
    opacity: 1; visibility: visible;
    transform: translateX(-50%) translateY(0);
  }
  .nav-dropdown li { margin: 0; }
  .nav-dropdown a {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 10px 20px; font-size: 0.88rem; font-weight: 500;
    color: #4a4a4a; white-space: nowrap;
    border: 0; transition: color 0.15s ease, background 0.15s ease;
  }
  .nav-dropdown a:hover { background: rgba(167,190,57,0.08); color: var(--brand-primary); }
  .nav-dropdown a::after { display: none; }

  /* ===== GET QUOTE BUTTON ===== */
  .btn {
    display: inline-flex; align-items: center; gap: 6px;
    font-family: var(--font-display); font-weight: 600; font-size: 0.95rem;
    padding: 12px 26px; border-radius: 999px; cursor: pointer;
    border: 2px solid transparent; transition: all 0.25s ease;
    text-decoration: none; position: relative;
  }
  .btn::after { content: '→'; display: inline-block; transition: transform 0.25s ease; }
  .btn:hover::after { transform: translateX(4px); }
  .btn-primary {
    background: var(--brand-gradient); color: #fff;
    box-shadow: 0 4px 14px rgba(167,190,57,0.35);
  }
  .btn-primary:hover {
    color: #fff; transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(167,190,57,0.45);
  }

  /* ===== MOBILE BREAKPOINT (1100px) ===== */
  @media (max-width: 1100px) {
    .nav-toggle { display: inline-flex; }
    .main-nav {
      display: none;
      position: absolute; top: 100%; left: 0; right: 0;
      flex-direction: column; gap: 0;
      background: #fff;
      border-bottom: 1px solid var(--line);
      padding: 12px 24px 20px;
      box-shadow: var(--shadow-sm);
      max-height: calc(100vh - 80px);
      overflow-y: auto;
    }
    .main-nav.open { display: flex; }
    .main-nav > a,
    .main-nav > .nav-item > a {
      padding: 12px 0; width: 100%;
      border-bottom: 1px solid var(--line);
    }
    .main-nav > a:last-child { border-bottom: 0; }
    .main-nav .nav-item { width: 100%; }
    .main-nav .nav-item > a {
      display: flex; justify-content: space-between; align-items: center;
    }
    .nav-dropdown {
      position: static;
      opacity: 1; visibility: visible; transform: none;
      box-shadow: none;
      border-top: 0;
      border-left: 3px solid var(--brand-primary);
      padding: 4px 0 4px 12px;
      margin: 0 0 4px 6px;
      min-width: 0;
      max-height: 0; overflow: hidden;
      transition: max-height 0.3s ease;
    }
    .nav-dropdown::before { display: none; }
    .main-nav .nav-item.open > .nav-dropdown { max-height: 600px; }
    .nav-dropdown a { padding: 8px 4px; border-bottom: 0; }
    .nav-item > a .nav-caret { transition: transform 0.25s ease; }
    .main-nav .nav-item.open > a .nav-caret { transform: rotate(180deg); }
  }

  /* ===== PRINT (hide nav on printed pages) ===== */
  @media print {
    .site-header, .skip-link, .announce, .nav-toggle { display: none !important; }
  }
