/* FOUND OBJECTS — header: wordmark centred, short menus either side */

.fo-header {
  display: block;
  position: relative;
  background-color: var(--fo-color-bg);
  z-index: 30;
}

.fo-header[data-sticky='true'] {
  position: sticky;
  top: 0;
}

/* Equal side columns keep the wordmark optically centred */
.fo-header__inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--fo-space-4);
  min-height: 4.5rem;
  padding-block: var(--fo-space-4);
}

.fo-header__side {
  display: flex;
  align-items: center;
  gap: var(--fo-space-6);
  min-width: 0;
}

/* Below 990 the left cell holds only the toggle, which stays at the edge */
.fo-header__side--end { justify-content: flex-end; }

.fo-header__rule {
  height: var(--fo-hairline);
  background-color: var(--fo-color-border);
}

/* ---- Wordmark ------------------------------------------------------------ */

.fo-header__wordmark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--fo-color-text);
}

/* The wordmark stays on one line wherever space allows */
.fo-header__wordmark-text {
  font-family: var(--fo-font-display);
  font-size: clamp(0.875rem, 2.6vw, 1.875rem);   /* to 30px */
  font-weight: var(--fo-weight-medium);
  letter-spacing: var(--fo-tracking-wordmark);
  text-transform: uppercase;
  white-space: nowrap;
  padding-inline-start: var(--fo-tracking-wordmark);
}

.fo-header__wordmark img {
  display: block;
  width: auto;
  max-height: 2rem;
}

/* ---- Navigation ---------------------------------------------------------- */

.fo-header__nav { display: none; }

.fo-header__nav-list {
  list-style: none;
  display: flex;
  align-items: center;
  gap: var(--fo-space-6);
  margin: 0;
  padding: 0;
}

.fo-header__nav-link {
  display: inline-flex;
  align-items: center;
  gap: var(--fo-space-1);
  padding: var(--fo-space-2) 0;
  border: 0;
  background: none;
  color: var(--fo-color-text);
  font-family: var(--fo-font-display);
  font-size: var(--fo-text-xs);
  font-weight: var(--fo-weight-medium);
  letter-spacing: var(--fo-tracking-eyebrow);
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  position: relative;
}

.fo-header__nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: var(--fo-hairline);
  background-color: currentColor;
  transform-origin: left;
  transform: scaleX(0);
  transition: transform var(--fo-duration) var(--fo-ease);
}

.fo-header__nav-link:hover::after,
.fo-header__nav-link[aria-current='page']::after {
  transform: scaleX(1);
}

/* ---- Mobile toggle ------------------------------------------------------- */

.fo-header__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  margin-inline-start: calc(var(--fo-space-3) * -1);
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.fo-header__toggle-bars {
  display: grid;
  gap: 0.3rem;
  width: 1.25rem;
}

.fo-header__toggle-bars span {
  display: block;
  height: var(--fo-hairline);
  background-color: var(--fo-color-text);
}

/* ---- Mobile drawer ------------------------------------------------------- */

.fo-mobile-nav {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: var(--fo-space-6);
  padding: var(--fo-space-5) var(--fo-gutter) var(--fo-space-9);
  background-color: var(--fo-color-bg);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.fo-mobile-nav[hidden] { display: none; }

.fo-mobile-nav__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: var(--fo-space-4);
  border-bottom: var(--fo-hairline) solid var(--fo-color-border);
}

.fo-mobile-nav__title {
  font-family: var(--fo-font-display);
  font-size: var(--fo-text-base);
  font-weight: var(--fo-weight-medium);
  letter-spacing: var(--fo-tracking-eyebrow);
  text-transform: uppercase;
}

.fo-mobile-nav__close {
  width: 2.75rem;
  height: 2.75rem;
  border: 0;
  background: none;
  color: var(--fo-color-text);
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
}

.fo-mobile-nav__search {
  display: flex;
  align-items: center;
  gap: var(--fo-space-4);
}

.fo-mobile-nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.fo-mobile-nav__item { border-bottom: var(--fo-hairline) solid var(--fo-color-border); }

.fo-mobile-nav__link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--fo-space-3);
  padding: var(--fo-space-4) 0;
  color: var(--fo-color-text);
  font-family: var(--fo-font-display);
  font-size: var(--fo-text-lg);
  font-weight: var(--fo-weight-medium);
  letter-spacing: var(--fo-tracking-wide);
  text-transform: uppercase;
  text-decoration: none;
}

.fo-mobile-nav__foot {
  display: grid;
  gap: var(--fo-space-4);
  margin-top: auto;
  padding-top: var(--fo-space-5);
  border-top: var(--fo-hairline) solid var(--fo-color-border);
}

/* ---- Breakpoints --------------------------------------------------------- */

@media screen and (max-width: 989px) {
  /* Mobile keeps the same three-part balance: toggle, wordmark, cart */
  .fo-header__side { gap: var(--fo-space-4); }
}

@media screen and (min-width: 990px) {
  /* Links sit next to the wordmark, not pinned to the page edges. The side
     columns stay equal width so the wordmark remains truly centred. */
  .fo-header__inner { min-height: 5.5rem; gap: var(--fo-space-5); padding-block: var(--fo-space-6); }
  .fo-header__toggle { display: none; }
  .fo-header__nav { display: block; }
  .fo-header__side--start { justify-content: flex-end; padding-inline-end: var(--fo-space-9); }
  .fo-header__side--end { justify-content: flex-start; padding-inline-start: var(--fo-space-9); }
}
