.navbar {
  display: flex;
  box-sizing: border-box;
  padding: 0.25rem;
  border: none;
  border-radius: 0.5rem;
  gap: 0.25rem;
}

.navbar-nav {
  position: relative;
}

.navbar-trigger {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border: none;
  border-radius: calc(0.5rem - 0.25rem);
  background: none;
  color: var(--secondary-color-4);
  cursor: pointer;
  transition: background-color 100ms ease-out;
}

.navbar-nav[data-state="open"] .navbar-trigger {
  background-color: var(--light, var(--primary-color-4))
    var(--dark, var(--primary-color-7));
  color: var(--secondary-color-1);
}

.navbar-trigger[data-disabled="true"] {
  color: var(--secondary-color-5);
  cursor: not-allowed;
}

.navbar-trigger:hover:not([data-disabled="true"]),
.navbar-trigger:focus-visible {
  background: var(--light, var(--primary-color-4))
    var(--dark, var(--primary-color-7));
  color: var(--secondary-color-1);
  outline: none;
}

/* Include the top margin in the navbar content pointer events */
.navbar-content::before {
  position: absolute;
  top: -0.5rem;
  left: 0;
  width: 100%;
  height: 0.5rem;
  content: "";
}

.navbar-content {
  position: absolute;
  z-index: 1000;
  top: 100%;
  left: 0;
  min-width: 200px;
  padding: 0.25rem;
  border-radius: 0.5rem;
  margin-top: 0.5rem;
  background: var(--light, var(--primary-color))
    var(--dark, var(--primary-color-5));
  box-shadow: inset 0 0 0 1px var(--light, var(--primary-color-6))
    var(--dark, var(--primary-color-7));
  transform-origin: top;
  opacity: 0;
  pointer-events: none;
  will-change: transform, opacity;
}

.navbar-nav:first-child .navbar-content {
  margin-left: -0.25rem;
}

.navbar-content[data-state="closed"] {
  transition: opacity 150ms ease-in, transform 150ms ease-in;
}

.navbar-content[data-state="closed"][data-open-menu-direction="start"] {
  transform: translateX(-100%) scale(0.98);
}

.navbar-content[data-state="closed"][data-open-menu-direction="end"] {
  transform: translateX(100%) scale(0.98);
}

.navbar-content[data-state="closed"][data-open-menu-direction="closed"] {
  transform: translateY(1rem) scale(0.98);
}

.navbar-content[data-state="open"] {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0) translateY(0) scale(1);
  transition: opacity 200ms ease-out,
    transform 200ms cubic-bezier(0.16, 1, 0.3, 1);
}

.navbar-item {
  display: block;
  padding: 8px 12px;
  border-radius: calc(0.5rem - 0.25rem);
  color: var(--secondary-color-4);
  cursor: pointer;
  font-size: 14px;
  text-decoration: none;
}

.navbar-item[data-disabled="true"] {
  color: var(--secondary-color-5);
  cursor: not-allowed;
}

.navbar-item:hover:not([data-disabled="true"]),
.navbar-item:focus-visible {
  background: var(--light, var(--primary-color-4))
    var(--dark, var(--primary-color-7));
  color: var(--secondary-color-1);
  outline: none;
}

[data-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.5;
}

.navbar-expand-icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: var(--secondary-color-4);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  transition: rotate 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.navbar-nav[data-state="open"] .navbar-expand-icon {
  rotate: 180deg;
}
