/* Figma 621:83 + 621:156. Shared colors and type come from global.css. */
.site-header {
  position: relative;
  z-index: 100;
  color: var(--color-ink);
}


.header-topbar {
  background-color: var(--color-primary);
  color: var(--color-text-inverse);
}

.header-topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  min-height: var(--top-bar-height);
  padding-block: var(--space-10px);
  font-size: var(--font-size-small);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
}

.header-contact, .header-phone, .header-email, .header-phone-numbers,
.header-socials {
  display: flex;
  align-items: center;
}

.header-contact { gap: var(--space-50px); }
.header-phone, .header-email { gap: var(--space-15px); }
.header-phone-numbers { gap: 0.25em; }
.header-socials { gap: var(--space-5); }
.header-topbar a { text-decoration: none; }
.header-topbar a:hover { text-decoration: underline; }
.header-phone-numbers a, .header-email { white-space: nowrap; }

.header-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
}

/* Keep the exported SVGs at their original dimensions inside 20 px slots. */
.header-icon img { max-width: none; }
.header-icon-instagram img { position: absolute; }
.instagram-frame { left: 4.17%; top: 4.17%; }
.instagram-ring { left: 25%; top: 25%; }
.instagram-dot { left: 70.83%; top: 20.83%; }

.header-navigation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-10);
  width: min(77.5rem, calc(100% - 2 * var(--page-gutter)));
  min-height: 6.25rem;
  margin-inline: auto;
  padding: var(--space-25px) var(--space-50px);
  border-radius: 0 0 var(--radius-button) var(--radius-button);
  background-color: var(--color-white);
}

.header-logo { display: block; flex-shrink: 0; }
.header-logo-crop {
  position: relative;
  display: block;
  width: 166px;
  height: 50px;
  overflow: hidden;
}

/* Display the complete navbar logo within the existing logo slot. */
.header-logo-crop img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: left center;
}

.header-nav-list, .header-dropdown {
  margin: 0;
  padding: 0;
  list-style: none;
}

.header-nav-list {
  display: flex;
  align-items: center;
  gap: 2.1875rem; /* 35 px in the desktop design */
}

.header-nav-link, .header-products-toggle {
  font-size: 1.125rem;
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-tight);
}

.header-nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--transition-duration) var(--transition-easing);
}

.header-nav-link:hover, .header-nav-link.active, .header-nav-link[aria-current="page"] {
  color: var(--color-primary);
}

.header-products { position: relative; }
.header-products-control { display: flex; align-items: center; gap: var(--space-5px); }
.header-products-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
}

.header-products-toggle img {
  max-width: none;
  transform: rotate(180deg);
  transition: transform var(--transition-duration) var(--transition-easing);
}

.header-products-toggle[aria-expanded="true"] img { transform: rotate(0); }

.header-dropdown {
  position: absolute;
  top: calc(100% + var(--space-10px));
  left: calc(-1 * var(--space-5));
  z-index: 1;
  min-width: 15.5rem;
  padding: var(--space-10px);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-sm);
  background-color: var(--color-white);
  box-shadow: var(--shadow-card);
}

/* Bridge the gap so the dropdown stays open as the pointer enters it. */
@media (min-width: 992px) {
  .header-dropdown::before {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    height: calc(var(--space-10px) + var(--border-width));
  }
}

.header-dropdown a {
  display: block;
  padding: var(--space-3) var(--space-10px);
  border-radius: var(--radius-xs);
  color: var(--color-ink);
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  text-decoration: none;
}

.header-dropdown a:hover, .header-dropdown a:focus-visible {
  background-color: #f7f7f7;
}

.header-menu-toggle {
  align-items: center;
  justify-content: center;
  gap: var(--space-10px);
  min-height: 44px;
  padding: var(--space-10px) var(--space-3);
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-sm);
  background-color: var(--color-white);
  color: var(--color-ink);
  font-weight: var(--font-weight-medium);
}

