/*
 * BD Header Polish — forced menu visibility pass
 * White header, blue nav, gold animated underline, sparkle shimmer.
 */

:root {
  --bd-header-white: #ffffff;
  --bd-header-blue: #062763;
  --bd-header-blue-deep: #031844;
  --bd-header-gold: #d5a84f;
  --bd-header-gold-bright: #ffe8aa;
  --bd-header-purple-kill: #062763;
}

/* Header white, no inherited dark blocks */
html body header,
html body .site-header,
html body .wp-site-blocks > header,
html body header.wp-block-template-part,
html body header.wp-block-template-part > *,
html body header.wp-block-template-part .wp-block-group,
html body header.wp-block-template-part .wp-block-group.alignfull,
html body header.wp-block-template-part .wp-block-group.alignwide,
html body header.wp-block-template-part .has-background,
html body header.wp-block-template-part [class*="-background-color"] {
  background: #ffffff !important;
  background-color: #ffffff !important;
  color: var(--bd-header-blue) !important;
}

html body header.wp-block-template-part,
html body .site-header {
  min-height: 112px !important;
  border-bottom: 4px solid var(--bd-header-gold) !important;
  box-shadow: 0 12px 34px rgba(3, 24, 68, 0.12) !important;
  position: relative !important;
  z-index: 999 !important;
}

/* Force main header row into logo-left / nav-right */
html body header.wp-block-template-part .wp-block-group.alignwide,
html body header.wp-block-template-part > .wp-block-group > .wp-block-group > .wp-block-group,
html body header.wp-block-template-part .is-content-justification-space-between {
  width: min(1480px, calc(100vw - 48px)) !important;
  max-width: 1480px !important;
  min-height: 108px !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding: 0.75rem 1.25rem !important;
  display: flex !important;
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: clamp(1rem, 3vw, 3rem) !important;
  flex-wrap: nowrap !important;
  overflow: visible !important;
}

/* Logo */
html body header.wp-block-template-part img,
html body header .custom-logo,
html body header .wp-block-site-logo img {
  display: block !important;
  max-height: 92px !important;
  width: auto !important;
  object-fit: contain !important;
  opacity: 1 !important;
  visibility: visible !important;
}

html body header.wp-block-template-part .wp-block-site-logo,
html body header.wp-block-template-part .custom-logo-link,
html body header.wp-block-template-part figure {
  flex: 0 0 auto !important;
  margin: 0 !important;
}

/* Force nav visible */
html body header.wp-block-template-part nav,
html body header.wp-block-template-part .wp-block-navigation,
html body header.wp-block-template-part .main-navigation,
html body header.wp-block-template-part .menu,
html body header.wp-block-template-part .nav-menu {
  display: flex !important;
  opacity: 1 !important;
  visibility: visible !important;
  position: relative !important;
  z-index: 1000 !important;
  flex: 1 1 auto !important;
  justify-content: flex-end !important;
  align-items: center !important;
  width: auto !important;
  max-width: none !important;
  height: auto !important;
  overflow: visible !important;
  color: var(--bd-header-blue) !important;
}

