/* One native Astra header, sticky as a complete unit on every device. */
.bounty-sticky-header {
  --bounty-sticky-top: 0px;
  --bounty-toolbar-height: 0px;
  --bounty-header-gutter: var(--ast-container-default-md-padding);
  --bounty-brown: #4b301f;
  position: sticky;
  top: calc(var(--bounty-sticky-top) + 5px);
  margin-block-start: 5px;
  z-index: 999;
  flex-shrink: 0;
}
/* The slot has no flow height on the hero, while #masthead keeps its real height
   and remains the containing block for Astra's mobile menus and search UI. */
.home.ast-theme-transparent-header .bounty-sticky-header { height: 0; margin-block-start: 0; }
.bounty-sticky-header #masthead {
  position: relative;
  inset: auto;
  width: 100%;
  opacity: 1;
  transform: none;
  transition: transform 300ms cubic-bezier(.22, .61, .36, 1), opacity 300ms ease;
}
.bounty-sticky-header[data-bounty-nav-hidden] #masthead {
  transform: translateY(calc(-100% - 5px - var(--bounty-sticky-top)));
  opacity: 0;
  pointer-events: none;
}
.bounty-sticky-header[data-bounty-nav-hidden] { pointer-events: none; }
/* Focus must reveal offscreen links before the browser tries to scroll to them. */
.bounty-sticky-header[data-bounty-nav-hidden]:focus-within #masthead {
  transform: none;
  opacity: 1;
  pointer-events: auto;
}
.bounty-sticky-header:focus-within #masthead,
.bounty-sticky-header[data-bounty-nav-keyboard] #masthead { transition: none; }

/* The outer wrappers only position the header. Paint Astra's actual container. */
.bounty-sticky-header #masthead .ast-main-header-wrap.main-header-bar-wrap {
  background: transparent;
  box-shadow: none;
}
.bounty-sticky-header #masthead .ast-main-header-wrap .site-primary-header-wrap {
  width: calc(100% - 2 * var(--bounty-header-gutter));
  margin-inline: auto;
  border-radius: 20px;
  background: #faf8f5;
  box-shadow: 0 3px 12px rgba(48, 33, 25, .10), inset 0 0 0 1px rgba(113, 73, 47, .08);
}
.bounty-sticky-header #masthead .ast-primary-header-bar:not(.site-primary-header-wrap) {
  background: transparent;
  border-bottom-color: transparent;
  box-shadow: none;
}
@supports ((backdrop-filter: blur(14px)) or (-webkit-backdrop-filter: blur(14px))) {
  .bounty-sticky-header #masthead .ast-main-header-wrap .site-primary-header-wrap {
    background: rgba(250, 248, 245, .68);
    -webkit-backdrop-filter: blur(14px) saturate(112%);
    backdrop-filter: blur(14px) saturate(112%);
  }
}
@media (max-width: 544px) {
  .bounty-sticky-header { --bounty-header-gutter: var(--ast-container-default-xxs-padding); }
}
/* Reference 2853a43d: compact pill navigation and a distinct rounded action.
   Keep Bounty's RTL order, native links, search, account, and WooCommerce cart. */
.bounty-sticky-header #masthead .main-header-menu > .menu-item > .menu-link {
  display: flex;
  align-items: center;
  min-height: 46px;
  height: 46px;
  padding: 0 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.6;
  text-decoration: none;
  transition: background-color 160ms ease, color 160ms ease;
}
.bounty-sticky-header #masthead .main-header-menu > .menu-item > .menu-link:hover {
  background: #71492f14;
  color: #4b301f;
}
.bounty-sticky-header #masthead .main-header-menu > .menu-item.current-menu-item > .menu-link,
.bounty-sticky-header #masthead .main-header-menu > .menu-item.current-menu-ancestor > .menu-link {
  background: #71492f;
  color: #fffaf3;
}
.bounty-sticky-header #masthead .ast-header-html .bounty-header-account {
  display: inline-flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding: 5px 16px 5px 5px;
  border-radius: 999px;
  background: linear-gradient(135deg, #71492f, #4b301f);
  color: #fffaf3;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  text-decoration: none;
}
.bounty-sticky-header #masthead .bounty-header-account::after {
  content: '';
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #fffaf3 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234b301f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M18 12H6m6-6-6 6 6 6'/%3E%3C/svg%3E") center / 18px no-repeat;
}
.bounty-sticky-header #masthead .ast-header-html .bounty-header-account:hover { background: #4b301f; }
.bounty-sticky-header #masthead .cart-container {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  color: var(--bounty-brown);
}
.bounty-sticky-header #masthead .ast-addon-cart-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 50%;
  color: inherit;
  border-color: currentColor;
}
.bounty-sticky-header #masthead .ast-icon-shopping-bag::after { background: #71492f; color: #fffaf3; }
/* These rules follow Astra's native desktop/mobile trees and visibility. */
.bounty-sticky-header #ast-desktop-header .site-primary-header-wrap > .ast-builder-grid-row {
  grid-template-columns: auto minmax(0, 1fr) auto;
  column-gap: 24px;
}
.bounty-sticky-header #ast-desktop-header .site-header-primary-section-center { justify-content: flex-end; }
.bounty-sticky-header #ast-desktop-header .main-header-menu { align-items: center; gap: 4px; }
.bounty-sticky-header #ast-desktop-header .main-header-menu > .menu-item { display: flex; align-items: center; }
.bounty-sticky-header #ast-desktop-header .bounty-product-search { width: 160px; }
.bounty-sticky-header #ast-desktop-header .bounty-product-search .search-field {
  height: 40px;
  border: 1px solid #71492f26;
  font-size: 12px;
}
.bounty-sticky-header #ast-desktop-header .bounty-product-search button { height: 40px; }
@media (max-width: 1200px) {
  .bounty-sticky-header #ast-desktop-header .site-primary-header-wrap > .ast-builder-grid-row { column-gap: 16px; }
  .bounty-sticky-header #ast-desktop-header .main-header-menu { gap: 2px; }
  .bounty-sticky-header #ast-desktop-header .main-header-menu > .menu-item > .menu-link { padding-inline: 10px; font-size: 12px; }
  .bounty-sticky-header #ast-desktop-header .bounty-product-search { width: 120px; }
  .bounty-sticky-header #ast-desktop-header .ast-header-html .bounty-header-account { gap: 8px; padding-inline-start: 12px; font-size: 12px; }
  .bounty-sticky-header #ast-desktop-header .bounty-header-account::after { flex-basis: 30px; width: 30px; height: 30px; }
}
/* The reference uses a separate inverted mobile bar. Adapt it in warm brown,
 keeping the same Astra header tree and the existing glass/scroll behavior. */
