/**
 * Sleep Navbar — styled to match Figma (shg400-4033, node 87:5267).
 */

/*
 * display:contents keeps the sticky navbar's containing block on the page
 * instead of the wrapper: a wrapper box would confine position:sticky to its
 * own height. The wrapper only becomes a real box on mobile, where the navbar
 * is pinned with position:fixed and its height has to be reserved.
 */
.sleep-navbar-wrapper {
  display: contents;
}

.sleep-navbar {
  position: sticky;
  top: var(--header-height, 0px);
  z-index: 49;
  background-color: #394034;
}

@media (max-width: 768px) {
  .sleep-navbar::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 48px;
    height: 100%;
    background: linear-gradient(to left, #394034 0%, transparent 100%);
    pointer-events: none;
    z-index: 1;
    opacity: 1;
    transition: opacity 0.2s ease;
  }

  .sleep-navbar.is-scrolled-end::after {
    opacity: 0;
  }
}

.sleep-navbar__list {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  list-style: none;
  margin: 0;
  padding: 0;
  height: 48px;
  overflow-y: hidden;
}

.sleep-navbar__item {
  display: flex;
  align-items: stretch;
  flex-shrink: 0;
  height: 100%;
}

@media (max-width: 768px) {
  .sleep-navbar__list {
    justify-content: flex-start;
    overflow-x: auto;
    padding: 0 16px;
    gap: 24px;
    scrollbar-width: none;
  }

  .sleep-navbar__list::-webkit-scrollbar {
    display: none;
  }
}

.sleep-navbar__btn {
  display: flex;
  align-items: center;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: #ffffff;
  cursor: pointer;
  font-family: "Brown", sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.15em;
  line-height: 1;
  padding: 20px 10px 12px;
  text-transform: uppercase;
  white-space: nowrap;
  transition: border-color 0.2s ease;
}

.sleep-navbar__btn:hover {
  border-bottom-color: rgba(255, 255, 255, 0.5);
}

.sleep-navbar__btn.is-active {
  font-weight: 900;
  border-bottom-color: #ffffff;
}

.paragraph--type--sleep-intro {
  text-align: center;
  margin: 100px 0 0 !important;
}

@media (max-width: 768px) {
  /* Reserve the navbar height so pinning it does not shift the page content. */
  .sleep-navbar-wrapper {
    display: block;
    min-height: 48px;
  }

  /*
   * .layout-container is overflow:hidden below 768px, which disables
   * position:sticky, so the pinned state uses position:fixed instead. The site
   * header stays visible and fixed at the top, and the navbar sits right below
   * it using --header-height, which sleep-navbar.js keeps up to date.
   */
  body.sleep-subnav-sticky .sleep-navbar {
    position: fixed;
    top: var(--header-height, 0px);
    left: 0;
    right: 0;
    width: 100%;
  }
}