/* Force nav list visible */
html body header.wp-block-template-part nav ul,
html body header.wp-block-template-part .wp-block-navigation__container,
html body header.wp-block-template-part .menu,
html body header.wp-block-template-part .nav-menu {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap !important;
  justify-content: flex-end !important;
  align-items: center !important;
  gap: clamp(0.7rem, 1.55vw, 1.55rem) !important;
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/* Force each menu item visible */
html body header.wp-block-template-part nav li,
html body header.wp-block-template-part .wp-block-navigation-item,
html body header.wp-block-template-part .menu-item,
html body header.wp-block-template-part .page_item {
  display: inline-flex !important;
  position: relative !important;
  align-items: center !important;
  opacity: 1 !important;
  visibility: visible !important;
  color: var(--bd-header-blue) !important;
}

/* Main link styling — covers block nav, classic menus, page lists */
html body header.wp-block-template-part nav a,
html body header.wp-block-template-part nav a:link,
html body header.wp-block-template-part nav a:visited,
html body header.wp-block-template-part .wp-block-navigation-item__content,
html body header.wp-block-template-part .wp-block-navigation-link a,
html body header.wp-block-template-part .menu-item > a,
html body header.wp-block-template-part .page_item > a,
html body header.wp-block-template-part .nav-menu a,
html body header.wp-block-template-part .main-navigation a,
html body header.wp-block-template-part .wp-block-page-list a,
html body header.wp-block-template-part .wp-block-pages-list__item__link {
  display: inline-flex !important;
  position: relative !important;
  isolation: isolate !important;
  align-items: center !important;
  min-height: 36px !important;
  padding: 0.45rem 0.1rem !important;
  color: var(--bd-header-blue) !important;
  font-size: clamp(0.9rem, 1vw, 1.06rem) !important;
  font-weight: 900 !important;
  line-height: 1.15 !important;
  text-decoration: none !important;
  text-shadow: none !important;
  opacity: 1 !important;
  visibility: visible !important;
  transition: color 180ms ease, transform 180ms ease, text-shadow 180ms ease !important;
}

/* Kill purple inherited colour */
html body header.wp-block-template-part .has-primary-500-color,
html body header.wp-block-template-part .has-text-color,
html body header.wp-block-template-part .has-link-color,
html body header.wp-block-template-part .wp-elements,
html body header.wp-block-template-part span,
html body header.wp-block-template-part a span,
html body header.wp-block-template-part .wp-block-navigation-item__label {
  color: var(--bd-header-blue) !important;
}

/* Gold underline */
html body header.wp-block-template-part nav a::after,
html body header.wp-block-template-part .wp-block-navigation-item__content::after,
html body header.wp-block-template-part .menu-item > a::after,
html body header.wp-block-template-part .page_item > a::after,
html body header.wp-block-template-part .wp-block-page-list a::after,
html body header.wp-block-template-part .wp-block-pages-list__item__link::after {
  content: "" !important;
  position: absolute !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0.05rem !important;
  height: 3px !important;
  border-radius: 999px !important;
  background: linear-gradient(
    90deg,
    transparent 0%,
    var(--bd-header-gold) 22%,
    var(--bd-header-gold-bright) 50%,
    var(--bd-header-gold) 78%,
    transparent 100%
  ) !important;
  background-size: 220% 100% !important;
  transform: scaleX(0) !important;
  transform-origin: center !important;
  opacity: 0 !important;
  transition: transform 240ms ease, opacity 240ms ease !important;
  z-index: -1 !important;
}

/* Sparkle shimmer */
html body header.wp-block-template-part nav a::before,
html body header.wp-block-template-part .wp-block-navigation-item__content::before,
html body header.wp-block-template-part .menu-item > a::before,
html body header.wp-block-template-part .page_item > a::before,
html body header.wp-block-template-part .wp-block-page-list a::before,
html body header.wp-block-template-part .wp-block-pages-list__item__link::before {
  content: "✦" !important;
  position: absolute !important;
  right: -0.85rem !important;
  top: -0.28rem !important;
  color: var(--bd-header-gold) !important;
  font-size: 0.75rem !important;
  line-height: 1 !important;
  opacity: 0 !important;
  transform: translateX(-5px) translateY(4px) rotate(-18deg) scale(0.5) !important;
  text-shadow: 0 0 12px rgba(255,232,170,0.95) !important;
  pointer-events: none !important;
  z-index: 3 !important;
  transition: opacity 180ms ease, transform 240ms ease !important;
}

/* Hover/current effects */
html body header.wp-block-template-part nav a:hover,
html body header.wp-block-template-part nav a:focus,
html body header.wp-block-template-part .wp-block-navigation-item__content:hover,
html body header.wp-block-template-part .wp-block-navigation-item__content:focus,
html body header.wp-block-template-part .current-menu-item > a,
html body header.wp-block-template-part .current_page_item > a,
html body header.wp-block-template-part .wp-block-navigation-item.current-menu-item > .wp-block-navigation-item__content {
  color: var(--bd-header-blue-deep) !important;
  transform: translateY(-1px) !important;
  text-shadow: 0 0 16px rgba(213,168,79,0.22) !important;
}

html body header.wp-block-template-part nav a:hover::after,
html body header.wp-block-template-part nav a:focus::after,
html body header.wp-block-template-part .wp-block-navigation-item__content:hover::after,
html body header.wp-block-template-part .wp-block-navigation-item__content:focus::after,
html body header.wp-block-template-part .current-menu-item > a::after,
html body header.wp-block-template-part .current_page_item > a::after,
html body header.wp-block-template-part .wp-block-navigation-item.current-menu-item > .wp-block-navigation-item__content::after {
  transform: scaleX(1) !important;
  opacity: 1 !important;
  animation: bdHeaderGoldSweep 1.1s ease both !important;
}

html body header.wp-block-template-part nav a:hover::before,
html body header.wp-block-template-part nav a:focus::before,
html body header.wp-block-template-part .wp-block-navigation-item__content:hover::before,
html body header.wp-block-template-part .wp-block-navigation-item__content:focus::before,
html body header.wp-block-template-part .current-menu-item > a::before,
html body header.wp-block-template-part .current_page_item > a::before,
html body header.wp-block-template-part .wp-block-navigation-item.current-menu-item > .wp-block-navigation-item__content::before {
  opacity: 1 !important;
  transform: translateX(0) translateY(0) rotate(10deg) scale(1) !important;
  animation: bdHeaderSparkle 1.15s ease-in-out infinite !important;
}

@keyframes bdHeaderGoldSweep {
  0% { background-position: 0% 50%; filter: brightness(0.92); }
  50% { background-position: 100% 50%; filter: brightness(1.35); }
  100% { background-position: 50% 50%; filter: brightness(1); }
}

@keyframes bdHeaderSparkle {
  0%, 100% {
    opacity: 0.55;
    transform: translateX(0) translateY(0) rotate(10deg) scale(0.88);
  }
  50% {
    opacity: 1;
    transform: translateX(2px) translateY(-2px) rotate(22deg) scale(1.22);
  }
}

/* Search/account/cart icons */
html body header.wp-block-template-part .wp-block-search,
html body header.wp-block-template-part .wp-block-woocommerce-customer-account,
html body header.wp-block-template-part .wc-block-mini-cart {
  display: inline-flex !important;
  opacity: 1 !important;
  visibility: visible !important;
}

html body header.wp-block-template-part .wp-block-search__button,
html body header.wp-block-template-part .wc-block-mini-cart__button,
html body header.wp-block-template-part .wc-block-customer-account__link,
html body header.wp-block-template-part .wp-block-woocommerce-customer-account a {
  color: var(--bd-header-blue) !important;
  fill: var(--bd-header-blue) !important;
  background: #fff !important;
  border: 1px solid rgba(213,168,79,0.55) !important;
  border-radius: 999px !important;
  box-shadow: 0 8px 18px rgba(3,24,68,0.08) !important;
}

html body header.wp-block-template-part svg,
html body header.wp-block-template-part svg path,
html body header.wp-block-template-part .wc-block-mini-cart__icon,
html body header.wp-block-template-part .wc-block-mini-cart__icon path {
  color: var(--bd-header-blue) !important;
  fill: var(--bd-header-blue) !important;
  stroke: var(--bd-header-blue) !important;
}

/* Dropdowns */
html body header.wp-block-template-part .wp-block-navigation__submenu-container,
html body header.wp-block-template-part .sub-menu,
html body header.wp-block-template-part .children {
  background: #fff !important;
  border: 1px solid rgba(213,168,79,0.55) !important;
  border-radius: 18px !important;
  box-shadow: 0 18px 48px rgba(3,24,68,0.16) !important;
  padding: 0.7rem !important;
  z-index: 9999 !important;
}

html body header.wp-block-template-part .wp-block-navigation__submenu-container a,
html body header.wp-block-template-part .sub-menu a,
html body header.wp-block-template-part .children a {
  color: var(--bd-header-blue) !important;
  padding: 0.65rem 0.8rem !important;
  border-radius: 12px !important;
}

html body header.wp-block-template-part .wp-block-navigation__submenu-container a:hover,
html body header.wp-block-template-part .sub-menu a:hover,
html body header.wp-block-template-part .children a:hover {
  background: rgba(213,168,79,0.13) !important;
}

/* Mobile menu */
html body header.wp-block-template-part .wp-block-navigation__responsive-container.is-menu-open {
  background: #fff !important;
  color: var(--bd-header-blue) !important;
  padding: 1.25rem !important;
}

html body header.wp-block-template-part .wp-block-navigation__responsive-container-open,
html body header.wp-block-template-part .wp-block-navigation__responsive-container-close {
  color: var(--bd-header-blue) !important;
  background: #fff !important;
  border: 1px solid rgba(213,168,79,0.55) !important;
  border-radius: 999px !important;
}

/* If theme hides nav behind responsive breakpoint too early */
@media (min-width: 782px) {
  html body header.wp-block-template-part .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) {
    display: block !important;
    position: static !important;
    width: auto !important;
    height: auto !important;
    overflow: visible !important;
    background: transparent !important;
    color: var(--bd-header-blue) !important;
  }

  html body header.wp-block-template-part .wp-block-navigation__responsive-container-content {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
  }
}