.bounty-sticky-header #masthead .ast-mobile-header-wrap .site-primary-header-wrap {
  --bounty-brown: #fff7ec;
  background-color: #4b301f;
  background-image: linear-gradient(135deg, #71492f, #4b301f);
}
.bounty-sticky-header #masthead .ast-mobile-header-wrap .site-primary-header-wrap .site-title a { color: #fff7ec; }
.bounty-sticky-header #masthead .ast-mobile-header-wrap .site-primary-header-wrap .menu-toggle {
  background: #fffaf3;
  color: #4b301f;
  border: 0;
  border-radius: 10px;
}
.bounty-sticky-header #masthead .ast-mobile-header-wrap .site-primary-header-wrap a:focus-visible,
.bounty-sticky-header #masthead .ast-mobile-header-wrap .site-primary-header-wrap .menu-toggle:focus-visible { outline-color: #fffaf3; }
.bounty-sticky-header #masthead .ast-mobile-header-wrap .site-primary-header-wrap .ast-icon-shopping-bag::after { background: #fffaf3; color: #4b301f; }
.bounty-sticky-header #masthead .ast-mobile-header-content .main-header-menu { padding: 8px; }
.bounty-sticky-header #masthead .ast-mobile-header-content .main-header-menu > .menu-item + .menu-item { margin-top: 4px; }
@supports ((backdrop-filter: blur(14px)) or (-webkit-backdrop-filter: blur(14px))) {
    .bounty-sticky-header #masthead .ast-mobile-header-wrap .site-primary-header-wrap {
      background-color: rgba(75, 48, 31, .88);
      background-image: linear-gradient(135deg, rgba(171, 120, 78, .4), rgba(75, 48, 31, 0));
    }
}
.bounty-sticky-header #masthead .menu-toggle {
  color: var(--bounty-brown);
  min-width: 44px;
  min-height: 44px;
}
.bounty-sticky-header #masthead .menu-toggle .ast-mobile-svg { fill: currentColor; }
.bounty-sticky-header #masthead .ast-mobile-header-wrap .ast-mobile-header-content {
  width: calc(100% - 2 * var(--bounty-header-gutter));
  margin-inline: auto;
  inset-inline: 0;
  background: #fffdfa;
  max-height: calc(100vh - 85px - var(--bounty-toolbar-height));
  max-height: calc(100dvh - 85px - var(--bounty-toolbar-height));
  overflow-y: auto;
  box-shadow: 0 12px 24px #30211914;
}

/* Keep the logged-in toolbar and header in separate, stable layers. */
.admin-bar .bounty-sticky-header {
  --bounty-sticky-top: 32px;
  --bounty-toolbar-height: 32px;
}
@media (max-width: 782px) {
  .admin-bar .bounty-sticky-header {
    --bounty-sticky-top: 46px;
    --bounty-toolbar-height: 46px;
  }
}
@media (max-width: 600px) {
  /* Astra's positioned body otherwise offsets WP's absolute phone toolbar into
     the navbar. Keep the native toolbar fixed, with the same 46px clearance. */
  body.admin-bar #wpadminbar { position: fixed; }
}
:root:has(.bounty-sticky-header) {
  scroll-padding-top: calc(101px + var(--wp-admin--admin-bar--height, 0px));
}
/* Page anchor clearance must not make the navbar's own links look occluded
   to the browser's focus-scrolling algorithm. */
:root:has(.bounty-sticky-header:focus-within),
:root:has(.bounty-sticky-header[data-bounty-nav-keyboard]) { scroll-padding-top: 0; }
@media (prefers-reduced-motion: reduce) {
  .bounty-sticky-header #masthead { transition: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .bounty-sticky-header #masthead .ast-main-header-wrap .site-primary-header-wrap {
    background: #faf8f5;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .bounty-sticky-header #masthead .ast-mobile-header-wrap .site-primary-header-wrap {
    background: #4b301f;
  }
}