.header-menu-icon { display: grid; place-items: center; width: 20px; height: 20px; }
.header-menu-icon img { grid-area: 1 / 1; max-width: none; }
.header-menu-close-image { display: none; }
.header-menu-toggle[aria-expanded="true"] .header-menu-open-image { display: none; }
.header-menu-toggle[aria-expanded="true"] .header-menu-close-image { display: block; }
.header-menu-icon span {
  height: 2px;
  background-color: currentColor;
  transition: transform var(--transition-duration) var(--transition-easing),
              opacity var(--transition-duration) var(--transition-easing);
}

/* Menu open: hamburger becomes a close (X) icon. */
.header-menu-toggle[aria-expanded="true"] .header-menu-icon span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.header-menu-toggle[aria-expanded="true"] .header-menu-icon span:nth-child(2) {
  opacity: 0;
}
.header-menu-toggle[aria-expanded="true"] .header-menu-icon span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.header-load-error { padding: var(--space-5); text-align: center; }

/* Set this modifier on the include host once a hero is added below the header. */
.header-over-hero .header-navigation {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
}

@media (max-width: 74.999rem) {
  .header-navigation { padding-inline: var(--space-30px); gap: var(--space-6); }
  .header-nav-list { gap: var(--space-5); }
}

/* Toggle menu breakpoint: 991px and below (must match js/header.js). */
@media (max-width: 991px) {
  .header-contact { gap: var(--space-5); }
  .header-navigation {
    flex-wrap: wrap;
    min-height: 5rem;
    padding: var(--space-15px) var(--space-6);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  }


  .header-menu-toggle:not([hidden]) { display: inline-flex; }
  .header-nav { flex-basis: 100%; }
  .header-nav-list { align-items: stretch; flex-direction: column; gap: 0; }
  .header-nav-link { display: flex; min-height: 44px; padding-block: 0; }
  .header-products-control { justify-content: space-between; }
  .header-products-control > .header-nav-link { flex: 1; }
  .header-products-toggle { width: 44px; }
  .header-dropdown {
    position: static;
    min-width: 0;
    margin-block: var(--space-2);
    background-color: var(--color-background-soft);
    box-shadow: none;
  }
}

@media (max-width: 47.999rem) {
  .header-topbar-inner { justify-content: center; }
  .header-contact { flex-direction: column; gap: var(--space-2); }
  .header-phone, .header-email { gap: var(--space-10px); }
  .header-socials { display: none; }
  .header-navigation { padding-inline: var(--space-5); gap: var(--space-15px); }
}

@media (max-width: 22.499rem) {
  .header-topbar-inner { font-size: var(--font-size-caption); }
  .header-navigation { width: calc(100% - var(--space-5)); padding-inline: var(--space-15px); }
  .header-menu-toggle { padding-inline: var(--space-2); }
}

/* The Products arrow inherits the same active/hover color as its label. */
.header-products-control:has(.header-nav-link.active),
.header-products-control:has(.header-nav-link[aria-current="page"]),
.header-products-control:hover,
.header-products-control:focus-within { color: var(--color-primary); }
.header-products-control:hover .header-nav-link,
.header-products-control:focus-within .header-nav-link { color: inherit; }
.header-products-toggle img { display: none; }
.header-products-toggle::before {
  content: "";
  width: 10px;
  height: 10px;
  background-color: currentColor;
  -webkit-mask: url("../images/dropdown-arrow.svg") center / contain no-repeat;
  mask: url("../images/dropdown-arrow.svg") center / contain no-repeat;
  transform: rotate(180deg);
  transition: transform var(--transition-duration) var(--transition-easing);
}
.header-products-toggle[aria-expanded="true"]::before { transform: rotate(0); }

