:host {
  --zanit-menubar-max-width: ;
  --zanit-menubar-top-offset: ;

  position: relative;
  z-index: 2;
  display: flex;
  width: 100%;
  background-color: #fff;
  color: var(--gray900);
  font-family: var(--font-family-sans);
}

:host,
*,
::before,
::after {
  box-sizing: border-box;
}

*:focus:focus-visible {
  box-shadow: var(--shadow-focus-primary);
  outline: none;
}

ul {
  padding: 0;
  margin: 0;
  list-style: none;
}

a {
  color: var(--gray900);
  cursor: pointer;
  text-decoration: none;
}

button {
  all: unset;
  cursor: pointer;
}

:host nav {
  width: 100%;
}

.shadow-wrapper {
  position: relative;
  z-index: 1;
  display: flex;
  width: 100%;
}

.shadow-wrapper::after {
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  background: transparent;
  box-shadow: var(--shadow-1);
  content: '';
  pointer-events: none;
}

.width-limiter {
  position: relative;
  display: flex;
  width: 100%;
  max-width: var(--zanit-menubar-max-width, 1366px);
  margin: 0 auto;
}

.shadow-wrapper + .shadow-wrapper {
  z-index: 0;
}

.sub-menubar > ul {
  gap: 28px;
}

.width-limiter > ul,
.sub-menubar > ul {
  position: relative;
  z-index: 3;
  display: flex;
  width: 100%;
  align-items: center;
  padding: 0 var(--grid-margin);
  margin-right: auto;
  margin-left: auto;
  gap: 20px;
}

.shadow-wrapper > .width-limiter,
.shadow-wrapper > ul {
  width: 100%;
  max-width: var(--zanit-menubar-max-width, 1366px);
}

ul.menubar {
  height: 3rem;
  padding-right: 0;
}

.menubar z-ghost-loading {
  display: block;
  width: 120px;
  height: 1.25rem;
}

/* separator bar */
.menubar > li[role='separator'] {
  width: 1px;
  height: 1.25rem;
  background-color: #000;
}

.menubar-item {
  position: relative;
  display: flex;
  align-items: center;
  padding: 14px 0;
  font-size: 1rem;
  gap: 8px;
  line-height: 1.25rem;
}

.menubar .menubar-item {
  text-transform: uppercase;
}

.menubar-item [data-text] {
  display: flex;
  flex-direction: column;
}

.menubar-item.active > [data-text],
.menubar-item:hover > [data-text],
.menubar-item:focus:focus-visible > [data-text] {
  font-weight: var(--font-bd);
}

/* To avoid size changes in the element, when it is hovered and becomes bold,
we put the same text already bold with height 0, so as to always occupy the maximum necessary width. */
.menubar-item > [data-text]::after {
  height: 0;
  content: attr(data-text) / '';
  font-weight: var(--font-bd);
  letter-spacing: normal;
  pointer-events: none;
  user-select: none;
  visibility: hidden;
}

/* active item bottom border */
.sub-menubar .menubar-item.active::after {
  position: absolute;
  z-index: -1;
  bottom: 0;
  left: -4px;
  width: calc(100% + 8px); /* the border is 4px per side larger than its container */
  height: 4px;
  background-color: var(--red500);
  content: '';
}

zanit-search-form {
  margin-left: auto;
}