/* Smaller screens: allow wrap */
@media (max-width: 980px) {
  html body header.wp-block-template-part .wp-block-group.alignwide,
  html body header.wp-block-template-part > .wp-block-group > .wp-block-group > .wp-block-group,
  html body header.wp-block-template-part .is-content-justification-space-between {
    flex-wrap: wrap !important;
    justify-content: center !important;
    min-height: auto !important;
  }

  html body header.wp-block-template-part nav,
  html body header.wp-block-template-part .wp-block-navigation {
    justify-content: center !important;
    flex-basis: 100% !important;
  }

  html body header.wp-block-template-part nav ul,
  html body header.wp-block-template-part .wp-block-navigation__container {
    justify-content: center !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  html body header.wp-block-template-part * ,
  html body header.wp-block-template-part *::before,
  html body header.wp-block-template-part *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* BD HEADER FINAL OVERRIDE — fix .bd-nav white links */
html body header .bd-nav,
html body header .bd-nav *,
html body header .bd-nav a,
html body header .bd-nav a:link,
html body header .bd-nav a:visited {
  color: #062763 !important;
  opacity: 1 !important;
  visibility: visible !important;
}

html body header .bd-nav {
  display: flex !important;
  flex-wrap: wrap !important;
  justify-content: flex-end !important;
  align-items: center !important;
  gap: clamp(0.75rem, 1.4vw, 1.45rem) !important;
}

html body header .bd-nav a {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  padding: 0.55rem 0.08rem !important;
  color: #062763 !important;
  font-weight: 900 !important;
  text-decoration: none !important;
  line-height: 1.15 !important;
  isolation: isolate !important;
  transition: color 180ms ease, transform 180ms ease, text-shadow 180ms ease !important;
}

/* Gold animated underline */
html body header .bd-nav a::after {
  content: "" !important;
  position: absolute !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0.08rem !important;
  height: 3px !important;
  border-radius: 999px !important;
  background: linear-gradient(
    90deg,
    transparent 0%,
    #d8ab44 20%,
    #ffe8aa 50%,
    #d8ab44 80%,
    transparent 100%
  ) !important;
  background-size: 220% 100% !important;
  transform: scaleX(0) !important;
  transform-origin: center !important;
  opacity: 0 !important;
  transition: transform 240ms ease, opacity 240ms ease !important;
}

/* Sparkle */
html body header .bd-nav a::before {
  content: "✦" !important;
  position: absolute !important;
  right: -0.8rem !important;
  top: -0.35rem !important;
  color: #d8ab44 !important;
  font-size: 0.78rem !important;
  opacity: 0 !important;
  transform: translateX(-5px) translateY(4px) rotate(-18deg) scale(0.5) !important;
  text-shadow: 0 0 12px rgba(255, 232, 170, 0.95) !important;
  pointer-events: none !important;
  transition: opacity 180ms ease, transform 240ms ease !important;
}

html body header .bd-nav a:hover,
html body header .bd-nav a:focus,
html body header .bd-nav .current-menu-item > a,
html body header .bd-nav .current_page_item > a {
  color: #031844 !important;
  transform: translateY(-1px) !important;
  text-shadow: 0 0 16px rgba(216, 171, 68, 0.25) !important;
}

html body header .bd-nav a:hover::after,
html body header .bd-nav a:focus::after,
html body header .bd-nav .current-menu-item > a::after,
html body header .bd-nav .current_page_item > a::after {
  transform: scaleX(1) !important;
  opacity: 1 !important;
  animation: bdNavGoldSweep 1.1s ease both !important;
}

html body header .bd-nav a:hover::before,
html body header .bd-nav a:focus::before,
html body header .bd-nav .current-menu-item > a::before,
html body header .bd-nav .current_page_item > a::before {
  opacity: 1 !important;
  transform: translateX(0) translateY(0) rotate(10deg) scale(1) !important;
  animation: bdNavSparkle 1.15s ease-in-out infinite !important;
}

@keyframes bdNavGoldSweep {
  0% { background-position: 0% 50%; filter: brightness(0.92); }
  50% { background-position: 100% 50%; filter: brightness(1.35); }
  100% { background-position: 50% 50%; filter: brightness(1); }
}

@keyframes bdNavSparkle {
  0%, 100% {
    opacity: 0.55;
    transform: translateX(0) translateY(0) rotate(10deg) scale(0.88);
  }
  50% {
    opacity: 1;
    transform: translateX(2px) translateY(-2px) rotate(22deg) scale(1.22);
  }
}

/* Keep header white after bd-nav override */
html body header,
html body header *,
html body header.wp-block-template-part,
html body header.wp-block-template-part * {
  border-color: inherit;
}

html body header,
html body header.wp-block-template-part {
  background: #ffffff !important;
  border-bottom: 4px solid #d8ab44 !important;
}

