/*
 * CWFD sticky desktop header. Desktop only (1025px and up); the mobile header plugin
 * owns 1024px and below and is not touched.
 *
 * The header wrapper sticks to the top (under the WP admin bar when logged in). The
 * script keeps the wrapper at the full header height, so the page never jumps when the
 * header turns compact; the empty strip left under the compact header lets clicks
 * through. --cwfd-hdr-offset (admin bar + header height, set by the script) moves the
 * the other sticky parts of the site (My Account menu, order sidebar) below the header
 * instead of under it. The product gallery is not sticky on the live site (it is
 * position: relative), so it is left alone.
 */
@media (min-width: 1025px){
  html body .header-wrapper{
    position: sticky;
    top: 0;
    z-index: 1030;
    pointer-events: none;
  }
  html body.admin-bar .header-wrapper{ top: 32px; }
  html body .header-wrapper > #header{
    pointer-events: auto;
    background: #ffffff;
    transition: box-shadow .2s ease;
  }
  html{ scroll-padding-top: var(--cwfd-hdr-offset, 0px); }

  /* Compact state, once the full header has scrolled past. */
  html body.cwfd-hdr-compact .header-wrapper > #header{
    box-shadow: 0 4px 14px rgba(15, 23, 42, .10);
  }
  html body #header .cwfd-v2-row .logo img{
    transition: height .2s ease, width .2s ease;
  }
  html body.cwfd-hdr-compact #header .cwfd-v2-row .logo img{
    height: 52px !important;
    width: auto !important;
  }

  /* Other sticky parts start below the header, not under it. */
  html body .cwfd-vo-side{
    top: calc(var(--cwfd-hdr-offset, 0px) + 20px) !important;
  }
  html body.woocommerce-account.logged-in .woocommerce > .woocommerce-MyAccount-navigation.cwfd-aa-portal{
    top: calc(var(--cwfd-hdr-offset, 0px) + 18px) !important;
  }
}
@media (min-width: 1025px) and (prefers-reduced-motion: reduce){
  html body #header .cwfd-v2-row .logo img,
  html body .header-wrapper > #header{ transition: none; }
}