/* Compact mobile logo/menu row directly below the contact bar. */
@media (max-width: 47.999rem) {
  #site-header .header-navigation {
    min-height: 0;
    margin-top: 0;
    padding-block: 6px;
    row-gap: 8px;
    align-items: center;
  }
  #site-header .header-logo {
    line-height: 0;
  }
  #site-header .header-menu-toggle {
    min-height: 44px;
    padding-block: 8px;
  }
}
/* Prevent logo/menu and contact details overflowing narrow phones. */
@media (max-width: 370px) {
  #site-header .header-navigation {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    width: calc(100% - 16px);
    padding-inline: 10px;
    column-gap: 8px;
  }
  #site-header .header-logo {
    min-width: 0;
    width: 100%;
    max-width: 166px;
  }
  #site-header .header-logo-crop {
    width: 100%;
    height: auto;
    aspect-ratio: 166 / 50;
  }
  #site-header .header-logo-crop img {
    width: 100%;
    height: 100%;
  }
  #site-header .header-menu-toggle {
    gap: 6px;
    padding-inline: 8px;
    font-size: 14px;
    white-space: nowrap;
  }
  #site-header .header-nav {
    grid-column: 1 / -1;
    min-width: 0;
  }
  #site-header .header-topbar-inner {
    width: calc(100% - 20px);
    margin-inline: auto;
  }
  #site-header .header-contact,
  #site-header .header-phone {
    min-width: 0;
    max-width: 100%;
  }
  #site-header .header-phone-numbers {
    flex-wrap: wrap;
    justify-content: center;
    min-width: 0;
  }
  #site-header .header-email {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
  }
  #site-header .header-email > span:last-child {
    min-width: 0;
  }
}
/* Products mega menu: keep Cobalt and Tungsten in two clear columns. */
@media (min-width: 992px) {
  .header-dropdown.header-mega-menu {
    display: grid;
    grid-template-columns: repeat(2, minmax(12rem, 1fr));
    gap: var(--space-6);
    width: min(42rem, calc(100vw - 2rem));
    padding: var(--space-5);
  }
}

.header-mega-menu-group > a {
  font-weight: var(--font-weight-bold);
}

.header-mega-menu-products {
  position: static;
  min-width: 0;
  margin: var(--space-2) 0 0;
  padding: 0;
  list-style: none;
}

.header-mega-menu-products a {
  font-size: var(--font-size-small);
}

@media (max-width: 991px) {
  .header-dropdown.header-mega-menu { display: block; }
  .header-mega-menu-products {
    margin: 0 0 var(--space-3);
    padding-left: var(--space-5);
  }
}
/* Keep the desktop mega menu aligned to the full navigation bar. */
@media (min-width: 992px) {
  #site-header .header-navigation {
    position: absolute;
    top: 100%;
    right: auto;
    left: 50%;
    transform: translateX(-50%);
  }
  #site-header .header-dropdown.header-mega-menu {
    top: calc(100% + var(--space-10px));
    right: -170px;
    left: auto;
    width: min(42rem, calc(100vw - 2rem));
    max-width: calc(100vw - 2rem);
    box-sizing: border-box;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* On phones, make the expanded menu use the available navigation width. */
@media (max-width: 991px) {
  #site-header .header-nav,
  #site-header .header-nav-list,
  #site-header .header-nav-list > li,
  #site-header .header-products {
    width: 100%;
    min-width: 0;
  }
  #site-header .header-dropdown.header-mega-menu {
    width: 100%;
    max-width: 100%;
    margin-inline: 0;
    padding: 12px;
    box-sizing: border-box;
    overflow: hidden;
  }
  #site-header .header-mega-menu-group,
  #site-header .header-mega-menu-products {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }
  #site-header .header-mega-menu-products a {
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

/* Keep the expanded product menu in the mobile navigation flow. */
@media (max-width: 991px) {
  #site-header .header-nav-list > li { align-self: stretch; }
  #site-header .header-products { position: relative; align-self: stretch; }
  #site-header .header-products > .header-dropdown.header-mega-menu {
    position: static !important;
    inset: auto;
    transform: none;
    display: block;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    height: auto;
    margin: 4px 0 8px;
    padding: 8px 12px;
    box-sizing: border-box;
  }
  #site-header .header-products > .header-dropdown.header-mega-menu[hidden] {
    display: none !important;
  }
  #site-header .header-mega-menu-group > a {
    padding-block: 6px;
  }
  #site-header .header-mega-menu-products a {
    padding-block: 5px;
    font-size: var(--font-size-small);
    line-height: var(--line-height-normal);
  }
}
/* Mobile safety net for WordPress dropdown markup. */
@media (max-width: 991px) {
  #site-header .header-products ul.header-dropdown {
    position: static !important;
    inset: auto !important;
    float: none !important;
    transform: none !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 4px 0 8px !important;
    box-sizing: border-box;
  }
  #site-header .header-products ul.header-dropdown[hidden] {
    display: none !important;
  }
}
/* Keep the mobile Products submenu directly below its control, spanning the nav width. */
@media (max-width: 991px) {
  #site-header .header-nav-list > li.header-products {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
  }
  #site-header .header-products > .header-products-control {
    display: flex;
    flex: 0 0 auto;
    width: 100%;
  }
  #site-header .header-products > ul.header-dropdown {
    align-self: stretch;
    width: 100% !important;
    max-width: 100% !important;
    margin-inline: 0 !important;
  }
}
/* Slightly enlarge the Products dropdown typography for readability. */
#site-header .header-mega-menu-group > a {
  font-size: 1.125rem;
}
#site-header .header-mega-menu-products a {
  font-size: 1rem;
}
/* Put Tungsten first and present product links as image, title, and subtitle rows. */
#site-header .header-mega-menu-group-tungsten { order: 1; }
#site-header .header-mega-menu-group-cobalt { order: 2; }
#site-header .header-mega-menu-product-link {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px;
  border-radius: var(--radius-xs);
  box-sizing: border-box;
}
#site-header .header-mega-menu-product-image {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
}
#site-header .header-mega-menu-product-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}
#site-header .header-mega-menu-product-title {
  font-size: 1rem;
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
}
#site-header .header-mega-menu-product-subtitle {
  color: var(--color-text-muted, #667085);
  font-size: var(--font-size-small);
  line-height: var(--line-height-normal);
}
@media (max-width: 991px) {
  #site-header .header-dropdown.header-mega-menu {
    display: flex;
    flex-direction: column;
  }
  #site-header .header-mega-menu-product-image {
    flex-basis: 40px;
    width: 40px;
    height: 40px;
  }
}
/* Keep product text contained within its own mega-menu column. */
@media (min-width: 992px) {
  #site-header .header-dropdown.header-mega-menu {
    width: min(42rem, calc(100vw - 2rem));
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
#site-header .header-mega-menu-group,
#site-header .header-mega-menu-products,
#site-header .header-mega-menu-products > li,
#site-header .header-mega-menu-product-link,
#site-header .header-mega-menu-product-copy {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
#site-header .header-mega-menu-product-link {
  align-items: flex-start;
}
#site-header .header-mega-menu-product-title,
#site-header .header-mega-menu-product-subtitle {
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
}
#site-header .header-mega-menu-product-subtitle {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
#site-header .header-mega-menu-group > a {
  display: inline-flex;
  width: fit-content;
  background: transparent;
}
#site-header .header-mega-menu-group > a:hover,
#site-header .header-mega-menu-group > a:focus-visible {
  color: #B17457;
  background: transparent;
}
#site-header .header-mega-menu-product-link:hover,
#site-header .header-mega-menu-product-link:focus-visible {
  background-color: #edededaa !important;
  border-radius: var(--radius-xs);
}
#site-header .header-mega-menu-product-link:hover .header-mega-menu-product-title,
#site-header .header-mega-menu-product-link:focus-visible .header-mega-menu-product-title {
  color: #B17457;
}
ul.header-mega-menu-products{padding-bottom: 10px;}
@media (max-width: 991px) {
  #site-header .header-products > .header-dropdown.header-mega-menu {
    display: flex !important;
    flex-direction: column;
  }
}
/* Tighten mobile product rows and remove the extra nested-list indent. */
@media (max-width: 991px) {
  #site-header .header-mega-menu-products {
    margin-bottom: 6px;
    padding-left: 0;
  }
  #site-header .header-mega-menu-product-link {
    gap: 8px;
    padding: 4px 6px;
  }
  #site-header .header-mega-menu-group > a {
    padding-block: 4px;
  }
  #site-header ul.header-mega-menu-products {
    padding-bottom: 0;
  }
}